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

Is it possible to pass an added data series into a loaded indicator?

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

    Is it possible to pass an added data series into a loaded indicator?

    I have a chart that has a main data series of 10 minute candles

    On this chart I have an indicator that I built.

    Inside of this indicator, I would like to pull in dynamically another indicator, but I want that other indicator to use a data series of say 50 minute candles or something bigger.

    Is there a way to do that when I initialize the dynamically loaded indicator inside of the indicator where I pass in the data series I want it to use so that it doesnt use the default chart 10 minute data series?


    #2
    Hello ErikY,

    Thank you for your note.

    When you say "pull in dynamically another indicator, do you mean you're calling the indicator inside your indicator, and you want to have it use an added data series?

    Yes, you can do that.

    For example, if I added a 50 minute data series in State.Configure in an indicator like so:

    else if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Minute, 50);
    }

    I could then use that then to call the SMA and specify the bars array to calculate the SMA from:

    mySMAValue = SMA(BarsArray[1], 14);

    I'd recommend reviewing this section of our help guide on Multi-series scripts as it goes over calculating indicators from added data series:



    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Awesome, thanks, exactly what I was hoping to do. I will also read up on that section. Much appreciated

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      2 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,771 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      945 views
      0 likes
      Last Post spwizard  
      Working...
      X