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, 05-11-2026, 05:56 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    185 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    344 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    266 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X