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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X