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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    621 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    566 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X