TL;DR. A triangle is a range that coils: the highs stop rising and the lows keep rising, so two trendlines through the swings narrow toward each other, and a close through one of them ends the pause. The Triangle node finds ascending, descending and symmetrical triangles, fires once on the breakout bar, and hands you the breakout line, a measured-move target and a stop. One Sensitivity setting decides how strict the shape must be.
What it measures
- A coil. The top line runs through the last two swing highs, the bottom line through the last two swing lows. When they converge, buyers and sellers are agreeing on a narrower range, and a close outside it says one side won.
- Three shapes, two directions. A flat or falling top over a rising bottom breaks up (an ascending triangle when the top is flat, a symmetrical one when it falls). A falling top over a flat or rising bottom breaks down (a descending or symmetrical triangle). A symmetrical triangle is armed both ways at once, and whichever line breaks first fires. The node's breakout reads +1 for an upside break and -1 for a downside break.
- Once per triangle. The breakout fires on one bar and the pattern ends. Another breakout needs a new swing, so a strategy never re-enters the same triangle.
Formula
Inputs in AlgoLift
| Setting | Default | Range | Notes |
|---|---|---|---|
| Sensitivity | 5 | 1 to 10 | How strict the shape is. 1 finds only the cleanest triangles, 10 the loosest; 5 is the textbook shape. Every setting below moves with it. |
| Longest triangle | 60 | 10 to 300 bars | The most bars a triangle may take, from its first swing. |
| Target (% of height) | 100 | 10 to 500 | The target's distance past the breakout, in percent of the triangle's starting height. 100 is the classic measured move. |
| Settings | From Sensitivity | From Sensitivity, Custom | Custom unlocks the six settings below and reads them as you set them. |
| Swings of | 3 bars each side | 1 to 50 | How far a swing must stand out. Step 1: 4, steps 8 to 10: 2. |
| Top may rise | 0.02 ATR a bar | 0 to 1 | How much the top line may rise and still count as flat. Step 1: 0, step 10: 0.06. |
| Narrows at least | 30% | 1 to 99 | How much narrower the triangle must be at its last swing. Step 1: 50%, step 10: 5%. |
| At least | 1.6 ATR tall | 0.1 to 50 | The triangle's least height at its first swing. Step 1: 3.0, step 10: 0.6. |
| Forms over at least | 12 bars | 1 to 500 | The fewest bars from the first swing before a break counts. Step 1: 20, step 10: 6. |
| Breaks by | 0.05 ATR | 0 to 5 | How far past the line a close must be. Step 1: 0.15, steps 7 to 10: 0. |
Outputs in AlgoLift
| Handle | Type | Plotted | Notes |
|---|---|---|---|
| Breakout | Numeric | Always | +1 on an upside break, -1 on a downside break, 0 elsewhere. Wire it into a Comparison (greater than 0 for longs, less than 0 for shorts). |
| Bullish triangle breakout, Bearish triangle breakout | Numeric | On select | 1 on that side's breakout bar, else 0. |
| Stage | Numeric | On select | The triangle forming now: 0 none, 1 forming, 2 armed (a close beyond the line would break out). Positive for an upside break, negative for a downside one. |
| Breakout level | Numeric | Always | The armed triangle's breakout line on this bar (the top line, or the bottom line for a downside break). It slopes with the line. |
| Pattern high, Pattern low | Numeric | On select | The forming triangle's highest high and lowest low since its first swing. |
| Target, Stop | Numeric | On select | The last breakout's measured move and the far line on its breakout bar, held until the next breakout. |
| Bars forming | Numeric | On select | Bars since the triangle's first swing. |
How to read it
- Stage 2: a triangle is armed and its breakout line is drawn. A close beyond it is the signal.
- Stage 1: the lines have formed, but fewer than Forms over at least bars have passed since the first swing.
- A line that disappears without a marker: price closed through the other line, the lines met, the triangle ran too long, or a new swing changed the shape.
- The delay: the last swing is only confirmed Swings of bars after it happened, so a triangle appears that many bars late. That is what keeps it from repainting.
Best in, worst in
Best in markets that pause between trending legs, where a coil resolves with the trend.
Worst in choppy, directionless sessions: swings come quickly, lines form and break constantly, and a loose Sensitivity turns ordinary noise into triangles. Pair it with a trend or volatility filter.
Three setups
1. Triangle with a trend filter
Wire Breakout into a Comparison (greater than 0) and AND it with an EMA trend filter (EMA 20 above EMA 50) into a long Entry. Mirror it with less than 0 and EMA 20 below EMA 50 for shorts.
2. Measured-move exits
Set a Bracket Order with its target at the node's Target and its stop at the node's Stop, so every trade's exits come from its own triangle.
3. Breakout on expanding volume
Require Volume above its average on the breakout bar, so quiet drifts through the line are skipped.
Common mistakes
- Expecting the triangle on the bar it completes. The last swing needs Swings of bars to confirm. A smaller swing setting finds triangles sooner and finds more of them, including weaker ones.
- Loosening several rules at once. Move Sensitivity one step, not six separate settings. If you need one rule different, switch Settings to Custom and change only that one.
- Choosing Sensitivity on the backtest you report. Pick it on one window and check it on another (overfitting in trading).
The Triangle node finds two converging lines through the latest swings and the close through one of them, once per triangle, in both directions. Sensitivity sets how strict the whole shape is with one number.