Properly backtest a time based strategy with DST in mind?

 

Hey,

i wonder how to go about this. Let's say i would like to ALWAYS see/find the london session open (that is 08:00 am GMT london time during the whole year) with my broker's chart in MT4 provided. Do i have to look at different times during winter/summer or will the chart data presented to me with MT4 automatically adjusted while scrolling back or forth to a winter or summer date? The broker is GMT+2 or GMT+3 when DST is on. So right now i am looking at the 10:00 am bar to reflect the london session open. Now i am not sure this will stay the same while scrolling back to let's say a summer date back in 2022 to 01/07/2022. Or do i then have to look at the 11:00 am bar instead?

thanks in advance. 

 

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Особенности языка mql5, тонкости и приёмы работы

fxsaber, 2023.01.07 23:01

RannForex-Server - Europe
MetaQuotes-Demo - Europe
FXOpen-MT5 - USA
Alpari-MT5 - Europe
Tickmill-Live - USA
ICMarketsSC-MT5-2 - USA
Darwinex-Live - USA
 
fxsaber #:

That doesn't answer what i tried to ask :) 

 
Roman #: That doesn't answer what i tried to ask :) 

You have to find out your brokers DST dates and times and take into account when looking at the data provided by the broker.

That was the point of @fxsaber's post, informing you of some well known brokers and which DST they are using.

 
Roman: ALWAYS see/find the london session open (that is 08:00 am GMT london time during the whole year)   do i then have to look at the 11:00 am bar instead?
  1. London open is not 08:00 am GMT. It is 8 AM London time. BST in the summer.
  2. You must ask your broker.

    Chart times are broker times.

    1. How can MetaQuotes know all brokers' (they come and go daily) Time zone and Daylight savings time (if they use it and including historical changes for back testing)? Do you have that information for just you and your broker? Only then, with code, can you convert session times to broker's time to UTC to local time. You can use offset inputs, but then you must maintain them correctly, through all three DST changes when they occur.
                When is the time zone problem going to be fixed? - General - MQL5 programming forum (2020)

    2. Foreign Exchange (FX) market opens 5 PM New York (NY)/Eastern Time (ET) Sunday and ends 5 PM NY Friday. Some brokers start after (6 PM is common) and end before (up to 15 minutes) due to low volatility.
                Checking for Market Closed - Expert Advisors and Automated Trading - MQL5 programming forum (2016)

      Swap is computed 5 PM ET. No swap if no open orders at that time.

    3. Brokers use a variety of time zones. Their local time, with or without Daylight Savings Time (DST), London, UTC, London+2, UTC+2, NY+7.

      Only with NY+7 does the broker's 00:00 equals 5 PM ET and the start of a daily bar (and H4) is the start of a new FX day.

      GMT/BST brokers, means there is a 1 or 2 hour D1/H4 bar on Sunday (depending on NY DST), and a short Friday bar. (Problems with indicators based off bars.)

      GMT+2 is close but doesn't adjust for NY DST.

      EET is closer, except when their DST doesn't match NY's. Last Sunday of March and 1:00 on the last Sunday of October vs second Sunday in March and return at 2:00 AM EDT to 1:00 AM EST on the first Sunday in November.

    4. Non-NY+7, means the chart daily bar overlaps the start, and converting broker time to NY time requires broker to UTC to NY timezone conversions.


    5. If you search the web, you will find differing answers. Those are all wrong (half the year) because they do not take DST into account (or that it changed for the US in 2007 [important when testing history.])


    6. Then there are (non-24 hour markets) with H4 candles that start on odd hours.
                Why My XAUUSD 4H candles start with 1 hour shift? - Currency Pairs - General - MQL5 programming forum (2019)
                H4 first opened candle - MT5 - General - MQL5 programming forum (2020)

      And H1 on the half hour.

    7. See also Dealing with Time (Part 1): The Basics - MQL5 Articles (21.10.01)
      and Dealing with Time (Part 2): The Functions - MQL5 Articles (21.10.08)

 
William Roeder #:
  1. London open is not 08:00 am GMT. It is 8 AM London time. BST in the summer.
  2. You must ask your broker.

1.) One hour ahead in the summer. So 08:00 AM GMT+0 in the winter and 07:00 AM GMT+0 in the summer right? 
2.) The Dukascopy data is stored at GMT +00:00. Not sure the DST region used. 

As another user mentioned, dates when clocks are changed can be slightly different each year. 

Now my question again.

I will have have to run a seperate backtest for every year i would like to test (as the backtesting period) and I can't just scroll back and use the 08:00 AM GMT+0 candle for my entry? 


 
Roman #:

1.) ...
2.) The Dukascopy data is stored at GMT +00:00. Not sure the DST region used. 

It's UTC, so no DST used.
 
Alain Verleyen #:
It's UTC, so no DST used.

https://www.timeanddate.com/time/gmt-utc-time.html

So it means i will have to run a seperate backtest for winter/summer testing against 07:00 AM and 08:00 AM to get accurate results reflecting the actual london open during a whole year period? 

UTC & GMT – Same Difference?
UTC & GMT – Same Difference?
  • www.timeanddate.com
Although GMT and UTC share the same current time in practice, there is a basic difference between the two: GMT is a time zone officially used in some European and African countries. The time can be displayed using both the 24-hour format (0 - 24) or the 12-hour format (1 - 12 am/pm). UTC is not a time zone , but a time standard that is the...
Reason: