Huu Tho Tran:
Where did you see such code ? A pattern I see in many EAs: read SymbolInfoSessionTrade for today, take from % 86400 and to % 86400, and compare them with the current time of day. It breaks when a session crosses midnight. The returned 'to' can be later than 24:00 (a session from 21:00 to 08:00 the next day), so to % 86400 becomes 08:00 and the whole evening looks closed. There is a second gap: after midnight, today's list does not contain the session that started yesterday.
The script below prints every session of a symbol, marks the ones that cross midnight, and compares the usual check with one that keeps the real length (to - from) and also looks at yesterday's sessions. Online it uses TimeTradeServer(), because TimeCurrent() stops between ticks.
Which symbols on your account have sessions that cross midnight, and how do you handle them in your EAs?
I have never seen such session, do you have an actual example of a broker/symbol using it ?
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
Which symbols on your account have sessions that cross midnight, and how do you handle them in your EAs?