/*[[ Name := ATRO Author := Jacob Yego , Copyright © 2005, MetaQuotes Software Corp. Link := http://www.metaquotes.net/ Lots := 1.00 Stop Loss := 20 Take Profit := 300 Trailing Stop := 60 ]]*/ var:RSI(0); var:CCI(0); var:EMAFast(0); var:EMASlow(0); var:EMA(0),EMAF(0); var:ATR(0); var: cnt(0),tt(0); var: Stoch(0),StochSig(0); If Bars<200 or TakeProfit<10 then Exit; // data into internal variables EMAFast=iMA(5,MODE_EMA,0); //EMAFast=iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,0); EMASlow= iMA(8,MODE_EMA,0); //EMASlow=iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0); ATR=iATR(10,0); //ATR=iATR(NULL,0,10,0); RSI=iRSI(14,0); // RSI=iRSI(NULL,0,14,PRICE_CLOSE,0); CCI=iCCIEx(14,PRICE_CLOSE,0); //CCI= iCCI(NULL,0,14,PRICE_CLOSE,0); Stoch= iSTO(13,3,3,MODE_SMA,MODE_MAIN,0); StochSig=iSTO(13,3,3,MODE_SMA,MODE_SIGNAL,0); EMA=iMA(8,MODE_EMA,0); EMAF=iMA(200,MODE_SMA,0); If TotalTrades<1 then {// no opened orders identified If FreeMargin<1000 then Exit; // not enough money If Close>EMA and Close>EMAF and CCI>-100 and RSI>40 and Stoch>StochSig then { SetOrder(OP_BUY,Lots,Ask,3,Ask-2*ATR,Ask+TakeProfit*Point,RED); // исполняем Exit; // выходим, так как все равно после совершения торговой операции // наступил 10-ти секундный таймаут на совершение торговых операций }; // проверяем на возможность встать в короткую позицию (SELL) //If MacdCurrent>0 and MacdCurrentSignalPrevious and MacdCurrent>(MACDOpenLevel*Point) and //MaCurrent0 then { If (Bid-OrderValue(cnt,VAL_OPENPRICE))>(Point*TrailingStop) then { If OrderValue(cnt,VAL_STOPLOSS)<(Bid-Point*TrailingStop) then { ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE), Bid-TrailingStop*Point,OrderValue(cnt,VAL_TAKEPROFIT),Red); Exit; }; }; }; } else { if RSI>70 then { CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Ask,3,Violet); Exit; // выходим }; If TrailingStop>0 then { If (OrderValue(cnt,VAL_OPENPRICE)-Ask)>(Point*TrailingStop) then { If OrderValue(cnt,VAL_STOPLOSS)=0 or OrderValue(cnt,VAL_STOPLOSS)>(Ask+Point*TrailingStop) then { ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE), Ask+TrailingStop*Point,OrderValue(cnt,VAL_TAKEPROFIT),Red); Exit; }; }; }; }; }; }; // the end.