<code>//--- Inputs extern double Lots = 0.01; // торговый объем ордера extern double MaxLot = 0.05; // максимальный торговый объем extern double KLot = 2; // увеличение лота extern double Profit = 8.6; // профит крайних ордеров extern int StopLoss = 2000; // лось extern int TakeProfit = 163; // язь extern int TrailingStop = 0; // трал extern int Step = 158; // шаг extern ENUM_TIMEFRAMES TF = PERIOD_H4; extern int MA1_Period = 27; // Период МА1 extern ENUM_MA_METHOD MA1_Metod = 0; extern int MA2_Period = 2; // Период МА2 extern ENUM_MA_METHOD MA2_Metod = 0; extern ENUM_APPLIED_PRICE MA_Price = PRICE_CLOSE; extern int Slip = 30; // реквот extern int Count = 1; // число ордеров extern int Magic = 123; // магик int PrevTime=0;</code>
<code>void OnTick() { if (Time[0]<=PrevTime) return; PrevTime=Time[0]; double ASK=SymbolInfoDouble(Symbol(),SYMBOL_ASK); double BID=SymbolInfoDouble(Symbol(),SYMBOL_BID); double OpenBar = iOpen(Symbol(),TF,0); double MA1 = iMA(NULL,0,MA1_Period,0,MA1_Metod,MA_Price,1); double MA2 = iMA(NULL,0,MA2_Period,0,MA2_Metod,MA_Price,1); if(TrailingStop>0) Trailing(); if((CountTrades()<1 && Close[1]>Open[1] && MA1 < MA2) && ASK > OpenBar || (FindOrderType()==0 && (FindLastBuyPrice()-Ask)/_Point>=Step) && MA1 < MA2) { PutOrder(0,Ask); ModifyOrders(); } if((CountTrades()<1 && Close[1]<Open[1] && MA1 > MA2) && BID < OpenBar || (FindOrderType()==1 && (Bid-FindLastSellPrice())/_Point>=Step) && MA1 > MA2) { PutOrder(1,Bid); ModifyOrders(); } if(CountTrades()>Count && AllProfit()>Profit && Profit>0) CloseAll(); Comment("\n Lot: ",Lot(), "\n Trades: ",CountTrades(), "\n All Profit: ",AllProfit()); } </code>
Все индикаторы врут.
Skyrider60