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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        35 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        13 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        19 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X