You need to use the time of the trading server. And it’s better to take it with a margin:
if(HistorySelect(0,TimeCurrent()+60*60*24;))
In general, the last deal needs to be caught in OnTradeTransaction.
How to start with MQL5
- 2019.08.18
- www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
Thank you so much Vladimir!
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
I need a function to retrieve the latest trades closed. I'm calling this function from OnTrade(). I use to program in MQL4 and I'm new to MQL5. Thanks for the help!