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

Futures Instruments and AddDataSeries

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

    Futures Instruments and AddDataSeries

    Hello Support Team,

    I have developed a strategy that uses 2 Futures instruments, ES (primary data series) and VX (secondary). This means I'm using AddDataSeries() method.

    According to documentation:

    Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided.
    Knowing this I have set my secondary data series to VX ##-##, which it has worked in Backtesting phase because I have used Kinetick as data provider.
    My broker is Interactive Brokers and I'm entering my Simulation phase, so when trying to enable the strategy it throws an error in the screenshot attached.

    What's the best way to handle this?


    Click image for larger version

Name:	FutureInstrumentIBError.PNG
Views:	132
Size:	25.7 KB
ID:	1068940
    Attached Files

    #2
    Hello lismartin,

    Thank you for the post.

    In this case the message is quite literal, it was not able to locate the instrument because that is not offered with IB.

    Are you going to have the Kinetick connection also while using IB or will you only be using IB for data? If you are using both, you can try to set your preferred connection as Kinetick in the options menu. Thats the tools -> options -> market data -> preferred realtime/historical connections for futures instruments as Kinetick. This would still not allow trades to be placed to the ##-## but may work to load data. Otherwise the contract would be needed.

    I will put in a vote for the feature request to allow dynamic series in NinjaScript as well.


    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 08-28-2019, 03:48 PM.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse, we want to use only interactive broker data to perform the simulation.

      But if we manually place the current contract, should we update it every time it changes? That update shouldn't be automatic?

      Thanks!

      Comment


        #4
        Hello 7robert,

        Correct, there is no means to make this change automatic so you would need to edit the script if you change the front month. This is a side effect of trading futures because it is not a single instrument and there is no means of adding data dynamically. Each contract is very similar to its own instrument in terms of how trading is handled, the master instrument contains the rollovers but you would specify the exact contract you wanted to trade with when actually using the instrument.

        I look forward to being of further assistance.


        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fitspressoburnfat, Today, 04:25 AM
        0 responses
        2 views
        0 likes
        Last Post fitspressoburnfat  
        Started by Skifree, Today, 03:41 AM
        1 response
        4 views
        0 likes
        Last Post Skifree
        by Skifree
         
        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
        604 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  
        Working...
        X