Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting of Futures Strategies

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

    Backtesting of Futures Strategies

    Hi, I would like to learn about how backtesting futures strategies in NT7 works. NT7 has what appears to me to be a very sophisticated backtester.

    When I backtest the CL 3-11 contract for more than 6 months, I would traditionally expect to see gibberish, since the CL 3-11 contract wasn't traded actively 6 months ago.

    However, watching the main window status bar, the backtester seems to be loading all the different relevant contracts from up to 6 months back. This appears to be confirmed by the existence of previous CL contracts dating back to CL 9-10 suddenly appearing in my data cache. Apparently, the backtester automatically downloaded data from previous contracts during the backtest.

    This appears to allow me to simply backtest a futures trading strategy for a period of 6 months simply by selecting the current month contract in the backtester. The backtester then appears to automatically draw previous contract data despite having clicked selected the current month in the backtester. Amazing!

    While this is really amazing, I would like to know how Ninjatrader determines the front month in the strategy analyzer. Although 2 different contracts may be trading at the same time, liquidity and narrow spreads will only exist in the front month contract, and I like to be absolutely sure that the backtester selects the correct front month in backtesting.

    Also, with this amazing looking feature, is there still a need to merge futures contracts for backtesting? Or am I completely misunderstanding how the backtester works?

    Thanks!

    #2
    skyholder84, you can find the date NinjaTrader decides to roll over the contracts in the instrument manager. To get there, please go to Tools -> Instrument Manager -> Double-click the instrument you'd like to view -> Go to the Misc tab, and scroll to the bottom. Here, you can click on the little "..." button to see the details of rolling over contracts.

    As such, there is no need to manually merge contracts anymore.
    Attached Files
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin, would this also apply to a multi-instrument strategy? Example: If I had a primary chart based on the data of the CL 3-11 contract month, it would contain merged data of previous months during a backtest. Now, if within this strategy, I had initialized a secondary instrument of the CL 4-11 contract month for placing protective spreads. Can I expect the secondary instrument to also contain properly merged historical data for deep backtesting of this type of strategy?

      Comment


        #4
        Hi AutoTrade12,

        Yes, this applies to all prior contract months. They will be merged as long as this setting is selected under Tools > Options > Data tab.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hi guys, I'm confused. If I'm reading the logic in this thread correctly, in the attached screenshot, shouldn't I expect to see:
          • More historical data for the 06-11 contract, representing back-adjusted data for a "continuous current month"
          • More historical data for the 07-11 contract, representing back-adjusted data for a "continuous 1st forward month"?

          I have merging selected in both global and instrument settings.

          Also, I have no rollover dates entered in. Does NT get these from its server? Or otherwise derive them from the data?

          Thanks a lot,
          Barry
          Attached Files

          Comment


            #6
            Hi Barry,

            Thanks for the post and welcome to the NinjaTrader forums. Unfortunately VX is not supplied with NinjaTrader by default. To see this contract merged you have to supply the rollover definitions for it. This is done in the instrument manager. Edit VX, click Misc, scroll to the bottom and click the [...] button near contract months to define the rollover. Before doing this, you can look at ES, for example, to see how they are defined there.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thanks for the quick response. I followed your advice, manually entered rollover dates, and am able to get back-adjusted continuous contracts for each forward month.

              I have a different issue now. They all chart identically! In the attached screenshot each forward contract shows the exact same price and volume data. Even though the data for each contract is unique when I look in the historical data editor for each each contract. Is that the expected behavior? (I'm showing ES since that's an instrument who's settings come default with NT and I haven't modified them at all.)

              Thanks again.
              Attached Files
              Last edited by brobbins; 06-04-2011, 12:21 PM.

              Comment


                #8
                I'm not sure why you are seeing that but it could be due to the rollover definitions and merge policy. Can you please send in your database file so we can setup similarly over here. Easiest way is using Help > Mail to support feature. In the subject write, Attn: RyanM 446769
                Let us know as well the merge policy settings under tools > options > data tab.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GussJ, 03-04-2020, 03:11 PM
                11 responses
                3,227 views
                0 likes
                Last Post xiinteractive  
                Started by andrewtrades, Today, 04:57 PM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by chbruno, Today, 04:10 PM
                0 responses
                7 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                440 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                12 views
                0 likes
                Last Post FAQtrader  
                Working...
                X