Announcement

Collapse
No announcement yet.

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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      151 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      303 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      244 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      345 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      175 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X