• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    https://ninjatrader.com/support/help...dataseries.htm

    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 trader252, Today, 08:38 PM
      0 responses
      2 views
      0 likes
      Last Post trader252  
      Started by ralett, Today, 06:20 PM
      0 responses
      5 views
      0 likes
      Last Post ralett
      by ralett
       
      Started by grizzlytrader, Today, 06:24 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by andrewtrades, Today, 01:43 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by FuturesRon, Today, 03:09 AM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X