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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      563 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      329 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X