try this, i didnt verify it...
Var: MA(0),UPTrend(0),DNTrend(0);
MA=Average(Close,20);
If SwingLow(2,MA,10,30) < SwingLow(1,MA,10,30) then UPTrend= 1;
DNTrend=0;
If SwingLow(2,MA,10,30) > SwingLow(1,MA,10,30) then DNTrend= -1;
UPTrend=0;
Plot1(UPTrend,"UPTrend");
Plot2(DNTrend,"DNTrend");
|