How to set the correct GMT and DST for your broker

Avatar
  • updated

1. Enable News filter, set the "Non-Farm" key-word.

2. Run the back-test for 1-1.5 years on any symbol containing "USD", timeframe M5-M15.

Modelling mode doesn't matter, you can use Control points for faster test.

3. Find the news lines on the chart (or trades arrows after MT5 test), they should fit the strongest price movement of the day.

4. If they are not, correct GMT (to move all lines left or right) or DST (to move only winter or summer lines).

5. Repeat until success ;)

Here I set GMT +4 and ran the first test:

Image 1121

Then I changed GMT to +2:

Image 1122

Always check both summer and winter periods, lines should fit the movements all the year.

Set for MT4 (CP v2.29) — CP_MT4_USD_GMTandDST_check.set

Set for MT5 (CP v2.29) — CP_MT5_USD_GMTandDST_check.set

Avatar
Ulises Cune

Hello Community,

Luckily I found this broker that has on its site an interesting option to calculate the trading sessions according to the "Time Zone" that is configured.

Maybe someone will find it useful. I know several EAs and Indicators for Metatrader that could do the same, but this being web seemed easier and faster to use.


Personally, I do not have an account with this broker.

https://freshforex.com/analitics/sessions/?switch_lang

Avatar
andy

Option "GMT offset for Strategy Tester" & "DST"

1) Timeshift for News Filter working well. Its OK.

2) But why do you apply it to the calculation of Work Time???

-If i set GMT+2 (for example Roboforex) and Option "Every Day" 00:05-23:55

EA tries to open a position in the period 23:55-00:05 (server time) according to the Test Log and errors go to the Logs that "The Market is closed"

-If i set GMT+2 and Option "Every Day" 12:00-23:55

EA open a position from 14:00 (server/logs time)

-If i set "GMT 0" - all is OK. Other Order sets in 00:05+...(not set at 23:55-00:05 server time in history/Logs)

3)

Hmmmm.... Work Time Filter on Demo Account works bad !!!

Alpari. Server Time: 23:30 (UTC+2/UTC+3)

Options:

Apply to all trade operations

Every day: 06.00-23.20, DST-Europe, GMT 3 = OPEN POSITIONS

Every day: 06.00-23.20, DST-Europe, GMT 2 = OPEN POSITIONS

Every day: 06.00-23.20, DST-Europe, GMT 1 = OPEN POSITIONS

Every day: 06.00-23.20, DST-Europe, GMT 0 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 0 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 1 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 2 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 3 = OPEN POSITIONS

Every day: 06.00-21.20, DST-Europe, GMT 0 = NO TRADES

Every day: 06.00-21.20, DST-Europe, GMT 1 = NO TRADES

Every day: 06.00-21.20, DST-Europe, GMT 3 = NO TRADES

Roboforex = also !!!

test script 

2022.05.06 07:54:11.388 test (EURUSD,H1) TimeGMT: 2022.05.06 04:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeCurrent: 2022.05.06 07:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeTradeServer: 2022.05.06 07:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeLocal: 2022.05.06 07:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeDaylightSavings: 0.00000000

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeGMTOffset: -3.00000000

Check the time calculation in the filter "Work Time" !!!

It may be worth applying a DST/GMT correction to the News Filter if there is data in UTC+0 format And not apply it to the "Work Time" filter because the data is there by server time (UTC+X) when terminal online

If the terminal is running on server time and automatically switch to winter/summer time (if the server is switching).

Because of this, the test results may differ!!!

Option "GMT" does not change anything in the History of ticks downloaded from the broker's server.

During testing, the local time is always equal to the server time. The server time always corresponds to the GMT time.

https://www.metatrader5.com/en/terminal/help/algotrading/testing_features#time

The Strategy Tester generates its own stream of quotes and values of the TimeCurrent() function correspond to the stream of quotes in the Strategy Tester. TimeTradeServer() function values correspond to values of TimeCurrent(). Similarly, TimeLocal() function values correspond to values of TimeCurrent().

https://www.mql5.com/en/articles/599

Avatar
Andrey Khatimlianskyi
Quote from andy

Option "GMT offset for Strategy Tester" & "DST"

1) Timeshift for News Filter working well. Its OK.

2) But why do you apply it to the calculation of Work Time???

-If i set GMT+2 (for example Roboforex) and Option "Every Day" 00:05-23:55

EA tries to open a position in the period 23:55-00:05 (server time) according to the Test Log and errors go to the Logs that "The Market is closed"

-If i set GMT+2 and Option "Every Day" 12:00-23:55

EA open a position from 14:00 (server/logs time)

-If i set "GMT 0" - all is OK. Other Order sets in 00:05+...(not set at 23:55-00:05 server time in history/Logs)

3)

Hmmmm.... Work Time Filter on Demo Account works bad !!!

Alpari. Server Time: 23:30 (UTC+2/UTC+3)

Options:

Apply to all trade operations

Every day: 06.00-23.20, DST-Europe, GMT 3 = OPEN POSITIONS

Every day: 06.00-23.20, DST-Europe, GMT 2 = OPEN POSITIONS

Every day: 06.00-23.20, DST-Europe, GMT 1 = OPEN POSITIONS

Every day: 06.00-23.20, DST-Europe, GMT 0 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 0 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 1 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 2 = OPEN POSITIONS

Every day: 06.00-22.20, DST-Europe, GMT 3 = OPEN POSITIONS

Every day: 06.00-21.20, DST-Europe, GMT 0 = NO TRADES

Every day: 06.00-21.20, DST-Europe, GMT 1 = NO TRADES

Every day: 06.00-21.20, DST-Europe, GMT 3 = NO TRADES

Roboforex = also !!!

test script 

2022.05.06 07:54:11.388 test (EURUSD,H1) TimeGMT: 2022.05.06 04:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeCurrent: 2022.05.06 07:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeTradeServer: 2022.05.06 07:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeLocal: 2022.05.06 07:54

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeDaylightSavings: 0.00000000

2022.05.06 07:54:11.389 test (EURUSD,H1) TimeGMTOffset: -3.00000000

Check the time calculation in the filter "Work Time" !!!

It may be worth applying a DST/GMT correction to the News Filter if there is data in UTC+0 format And not apply it to the "Work Time" filter because the data is there by server time (UTC+X) when terminal online

If the terminal is running on server time and automatically switch to winter/summer time (if the server is switching).

Because of this, the test results may differ!!!

Option "GMT" does not change anything in the History of ticks downloaded from the broker's server.

During testing, the local time is always equal to the server time. The server time always corresponds to the GMT time.

https://www.metatrader5.com/en/terminal/help/algotrading/testing_features#time

The Strategy Tester generates its own stream of quotes and values of the TimeCurrent() function correspond to the stream of quotes in the Strategy Tester. TimeTradeServer() function values correspond to values of TimeCurrent(). Similarly, TimeLocal() function values correspond to values of TimeCurrent().

https://www.mql5.com/en/articles/599

Hey

2) It was designed this way to use the same time settings with all your brokers.

Make a single set and use it with broker located in GMT+3 timezone, and with another one in GMT+1 timezone.

EAs will trade at the same time.

3) Please, check again.

You should set all time settings in GMT. Then compare open time of your trades with real GMT time.

I'll check again on Monday, but it should work )

Avatar
andy

Yes, it should work... I didn't notice in the documentation that...

*** All settings are in GMT time corrected with selected DST mode. ***


Avatar
david pendragon

Hi Andrey Khatimlianskyi,


I did exactly whay you said in the tutorial but unfortunately the news lines do not appear on the chart.

I let you below the screenshots of the process from the downloading of the news data to the backtest's result in visual mode.


Hope you can help me,

David

Avatar
Ulises Cune

Hello David,

Check with this file.

investor_v2.48_Tester.set

Your mistake is that you have wrong files.
The correct path is:
C:\Users\your_name\AppData\Roaming\MetaQuotes\Terminal\Common\Files\News\FF\*


You have it in "News 2007-2022"

Try using my script:

https://communitypowerea.userecho.com/en/communities/7/topics/593-script-news-download


Avatar
david pendragon
Quote from Ulises Cune

Hello David,

Check with this file.

investor_v2.48_Tester.set

Your mistake is that you have wrong files.
The correct path is:
C:\Users\your_name\AppData\Roaming\MetaQuotes\Terminal\Common\Files\News\FF\*


You have it in "News 2007-2022"

Try using my script:

https://communitypowerea.userecho.com/en/communities/7/topics/593-script-news-download


Thank you for the answer Ulises, 

Now that the file has been renamed into "News" and that I tried the baktest with your attached set, I am able to see the news' lines and it seems that they align with the market but I'm not certain of that.


That is why I would like to have your opinion about it. Are the news' lines in the right place?

I let you several screenshots of the strongest news below.

backtest zoom out.png
Screenshot 2022-08-15 072456.png
Screenshot 2022-08-15 072537.png
Screenshot 2022-08-15 072622.png
Screenshot 2022-08-15 072643.png
Screenshot 2022-08-15 072702.png
Screenshot 2022-08-15 072751.png
Screenshot 2022-08-15 072602.png
Screenshot 2022-08-15 072807.png
Screenshot 2022-08-15 072827.png
Screenshot 2022-08-15 072948.png

Avatar
Ulises Cune

Hello David,

Check the time of the server and your computer. Ideally, you should have the time zone set to the same as the server's.

Check this out.

https://communitypowerea.userecho.com/en/communities/7/topics/273-how-to-set-the-correct-gmt-and-dst-for-your-broker?redirect_to_reply=2251#comment-2251

In my case Roboforex uses UTC+2

https://roboforex.com/beginners/info/forex-trading-hours/

Config Windows 10:

Avatar
Ulises Cune

English: