Прощу помощи!
Всем привет!
...Это точно:

Это точно:
а что именно?.............можно узнать что я чуданул?
а что именно?.............можно узнать что я чуданул?
//*------------------------ if (cc1 + cc2 <= numberoforders) { if (cmft1 == true && ma1 < bo1 && ma1 > bc1) { ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, 2, 0, 0, g_comment_132, magic, 0, Green); if (ticket > 0) { if (StopLoss != 0) SL = NormalizeDouble(Ask - stoploss *_Point, Digits); if (TakeProfit != 0) TP = NormalizeDouble(Ask + takeprofit * _Point, Digits); if (OrderSelect(ticket, MODE_CLOSEBY_ALLOWED, MODE_TICKSIZE)) if (!OrderModify(ticket, OrderOpenPrice(), SL, TP, 0)) Print("Error of modification of a buy order"); } else Print("Error opening a buy order"); } if (cmft2 == true && ma1 > bo1 && ma1 < bc1) { ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, 2, 0, 0, g_comment_132, magic, 0, Red); if (ticket > 0) { if (StopLoss != 0) SL = NormalizeDouble(Bid + stoploss *_Point, Digits); if (TakeProfit != 0) TP = NormalizeDouble(Bid - takeprofit * _Point, Digits); if (OrderSelect(ticket, MODE_CLOSEBY_ALLOWED, MODE_TICKSIZE)) if (!OrderModify(ticket, OrderOpenPrice(), SL, TP, 0)) Print("Error modifying the sell order!"); } else Print("Error opening a sell order!"); } } } //+------------------------------------------------------------------+
вставьте так код
у вас есть в терминале Эксперт Moving Average.mq4
//+------------------------------------------------------------------+ //| Check for open order conditions | //+------------------------------------------------------------------+ void CheckForOpen() { double ma; int res; //--- go trading only for first tiks of new bar if(Volume[0]>1) return; //--- get Moving Average ma=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,0); //--- sell conditions if(Open[1]>ma && Close[1]<ma) { res=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,0,0,"",MAGICMA,0,Red); return; } //--- buy conditions if(Open[1]<ma && Close[1]>ma) { res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,0,0,"",MAGICMA,0,Blue); return; } //--- } //+------------------------------------------------------------------+ //| Check for close order conditions | //+------------------------------------------------------------------+ void CheckForClose() { double ma; //--- go trading only for first tiks of new bar if(Volume[0]>1) return; //--- get Moving Average ma=iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,0); //--- for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue; //--- check order type if(OrderType()==OP_BUY) { if(Open[1]>ma && Close[1]<ma) { if(!OrderClose(OrderTicket(),OrderLots(),Bid,3,White)) Print("OrderClose error ",GetLastError()); } break; } if(OrderType()==OP_SELL) { if(Open[1]<ma && Close[1]>ma) { if(!OrderClose(OrderTicket(),OrderLots(),Ask,3,White)) Print("OrderClose error ",GetLastError()); } break; } } //--- } //+------------------------------------------------------------------+
у вас есть в терминале Эксперт Moving Average.mq4
эти места - открывают
//--- sell conditions if(Open[1]>ma && Close[1]<ma) { res=OrderSend(Symbol(),OP_SELL,0.01,Bid,3,0,0,"",MAGICMA,0,Red); return; } //--- buy conditions if(Open[1]<ma && Close[1]>ma) { res=OrderSend(Symbol(),OP_BUY,0.01,Ask,3,0,0,"",MAGICMA,0,Blue); return; }
эти места - закрывают
//--- check order type if(OrderType()==OP_BUY) { if(Open[1]>ma && Close[1]<ma) { if(!OrderClose(OrderTicket(),OrderLots(),Bid,3,White)) Print("OrderClose error ",GetLastError()); } break; } if(OrderType()==OP_SELL) { if(Open[1]<ma && Close[1]>ma) { if(!OrderClose(OrderTicket(),OrderLots(),Ask,3,White)) Print("OrderClose error ",GetLastError()); } break; }
эти места - открывают
эти места - закрывают
Здравствуйте. Мне нужна Ваша помощь. Вопрос такой: у меня сигнал на платформе МТ5 символ eurusd.m. Подписчик на платформе МТ4 символ eurusd. Сможет ли он копировать мои сигналы. Нужны будут ли для него дополнительные настройки?
Между разными терминалами копирование не происходит.
Всем привет!
if (cc1 + cc2 <= numberoforders)
{
if (cmft1 == true && ma1 < bo1 && ma1 > bc1)
{
ticket = OrderSend(Symbol(), OP_BUY, lots, Ask, 2, 0, 0, g_comment_132, magic, 0, Green);
if (ticket > 0)
{
if (StopLoss != 0) SL = NormalizeDouble(Ask - stoploss *_Point, Digits);
if (TakeProfit != 0) TP = NormalizeDouble(Ask + takeprofit * _Point, Digits);
if (OrderSelect(ticket, MODE_CLOSEBY_ALLOWED, MODE_TICKSIZE))
if (!OrderModify(ticket, OrderOpenPrice(), SL, TP, 0))
Print("Error of modification of a buy order");
} else Print("Error opening a buy order");
}
if (cmft2 == true && ma1 > bo1 && ma1 < bc1)
{
ticket = OrderSend(Symbol(), OP_SELL, lots, Bid, 2, 0, 0, g_comment_132, magic, 0, Red);
if (ticket > 0)
{
if (StopLoss != 0) SL = NormalizeDouble(Bid + stoploss *_Point, Digits);
if (TakeProfit != 0) TP = NormalizeDouble(Bid - takeprofit * _Point, Digits);
if (OrderSelect(ticket, MODE_CLOSEBY_ALLOWED, MODE_TICKSIZE))
if (!OrderModify(ticket, OrderOpenPrice(), SL, TP, 0))
Print("Error modifying the sell order!");
} else Print("Error opening a sell order!");
}
}
}
//+------------------------------------------------------------------+