You are on page 1of 2

a1:=Input("first value",1,260,1);

b1:=Input("second value",1,260,1);

Stop1:=If( PREV < L,

If(( H - a1*ATR(10) ) >= PREV,

( H - a1*ATR(10) ),

PREV),

( H - a1*ATR(10) ));

Stop2:=If( PREV < L,

If(( C - b1*ATR(10) ) >= PREV,

( C - b1*ATR(10) ),

PREV),

( C - b1*ATR(10) ));

StopLong:=If(Stop1>Stop2,Stop1,Stop2);

Stop1:=If( PREV > H,

If(( L + a1*ATR(10) ) <= PREV,

( L + a1*ATR(10) ),

PREV),

( L + a1*ATR(10) ));

Stop2:=If( PREV > H,

If(( C + b1*ATR(10) ) <= PREV,


( C + b1*ATR(10) ),

PREV),

( C + b1*ATR(10) ));

StopShort:=If(Stop1<Stop2,Stop1,Stop2);

If(BarsSince(L<Ref(StopLong,-1))>BarsSince(H>Ref(StopShort,-1)),StopLong,StopShort);

You might also like