Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

coping with daylight savings times in back testing and session templates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    coping with daylight savings times in back testing and session templates

    Hi,

    I'm sure this is not an isolated problem that only I have, so hopefully this will be of use to many.

    I have 1 minute fx data spanning back many years. The issue I have is that i want to represent my daily bars for testing in london time.
    Typically you can just set the session template times for the appropriate timezone, however there's an issue:

    london has daylight savings time some parts of the year, where you would need to offset the bar data by 1 hour.
    Also, the data imported was from CQG (time reference Chicago time). The complication is then and different times of the year you need to offset one hour for the chicago daylight savings time also.
    The result is at different dates in the year, my data needs to be shifted by 0, 1 or 2 hours.

    From previous correspondance, the strategy backtest can be assigned the session template, so the daily bars constructed have the correct start/end time.
    How do you set it up to accomidate the above (different times of the year have offset start/end times).

    Note that the changes/shift in timezone occur over the weekend where FX is closed, so there is no issue of data overlap or an hour of data missing etc.

    thanks

    #2
    PolarBear,

    Generally historical data that is saved is time stamped to your local PC. The session templates simply limit the data that displays on your chart to be between certain times. It is generally recommended to keep your PC clock synced to some time service, like NIST to avoid issues.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      thanks for the reply. The data isn't from a broker connection. The data is from very reputable high quality 1 minute cqg data. the data varies throughout the year depending on the daylight saving time, and the issue as described below, if you say want to have your daily bars matched up to something like the london open or similar, means there's again different times of the day where there's an issue.

      How does the NT team suggest I approach this problem.

      Ideally there should be some way to set the session template for the backtest run THROUGHOUT the backtest run.
      So for example at a certain date (eg: at the end of the weekly session) i then change the session template, so for the next week the open/close times are correct.

      From what I understand it you currently assign all dataseries added to the strategy as whatever the session template is defined as in the parameters for the backtest/optimisation.

      Please advise.
      thanks

      Comment


        #4
        Hi PolarBear,

        Unfortunately NinjaTrader does not provide for dynamic session templates. They're set once per bar series. For any time-sensitive parts of your strategy, you would need to custom code what you would like to happen. This sample can help work with DateTime objects:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by PolarBear View Post
          ...How do you set it up to accomidate the above (different times of the year have offset start/end times)...
          You have a choice of two alternatives, I believe:
          a) leave your trading computer in Chicago time CST (even though it's located somewhere else), so that the operating system will make the correct adjustments for daylight saving in Chicago, with the result that your data will always be correct relative to CST (I do this: I'm in Europe, but trade US markets ... my trading computers are all in EST)
          b) convert your data to GMT (someone like the following could do this for you) tickmaster.webs.com

          Comment


            #6
            thanks for this. You've prompted me to think of the best solution I believe. I hope this is of use to other trades.

            My (quite) simple solution is to just modify my C# executible I created that converts my original data into format suitable for NT6/7 import. In this code you simply have some kind of lookup table that provides the offset in hours within certain date ranges. When you parse the input file to output, you add/subtract the relevant hours to fix your data.
            You then import the data into NT and apply whatever session template you would like for your starting time of the day


            hope this helps some others.
            thanks
            PolarBear

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Barry Milan, Today, 10:35 PM
            2 responses
            8 views
            0 likes
            Last Post Barry Milan  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,428 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            41 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Working...
            X