Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT8 chart bars do NOT Match NT7 chart bars

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

    NT8 chart bars do NOT Match NT7 chart bars

    Hello NT Support

    I am trying to convert an NT7 strategy to NT8. The strategy uses 240 minute (4hr) dataseries.

    I've found, for example, that bar times on the NT7 240 min. chart do not match the same instrument (CL ##-##) using an NT8 chart, BUT they should be identical.

    The converted NT8 strategy produces completely different results than the NT7 equivalent since the bar times are completely different.

    For example, when I print values for Time[0] and SMA()

    NT7 chart bar Time[0] and SMA() are:
    9/22/2016 6:00:00 AM 45.213
    9/22/2016 10:00:00 AM 45.414
    9/22/2016 2:00:00 PM 45.568
    9/22/2016 5:00:00 PM 45.687
    9/22/2016 10:00:00 PM 45.768
    9/23/2016 2:00:00 AM 45.864
    9/23/2016 6:00:00 AM 45.967
    etc...

    NT8 chart bar Time[0] and SMA() are:
    9/22/2016 9:00:00 AM 45.398
    9/22/2016 1:00:00 PM 45.538
    9/22/2016 5:00:00 PM 45.661
    9/22/2016 9:00:00 PM 45.758
    9/23/2016 1:00:00 AM 45.845
    etc...

    The NT8 chart bar intervals are correct at 4 hrs, but the bar start times are NOT the same. They don't match, but should.

    I've uploaded 2 NT export zip packages. 1 from NT7 and another from NT8 so that you can reproduce and see the error at your end.

    Both scripts show the error using the standard NT SampleMACrossOver strategy.

    I've repackaged SampleMACrossOver into script MyCustomStrategy to include Print statements.

    I've also uploaded screen scrapes of NT Analyzer Output, Instrument Mgr settings and Session settings for both NT7 & NT8, for instrument CL.

    Both NT7 and NT8 are at the most recent release levels.

    Can you please tell me what I should change in NT8 to make chart bar times be the same as NT7 ?

    OR is this a NT8 bug.

    Please let me know.

    Thank you
    Attached Files

    #2
    When I first converted my NT7 strategy to NT8, I also tried to use continuous contracts (e.g. CL ##-##), but like you, found inconsistencies. After consulting with NT support, I learned that NT8 does not support continuous contracts. Apparently, it doesn't need them because all contracts in NT8 effectively function like continuous contracts did in NT7. Unfortunately, NT8 still lets you specify continuous contracts without generating an error message. I'm not even sure if NT8 documentation even mentions that continuous contracts are not supported in NT8. I just did a quick scan of the NT8 Code Breaking Changes page and didn't see any reference to "##-##" or the word "continuous". I guess they could argue that it doesn't actually break the code, but it sure would be nice if it were at least mentioned on that page.

    The solution for me was to simply use the front month contract (e.g. ES 09-17) in my NT8 strategy instead of the continuous contract (ES ##-##). Note, the contract expiration doesn't actually have to be the front month, it just has to be a later date than your historical backtest period.

    HTH,
    -Conan

    Comment


      #3
      Hello NT Support.

      Can you please take a look and let me know



      Hello Conan108,

      Thanks for sharing. I tried what you suggested. In NT8 I used CL11-17 for the test with System Analyzer. It failed to. The bar times and SMA() values in NT8 where as wrong as when I used CL ##-##.

      I attached another screen scrape.
      Attached Files

      Comment


        #4
        Hello rayko,

        Thanks for your inquiry.

        Continuous Contract Months are supported in NinjaTrader 8, however this may not be available from your provider. NinjaTrader's Merge policy (Merge Back Adjusted) allows you to merge previous contract months with the front month which can recreate a continuous contract month using the front month.

        Merge Policy can be modified from the Options menu under Data (NT7) or Market Data (NT8.)

        Market Data (NT8) - https://ninjatrader.com/support/help...marketdata.htm

        NinjaTrader 8 Trading Hours templates include holidays when NinjaTrader 7 Session Hours templates do not. This will create a difference in data which will then create a difference in Strategy Analyzer results.

        I have tested your supplied modification of the SampleMACrossover strategy against 240 minute data on the continuous contract month for CL. When I use default 24/7 for the Trading Hours/Session template, I get aligned results. When using Nymex Metals / Energy ETH, (Use Instrument Settings) I get diverging results with a couple extra trades on NT7 due to the holidays included in the NT8 Trading Hour template.

        I have also set the end date on NinjaTrader 7 to be one day earlier to get the end dates to align with NinjaTrader 8.

        I have attached pictures of the Trading hours templates, output window and the Strategy Analyzer so you can test the same on your end.

        Please let me know if I may be of further assistance.
        Attached Files
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Support,

          Switching trading hour template will not solve the problem however.

          What is needed is to have NT8 session "Nymex Metals / Enery ETH" produce the same bar chart as NT7, where trading happens 6pm - 5pm the next day, Mon-Fri.

          I can't just substitute a session of 24x7 using NT8 and have the trading results to match NT7. The results are completely different, un-optimized and un-tested.

          Otherwise all testing and optimizations I have done to my strategies using NT7 are throw-away garbage since the underlying data of all that testing & optimization was done using completely different NT7 input data.

          To migrate my strategies to NT8 now means I would also have re-optimize using the new NT8 bar intervals

          It also means that perhaps some NT7 strategies will no longer be profitable / trade-able when migrated to NT8

          Can you please tell me how to make NT8 produce the same underlying chart bars as NT7 using the standard NT session templates ?

          Thank you

          Comment


            #6
            Hello rayko,

            Can you please tell me how to make NT8 produce the same underlying chart bars as NT7 using the standard NT session templates ?
            Trading Hours templates and Session templates are different between NinjaTrader 7 and NinjaTrader 8. The standard templates will create a different data set. You could duplicate and modify a Trading Hours template so it does not include holidays to achieve the results you want to have matched.

            Editing Trading Hours templates - https://ninjatrader.com/support/help...ngHourTemplate
            JimNinjaTrader Customer Service

            Comment


              #7
              Hello Support

              So if I'm understanding this correctly, and to be clear with this issue.
              • NT8 now uses new bartime intervals that are different from NT7.

              • All NT8 charts for the same time period, ie 5, 10, 15, 30, etc will have different Open, High, Low, Last values than that of NT7

              • To migrate strategies to NT8 not only means code compatibility changes, it also means functional changes for new NT8 bar intervals

              • Migrated strategies must undergo re-optimization and re-test of new functional changes using the new NT8 bar intervals

              • It also means that some NT7 strategies will no longer be profitable / trade-able when migrated to NT8 due to the new bar intervals.

              • NT8 bar intervals Cannot be changed to match NT7 for compatibility.

              To be frank, I expected to see this documented in the Code Breaking sections of Help.

              Can you tell me why NT8 bartime intervals where changed from NT7 ?

              It has caused a large compatibility gap between NT7 & NT8, where users loose out by migrating to NT8.

              Comment


                #8
                Hello Rayko,

                Sorry that we didn't catch this on our first reply but upon looking at your screen-shot of the Strategy Analyzer you have disabled the 'Break At EOD' option. By default this setting is enabled and is the same logic that NinjaTrader 7 uses to build minute bars. This feature will determine if NinjaTrader should start a new bar on a new session boundary or not, which will affect the start time of the first bar of a new session.

                It’s my expectation that if you check 'Break At EOD' and use the same session template used in NinjaTrader 8 that you use in NinjaTrader 8 you should generally have the same start and end times on minute bars.

                Let me know if you do not see that after changing the setting and we can debug further.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by arvidvanstaey, Today, 02:19 PM
                4 responses
                11 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                61 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                9 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Started by algospoke, 04-17-2024, 06:40 PM
                5 responses
                48 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X