Hedging account [Only position closing is allowed]

 

Hello,

I have an working EA, but I was forced to use different broker (AdmiralMArkets).

Unfortunately it's nor working here. I get an error 4756 [Only position closing is allowed].

I don't know how to understand it or what should I change. I guess it's concerning hedging account. but I am not sure.


Please can anyone help?

   MqlTradeRequest mrequest;  // To be used for sending our trade requests
      ZeroMemory(mrequest);
      mrequest.action = TRADE_ACTION_DEAL;                                  // immediate order execution
      mrequest.price = NormalizeDouble(latest_price.ask,_Digits);           // latest ask price
      //if(UseStopLoss)
      //   mrequest.sl = NormalizeDouble(latest_price.ask - STP*_Point,_Digits); // Stop Loss
      //if(UseTakeProfit)
      //   mrequest.tp = NormalizeDouble(latest_price.ask + TKP*_Point,_Digits); // Take Profit
      mrequest.symbol = Symbol_A;                                            // currency pair
      mrequest.volume = MM_Lot;                                                 // number of lots to trade // Lot
      mrequest.magic = EA_Magic;                                             // Order Magic Number
      mrequest.type = ORDER_TYPE_BUY;                                        // Buy Order
      mrequest.type_filling = Filling_mode;                             // Order execution type
      mrequest.deviation=100;                                                // Deviation from current price
      //mrequest.type_time = ORDER_TIME_SPECIFIED;
      
      //--- send order
      if(!OrderSend(mrequest,mresult))
         Alert("The Buy order request could not be completed -error:",GetLastError());
         
Reason: