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

AddDataSeries Question

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

    AddDataSeries Question

    In Ninjatrader 7 I could use Add(BarsPeriod.Id ,BarsPeriod.Value*7); to add a DataSeries that the was the same BarType as the root but 7 times the Period Value.

    I Can't figure out how to read back the root Series Compression in NT8
    Is this even possible ? If so How do I do it ?

    Thanks

    #2
    Hello JerryWar,

    Thanks for opening the thread.

    This would constitute as a dynamically loaded Data Series and would not be possible in NinjaTrader 8. Since BarsPeriod and MasterInstrument get their values in State.DataLoaded, you would not be able to reference this value properly in State.Configure when we add additional data series.

    From the help guide:
    Warning:
    • This method should ONLY be called from the OnStateChange() method during State.Configure
    • Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments
    • 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. Trying to load bars dynamically may result into an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner.


    You may view the documentation for MasterInstrument and BarPeriod to reference the associated warnings.

    MasterInstrument - https://ninjatrader.com/support/help...instrument.htm

    BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm

    This is an item that we get a lot of feedback on and we are tracking with the Feature Request ID SFT-882. I will add a vote for this feature request on your behalf.

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim,
      I suspected as much.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Trader146, Today, 09:17 PM
      0 responses
      2 views
      0 likes
      Last Post Trader146  
      Started by ttrader23, 05-08-2024, 09:04 AM
      9 responses
      43 views
      0 likes
      Last Post ttrader23  
      Started by ZeroKuhl, Yesterday, 04:31 PM
      8 responses
      44 views
      0 likes
      Last Post ZeroKuhl  
      Started by reynoldsn, Today, 07:04 PM
      0 responses
      8 views
      0 likes
      Last Post reynoldsn  
      Started by puapwr, Today, 06:09 PM
      0 responses
      4 views
      0 likes
      Last Post puapwr
      by puapwr
       
      Working...
      X