elliottTriangleWave
The Elliott Triangle Wave is a corrective pattern made of five legs (A–B–C–D–E) that form a contracting or expanding triangle. It often happens before the final wave of a trend or inside complex corrections. Traders use it to anticipate the breakout direction after the triangle finishes.
Syntax
elliottTriangleWave(originPoint, pA, pB, pC, pD, pE, styles?)
Parameters
originPoint (PricedData) · Starting point before the triangle begins.
pA (PricedData) · First leg of the triangle.
pB (PricedData) · Second leg of the triangle.
pC (PricedData) · Third leg of the triangle.
pD (PricedData) · Fourth leg of the triangle.
pE (PricedData) · Final leg, completing the triangle before breakout.
styles (ElliottTriangleStyleOverrides) · Visual options:
fillBackground(boolean) · Fill the triangle area.transparency(number) · Transparency level for the fill (0–100).showLabels(boolean) · Show labels A–E on each leg.line(LinesLevels without coeff) · Style for triangle connectors (linestyle,linewidth,color).background(RGBAColor | BaseColors) · Fill color for the body of the triangle.
Return Value
(string) · The drawing ID of the created Elliott Triangle Wave.
Example
Every 100 candles, draw a contracting Elliott Triangle with five pivots.
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 100 === 0) { // draw every 100 bars
// 1) Define six anchors (origin + A–E)
const O = newPoint(time(120), high(120));
const A = newPoint(time(100), low(100));
const B = newPoint(time(85), high(85));
const C = newPoint(time(70), low(70));
const D = newPoint(time(50), high(50));
const E = newPoint(time(30), low(30));
// 2) Style setup
const style = {
fillBackground: true,
transparency: 75,
showLabels: true,
line: { linestyle: 0, linewidth: 2, color: color.orange },
background: color.rgba(255, 165, 0, 0.2)
};
// 3) Draw triangle wave
elliottTriangleWave(O, A, B, C, D, E, style);
}
};Tips
Triangles usually form in wave 4 of an impulse or as part of a B wave correction.
They typically contract (lower highs and higher lows), but can also expand.
Look for a breakout after point E — often it’s a sharp move in the trend direction.
Warning
Avoid confusing triangles with random sideways chop. A proper Elliott triangle should have five clear legs labeled A–E.
Good Practice
Use a unique color (like orange) for triangles so they’re easy to distinguish from impulses and ABC corrections.
Confirm the breakout after point E with volume or momentum indicators.
Last updated