$npx -y skills add SKE-Labs/agent-trading-skills --skill cup-and-handleDefine and test cup-and-handle breakout shapes. Use when measuring a rounded base, handle depth, lip break, retest, invalidation, and measured-move hypothesis without inferring accumulation.
| 1 | # Cup and Handle Pattern |
| 2 | |
| 3 | A conventionally bullish continuation shape. Treat its geometry, breakout direction, and measured move as testable hypotheses rather than evidence of accumulation. |
| 4 | |
| 5 | ## Pattern Structure |
| 6 | |
| 7 | ### The Cup |
| 8 | - Price rounds down from resistance, forms a "U" shaped bottom (not "V"), rises back to resistance |
| 9 | - Duration and symmetry are market- and timeframe-specific; define minimum and maximum bars before scanning |
| 10 | |
| 11 | ### The Handle |
| 12 | - Small pullback from resistance into a declining flag/pennant |
| 13 | - Define handle depth as `(lip - handle_low) / (lip - cup_low)` and reject only at a pretested threshold |
| 14 | - Require the handle to remain above the cup midpoint only if that rule is part of the frozen specification |
| 15 | |
| 16 | | Factor | Preferred seed definition | Alternative to test | |
| 17 | |--------|-------|------------| |
| 18 | | Cup shape | Rounded "U" | Slightly V-shaped | |
| 19 | | Handle depth | Shallow relative to cup | Predeclare a tested maximum | |
| 20 | | Volume | Decreasing in handle | Stable | |
| 21 | |
| 22 | ## Workflow |
| 23 | |
| 24 | ### 1. Get Exact Data |
| 25 | |
| 26 | ``` |
| 27 | get_candles_around_date(symbol=<symbol>, exchange=<exchange>, interval=<interval>, date=<cup_bottom_date>) |
| 28 | ``` |
| 29 | |
| 30 | ### 2. Mark Key Structure |
| 31 | |
| 32 | **Cup lip** (resistance level where both sides of the cup meet): |
| 33 | |
| 34 | ``` |
| 35 | draw_chart_analysis(action="create", drawing={ |
| 36 | "type": "resistance", |
| 37 | "points": [ |
| 38 | {"time": <left_lip_time>, "price": <lip_price>}, |
| 39 | {"time": <right_lip_time>, "price": <lip_price>} |
| 40 | ], |
| 41 | "options": {"text": "Lip"} |
| 42 | }) |
| 43 | ``` |
| 44 | |
| 45 | **Cup bottom:** |
| 46 | |
| 47 | ``` |
| 48 | draw_chart_analysis(action="create", drawing={ |
| 49 | "type": "highlight", |
| 50 | "points": [{"time": <bottom_time>, "price": <bottom_price>}], |
| 51 | "options": {"text": "Cup Low"} |
| 52 | }) |
| 53 | ``` |
| 54 | |
| 55 | **Handle boundaries** (2 converging or parallel trend lines): |
| 56 | |
| 57 | ``` |
| 58 | draw_chart_analysis(action="create", drawing={ |
| 59 | "type": "trend", |
| 60 | "points": [ |
| 61 | {"time": <handle_high1_time>, "price": <handle_high1>}, |
| 62 | {"time": <handle_high2_time>, "price": <handle_high2>} |
| 63 | ], |
| 64 | "options": {"text": "Handle R"} |
| 65 | }) |
| 66 | |
| 67 | draw_chart_analysis(action="create", drawing={ |
| 68 | "type": "trend", |
| 69 | "points": [ |
| 70 | {"time": <handle_low1_time>, "price": <handle_low1>}, |
| 71 | {"time": <handle_low2_time>, "price": <handle_low2>} |
| 72 | ], |
| 73 | "options": {"text": "Handle S"} |
| 74 | }) |
| 75 | ``` |
| 76 | |
| 77 | ### 3. Enter |
| 78 | |
| 79 | **Standard:** Enter on break above cup lip with volume spike. Stop below handle low. |
| 80 | **Aggressive:** Enter as handle finds support. Tighter stop, higher risk. |
| 81 | **Conservative:** Wait for breakout + retest of lip (now support). |
| 82 | **Target:** Breakout level + cup depth (lip to bottom distance). |
| 83 | |
| 84 | ## Evidence and Validation |
| 85 | |
| 86 | - Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes. |
| 87 | - Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried. |
| 88 | - Include spread, fees, slippage, borrow or funding, partial fills, and latency. Reject the setup when net expectancy is not positive or depends on one narrow parameter. |
| 89 | - Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status. |
| 90 | - Research basis: [Lo, Mamaysky & Wang](https://www.nber.org/papers/w7613) supports testing objectively defined chart patterns, not assuming that a named shape has a universal measured-move edge. |
| 91 | |
| 92 | ## Key Rules |
| 93 | - NEVER enter before the handle forms — cup alone is incomplete |
| 94 | - Treat a break below the cup midpoint as structural invalidation only when the chosen specification says so |
| 95 | - Measure relative volume during the handle and breakout; do not require an untested universal multiple |
| 96 | - Failure at lip on second attempt = potential double top, not cup and handle |
| 97 | |
| 98 | ## Related Skills |
| 99 | - **flag-pennant** — The handle is essentially a small flag |
| 100 | - **double-top-bottom** — Failed cup breakouts can become double tops |