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

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ninza33, Today, 12:31 PM
        2 responses
        9 views
        0 likes
        Last Post ninza33
        by ninza33
         
        Started by Bobin, 03-12-2024, 08:51 AM
        15 responses
        480 views
        0 likes
        Last Post fiddich
        by fiddich
         
        Started by Skifree, Today, 11:21 AM
        4 responses
        13 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by Bogdan097, Today, 03:25 PM
        0 responses
        3 views
        0 likes
        Last Post Bogdan097  
        Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
        25 responses
        127 views
        0 likes
        Last Post cmtjoancolmenero  
        Working...
        X