Handling DST transitions when backtesting a time-based strategy

Discussion in 'Automated Trading' started by rmu, Jun 16, 2025 at 10:59 AM.

  1. Cam12

    Cam12

    I have had the same problem recently testing around DLST changes.

    A simple solution that worked for me was specifying the mkt (that I'm testing) open time for specific dates during my test period.

    That way the script knows that according to my price data:
    Date range A-B: 8am is the open
    Date range C-D: 9am is the open (according the price data)
    Date range E-F: 8am is the open again...

    I am currently using a script that checks for DLST and automatically adjusts but both methods work.

    Hope that makes sense
     
  2. rmu

    rmu

    Unfortunately, i don’t have any MQL coding skills myself. I really wonder that there isn’t any kind of historical data feed for MT4/5, where the forex sessions opening/closing times could be found at the same position/time throughout the year/s/backtest period regardless of DST.
     
  3. Cam12

    Cam12

    I do all of my coding in R. It's relatively straight forward with ChatGPT helping.

    Although it can be tedious, if you can figure out how to deal with the DLST on this one data set, then you'll already have solved the problem for all future data sets as well.