// Downloaded From https://www.WiseStockTrader.com Factor:=Input("Factor",1.00,10.00,3.00); Pd:=Input("ATR Periods",1,100,10); Up:=MP()+(Factor*ATR(Pd)); Dn:=MP()-(Factor*ATR(Pd)); Td:=If(Cross(C,LLV(Up,13)),1,If(Cross(HHV(Dn,13),C ),-1,PREV)); Dnx:=If(Dn=HighestSince(1,Cross(Td,0),Dn),Dn,PREV) ; Upx:=If(Up=LowestSince(1,Cross(0,Td),Up),Up,PREV); ST:=If(Td=1,Dnx,If(Td=-1,Upx,PREV)); ST