$npx -y skills add SKE-Labs/agent-trading-skills --skill market-structure-shiftDetect Break of Structure (BOS) and Change of Character (CHoCH) for trend analysis. Use when identifying trend reversals, confirming entry signals, or determining market bias direction.
| 1 | # Market Structure Shift |
| 2 | |
| 3 | Identify trend direction and potential reversals through swing point analysis. |
| 4 | |
| 5 | ## Structure |
| 6 | |
| 7 | ### Swing Points |
| 8 | - **Higher High (HH)** + **Higher Low (HL)** = Uptrend |
| 9 | - **Lower Low (LL)** + **Lower High (LH)** = Downtrend |
| 10 | |
| 11 | Choose an objective swing algorithm before analysis—for example, a pivot with fixed left/right bars or an ATR-reversal rule. State how equal highs/lows, nested swings, and the unconfirmed final pivot are handled. |
| 12 | |
| 13 | ### Break of Structure (BOS) |
| 14 | - Descriptive continuation label under the chosen swing rule |
| 15 | - **Bullish BOS**: Price breaks above swing high (HH) |
| 16 | - **Bearish BOS**: Price breaks below swing low (LL) |
| 17 | |
| 18 | ### Change of Character (CHoCH) |
| 19 | - Descriptive possible-change label, not confirmation of reversal |
| 20 | - **Bullish CHoCH**: In downtrend, price breaks above LH |
| 21 | - **Bearish CHoCH**: In uptrend, price breaks below HL |
| 22 | |
| 23 | ## Workflow |
| 24 | |
| 25 | 1. **Identify current trend** on a predeclared context timeframe: |
| 26 | ``` |
| 27 | get_candles_around_date(symbol=<symbol>, exchange=<exchange>, interval="4h", date=<date>) |
| 28 | ``` |
| 29 | 2. **Mark swing points** using `draw_chart_analysis` with `highlight` type (label HH, HL, LH, LL) |
| 30 | 3. **Detect structure breaks** only after a closed bar exceeds the pivot by a calibrated tick/ATR buffer. |
| 31 | 4. **Map nested timeframes** with exact ratios and timestamps. If context and execution structure conflict, return `watch` or `no trade`; do not force alignment. |
| 32 | |
| 33 | ### Trend Continuation Entry (BOS) |
| 34 | 1. Wait for the closed-bar BOS trigger |
| 35 | 2. Enter on pullback to FVG or order block |
| 36 | 3. Stop below recent swing low (bull) or above swing high (bear) |
| 37 | |
| 38 | ### Trend Reversal Entry (CHoCH) |
| 39 | 1. Treat HTF CHoCH as a candidate reversal condition |
| 40 | 2. Wait for LTF BOS in the new direction |
| 41 | 3. Enter on retracement to CHoCH level |
| 42 | 4. Stop beyond the CHoCH swing point |
| 43 | |
| 44 | ## Evidence and Validation |
| 45 | |
| 46 | - Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes. |
| 47 | - Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried. |
| 48 | - 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. |
| 49 | - Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status. |
| 50 | - Research basis: Use BOS/CHoCH as explicit swing-labeling rules. [Lo, Mamaysky & Wang](https://www.nber.org/papers/w7613) shows why visual price patterns must be algorithmically defined and tested. |
| 51 | |
| 52 | ## Key Rules |
| 53 | |
| 54 | - The context timeframe supplies a feature, not an immutable direction. |
| 55 | - Never use an unconfirmed right-edge pivot or intrabar break. |
| 56 | - Predeclare whether a single close, retest, or second-timeframe event is required; avoid future leakage. |
| 57 | - Select timeframes for the instrument/session and test nested conflicts explicitly. |
| 58 | |
| 59 | ## Related Skills |
| 60 | |
| 61 | - **order-blocks** — define and test candle zones around objective structure events |
| 62 | - **liquidity-zones** — Structure breaks often occur after liquidity sweeps of swing points |