Triangle breakout buy sell
Buy and sell marks when price breaks a converging triangle's falling top or rising floor; rare at default settings.
The indicator takes the highest and lowest closes of the last 100 one-minute bars as a top and a floor, then measures how each moved over the last 20 bars, in percent. A symmetric triangle holds when the floor rises by more than 0.05% and the top falls by more than 0.05% at the same time. After that shape has held for hold_n bars in a row, the indicator enters a Forming state, which ends as soon as the shape breaks.
How to read it
- Buy markers sit on the candles where close first clears the falling top; sell markers where close first drops through the rising floor.
- The top and floor are not drawn. They are the 100-bar highest and lowest closes, so trace them on the price pane to judge the coil.
- At default settings a blank chart is normal here, because the triangle almost never forms. A marker only means a breakout after a sustained coil.
What it outputs
- Buy: break above falling top
- Marks the first bar where close is above the 100-bar closing high while the triangle is Forming. Later bars in the same run stay unmarked.
- Sell: break below rising floor
- Marks the first bar where close is below the 100-bar closing low while the triangle is Forming. Later bars in the same run stay unmarked.
When it fires
A marker fires on the first bar close clears the line while the triangle is Forming. At defaults it never fired on the SPY sample (September 2026, one-minute bars): the shape held on 8 bars, never 5 in a row. With hold_n 1 and band -0.001 it marked 2 buys and 1 sell.
Settings
- hold_n
- Bars in a row the triangle shape must hold before the indicator enters Forming. Raising it demands a longer coil and cuts markers. At 1, any single bar of shape counts. At the default 5, the shape never held that long on the SPY sample, so nothing marks.
- band
- Buffer around the top and floor, as a fraction of the line: 0.005 is 0.5%. Positive values make close clear the line by that much, so fewer markers. Negative values let close fall short of the line and still count, which adds markers.
- confirm_days
- Bars in a row close must stay beyond the line before a marker, so 1 marks the first bar beyond it. Raising it waits for a hold, skipping quick false breaks at the cost of later and fewer markers.
Pitfalls
- Rare by construction. The 0.05% tolerance is fixed in the triangle code, not a parameter, so no setting here makes the shape itself more common. Only hold_n and band change how often a marker follows it.
- The top and floor are rolling 100-bar extremes of closes, not drawn trendlines. A falling top often means an old high left the window, so the shape can appear with no new lower highs.
- A breakout counts only while Forming holds. Once the shape breaks, Forming ends and a later breakout is never marked. The direction is not predicted, and only the symmetric variant is exposed here.