Hi Bob,

Sorry there was some mistake while copying.   Shall be thankful if it could be 
converted into AFL.

The correct metastock formula is as under :

Stop1:=If( PREV < L,
If(( H - 4.5*ATR(21) ) >= PREV,
( H - 4.5*ATR(21) ),
PREV),
( H - 4.5*ATR(21) ));

Stop2:=If( PREV < L,
If(( C - 3.5*ATR(21) ) >= PREV,
( C - 3.5*ATR(21) ),
PREV),
( C - 3.5*ATR(21) ));

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

Stop1:=If( PREV > H,
If(( L + 4*ATR(21) ) <= PREV,
( L + 4*ATR(21) ),
PREV),
( L + 4*ATR(21) ));

Stop2:=If( PREV > H,
If(( C + 3.5*ATR(21) ) <= PREV,
( C + 3.5*ATR(21) ),
PREV),
( C + 3.5*ATR(21) ));

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

If( ((Year()<=2008) OR (Year()=2009 AND Month()<=04 AND DayOfMonth()<=31)), 
If((BarsSince(L<Ref(StopLong,-1))>BarsSince(H>Ref(StopShort,-1)) 
),StopLong,StopShort),C);


Thanks and regards

perumal

Reply via email to