Expand description
§The squeeze clock
A squeeze is a stretch of bars where price has gone unusually quiet: the Bollinger Bands (which measure how spread out closes are) have shrunk inside the Keltner Channels (which measure how far price usually travels per bar). Quiet markets do not stay quiet forever. When the bands burst back out, the squeeze has fired, and the move that follows is what SD tries to ride.
This file is the finite-state machine from the paper, written once so that
both the classic indicator (classic.rs) and SD v2 (features.rs) run on
the very same clock. The only thing that differs between them is which
compression series and which “momentum flipped” series they feed in.
comp rises above 0 comp drops below the
(none) ───────────────────────▶ SQUEEZE ─── highest tier reached ──▶ FIRED
▲ ▲ │
│ comp climbs again │ │
│ ("unfire") └───────────────────────────────────┤
│ │
└──── time runs out (τ > ⌈θ⌉) or momentum flips ◀── ACTIVE while ───┘
neither happensStructs§
- Clock
Series - Everything the clock knows at one bar.
Constants§
- THETA_
WINDOW - Window used to learn “how long does a squeeze usually last here?”.