Candle GMT offset

To add comments, please log in or register
Tzvetan Jordanov
3759
Tzvetan Jordanov  

It really frustrates me that the MQL4, does not provide a way to get the GMT offset from a specific candle in the past.

I'm writing an indicator which needs to draw a vertical line on the chart when the broker timezone has been changed.

How I can do this ?

Please guys, if anyone out there has a solution, please share it.

Thank you and much appreciated!

Carl Schreiber
Moderator
7132
Carl Schreiber  

You can calculate by yourself!

You have (local) TimeGMT() and  CurrentTime() this way you get time offset of the Server to GMT (if the clock of your pc ist set correctly!!) - and if this changes..

Tzvetan Jordanov
3759
Tzvetan Jordanov  
Carl Schreiber:

You can calculate by yourself!

You have (local) TimeGMT() and  CurrentTime() this way you get time offset of the Server to GMT (if the clock of your pc ist set correctly!!) - and if this changes..


This way I think you will get the current GMT offset. I need to see what was the GMT offset 5 months ago let say. 

Tzvetan Jordanov
3759
Tzvetan Jordanov  

MQL4/5 developers , please help, I need it.

Marco vd Heijden
Moderator
8176
Marco vd Heijden  

Isn't that just the same as the time 5 months ago including that correction?

Tzvetan Jordanov
3759
Tzvetan Jordanov  
Marco vd Heijden:

Isn't that just the same as the time 5 months ago including that correction?


Hi, what do you mean?

How it can be the same if let say 4 month ago the broker changed its time zone from +2 to +1 ?

Carl Schreiber
Moderator
7132
Carl Schreiber  
Tzvetan Jordanov:

This way I think you will get the current GMT offset. I need to see what was the GMT offset 5 months ago let say. 

If your broker follows the normal fx-session open time it opens Sunday 17:00 NY-time. Therefore NT_Open_Time - NY_DST - NY_GMT_Offset  should give you GMT_Offset of your quotes.

Make a list when the NY_DST changes, see here for example: https://www.timeanddate.com/time/change/usa/washington-dc

Tzvetan Jordanov
3759
Tzvetan Jordanov  
Carl Schreiber:

If your broker follows the normal fx-session open time it opens Sunday 17:00 NY-time. Therefore NT_Open_Time - NY_DST - NY_GMT_Offset  should give you GMT_Offset of your quotes.

Make a list when the NY_DST changes, see here for example: https://www.timeanddate.com/time/change/usa/washington-dc


Thank you for your reply Carl.

What I'm looking for is this little peace of code which takes the GMT offset from a candle in the past.

Can you write an example following your explanation above ?

Thanks and much appreciated !

Carl Schreiber
Moderator
7132
Carl Schreiber  
I haven't it coded yet, so I am sorry.
Tzvetan Jordanov
3759
Tzvetan Jordanov  
Carl Schreiber:
I haven't it coded yet, so I am sorry.

Yes I think it will be difficult to be coded tho :)

Tzvetan Jordanov
3759
Tzvetan Jordanov  

Come on guys, help please.

Is it impossible ?

123
To add comments, please log in or register