Rule-Based Detection of Cup-and-Handle Chart Patterns
Summary
The document presents an indicator that searches recent price bars for a cup-and-handle formation and draws the detected structure on a chart. It locates a recent high, searches backward for an earlier boundary high, finds the intervening low, and divides the price and time span into grid levels. Conditions on closes and lows across those regions are then used to qualify the pattern, including a depth constraint and checks that price has not moved above an intermediate level. An optional rising-average condition marks the earlier boundary.
The evidence is implementation logic only: no chart examples, market tests, or performance results are provided. The code is intended for a particular charting platform and relies on platform-specific functions and indexing behavior. Its thresholds and pattern rules are therefore implementation choices, not validated universal definitions. It does not specify entry, exit, position sizing, or risk controls, so detecting the shape alone does not establish a profitable trading strategy.
Key ideas
- The indicator identifies two boundary highs and the lowest intervening price to define a candidate cup.
- It partitions the cup's price range and bar span into five levels for shape checks.
- Close and low conditions reject candidates that breach selected depth thresholds.
- A rising short-period average can add a visual marker at the earlier boundary.
- The document gives no performance evidence or complete trading rules.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.