You have to call OrderSelect() again to update the values.
Yes, thanks, looks like I had a glitch in my head and thought for a moment, since OrderXXXXX() are calls (not variables), they should return actual current values every time...
But actually they just return values saved by last OrderSelect() call...
Woldemar89: they should return actual current values every time...
Current values of what order?
William Roeder:
Current values of what order?
Current values of order selected by last OrderSelect() call...
Topic is not actual anymore.. As I said, I just had wrong thought for a moment...
I was thinking OrderSelect() can be called just once, then, for example, each OrderProfit() call will be always returning actual current (different) value every time...
But this is wrong...
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
If I call OrderSelect() before OrderCloseTime() it returns correct datetime... Sleep(1000) call does not help...
Tools and account:
MQL4
Test script:
Output:
2021.01.21 18:17:31.195 OrderCloseTimeBug EURUSD,H1: 1970.01.01 00:00
2021.01.21 18:17:31.195 OrderCloseTimeBug EURUSD,H1: -0.3
Is this bug or expected behaviour or I do something wrong?