plotbar

Draws bars from the same four required series that plotcandle takes. The difference is the colouring: one colour for the whole bar, with no separate wick or border. Neither function has an offset parameter at all.

plotbar(series float open, series float high, series float low, series float close, const string title, series color color, const bool force_overlay) → void
ParameterTypeRequiredDescription
openseries floatyesThe open of each bar. Required.
highseries floatyesThe high of each bar. Required.
lowseries floatyesThe low of each bar. Required.
closeseries floatyesThe close of each bar. Required.
titleconst stringnoThe name of the drawing. Const-form.
colorseries colornoThe colour of the whole bar. Series-form.
force_overlayconst boolnoSets this drawing’s overlay, separately from the script-wide setting.

Returns void — void.

indicator("Recoloured bars")
plotbar(open, high, low, close, title = "Bars", color = color.blue)

See also bars and background

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade