• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:
        http://www.ninjatrader.com/support/f...ad.php?t=19292
        Ryan MNinjaTrader 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 b16_aln, Today, 08:53 AM
            0 responses
            4 views
            0 likes
            Last Post b16_aln
            by b16_aln
             
            Started by learningnt, Yesterday, 10:52 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by U0000999, Today, 07:31 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by TheGameOfProbabilities, Today, 06:56 AM
            5 responses
            23 views
            0 likes
            Last Post NinjaTrader_Tyler  
            Started by emuns, Today, 06:40 AM
            2 responses
            11 views
            0 likes
            Last Post emuns
            by emuns
             
            Working...
            X