inputs:Longlenght(58), Max(4250);
//entries with filters
if (ADX(14) and RSI(close,14) > 60 and StdDev(Close,20)> StdDev(close,20)[1])=false //Filters #672 ADX RSI Vol Up
and ADX(5) <50 then begin// filters #190: ADX above 50
Buy next bar highest (high,longhlenght) stop; end;
If (close<lowest(low,21)[1]=false //filter #243 close below lowest average lows +1
and (StdDev(close,10)>StdDev(close,20) and RSI(close,14) <40 and CCI(14)<-100) = false then begin // Filters #725: StdDev RSI CCI down
If (PivotHighVSBar (1,high,2,2,50)<PivotLowVSBar(1,low,2,2,50)) then begin
Sellshort next bar Lowest (Low, Longlenght) Stop; end;end;
//Exit: Profit,StopLoss, #15 High/Low trail stop
Setprofittarget(Max); Setstoploss (Max*0.3);
if marketposition>0 then sell next bar at lowest(Low,10) stop;
if marketposition<0 then buytocover next bar at highest(high,10) stop