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 helpwanted, Today, 03:06 AM
        0 responses
        3 views
        0 likes
        Last Post helpwanted  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X