garin
6th February 2005, 10:15 AM
I would like to know if there is a way to find the BarsSince the HHV since Entry ?
Jose
7th February 2005, 02:27 AM
Try this:
{ BarsSince HHV since trade entry }
{ http://www.metastocktools.com }
{ Trade signals reference }
In:=Fml("001 system buy signals");
Out:=Fml("002 system sell signals");
{ User inputs }
plot:=Input("plot: [1]BarsSince HHV, [2]Trade signals",1,2,1);
choose:=Input("signals: [1]Clean, [2]All",
1,2,1);
delay:=Input("Entry and Exit delay",0,5,0);
{ Clean signals }
Init:=Cum(In+Out>-1)=1;
InInit:=Cum(In)=1;
flag:=BarsSince(Init OR In)
<BarsSince(Init OR Out)+InInit;
signals:=(InInit AND Alert(InInit=0,2)
OR flag AND Alert(flag=0,2))
-(flag=0 AND Alert(flag,2));
signals:=
Ref(If(choose=1,signals,In-Out),-delay);
{ BarsSince HHV since trade entry }
barCount:=HighestSinceBars(1,signals=1,H);
{ Plot in own window }
If(plot=1,barCount,signals)
jose '-)
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.