Download MetaTrader 5
To add comments, please log in or register
Interested in MQL5 features? Find them in documentation!
Cezar Graczyk
34
Cezar Graczyk 2016.06.07 16:00 

If I am not mistaken, earlier we get an error message if we use in the Ordersend the wrong price, like OP_SELL with Bid.


Abstract from the MQl4 documentation for Ordersend():

... At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask (for buying) can be used as open price....


But now if I use a price like 99999999.0 the EA open Order wothout Error. Is this a bug or a change or did I´m wrong?


e.g.

int Magic = 1;
doubleOrderLots_ = 0.01;
double Price = 99999999.0;
int MaxSlippage = 1;

int ticket=OrderSend(Symbol(),OP_SELL,OrderLots_, Price,MaxSlippage,0,0,"",Magic,0,Red);

Fernando Carreiro
1438
Fernando Carreiro 2016.06.07 16:27  
Pago:

If I am not mistaken, earlier we get an error message if we use in the Ordersend the wrong price, like OP_SELL with Bid.

It can also depend on the Broker or Account type. If a Broker or Account type, does not implement slippage control, an OrderSend() for a Market Order (OP_BUY or OP_SELL) will always be filled at the current market price (Bid or Ask), irrespective of the supplied price, and there will be no slippage limit or a re-quote. You can usually identify this when a Broker or Account type has an "Execution Type" of "Market Execution" instead of "Instant Execution". In other words, "Instant Execution" does have slippage control and can allow re-quotes to occur, while the "Market Execution" has no slippage control at all and orders are always accepted at current market price irrespective of the Open Price provided in the OrderSend() parameter.

So please verify that it is not the case first, and if it is not, then in order for us to test it and to try recreate and identify this as a possible bug, please inform us of:

  • MT4 Build?
  • Broker/account Execution Type?
  • Broker and Account type?
Cezar Graczyk
34
Cezar Graczyk 2016.06.07 18:59  

Thank you for the fast answer.

I check my ECN Account and it has the execution type market execution. So it will not work. My broker told me, that only market maker has instant execution and real ECN use the market execution accounts.

Fernando Carreiro
1438
Fernando Carreiro 2016.06.07 19:03  
Pago:

Thank you for the fast answer.

I check my ECN Account and it has the execution type market execution. So it will not work. My broker told me, that only market maker has instant execution and real ECN use the market execution accounts.

That is correct! Good ECN brokers are usually "Market Execution Type" so there is no slippage control and orders are always filled at current market prices.
/
To add comments, please log in or register