Below is an excellent Darvas signals indicator found within the Divergence kit's documentation at http://www.metastocktools.com/MACDH/MACDH.pdf:
===============
Darvas Box - Buy & Sell
===============
---8<------------------------------------
{ Darvas Box - Buy & Sell v1.0
Copyright © 2006-2007 Jose Silva.
For personal use only.
http://www.metastocktools.com }
{ User input }
pds:=Input("Lookback periods",2,2600,100);
{ Variables }
h3:=Ref(H,-3);
l3:=Ref(L,-3);
init:=Cum(IsDefined(Ref(HHV(H,pds),-4)))=1;
{ Darvas High }
DvHi:=ValueWhen(1,init OR
h3>=Ref(HHV(H,pds),-4) AND h3>HHV(H,3),h3);
{ New Darvas High }
NuDvHi:=Dvhi<>Ref(DvHi,-1);
{ New Darvas Low }
NuDvLo:=l3<LLV(L,3) AND DvHi>HHV(H,3);
NuDvLo:=NuDvLo AND Ref(NuDvLo,-1)<1
AND Cum(NuDvHi)>0;
{ Darvas Low }
DvLo:=ValueWhen(1,NuDvLo,l3);
{ Darvas Box End }
DvEnd:=
BarsSince(NuDvHi)<BarsSince(Ref(NuDvLo,-1));
DvEnd:=(DvEnd AND NuDvLo)
OR Cum(IsDefined(DvEnd))=1;
{ Darvas Box High }
DvBoxHi:=ValueWhen(1,DvEnd,DvHi);
{ Darvas Box Low }
DvBoxLo:=ValueWhen(1,DvEnd,DvLo);
{ Darvas Possible Sell }
DvPosSell:=L<DvBoxLo AND Alert(L<DvBoxLo=0,2);
{ Darvas Sell }
exit:=BarsSince(DvEnd)<BarsSince(DvPosSell);
exit:=exit=0 AND Alert(exit,2)
OR Cum(IsDefined(exit))=1;
{ Darvas Buy }
{ Classic Darvas: change next line to H>DvBoxHi}
entry:=C>DvBoxHi
AND BarsSince(DvEnd)<BarsSince(exit);
{ Clean signals }
init:=Cum(IsDefined(entry+exit))=1;
bin:=ValueWhen(1,entry-exit<>0 OR init,entry);
long:=bin*(Alert(bin=0,2) OR init);
short:=(bin=0)*(Alert(bin,2) OR init);
{ Plot in own window }
long-short
---8<------------------------------------
MACDH/All-In-One Divergence kit :
http://www.metastocktools.com/MACDH/MACDHdiverg.htm
jose '-)