//NRTR WATR variable : Trend($data), HPrice($data), LPrice($data), Reverse($data); M=inparam("M=", 0, 500, 3); len=inparam("len=", 1, 500, 15); WATR=atr(len,w); if cum(1)=1 then begin Trend=0; HPrice=c; LPrice=c; Reverse=c; end; else begin Trend=ref(Trend,-1); HPrice=ref(HPrice,-1); LPrice=ref(LPrice,-1); Reverse=ref(Reverse,-1); if (Trend>=0) then begin if (C > HPrice) then HPrice = C; Reverse = HPrice - M*WATR; if (C <= Reverse) then begin Trend = -1; LPrice = C; Reverse = LPrice + M*WATR; end; end; if (Trend <= 0) then begin if (C < LPrice) then LPrice = C; Reverse = LPrice + M*WATR; if (C > Reverse) then begin Trend = 1; HPrice = C; Reverse = HPrice - M*WATR; end; end; end; NRTR_WATR = Reverse; NRTR_WATR;