Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 cre8able, Today, 01:16 PM
        2 responses
        9 views
        0 likes
        Last Post cre8able  
        Started by chbruno, 04-24-2024, 04:10 PM
        3 responses
        48 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by samish18, Today, 01:01 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by WHICKED, Today, 12:56 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by WHICKED, Today, 12:45 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X