A Pivot-Based Cup Pattern Detector With Breakout Tolerance Checks
Summary
This indicator searches for cup-shaped price structures using successive pivot highs. For candidate endpoints, it finds the lowest low between them and checks whether the two highs are sufficiently aligned relative to the cup depth. It rejects candidates when closing prices break above a line joining the endpoints or when too many highs exceed the modeled upper boundary or lows fall beneath the lower boundary. The boundaries are shaped with a cosine-based curve, with optional flattening for display.
When a candidate passes these rules, the indicator draws a filled cup region and a projected area to the right, with optional labels and guide lines. Inputs control pivot sensitivity, historical search depth, angle tolerance, cup-height proportions, and allowed boundary breaks. This is a visual pattern-recognition tool, not a trading strategy: the supplied code does not define entries, exits, position sizing, or test performance. Its detection depends on chosen parameters and confirmed pivots, and the document provides no evidence that detected patterns predict profitable trades.
Key ideas
- The indicator uses pivot highs as candidate left and right rims of a cup.
- It measures the lowest low between candidate rims to estimate cup depth.
- A candidate is filtered by rim alignment, closing-price breaches, and tolerated boundary breaks.
- Cosine-based boundaries model the cup shape, with optional flattening for visualization.
- The script draws detected patterns but does not specify trade rules or provide performance evidence.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.