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

Backtest Results: Expired Futures Contracts

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

    Backtest Results: Expired Futures Contracts

    Hello, I searched around a bit for this but couldn't find anything...when I am backtesting futures contracts, I seem to only get reliable/accurate results on the current contract. If I try to test a period that is further back in the past on a contract set that has already expired, I'm getting completely different results. I have backtested the same strategy elsewhere and have not had this issue.

    Purely for example, but if I am looking at the current futures contract I may have a profit factor around 2 with around 50% win rate but when I test the most recent expired contract (same product), my profit factor is <1 and win rate is closer to 30%. Whereas on other platforms, testing the prior contract may have still had a profit factor around 2 (+/- 0.25) with a win rate some where around 50% still.

    I have tried going back and downloading historical data for the actual contract that expired already in the same timeframe that it would've been active but I'm still getting the same results.

    Is there anyway to test these strategies more accurately further back in time that just the current active contract? Thanks in advance.

    #2
    I'm having similiar issues
    when backtesting futures contract, a large portion of data is missing. Backtest 2020 and data is missing for dec futures contract. Trade summary shows largest flat period is 92 days. I don't know why this is

    Comment


      #3
      TradingForTheFutures and PTNETA,

      Welcome to the NinjaTrader forums!

      For accurate results, be sure the strategy is designed to use 1 tick granularity for accuracy with order fills.


      With older future contracts, ensure the rollovers are setup properly.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        This only happens with cash contracts that have not been closed before the expiration date. Cash recalculation will be made on the position. As a rule, this procedure takes 1-2 working days so that the situation will be reflected in your account until the recalculation. You can avoid this by rolling over or closing your posts before expiration. If futures positions are not completed by the appropriate date, futures alerts will close the work on your behalf at the first opportunity at the prevailing market rate. If your trading window has a notice date, your contract assumes physical payment
        Last edited by autoframm; 07-04-2021, 10:57 AM.

        Comment


          #5
          Hello everyone,

          Please also keep in mind that NinjaTrader uses a Merge Policy to merge previous contract months to the current contract month. This comes into play involving the rollover dates configured in the instrument's definitions as Chelsea mentions.

          For example, if you backtest from the first of the year to today's date with ES 09-21, and again with ES 06-21, ES 06-21 would be chosen as the front month for the second backtest and all previous contract periods would be back adjusted to align with ES 06-21. The data from ES 06-21 would also be used up until that contract has expired, since we have chosen ES 06-21 as the front month. We can expect these results to be different.



          If you have any specific questions, please provide an example of a backtest using the SampleMACrossover strategy, and please attach screenshots showing your test and results so we may elaborate.

          We look forward to assisting.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          603 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          23 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          22 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          230 views
          0 likes
          Last Post TradingLoss  
          Working...
          X