Triangle
Flags bars where the recent low is rising and the recent high is falling, a converging triangle shape that is rare at defaults.
Triangle measures two lines built from closing prices: the lowest and the highest close over the last 100 bars. For each line it takes the percent change over the last 20 bars. A bar qualifies when the low line has risen by more than eps percent, the high line has fallen by more than eps percent, and the high line is still above the low line. It checks only these slopes and that line order; it does not fit trendlines to swing points and does not check for a breakout.
How to read it
- Markers sit on each candle where the shape holds, so a stretch of the shape shows as a run of markers.
- The pattern draws no lines, so the 100-bar low and high it measures are not shown; judge the narrowing range by eye.
- A marker says the range has been narrowing over the last 20 bars. It does not say which way price will leave the range.
What it outputs
- Triangle
- Marks each bar where the 100-bar low has risen and the 100-bar high has fallen by more than eps percent over 20 bars, with the high above the low.
When it fires
Fires on a bar where the 100-bar low rose more than eps percent over 20 bars, the 100-bar high fell more than eps percent, and the high stays above the low. Textbook meaning: the range is narrowing and price is coiling. It does not mean a breakout has happened or which way it will go.
Settings
- Epsilon
- The percent move each line must make over 20 bars, low rising and high falling. Default 0.05 is about 38 cents on SPY near 765. Raising it demands faster convergence, so fewer markers. Lowering it toward 0 accepts flatter lines, so more markers.
Pitfalls
- At defaults it marked 8 of 20,160 SPY one-minute bars in the one-month sample (0.04 percent), as one event. Most charts will show nothing.
- The catalog says lower eps means tighter triangles, but the code does the reverse. Lowering eps makes the slope tests easier to pass, so more bars mark.
- The lines are rolling 100-bar extremes of closes, not trendlines through swing points. A rising low can be an old low leaving the window, and the high-above-low test is nearly always true.