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

Second Time Series

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

    Second Time Series

    Morning,

    I am running a Strategy file on a small granularity bar size. Say 200 ticks or 20 Renko etc for a bunch of futures.

    I'd like to be able to add a time series using

    AddDataSeries("XX ##-##", Data.BarsPeriodType.Day, 1);

    whose instrument is whatever instrument the chart is that I am applying the strategy to. Right now, I only know how to go in and hard code daily bars for NQ for a high freq NQ trade, daily bars for ES for a etc etc

    Is this possible?

    Thanks!




    #2
    Hello ozziyhtomit,

    Thanks for your post.

    If you want to add a data series of the same instrument as the chart, you need only provide barsperiodtype and size.

    from the help guide:

    Syntax
    The following syntax will add another Bars object for the primary instrument of the script.
    AddDataSeries(BarsPeriod barsPeriod)
    AddDataSeries(BarsPeriodType periodType, int period)


    Reference: https://ninjatrader.com/support/help...dataseries.htm

    So you just need AddDataSeries(BarsPeriodType.Day, 1);

    It is only when you want to add a different instrument that you would need to hard code the instrument name in the addDataSeries() method.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Awesome and thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by elirion, Today, 01:36 AM
      0 responses
      2 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      2 views
      0 likes
      Last Post gentlebenthebear  
      Started by samish18, Yesterday, 08:31 AM
      2 responses
      9 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by Mestor, 03-10-2023, 01:50 AM
      16 responses
      389 views
      0 likes
      Last Post z.franck  
      Started by rtwave, 04-12-2024, 09:30 AM
      4 responses
      31 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Working...
      X