- OrderSendAsync() function
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- OrderSend vs OrderSendAsynch
If you want that you can also code it to wait for the results.
Sending a buy trade request leads to a chain of trade transactions on a trading account:
1) request is accepted for processing,
2) an appropriate purchase order is created for the account,
3) the order is then executed,
4) the executed order is removed from the list of active ones,
5) adding to the history of orders,
6) the subsequent transaction is added to history and
7) a new position is created.
All these stages are trade transactions.
The arrival of each such transaction to the terminal is the TradeTransaction event.
Priority of these transactions' arrival at the terminal is not guaranteed.
Thus, you should not expect that one group of transactions will arrive after another one when developing your trading algorithm.
- www.mql5.com
If you want that you can also code it to wait for the results.
Sending a buy trade request leads to a chain of trade transactions on a trading account:
1) request is accepted for processing,
2) an appropriate purchase order is created for the account,
3) the order is then executed,
4) the executed order is removed from the list of active ones,
5) adding to the history of orders,
6) the subsequent transaction is added to history and
7) a new position is created.
All these stages are trade transactions.
The arrival of each such transaction to the terminal is the TradeTransaction event.
Priority of these transactions' arrival at the terminal is not guaranteed.
Thus, you should not expect that one group of transactions will arrive after another one when developing your trading algorithm.
Using OrderSendAsync in order to wait for results is futile. Then just use OrderSend.
Anyways, in order to not reinvent the wheel, see https://www.mql5.com/ru/code/22166
If you want to keep some background process running while halting primary or sub routines.
As always it depends on the specific implementation.
If you want to keep some background process running while halting primary or sub routines.
As always it depends on the specific implementation.
Using OrderSendAsync in order to wait for results is futile. Then just use OrderSend.
Anyways, in order to not reinvent the wheel, see https://www.mql5.com/ru/code/22166
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use