/*[[ Name := simple parabolic SAR strategy Author := Copyright © 2003, Nick Bilak beluck[at]ukr.net Link := http://bilak.port5.com Notes := optimize 'step' and 'maximum' inputs! Lots := 1 Stop Loss := 0 Take Profit := 0 Trailing Stop := 0 ]]*/ Defines: step(0.02),maximum(0.2),slippage(5),risk(10),mm(0); var: h1(0),lotsi(0),i(0); If Bars<11 then Exit; If FreeMargin<100 then Exit; If((CurTime-LastTradeTime)<10) then Exit; //Print(iSAR(step,maximum,0),h[0],l[o]); if iSAR(step,maximum,0)-h[0] > 0 then h1=-1; if iSAR(step,maximum,0)-l[0] < 0 then h1=1; if mm<>0 then lotsi=Ceil(Equity*risk/10000)/10 else lotsi=lots; if h1>0 then { for i=1 to TotalTrades { if ord(i,VAL_TYPE)=OP_SELL then CloseOrder(ord(i,VAL_TICKET),ord(i,VAL_LOTS),bid,slippage,red); }; If((CurTime-LastTradeTime)<10) then Exit; if TotalTrades<1 then { SetOrder(OP_BUY,lotsi,PriceAsk,Slippage,0,0,RED); }; }; if h1<0 then { for i=1 to TotalTrades { if ord(i,VAL_TYPE)=OP_BUY then CloseOrder(ord(i,VAL_TICKET),ord(i,VAL_LOTS),ask,slippage,red); }; If((CurTime-LastTradeTime)<10) then Exit; if TotalTrades<1 then { SetOrder(OP_SELL,lotsi,Pricebid,Slippage,0,0,RED); }; };