sineLine
Syntax
Parameters
Return Value
Example
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 90 === 0) { // draw every 90 bars
// 1) Define two anchors
const O = newPoint(time(120), closeC(120)); // sine start
const T = newPoint(time(60), closeC(60)); // defines curve length
// 2) Style settings
const style = {
fillBackground: true,
transparency: 80,
showLabels: true,
line: { linestyle: 0, linewidth: 2, color: color.teal },
background: color.rgba(0, 128, 128, 0.2)
};
// 3) Draw sine line
sineLine(O, T, style);
}
};Tips
Warning
Good Practice
Last updated