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 rocketman7, Today, 09:41 AM
    0 responses
    1 view
    0 likes
    Last Post rocketman7  
    Started by rocketman7, Today, 02:12 AM
    7 responses
    31 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by guillembm, Yesterday, 11:25 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by junkone, 04-21-2024, 07:17 AM
    10 responses
    149 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by tsantospinto, 04-12-2024, 07:04 PM
    6 responses
    101 views
    0 likes
    Last Post tsantospinto  
    Working...
    X