Error 4756 the buy request could not be completed

To add comments, please log in or register
mohammad7521
8
mohammad7521  

Hi!


  //Entry for Long Positions

  

  if(PriceDataTable[0].close>Kijun_Sen1 && Kijun_Sen1>Kijun_Sen2)

  {

  if(UseStopLoss)StopLossLevel=CurrentBid+(FinalStopLossPips*_Point)*p;else StopLossLevel=0.0;

  if(UseTakeProfit)TakeProfitLevel=CurrentBid+(FinalTakeProfitPips*_Point)*p;else TakeProfitLevel=0.0;

  

   MyTradingControlPanel.PositionOpen(_Symbol,ORDER_TYPE_BUY,lot,CurrentBid,StopLossLevel,TakeProfitLevel);

    if (MyTradingControlPanel.ResultRetcode()==10008 || MyTradingControlPanel.ResultRetcode()==10009) 

     {Print("Entry rules: A Buy order has been successfully placed with Ticket#: ", MyTradingControlPanel.ResultOrder());

     }

     else

       {Print("Entry rules: The Buy order request could not be completed. Error: ", GetLastError());

        ResetLastError();

        return;

        }

    } 

my long entry is based on price closing above the Ichimoku Kijun sen line but doesn't make any orders.


Help Please!!

Sergey Golubev
Moderator
118386
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button


William Roeder
23253
William Roeder  
  1. mohammad7521: Help Please!!

    Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?

  2. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

To add comments, please log in or register