Help me with metastock code

#1
Hello at all

I'd like traslate 4% Rule from Metastock to Amiboker
Who can help me ?
Best reagards
Paolo


R:= 1-(((2.5*ATR(5))/((H+L+C)/3)));
R1:= 1+(((2.5*ATR(5))/((H+L+C)/3)));

If(PREV = 1,
If(CLOSE < HighestSince(1,PREV <> 1,CLOSE)*R,
-1,PREV),
If(PREV = -1, If(CLOSE>LowestSince(1,PREV <> -1,CLOSE)*R1,
+1,PREV),
If(PREV = 0, If(CLOSE>Lowest(CLOSE)*R1,
+1,
If(CLOSE<Highest(CLOSE)*R,
-1,
PREV)),PREV)))
 

Similar threads