Cup and handle
Flags a cup-and-handle breakout, but as coded it never fires, so the chart stays empty.
The indicator looks for a cup: a high, a drop of at least min_decline to a low, then a rebound of at least min_decline to a second high, with each leg lasting at least min_distance bars. Once the cup completes it requires a shallow handle over the last max_handle_length bars and a close above the handle high by breakout_threshold. That breakout test cannot pass on normal bars, because the handle high includes the current bar's high, which is always at or above the close.
How to read it
- A marker would sit on the candle that closes above the handle high, after a cup and handle have formed.
- At default settings the September 2026 SPY sample (20,160 one-minute bars) produced zero markers.
- An empty chart here is a bug, not a quiet market: no parameter value changes that today.
What it outputs
- Cup and handle
- Marks the bar where a cup and handle is confirmed as broken out upward. Under the current code it never draws.
When it fires
Meant to fire on the bar that closes above the handle high by breakout_threshold, right after a cup and a shallow handle form. With the current code it cannot happen on normal bars, because the handle high includes that bar's own high, which is always at or above the close.
Settings
- Min Decline
- Sets the drop from the cup's high to its low and the rebound from that low to the second high, each at least this share. Raising it accepts only deeper cups; lowering it, down to 1%, accepts shallower swings. Markers still do not draw at any value.
- Min Decline Length
- Minimum bars each leg of the cup must last, from high to low and from low to second high. Raising it accepts only slower, longer cups; lowering it accepts quick swings. Markers still do not draw at any value.
- Max Handle Depth
- Largest pullback allowed in the handle, as a share of the handle high. Raising it lets looser handles count; lowering it demands a tight handle. No visible change today, since the breakout test blocks every marker.
- Max Handle Length
- Bars the handle window looks back over. Longer windows raise the handle high and usually widen the range, which makes the depth test harder to pass. Shorter windows judge only a tight handle. No visible change today.
- Breakout Threshold
- Distance the close must clear the handle high by. Raising it demands a bigger push past the handle high. The current code cannot clear it at any value, so no markers draw.
Pitfalls
- Looks broken: the breakout test cannot pass, so the chart stays empty. Zero markers in the September 2026 SPY sample at defaults.
- The try presets loosen the cup and handle rules, but none will draw a marker until the breakout test is fixed.
- The catalog wires Donchian trend inputs (mins, maxs), but the function never uses them.