Diamond forming event
Marks a diamond: the price channel widened first, then narrowed into a triangle, before any breakout.
The channel is the lowest and highest close of the last 100 bars, and each edge's slope is its percent move over the last 20 bars. The indicator first needs a widening run: the edges spreading apart for broad_hold bars in a row, in any of three directions. After that it waits for a narrowing run, lows rising and highs falling by more than 0.05% over 20 bars, held for contract_hold bars in a row. It fires once, on the bar that completes the narrowing, and it does not say which way price will leave.
How to read it
- Markers sit on the candles at the bar that confirms the narrowing, so they come after the pattern has already formed.
- The two channel edges are the lowest and highest closes of the last 100 bars, not wicks.
- A marker means the channel widened and then tightened into a triangle. It is a setup only; wait for a close beyond an edge.
- On SPY in September 2026 it fired once, so a chart with no marker is normal.
What it outputs
- Diamond forming
- True on the bar where the narrowing leg reaches contract_hold bars, after a widening leg of broad_hold bars. Drawn on the candles where it fires; no line is drawn.
When it fires
When lows rise and highs fall by more than 0.05% over 20 bars for contract_hold bars in a row, after a completed widening run of broad_hold bars with no diamond since. It marks the turn from widening to narrowing. It is not a breakout; the diamond breakout indicators add a close beyond an edge.
Settings
- broad_hold
- How many bars in a row the channel must widen before the indicator arms. Raising it needs a longer widening, so fewer diamonds arm; lowering it to 1 arms on a single widening bar, so more diamonds can form.
- contract_hold
- How many bars in a row the channel must narrow before the marker fires. Raising it moves the marker later into the triangle and drops short narrowings; lowering it to 1 fires on the first narrowing bar.
Pitfalls
- Rare at defaults: on SPY from 1 to 30 September 2026 it fired once, because the narrowing condition held on only eight bars all month. Lowering the holds moves that one marker earlier and adds none.
- The widening phase never expires. After broad_hold widening bars, any later narrowing run of contract_hold bars fires, however long after, so a marker can appear with no widening visible nearby.
- The edges use closes over 100 bars, not wicks, so a long wick that never closes beyond an edge leaves the channel unchanged.