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

How to manage loading multiple dataseries added using AddDataSeries

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

    How to manage loading multiple dataseries added using AddDataSeries

    Hi,
    I'm loading a several data series using AddDataSeries in my indicator. I want to also load a larger timeseries of the primary dataseries I have on the chart.
    So for example say I have 5 days of 1 minute data on the chart, I want to be able to load a larger set of 5000 bars in the indicator for analysis behind the scenes.
    1) Will this work?
    2) How can I check which Bars object this is in the BarsArray?
    Thanks,
    iq

    #2
    You may the the below link instructive:
    NT8 - Multi-Time Frame & Instruments

    Comment


      #3
      Hello,

      Thank you for the post.

      Yes the Multi-TimeFrame page previously linked is a good place to start learning about these concepts.

      We have further documentation on the AddDataSeries command here: https://ninjatrader.com/support/help...dataseries.htm

      Using the overload with BarsToLoad would allow you to specify the number of BarsToLoad but that is assuming that the second series is not the same as the primary series in respect to using the same instrument and the same Bar Type. To answer your question if the secondary is the same instrument and bar type, you would need to just load that many bars on the primary series to achieve that goal. If the second series is not the same, you can specify a BarsToLoad in the overloads.

      To check that data you would use the standard ways to check a secondary series price such as Closes[1][0]. There are further examples in the page linked in post #2.

      Please let me know if I may be of additional assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Hi Shansen/Jesse, Thank-you both for your answers.
        If I load all the data into the primary dataset, is there an example to show how I can only plot the analysis techniques on the chart on part of the most recent data ? I only need to plot the indicators I have on the chart for a couple of days but need to perform analysis on the longer data for many days back.
        Thanks,
        iq

        Comment


          #5
          Hello,

          Thank you for the reply.

          I wouldn't know of a specific sample that shows what you are asking, this would likely be something you need to handle with logic in the script. Depending on your condition to know when it should plot, you would just start plotting from that point. Most indicators by default are also set to a Maximum lookback of 256 bars so this should prevent some data from being used to start with. To avoid calculating until a certain point, the script that will be plotting would need to delegate that in its logic to know to avoid to plot for a period of time. if you are referring to manually added indicators, there would be no way to affect those as they will use the series they are applied to.

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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottWalsh, Today, 04:52 PM
          0 responses
          1 view
          0 likes
          Last Post ScottWalsh  
          Started by ScottWalsh, Today, 04:29 PM
          0 responses
          5 views
          0 likes
          Last Post ScottWalsh  
          Started by rtwave, 04-12-2024, 09:30 AM
          2 responses
          22 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by tsantospinto, 04-12-2024, 07:04 PM
          5 responses
          70 views
          0 likes
          Last Post tsantospinto  
          Started by cre8able, Today, 03:20 PM
          0 responses
          7 views
          0 likes
          Last Post cre8able  
          Working...
          X