priceLabel
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 (PriceLabelLineToolOverrides)
const style = {
backgroundColor: color.rgba(0, 122, 255, 0.18),
borderColor: color.rgba(0, 122, 255, 0.85),
color: color.white,
fontsize: 12,
fontWeight: "bold",
transparency: 82
};
// 2) Place the price label at this bar’s close
priceLabel(time(0), closeC(0), style, "Target");
}
};Tips
Warning
Good Practice
Last updated