Triangle breakout up event
Marks a close above the 100-bar high while a triangle has held; never fires at default settings.
It looks for a symmetric triangle in closing prices: the 100-bar rolling high falls and the 100-bar rolling low rises, each by more than eps percent over 20 bars. Once that shape has held for hold_n bars in a row, it fires when a close rises above the rolling high scaled by 1 + band. The rolling high already includes the bar being tested, so with band 0 or above no close can clear it and the indicator never fires.
How to read it
- Markers sit on the candles where the breakout fires. The price pane has no extra lines.
- A marker means price closed above the recent 100-bar high after the triangle shape had held for hold_n bars.
- With default settings the chart shows no markers, so a negative band such as -0.002 is needed to see any.
- Each uninterrupted run of qualifying closes gives one marker, so a breakout that stalls and retries can mark again.
What it outputs
- Triangle breakout up
- First bar of each run where the triangle is forming and the close is above the 100-bar high times (1 + band).
When it fires
On the first close of each run where the triangle has held for hold_n bars and the close clears the 100-bar high times (1 + band). With confirm_days above 1, it fires on the bar that completes that many bars in a row. It means price tests the top of its recent range out of a converging shape.
Settings
- hold_n
- Bars the triangle shape must hold in a row before it counts as forming. Raising it lowers the count, since only longer-lived shapes qualify. Lowering it toward 2 adds markers.
- band
- Level as a fraction of the 100-bar high. Zero or above never fires. Negative values such as -0.002, which is 0.2% under the high, let a close just below the high count. Past -0.002 the count barely changed on the test month.
- confirm_days
- Consecutive bars the breakout must hold. At 1 the first close above the level marks. At 2 or more, the marker lands on the bar that completes that many in a row, so one-bar pokes drop out. Raising it trims the count a little.
- eps
- Slope tolerance in percent over 20 bars, default 0.05. The rolling low must rise and the rolling high fall by more than this. Raising it cuts markers sharply. Zero admits any rising low and falling high. Negatives allow slight wrong-way slopes.
Pitfalls
- Looks broken at default settings: band 0 requires a close above a high that already contains that close. On the SPY one-minute test month the default produced no markers.
- The triangle is inferred from rolling highs and lows of closes and their 20-bar percent change, not from drawn trendlines. Only the symmetric shape is built here, since no ascending or descending option is exposed.
- Small slope changes move the count a lot. On the test month with band -0.002, eps -0.05 gave 257 markers, eps 0 gave 21, and the default eps gave 1.