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

Calling an indicator from another indicator.

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

    Calling an indicator from another indicator.

    I have an indicator that counts the number of consecutive green bars and red bars. (A00NumeroVerdesRojosV01.cs)
    I have another indicator "A02SMArisingFalling" where I call the first one "A00NumeroVerdesRojosV01" using the following code:
    barrasVerdesConsecutivas = (A00NumeroVerdesRojosV1().BarrasVerdesConsecutivas[0]);
    SubiendoTodos.Set(barrasVerdesConsecutivas);

    and it works perfectly for the same Period of Time, I mean it gives me the number of green bars of the period of time of the graph where the indicator is attached.

    But I would like to know also the number of green bars that are in the 5min graph of the same symbol.
    My guess is that I can send also an integer number (a 5 or 10) in order to get the number of green bars in another timeframe...
    Attached Files
    Last edited by efeuvejota01; 04-25-2016, 12:19 PM. Reason: forgot to attach the second indicator...

    #2
    Hello efeuvejota01,

    Thank you for your post.

    You would add in a secondary series for the desired additional period type.
    For example:
    Code:
    // in Initialize()
    Add(PeriodType.Minute, 5);
    Then pass BarsArray[1] as the Input Series to the indicator.
    For example:
    Code:
    A00NumeroVerdesRojosV1([B]BarsArray2[/B]).BarrasVerdesConsecutivas[0]
    For information on multiple series in your script please visit the following link: http://ninjatrader.com/support/helpG...nstruments.htm

    Please let me know if you have any questions.

    Comment


      #3
      Thank you!!! working

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by andrewtrades, Today, 04:57 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      4 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X