path
Syntax (one line)
Parameters
Return Value
Example
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 80 === 0) { // draw occasionally
// 1) Define the points
const points = [
newPoint(time(90), high(90)), // older high
newPoint(time(60), low(60)), // middle low
newPoint(time(30), closeC(30)) // recent close
];
// 2) Style (PathLineToolOverrides)
const style = {
lineColor: color.orange,
lineStyle: 0,
lineWidth: 2,
leftEnd: 0,
rightEnd: 0
};
// 3) Draw the path
path(points, style);
}
};Tips
Warning
Good Practice
Last updated