About Chart Patterns: Triangles and Wedges
Unlike pattern tools that only draw the lines, Chart Patterns: Triangles and Wedges also follows each break: the target, the retest of the break level, and a failed break.
How it works
- Swings: a swing high is higher than the bars before it and not lower than the bars after it, and highs and lows always alternate. Three swing sizes (6, 12 and 24 bars) are searched at once.
- A pattern is the last two swing highs and two swing lows when the two lines meet ahead. The slopes set the name: Symmetrical, Ascending (flat upper line) or Descending (flat lower line) triangle, Rising or Falling wedge (both lines move the same way). A triangle right after a sharp move of at least twice its height is a Bullish or Bearish pennant.
- By default a pattern is at least 3 ATR high and 10 bars long, and price stays inside its lines.
- Patterns of a similar size never overlap. A pattern at least twice as long can enclose smaller ones, one level deep, so a big triangle shows with the small patterns inside it.
- Break: the first close outside the pattern before the apex. Target: the pattern's height from the break; for a pennant broken in the direction of its pole, the pole's length. Retest: price moves away, comes back to the break level and closes on the broken side within 20 bars. Failed break: a close back beyond the break level within 20 bars; the target is then no longer watched. No break: the apex is reached first.
- Timeframe: patterns can be found on a higher timeframe. They are checked when its bar closes and drawn through the chart bars where those highs and lows were made, for example "4h Ascending triangle".
On the chart
- Each pattern type has its own color for the lines, a light fill and a filled name label. While a pattern is still open, the label shows the bars left to the apex.
- Break and Retest labels and the dashed target line are green for up and red for down.
- A forming pattern has dashed lines and "(forming)" after its name, on the last bar only.
- Older patterns turn lighter. Colors, line width and text size can be changed, and every part can be turned off.
Alerts
Use the "Any alert() function call" condition and choose the patterns, the direction and the events: pattern formed, testing a line, break, retest, target reached, failed break and no break. The message can be text or JSON for webhooks. Each event is also in the Condition list as its own alert. Alerts are sent when a bar closes; with a higher timeframe, when its bar closes.
Notes
- A swing is confirmed a few bars after it is made, so a pattern appears a few bars after its last touch. Its touches do not move after that; the lines only extend until the break.
- A forming pattern can change or disappear until its last touch is confirmed, and it is not alerted.
- When you create an alert, TradingView may show an orange "may function differently" note. It appears for custom scripts that read past bars. Patterns are checked on closed bars only.
- With a much higher timeframe than the chart, scroll the chart back to load enough history.
How to add it
- 1Open the script page on TradingView with the button above (or here).
- 2Click “Add to favorites” on that page.
- 3On any chart, open Indicators, go to Favorites and click Chart Patterns: Triangles and Wedges [Saikix].
First steps on the chart
- Start with the name labels: each pattern shows its type and, while it is still open, the bars left to the apex, for example "Falling wedge · 11 bars to apex".
- To find patterns on a higher timeframe, set Timeframe. Those patterns carry the timeframe name, for example "4h Ascending triangle", and are checked when that bar closes.
- In a TradingView alert, use the "Any alert() function call" condition and choose the patterns, the direction and the events: pattern formed, testing a line, break, retest, target reached, failed break and no break.
- A pattern marked "(forming)" can change or disappear until its last touch is confirmed, and it is not alerted. After a failed break, the target is no longer watched.