Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What is the best strategy to import long term future contracts for backtesting

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

    What is the best strategy to import long term future contracts for backtesting

    Hello,

    I am wondering what is the best method to import price series (20 years +) for future instruments for backtesting on a daily basis.

    In addition, I would like to understand how and if contracts are adjusted (or not) when using the Strategy Analyzer:


    I think two options are viable, here are my thoughts:


    1) Create one import file and import it as a continuous future contract (e.g. CL ##-##)

    - In case rollover adjustment is desired, these has to be implemented upfront. NT is not able to adjust continuous contracts with the rollover rules that are defined for each instrument.


    2) Import each contract individually

    - in this scenario each contract will be imported on its own (e.g. CL 10-04, CL 12-04)
    - Rollover rules that are not implemented by NT have to be implemented along with the desired offset (or is any option available to import rollover dates for the past?)


    Is it correct, that the Strategy Analyzer will use the Global merge policy that is defined under Options => Market data? But only for option 2?


    Thank you and best regards,
    Lukas

    #2
    Hello.

    Thanks for the post.

    The Strategy Analyzer will use the merge policy you have selected under Tools> Options. If you selected the CL 03-18, for instance, and you ran over 2 years of data, it would merge each singular contract month based on your merge policy.

    Please let us know if we may be of any further assistance.

    Comment


      #3
      Hi Christ,

      thanks for your quick reply.


      But what about futures which are stored as a continuous price series (e.g. CL ##-##, contains data from 1990 - 2018)? Is it possible to test strategies with this kind of price series or must each contract be stored individually to do so?


      For the future CL rollover dates and offsets are only present till 2008. Do I have to insert any older rollover date manually (Instrument => contract month) or is there any other possibilty?

      Can you tell me where the rollover dates and offsets are stored on the HDD?

      Thanks,
      Lukas

      Comment


        #4
        Hello.

        Thanks for the reply.

        You can use a continuous contract if you have that contract loaded into NinjaTrader. If you are connected to a data feed while you are running the backtest, the historical data will be pulled by the data provider and organized for each month you are testing. If you are not connected, you must ensure you have downloaded all of the data needed for each contract month via the Historical data manager, or you can import the continuous contract:

        https://ninjatrader.com/support/help.../?download.htm - Downloading historical data.

        The historical data for NinjaTrader is stored in the following directory:

        ..\Documents\NinjaTrader 8\db

        Please let us know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        38 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X