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

NBarsUp/Down

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

    NBarsUp/Down

    How do these methods work? I am trying to develop a strategy that sets a condition when there are consecutive up or down bars. All I want is to set the condition when N consecutive bars either have their close lower than their open (for the down bar condx) or their close higher than their open (for the up bar condx). I don't care about lower/higher highs and lows.

    Hence, I set the BarDown parameter true for NBarsDown and the BarUp parameter true for NBarsUp. The other two parameters are false for both NBarsDown and NBarsUp. Hence, I am just looking for N consecutive Red bars (for NBarsDown) and N consecutive Green bars (for NBarsUp).

    However, when I test using Sim101 the strategy doesn't trigger my condition when I have the required consecutive red/green bars.

    Any thoughts?

    Jeff

    #2
    Hello,

    Thank you for the question.

    Can you provide a sample of the logic you have used in the script?

    The NBarsUp and down should return only a 0 or a 1 depending if the occurrence was found.

    If this is not working it may be due to the logic being used.

    There are other ways to accomplish this but I would like to see what you are currently trying to figure out where the problem is.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by helpwanted, Today, 03:06 AM
    1 response
    7 views
    0 likes
    Last Post sarafuenonly123  
    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
    385 views
    1 like
    Last Post Gavini
    by Gavini
     
    Working...
    X