Read the help - there are many answers. OrderSendAsync
Return Value
Returns true if the request is sent to a trade server. In case the request is not sent, it returns false. In case the request is sent, in the result variable the response code contains TRADE_RETCODE_PLACED value (code 10008) – "order placed". Successful execution means only the fact of sending, but does not give any guarantee that the request has reached the trade server and has been accepted for processing. When processing the received request, a trade server sends a reply to a client terminal notifying of change in the current state of positions, orders and deals, which leads to the generation of the Trade event.
The result of executing the trade request on a server sent by OrderSendAsync() function can be tracked by OnTradeTransaction handler. It should be noted that OnTradeTransaction handler will be called several times when executing one trade request.
For example, when sending a market buy order, it is handled, an appropriate buy order is created for the account, the order is then executed and removed from the list of the open ones, then it is added to the orders history, an appropriate deal is added to the history and a new position is created. OnTradeTransaction function will be called for each of these events. To get such a data, the function parameters should be analyzed:
- trans - this parameter gets MqlTradeTransaction structure describing a trade transaction applied to a trade account;
- request - this parameter gets MqlTradeRequest structure describing the trade request resulted in a trade transaction;
- result - this parameter gets MqlTradeResult structure describing a trade request execution result.

- www.mql5.com
Thanks, I have already read this, there's no retcode indicating that order was rejected because of an allowed price deviation too low.... correct?
https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes

- www.mql5.com
Thanks, I have already read this, there's no retcode indicating that order was rejected because of an allowed price deviation too low.... correct?
https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes
Just use the synchronous function:
Sends trade requests to a server |

- www.mql5.com
What is the Trade error "return code" that the synchronous will give, if the allowed "price deviation" is too low and the broker rejects the order?
Thanks

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My OrderSendAsync returns true (sent ok) but the order isn't executed.
I suppose this is because of request.deviation (because if I put a higher value, then orders are executed).
How can I determine, for sure, that my orders are rejected because of a request.deviation that is too low?
Thanks