trianglePattern
The Triangle Pattern connects four swing points (A, B, C, D) to form a contracting or expanding triangle. Traders use it to anticipate breakouts because price tends to coil inside the triangle before moving strongly in one direction. It can appear as ascending, descending, or symmetrical.
Syntax
trianglePattern(pointA, pointB, pointC, pointD, styles?)
Parameters
pointA (PricedData) · First anchor, starting the triangle.
pointB (PricedData) · Second anchor, forming the opposite side.
pointC (PricedData) · Third anchor, continuing the structure.
pointD (PricedData) · Fourth anchor, completing the triangle.
styles (TrianglePatternStyleOverrides) · Style and visual options:
backgroundColor(RGBAColor | BaseColors): background color used for the pattern area.bold(boolean): render text using a bold font weight.color(RGBAColor | BaseColors): line color of the pattern.fillBackground(boolean): fill the background area of the pattern.fontsize(number): font size used for text labels.italic(boolean): render text using italic style.linewidth(number): thickness of the pattern lines.textcolor(RGBAColor | BaseColors): color of the label text.transparency(number): transparency level.
Return Value
(string) · The drawing ID of the created Triangle Pattern.
Example
Every 70 candles, a triangle is drawn using four pivots that outline consolidation.
Result

Tips
Works best when price contracts into the triangle before a breakout.
Use it alongside volume analysis — volume often drops during consolidation and spikes on the breakout.
Ascending triangles usually break upward; descending ones often break downward.
Warning
Avoid drawing triangles on random swings — the structure must clearly form converging or diverging trendlines.
Last updated