Overview
These four functions complementplot() with static and per-bar visual layers:
hline
Draws a static horizontal line across the entire chart at a fixed price/value. Call at the top level.
Budget: maximum 64 hlines per indicator.
fill
Shades the area between two plot series. Both plots must be registered before calling fill. Call at the top level.
Budget: maximum 64 fills per indicator.
bgcolor
Overrides the chart background color for the current bar. Call inside onBar.
null clears the color for that bar.
barcolor
Overrides the candle/bar color on the main price chart for the current bar. Call inside onBar.
Per-bar vs static
bgcolor and barcolor only take effect for bars where they are explicitly called. Bars without a call retain the default chart color.Complete RSI indicator example
Related pages
Plot basics
plot() - the main time-series drawing primitive.
color.*
Color format and named constants.
API limits
Budget numbers for all drawing primitives.