Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Counting consecutive bars in oversold zone

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

    Counting consecutive bars in oversold zone

    Hi, Is it possible to have ninjatrader count how many consecutive bars an instrument has spent in the oversold zone? How do I go about getting ninjatrader to do the counting?

    #2
    kaywai, to increment a variable in C#, you just have to do: variable++;

    It is definitely possible for NinjaTrader to count how many bars an instrument is oversold. This pseudo-code should outline how:
    Code:
    OnBarUpdate()
    {
             if (oversold)
                     oversoldCounter++;
             else // not oversold anymore
                     oversoldCounter = 0;
    }
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi Austin, The attached chart shows the oscillator as it currently stands. What I am trying to do is to shade an area in the overbought/oversold if the oscillator remains consecutively in overbought/oversold for more than 8 bars.
      Attached Files

      Comment


        #4
        kaywai, unfortunately we don't provide custom programming services. We can assist you and point you in the right direction but we can't write a complete indicator. Thanks for understanding.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        612 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        355 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        561 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        564 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X