How it is calculated
A swing high has a high above the length bars before it and not below the length bars after it; it is confirmed once those bars have closed. Lows mirror this. A close (or, with Break on wick, a high) above the last swing high breaks it, once. A break with the trend, or the first one, is a BoS (+1 up, -1 down); one against the trend is a CHoCH and turns the trend. One break per bar, the break up first.
Reference: ICT market structure, from public descriptions (#546)
How to read it
A swing shows length bars after its extreme, on the bar that confirms it, and never moves. trend is +1 after a break up, -1 after a break down and 0 before the first. bos and choch are +1 or -1 on the bar of the break and 0 otherwise; the level lines hold the price the last BoS and CHoCH broke.
In a strategy
Trade with the structure: buy when ctx.ind("structure", length=3, break_on="close").choch is 1, the trend has just turned up, with the stop below .swing_low, and add on each later .bos of 1.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Swing bars each sidelength | Whole number | 3 | min 1, max 50 |
Break onbreak_on | Choice | "close" | Close, Wick |
What it draws
| Line | Drawn as |
|---|---|
| Swing high | Steps |
| Swing low | Steps |
| BoS level | Steps |
| CHoCH level | Steps |
Used in
No strategy template reads it yet.