Diamond breakout up event
A diamond pattern's breakout marker; never fires at default settings and rare even when loosened.
The indicator tracks the highest and lowest closes of the last 100 bars and how each line's slope moved over 20 bars. It runs a three-state machine: a widening phase of those lines, then a contracting phase where the low rises and the high falls. The marker lands on the one bar a contracting run completes, and only if the close is above the high scaled by (1 + band) on that bar.
How to read it
- Markers sit on the candles where a diamond's contracting phase completes and the close clears the scaled 100-bar high.
- An empty chart at default settings is expected: band 0 cannot be cleared, so it is not missing data.
- On the SPY sample, band -0.5% gave one marker near the end of the 20,160 bars, and no setting tried gave more than one.
What it outputs
- Diamond breakout up
- Marker on the one bar where a diamond's contracting phase completes and the close is above the 100-bar high scaled by (1 + band). One marker per completed diamond.
When it fires
Fires once per diamond, on the bar its contracting phase completes, if the close is above the 100-bar high scaled by (1 + band) on that bar. Read it as price sitting near the top of a squeezed range, not a confirmed breakout. At defaults it never fires.
Settings
- broad_hold
- Bars in a row the widening shape must hold before a diamond starts. Raising it makes the widening phase harder to start, so fewer diamonds begin. On the SPY sample, holds of 1 to 5 each gave one marker, so the count did not change.
- contract_hold
- Bars in a row the contracting shape must hold to complete a diamond. Raising it delays and thins the markers; lowering it completes diamonds sooner. On the SPY sample, holds of 1 to 5 moved the one marker's bar, not the count.
- band
- The break level as a fraction of the 100-bar high. At 0 or above it cannot fire, because the high includes the current close. Below 0 the close must sit within that fraction under the high: -0.1% to -2% each gave the same one marker on the SPY sample.
- confirm_days
- Bars in a row the break must hold. Any value of 2 or more never fires, because the event lasts one bar, so keep it at 1. On the SPY sample, 2 gave zero markers at -0.5% and at -1%.
Pitfalls
- At band 0 it never fires: the 100-bar high includes the current close, so no close can be above it. The empty chart at defaults comes from that default, not from a quiet market.
- The contracting phase lasts one bar, so the break must land on that exact bar, and confirm_days of 2 or more never fires. At default holds the SPY sample completed a diamond only once.
- The slope tolerance is fixed at 0.05% and is not a parameter, and the widening phase has no timeout, so an old widening can still set up a later contraction.