Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    152 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    87 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    131 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    127 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    106 views
    0 likes
    Last Post CarlTrading  
    Working...
    X