cyclicLines
Syntax
Parameters
Return Value
Example
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 60 === 0) { // draw every 60 bars
// 1) Define two anchors
const O = newPoint(time(100), closeC(100));
const T = newPoint(time(60), closeC(60));
// 2) Style setup
const style = {
fillBackground: true,
transparency: 85,
showLabels: true,
line: { linestyle: 2, linewidth: 1, color: color.gray },
background: color.rgba(0, 128, 255, 0.15)
};
// 3) Draw cyclic lines
cyclicLines(O, T, style);
}
};Tips
Warning
Good Practice
Last updated