Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting dynamic list of contract months in backtest

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

    Getting dynamic list of contract months in backtest

    Hi Ninjas,

    I'd like to ask, if is it possible in NT script to get list of contract months defined withing the basket via instrument manager. I mean:
    ZC basket has these contracts defined through instrument mananager:
    ZC 09-12, ZC 12-12, ZC 03-13, ZC 07-12.
    I'd like to get list of these contracts dynamically in NT script.
    I need this for comparing price of actually backtested contract month to the next nearest contract month. I didn't find any ideas on this in NT7 help.
    Any hints?
    Thanks in advance.

    #2
    instrument.txt

    Comment


      #3
      qoheleth, there would be unfortunately no supported NinjaScript method to query those however as Baruch pointed out the Instruments.txt file would hold the info for all contracts we track per default. Further you could check into this script here from our sharing working with the rollover's prorgrammatically - http://www.ninjatrader.com/support/f...d=4&linkid=558
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Instruments.txt

        Hi Bertrand,

        Rollover indicator I found not suitable, since it's only for chat use. I dont know ho to use it inside automated strategy.
        I have question regarding Instruments.txt file:
        In file, I looked for ZS symbol to find out the contract months (@rollover line), but I found out that line contains much more contract months then I defined through Instrument Manager GIU. Now I'm not sure if this file is intented to be synchronized with Instrument Manager or not.
        If yes, do I need to follow some procedure in NT7 GIU to make it synchronized?
        Or in general those things are not synchronized and I have to handle differencies in my script?
        Thanks.
        BR.
        P.

        Comment


          #5
          Hello,

          First please ensure you're running the latest version of NinjaTrader here: http://www.ninjatrader.com/download-registration.php

          Once you've installed this go to tools -> Options -> Data tab -> Reset Instruments

          This should sync the instrument.txt and your list.

          Let me know if I can further assist.
          LanceNinjaTrader Customer Service

          Comment


            #6
            Hi Lance,
            I tried, but didn't help. In @RollOver line I still see contract months that are not defined through Instrument Manager in my basket.
            Any other idea?
            BR.
            P.

            Comment


              #7
              I think I may have misunderstood your original request. The rollover dates you've manually added to a basket will not be stored in this text file. You would have to manually code a work around to recognize the rollover dates in the basket as this information is stored in (MY)Documents\NinjaTrader 7\db\NinjaTrader.sdf

              Let me know if I can further assist.
              LanceNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by trilliantrader, Today, 03:01 PM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by geddyisodin, Today, 05:20 AM
              6 responses
              34 views
              0 likes
              Last Post geddyisodin  
              Started by pechtri, 06-22-2023, 02:31 AM
              9 responses
              122 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by frankthearm, 04-18-2024, 09:08 AM
              16 responses
              67 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by habeebft, Today, 01:18 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X