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 pechtri, 06-22-2023, 02:31 AM
      10 responses
      124 views
      0 likes
      Last Post Leeroy_Jenkins  
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Yesterday, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Yesterday, 03:01 PM
      2 responses
      22 views
      0 likes
      Last Post helpwanted  
      Working...
      X