Tzvetan Jordanov
Tzvetan Jordanov

Reputation: 123

How to get GMT offset from candle in the past MQL4

It is actually an MQL4 question.

What I actually need to code is an indicator, which draws a vertical line on the day the timezone of the broker has been changed. This is happening once on every 6 month.

Any idea how to get the GMT offset of a candle in the past or anything similar ?

Thanks for your help guys!

Upvotes: 1

Views: 1509

Answers (2)

user3666197
user3666197

Reputation: 1

Long story short:

Based on what was available in 2017Q3, there is the only chance for MQL4-code to ask an external process.

Doable:

The external process ( be it a python, tz-equipped, code or other ) must be informed not only of the Bar's "indicated"-time, from iTime(...), but it must also have gotten be configured, where is the Trading-Server located ( the Broker-specific setup ) + whether all the Broker-Servers keep their geo-located-TimeZone or still keep some Broker's administrative-centre "united" TimeZone-location, even if not physically present in such administratively-given-TimeZone location.

I.e. London access-point may present itself to be in UTC +0000 geo-location zone, but yet may follow UTC { +0300 | +0400 }-administratively-enforced-TimeZone location(s).

The same applies for what rules do actually enforce the Broker's Server DLS-Time { On | Off }-to happen in reality. US geo-located Broker's Servers may yet be subordinated for non-US DLS-Time shift dates.

So, indeed, not an easy or any straightforward step to ask today, what was the actual geolocated time in some far moment of time in the past.

Upvotes: 0

Daniel Kniaz
Daniel Kniaz

Reputation: 4691

int TimeGMTOffset() and datetime TimeGMT() are available in MQL4, but you cannot know what was a GMT offset some time ago as the TimeGMT() returns the same value for any bar.

Upvotes: 0

Related Questions