You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Unfortunately, only through a crutch - a global variable of the terminal.
And through additional crutches to ensure that the main variable is deleted in case of a crash, for example.
So my variant with waiting for a transaction in the history is more reliable and simpler. But it's still a crutch.
I haven't checked, but maybe after OrderSend ALL EAs get corresponding event forOnTradeTransaction.
Then everything is solved without crutches and for multiple EAs on the same symbol.
Do you want me to help you bypass these mishaps (from personal experience of trading with MT5 robots on a real account)?
Added
Totally free :)
People don't want to think for themselves, they want others to do it for them... Unfortunately, this is true.
People not only think, but also share their solutions. The developers are silent on this, unfortunately.
Not a single example in the Documentation on this topic. And that's with the main function.
I support. If it was written somewhere that OrderSend() waits for a response from the server and what happens next, there would be no need to come up with workarounds to check.
There is an excellent article about orders, deals and positions and working with them and their cache which details everything. However, it completely sidesteps the processes that take place when orders are sent itself.
My suggestion
Use it.
And what happens if OnTrade() event is triggered before OnTick() processing is finished. Sometimes time is of the essence. Waiting for the OnTrade() event to occur may be problematic. Besides, the OrderSend() function itself is designed so that I can get information about its results right on the spot. Or is it not?
OrderSend() is an absolutely synchronous function - if a ticket is received, everything is executed.
Below is an example
Added, and here are the logs
https://www.mql5.com/ru/forum/38456/page85#comment_2888263
Not executed, but sent to the MT5 server.
No. For the Exchange - went to the Exchange (may not have fulfilled :) ), for FOREX I don't know
Added
Ie (for the exchange), if you get a ticket in the OrderSend(() function, it means that the order is accepted by the exchange
Added
See picture (there were changes in 1375)
This is a special case of sending a limit order to an exchange. What about a market order in forex?
Not once in this thread. Only about MT5 and OrderSend synchronicity.
So the answer doesn't fit.
No. For Exchange - went to Exchange (maybe not fulfilled :) ), for FOREX I don't know
Added
Ie (for the exchange), if you get a ticket inthe OrderSend(() function, it means that the order is accepted by the exchange
Added
See picture (there were changes in 1375)