
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
How, using only the information which MT4 provides, do you know that the broker was on GMT+2 last week?
Because today, the offset to GMT is +3 with daylight saving adjustment, so last week, when broker was in standard time, the offset was +2.
The only difference is daylight saving time.
The common sense approach would be for MT4 server to use GMT all the time but you know they aren't going to do that.
I think MT4 should encode time zone and daylight saving adjustment in its time structure. This would allow historical time to be used accurately. :)
Because today, the offset to GMT is +3 with daylight saving adjustment, so last week, when broker was in standard time, the offset was +2.
The only difference is daylight saving time.
gchrmt4:
[2] How do you know that they're not currently on winter time and will move on March 30th? Or that they are not using constant GMTZ?[1] how . . . do you know that the broker moved to DST on the US schedule rather than the European schedule (or not at all)?
That is not information which MT4 is providing. That is information which you are providing because you know which broker you are using. You could not e.g. give other people a piece of code to run on an unknown broker server which then reliably converted historical times to GMT (or, via GMT, to another timezone such as London).
... Taking us back to the OP, how do you propose to give them a code sample which will reliably run on whichever broker server he/she is using in order to determine London times and London prices?
The only point I have been trying to make all along is that, yes you can do conversions to GMT or other timezones if you know the origin offset, but MT4 provides no reliable alternative to asking for some sort of user input about the broker's time settings.
You can get the local GMT offset from Windows. Simple comparison will give you the brokers offset without asking for user inputs.
Thanks a lot for all comments! I will give an update when my EA is ready! with my learning curve for MQL4 I hope by the end of this year ;-)
Example:
datetime some_time=D'2004.03.21 12:00';
int shift=iBarShift("EURUSD",PERIOD_M1,some_time);
Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);
when does London open what timezone is that ??
What was the brokertime today at opening time London ?? some_time= .................
What time did your broker had that moment....