Breakout (Turtle) strategy for the VST Custom.

Click here to view video

The " Breakout " formula is at the end of this post. Copy/paste the formula into the " Custom Strategy" indicator.

The 2 charts below have been created using the VSTPro using an identical " Breakout " indicator.

Copy formula below this line............
--------------8--------------8-------------------


{VST Custom Strategy. Indicator must plot +1/-1.
Trade at own risk!
Enter your own indicator in the template below.}

x:=Input("Place your custom formula within Formula tab",0,0,0);
x:=Input("Entry/Exit output *must be* in +1/-1 format",0,0,0);


{*** Place your code below ***}

{ User inputs }
pds1:=21; {Enter Long breakout periods}

pds2:=10; {Enter Exit Long breakout periods}

{Best not to edit below this line
-----8-------------8---------------8}
x:=4; {"use Open=1 High=2 Low=3 Close=4 Volume=5 WC=6"}
;
delay:=0; {Input("Entry and Exit delay"}

plot:=1; {Input("Signals: [1]Clean, [2]All, [3]Trade binary"}

{ Select breakout price field }
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,WC(),C)))));

{ Entry/Exit Long breakouts }
entry:=x>Ref(HHV(x,pds1),-1);
exit:=x0 OR init,long);
long:=flag*(Alert(flag=0,2) OR init);
short:=(flag=0)*(Alert(flag,2) OR init);
signals:=long-short;

{ Plot in own window }
Ref(If(plot=2,entry,0),-delay);
Ref(If(plot=1,signals,
If(plot=2,-exit,flag)),-delay)

No comments:

Post a Comment

 
Design Credit Best Blogger Tips | Best Blogger Templates | Best Social Icons