Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CrossAbove CrossBelow from plots which are equal

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

    CrossAbove CrossBelow from plots which are equal

    Hello,

    Is there a way to write the CrossAbove or CrossBelow code for a situation where the plots I am considering may be equal on the previous bar? I previously thought it was picking them up, but I had a normal CrossAbove which was picked up, then the plots became equal before one moved below on the next bar, but that last move was not picked up. I can write an alternative piece of code to pick them up, but that would make the shorter CrossAbove and CrossBelow codes redundant.

    Thank you. ,

    #2
    Hello,

    Thank you for the post.

    In the situation where your plots are exactly equal or the same value and then one moves to a new value which is greater or lesser, this would not be a true cross as the value were previously the same value. The existing cross methods would not check for this specific case with a lookback of 1 as they are instead specifically checking if a price cross happened where the price was below, and then passed through the other price or the opposite.

    For this, you would either need to know ahead of time how long the values will be the same and use a lookback period that would allow for a cross to be found, or you would need to write a specific condition for this situation separate from your cross statements.

    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
    563 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    329 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X