Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Performance Variance - Platform Timezone Specification

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

    Strategy Performance Variance - Platform Timezone Specification

    Hi,

    I am testing strategies using various trading hour templates based in various timezones. I would like to create custom trading hour templates in UTC for all of the profitable strategies I have found to keep them consistent. When I transpose a non-UTC trading hour template to UTC and re-run the backtest (CST for example), I get drastically different results. Also, when I change the local timezone in the options settings within the NJ platform the strategy, the backtest results change. I would like to know what clock is NJ using for the trading templates so I can baseline them. Historical data has been imported in UTC.

    I am running NJ V. 8.1.1.7 64-bit

    Thx in advance.

    #2
    Hello sumobull,

    Thanks for your post.

    For information about how to create custom Trading Hours templates, please see the 'How to create and edit a Trading Hour template' section of the help guide page linked below.

    Trading Hours: https://ninjatrader.com/support/help...ding_hours.htm

    You could set the time zone you want the Trading Hours template to use in the 'Time zone' drop-down menu when creating a custom Trading Hours template.

    When using the custom Trading Hours template (such as on a chart or on the Chart Display of the Strategy Analyzer), you will see the time is converted to the time zone that NinjaTrader is set to use in the Tools > Options > General tab.

    Tools > Options > General help guide page: https://ninjatrader.com/support/help...al_section.htm
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi, I went through the trading hours guide to confirm I was creating/using them correctly. I appear to be. For consistency for my trades, I want to set all of my trading hour templates to be set in UTC. I re-confirmed the template I created in UTC to match a default template in NJ that is created for HK time. The backtesting results between the two are radically different. They should be 100% identical.

      Also, when I run the exact same backtest with the platform set at timezone Y, and then change it to Z, backtest results are altered. Attached is a sample of this happening. I run the test once, it produced 115 trades, changed the time in the platform, closed/reopened NJ, ran the exact same test again and got 122 trades, ran it again and got the same 122 trades. I then changed the time back to the original and got 155 again. It shouldn't be doing this, correct? Something is wrong.

      Comment


        #4
        Hello sumobull,

        Thanks for your notes.

        When you mention "default template in NJ that is created for HK" time, what is the specific time zone that you are referring to?

        What is the name of the NinjaTrader Trading Hours template that you created a created a copy of and changed the time zone for?

        What time zone is your platform set to in the Tools > Options > General tab?

        Please share the Trading Hours template that you created with us so we may take a look at it and test it on our end. Trading Hours templates could be found in the Documents\NinjaTrader 8\templates\TradingHours folder.

        If you test the SampleMACrossover strategy that comes with NinjaTrader, do you see the same behavior occurring?

        Also, share a screenshot of the Strategy Analyzer settings you are using to test the SampleMACrossover strategy so we may use the same settings for testing on our end.
        • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
        • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
        We look forward to assisting further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi, I am seeing the same issue when running the SampleMACrossover strategy. The first run was done with the platform set to where I am (JST UTC+9) and the second was with the platform set at UTC. I am seeing the issue using the built in 24x7 template (in screenshot)

          Re "HK Time" - UTC +8 - Beijing, Hong Kong.

          I just downgraded to 8.0.28.0 64-bit and still experience the issue.

          The market data was imported manually. I tried to upload the data here but receiving an error w/no detail, unfortunately. Market data is timestamped at UTC.
          Last edited by sumobull; 03-07-2024, 01:00 AM.

          Comment


            #6
            Hello sumobull,

            Thanks for your notes.

            To clarify, are you using the 'Default 24 x 7' Trading Hours template that comes with NinjaTrader without modifying it or did you modify this Trading Hours template in any way?

            I see you have ETHUSD selected as the instrument to backtest on. Is this the ETHUSD Crypto instrument or is this the ETHUSD CFD (Ether CFD)?

            If you have the Tools > Options > General tab > Time zone is set to UTC compare backtest results to the backtest results with the Tools > Options > General tab > Time zone is set to JST UTC+9 you will see a difference in results occur.

            This would be the expected behavior since the first bar being tested over, the last bar being tested over, and the time the Exit On Session Close occurs will be different when comparing the two.

            If you go to the Chart Display on the Strategy Analyzer and note the time of the first bar, last bar, and when Exit On Session close occurs, we can see a difference when comparing the two backtest results each run when set to a different time zone. Since different data is tested over and Exit On Session Close occurs at different times, this will lead to different results.

            You could implement a StreamWriter within your strategy script to write information to a file and review that information to get a better picture of what is causing differences to occur.

            StreamWriter: https://ninjatrader.com/support/help...o_write_to.htm

            If the time zone is changed then you would need to delete historical data and redownload the historical data.

            Historical Data should not be imported manually as this could possibly lead to issues. If you have Historical Data from a third-party provider, this would need to be imported. To import Historical Data, the supported way to do so is to go to Control Center > Tools > Import > Historical Data. The Historical Data must also be in the correct data format seen in the help guide page below.

            See this help guide page for information about importing Historical Data: https://ninjatrader.com/support/help.../importing.htm
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              I used the 24x7 session template unmodified on a fresh install of NT (renamed the Ninjatrader folder in the Documents folder prior to installing).

              I am testing on the ETHUSD crypto instrument.

              this problem shouldn’t be specific to me. Anyone using the product is theoretically impacted by this if they are manually importing price data (assuming this is the trigger).

              is it possible to open a support case to investigate?

              thx in advance.


              Comment


                #8
                Hello sumobull,

                Thanks for your notes.

                I understand that you are using an unmodified 24x7 trading hours template when running the backtest in the Strategy Analyzer?

                Are you changing the Time Zone setting in the Tools > Options > General tab between Strategy Analyzer backtest runs?

                If so, this will cause discrepancies the backtest results generated in the Strategy Analyzer. Since the platform is set to a different time zone in the Tools > Options > General tab between backtest runs, the first bar and last bar and Exit On Session Close order will be at a different time.

                If you go to the Chart Display on the Strategy Analyzer and note the time of the first bar, last bar, and when Exit On Session close occurs, we can see a difference when comparing the two backtest results each run when set to a different time zone.

                Since different data is being tested over and Exit On Session Close is occurring on a different time, the backtest results will be different.


                Brandon H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ageeholdings, Today, 07:43 AM
                0 responses
                7 views
                0 likes
                Last Post ageeholdings  
                Started by pibrew, Today, 06:37 AM
                0 responses
                4 views
                0 likes
                Last Post pibrew
                by pibrew
                 
                Started by rbeckmann05, Yesterday, 06:48 PM
                1 response
                14 views
                0 likes
                Last Post bltdavid  
                Started by llanqui, Today, 03:53 AM
                0 responses
                6 views
                0 likes
                Last Post llanqui
                by llanqui
                 
                Started by burtoninlondon, Today, 12:38 AM
                0 responses
                12 views
                0 likes
                Last Post burtoninlondon  
                Working...
                X