Cup and Handle

The cup and handle and the inverted cup as one node: two rims, a rounded base, a shallow handle, a close through it. Sensitivity sets how strict it is.

IndicatorBy AlgoLiftUpdated 6 min read
On this page 11What it measuresFormulaInputs in AlgoLiftOutputs in AlgoLiftHow to read itBest in, worst inThree setups1. Cup breakout with a trend filter2. Measured-move exits3. Volume on the breakCommon mistakes

TL;DR. A cup and handle is a rounded base between two highs at about the same price (the rims), then a short, shallow pullback from the right rim (the handle), then a close above the handle. The Cup and Handle node finds it, and the inverted cup that breaks down, fires once on the breakout bar, and hands you the breakout level, a measured-move target and a stop. One Sensitivity setting decides how strict the shape must be.

What it measures

  • A base that resolves upward. Price falls from a high, rounds out, climbs back to about the same high, pauses briefly, then breaks through. The breakout says the supply at that high has been absorbed.
  • Both directions in one node. The cup and handle breaks up; the inverted cup is the same shape upside down and breaks down. The node's breakout reads +1 for a cup and handle and -1 for an inverted cup.
  • Once per pattern. The breakout fires on one bar and the pattern ends. Another breakout needs a new right rim.

Formula

Inputs in AlgoLift

SettingDefaultRangeNotes
Sensitivity51 to 10How strict the shape is. 1 finds only the cleanest cups, 10 the loosest; 5 is the textbook shape. Every setting below moves with it.
Longest cup12020 to 500 barsThe most bars from the left rim to the breakout, the handle included.
Target (% of height)10010 to 500The target's distance past the breakout level, in percent of the cup's depth. 100 is the classic measured move.
SettingsFrom SensitivityFrom Sensitivity, CustomCustom unlocks the seven settings below and reads them as you set them.
Rims are swings of4 bars each side1 to 50Swing strength of each rim. Step 1: 5, steps 6 to 10: 3.
Cup at least (ATR deep)2.20.1 to 50The cup's least depth below the lower rim. Step 1: 4.0, step 10: 1.0.
Rims within0.75 ATR0 to 20How far apart the two rims may be. Step 1: 0.3, step 10: 1.6.
Cup at least (bars long)154 to 500The fewest bars from rim to rim. Step 1: 30, step 10: 6.
Handle gives back at most40% of the cup1 to 100The deepest the handle may pull back. Step 1: 25%, step 10: 65%.
Handle at least5 bars1 to 200The fewest handle bars before a break counts. Step 1: 8, step 10: 2.
Breaks by0.05 ATR0 to 5How far past the handle a close must be. Step 1: 0.15, steps 7 to 10: 0.

Outputs in AlgoLift

HandleTypePlottedNotes
BreakoutNumericAlways+1 on a cup and handle's breakout bar, -1 on an inverted cup's, 0 elsewhere. Wire it into a Comparison (greater than 0 for longs, less than 0 for shorts).
Cup and handle breakout, Inverted cup breakoutNumericOn select1 on that side's breakout bar, else 0.
StageNumericOn select0 none, 1 a cup found with a handle still short, 2 armed (a close beyond the level would break out). Positive for a cup and handle, negative for an inverted cup.
Breakout levelNumericAlwaysThe armed pattern's handle high (or low, for an inverted cup).
Pattern high, Pattern lowNumericOn selectThe pattern's range since the left rim.
Target, StopNumericOn selectThe last breakout's measured move and its handle's far side, held until the next breakout.
Bars formingNumericOn selectBars since the left rim.

How to read it

  • Stage 2: a cup is confirmed and its handle is long enough. A close beyond the level is the signal.
  • Stage 1: the right rim is confirmed, but the handle has not lasted Handle at least bars yet.
  • A level that disappears without a marker: the handle dropped too deep or ran too long, a new swing high formed, or the whole pattern ran longer than its limit.
  • Few signals: raise Sensitivity one step at a time and watch the count. Each step loosens every rule together, so the shape stays coherent.
Common Misconception
Myth
Any U-shaped dip that recovers is a cup and handle.
Reality
The node asks for two rims at about one price, a cup with real depth and length, and a shallow, short handle. Most recoveries miss one of these, and the ones that pass are the setups the pattern describes. Loosening Sensitivity admits shallower, shorter cups, which are different trades.

Best in, worst in

Best in markets that have trended and then based for a while, where the old high is a level other traders watch.

Worst in fast, choppy sessions: the rims rarely line up, and a loose step finds small cups that are only noise.

Three setups

1. Cup breakout with a trend filter

Wire Breakout into a Comparison (greater than 0) and AND it with an EMA trend filter (EMA 20 above EMA 50) into a long Entry. Mirror it with less than 0 and EMA 20 below EMA 50 for shorts.

2. Measured-move exits

Set a Bracket Order with its target at the node's Target and its stop at the node's Stop, so every trade's exits come from its own cup.

3. Volume on the break

Require Volume above its average on the breakout bar, as a separate clause, so you can see how many breakouts it removes.

Common mistakes

  • Expecting the signal at the right rim. The node waits for the rim to be confirmed and for the handle to form. Buying the rim itself is a different, earlier trade.
  • Loosening several rules at once. Move Sensitivity one step, not seven separate settings. If you need one rule different, switch Settings to Custom and change only that one.
  • Choosing Sensitivity on the backtest you report. Pick it on one window and check it on another (overfitting in trading).
Key Takeaway

The Cup and Handle node finds two rims around a rounded cup, a shallow handle, and the close through it, in both directions, once per pattern. Sensitivity sets how strict the whole shape is with one number.