convert to unix time and use it to calculate the time shift.
1 Hour = 60 x 60 seconds
good luck.
Minh Truong Pham:
+3 so i thing my hourshift value always 3.
+3 so i thing my hourshift value always 3.
I think you should go for minutes shift instead of hour shift. This is safer.
Try this: https://www.mql5.com/en/code/45287

Dealing with time (2) functions
- www.mql5.com
Calculate DST for USA, EUR, AUD and RUB and the offset time of the broker automatically from the 70's until 2030 - even in the Strategy Tester of MQ.
Thank Carl Schreiber ! This work!

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
Hello all,
I trying to build indicator relax with sessions open and close. Input time setting is UTC, so i need to convert each time[i] (broker time) to UTC time. My ideal is
this will calculate shift hour from broker time to UTC and this value is static, in loop of indicator need ajust this hourshift.
BUT i found strange: hourshift some time =2, some time=3. I ask my broker (perperstone) and their timezone is GMT+3 so i thing my hourshift value always 3.
Can you please clean for me? Or help me better way to calculate hourshift beetween broker time and UTC time?
Thank you!