comment
Syntax (one line)
Parameters
Return Value
Example
//@version=1
init = () => {
indicator({ onMainPanel: true, format: 'inherit' });
};
onTick = () => {
if (index % 40 === 0) { // draw occasionally to keep charts clean
// 1) Style (CommentLineToolOverrides)
const style = {
backgroundColor: color.rgba(0, 150, 136, 0.18), // teal tint
borderColor: color.rgba(0, 150, 136, 0.9),
color: color.white,
fontsize: 12,
transparency: 82
};
// 2) Place the comment at this bar’s close
comment(time(0), closeC(0), style, "News spike");
}
};Tips
Warning
Good Practice
Last updated