$npx -y skills add SKE-Labs/agent-trading-skills --skill flag-pennantDefine and test flag or pennant continuation shapes. Use when measuring an impulse, consolidation, closed-bar break, invalidation, and measured-move hypothesis.
| 1 | # Flag & Pennant Patterns |
| 2 | |
| 3 | Continuation patterns that form during pauses in strong trends. |
| 4 | |
| 5 | ## Pattern Structure |
| 6 | |
| 7 | **Components:** Flagpole (strong impulsive move) → Flag/Pennant (consolidation) → Breakout (continuation). |
| 8 | |
| 9 | - **Bull Flag** — Strong upward pole, downward-sloping rectangular channel, breaks upward |
| 10 | - **Bear Flag** — Strong downward pole, upward-sloping rectangular channel, breaks downward |
| 11 | - **Pennant** — Strong move (pole), symmetrical triangle consolidation, breaks in pole direction |
| 12 | |
| 13 | | Criteria | Flag | Pennant | |
| 14 | |----------|------|---------| |
| 15 | | Shape | Rectangular channel (2 parallel lines) | Symmetrical triangle (2 converging lines) | |
| 16 | | Slope | Against trend | Neutral | |
| 17 | | Volume | Decreasing | Decreasing | |
| 18 | |
| 19 | ## Workflow |
| 20 | |
| 21 | ### 1. Get Swing Point Data |
| 22 | |
| 23 | Identify the flagpole and consolidation boundaries: |
| 24 | |
| 25 | ``` |
| 26 | get_candles_around_date(symbol=<symbol>, exchange=<exchange>, interval=<interval>, date=<flag_date>) |
| 27 | ``` |
| 28 | |
| 29 | ### 2. Draw Flag/Pennant Boundaries (2 parallel calls) |
| 30 | |
| 31 | **For flags** (2 parallel trend lines sloping against the pole): |
| 32 | |
| 33 | ``` |
| 34 | # Upper flag boundary |
| 35 | draw_chart_analysis(action="create", drawing={ |
| 36 | "type": "trend", |
| 37 | "points": [ |
| 38 | {"time": <flag_high1_time>, "price": <flag_high1_price>}, |
| 39 | {"time": <flag_high2_time>, "price": <flag_high2_price>} |
| 40 | ], |
| 41 | "options": {"text": "Flag R"} |
| 42 | }) |
| 43 | |
| 44 | # Lower flag boundary (parallel to upper) |
| 45 | draw_chart_analysis(action="create", drawing={ |
| 46 | "type": "trend", |
| 47 | "points": [ |
| 48 | {"time": <flag_low1_time>, "price": <flag_low1_price>}, |
| 49 | {"time": <flag_low2_time>, "price": <flag_low2_price>} |
| 50 | ], |
| 51 | "options": {"text": "Flag S"} |
| 52 | }) |
| 53 | ``` |
| 54 | |
| 55 | **For pennants:** same approach but lines converge (like a small symmetrical triangle). |
| 56 | |
| 57 | ### 3. Confirm and Enter |
| 58 | |
| 59 | Confirm declining volume during consolidation via `get_indicators(indicator_code="mfi", symbol=<symbol>, exchange=<exchange>, interval=<interval>)`. |
| 60 | |
| 61 | **Standard:** Enter on break of flag/pennant boundary with volume spike. Stop beyond opposite side. |
| 62 | **Conservative:** Wait for breakout + retest of boundary. Enter on bounce. |
| 63 | **Target:** Flagpole length projected from breakout point. |
| 64 | |
| 65 | ## Evidence and Validation |
| 66 | |
| 67 | - Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes. |
| 68 | - Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried. |
| 69 | - 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. |
| 70 | - Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status. |
| 71 | - Research basis: [Lo, Mamaysky & Wang](https://www.nber.org/papers/w7613) supports objective pattern definitions and conditional testing rather than visual labels alone. |
| 72 | |
| 73 | ## Key Rules |
| 74 | - Quantify the pole with return divided by ATR and a maximum bar count; “looks impulsive” is not reproducible |
| 75 | - Define and calibrate the maximum retracement rather than assuming 50% is universal |
| 76 | - Treat volume contraction and breakout expansion as candidate filters; report their measured values |
| 77 | - Quick formations are more reliable than extended consolidations |
| 78 | - Flag duration should be short relative to the pole |
| 79 | |
| 80 | ## Related Skills |
| 81 | - **triangle-patterns** — Pennants are small symmetrical triangles |
| 82 | - **channel-trading** — Flags are short-duration trending channels |