Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

N bars down in indicator

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

    N bars down in indicator

    i want to mark ADX as trending if it has 3 consequetive increases. can i use NBarsUp for the same.
    for eg.
    ADXRising=NBarsUp(ADX(14),3,false,false,false)

    #2
    junkone,

    Nope. NBarsUp/Down are for determining higher/lower closes. If you are only comparing 3 bars its much faster to just check those bars directly.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      What do you mean by check the bar directly? Is their a indicator that i could use to check if it has three consequetive increase?

      Comment


        #4
        johnchandler32, Josh was referring to checking the closes and opens of each bar individually. You can use the options in NBarsUp to do so, or you can check directly:
        Code:
        if (Close[0] > Close[1] && Close[1] > Close[2])
        // three rising bars
        
        // or
        if (Close[0] > Open[0] && Close[1] > Open[1] && ...)
        // a different "rising" condition
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        155 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        90 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        137 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        130 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X