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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        169 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        327 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        252 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        353 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        181 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X