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?
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);
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:
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.