elliottTriangleWave
Syntax
Parameters
Return Value
Example
//@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
Warning
Good Practice
Last updated