Check how many daily bars are in last week. If 5 - broker's time is GMT+DST+2, if 6 - check how many hours are in first and last. One would be less than 24 and you will need to add/subtract that value to GMT+DST+2.
Or, since you need to recalculate it twice per year per broker at the worst case, you might as well hardcode it.
Check how many daily bars are in last week. If 5 - broker's time is GMT+DST+2, if 6 - check how many hours are in first and last. One would be less than 24 and you will need to add/subtract that value to GMT+DST+2.
Or, since you need to recalculate it twice per year per broker at the worst case, you might as well hardcode it.
Thanks for the idea. The calculation seems to be a bit complex.
However, i did a quick test & found that broker (fxpro) had 5 daily candles last week. But their server's GMT offset is +3.(asked their support)
Maybe I'm doing something wrong. Not sure.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This piece of code I believe was working correctly until market closed for the weekend.
Now its plotting the session in wrong places of charts. Is this because the last tick arrival is locked at 23:59:59?
How can you accurately get broker's GMT offset(even during weekends)?