Triangle breakout down event
Meant to flag a breakdown below a triangle floor; at default settings it never fires.
The indicator builds a converging range from the lowest and highest closes of the last 100 bars, and measures each line's percent change over the last 20 bars. After hold_n bars in a row where the low line rises and the high line falls by more than eps percent, it enters a forming state. While forming, it marks the first bar where the close sits below the low line shifted by band. At the default band of 0 that never happens, because the low line includes the current close and so can never be above it.
How to read it
- Markers sit on single candles, one per stretch of qualifying bars. No lines are drawn.
- The floor is the lowest close of the last 100 bars. Judge each marker against recent lows by eye.
- At defaults the chart shows no markers on SPY over a month. A negative band such as -0.002 shows markers where price is pressed against its low, which is a touch, not a confirmed break.
What it outputs
- Breakdown trigger
- Marks the first bar of each stretch where the range is forming and the close sits under the 100-bar closing low, shifted by band. At default band 0 it never marks.
When it fires
Fires on the first bar of each stretch where the range is forming and the close has been in the band zone for confirm_days bars in a row. At band 0 that zone is empty, so it never fires. It marks price pressed against its recent low inside a converging range, not a confirmed break.
Settings
- hold_n
- Consecutive bars the range test must pass before the forming state turns on. Raising it demands a longer run, so fewer markers. At 1 the state turns on after one bar. With loose eps it stays on nearly always, so the count barely moves.
- band
- Shifts the trigger from the 100-bar closing low. Zero or positive never fires, since the low includes the current close. Negative values fire when the close is within that fraction above the low, -0.002 being about 1.5 points on SPY. Wider zones merge touches.
- confirm_days
- Consecutive bars the close must stay in the zone before a marker fires. The name says days, but the count is bars, so 3 means three minutes on this chart. Raising it cuts brief touches. At 1 the first touch marks.
- eps
- Sets how far each line must move, in percent over 20 bars: the low must rise and the high fall by more than eps. Raising it demands steeper convergence, so fewer markers. Lowering it to 0 or below loosens the test; at -1 or lower it is on nearly every bar.
Pitfalls
- At defaults it never fires: the close must be under the 100-bar low, which already includes the current close. On the one-month SPY sample it fired zero times, so this is not just rare.
- A negative band turns this into a touch of the low. Wider zones merge nearby touches, so markers fall as the band widens. With hold_n 1 and eps -1, band -0.001 gave 411 markers and band -0.005 gave 47.
- The range is percent change of rolling closes over 20 bars, not drawn trendlines. At default eps the range was forming on only 8 bars in the month; at eps -1 it is on almost every bar, so the close test alone decides.