Functions
plotbar()
Plots ohlc bars on the chart.
Syntax
plotbar(series float open, series float high, series float low, series float close, const string title, series color color, const bool force_overlay) → void
Arguments
open required series float Open series of data to be used as open values of bars. Required argument. high required series float High series of data to be used as high values of bars. Required argument. low required series float Low series of data to be used as low values of bars. Required argument. close required series float Close series of data to be used as close values of bars. Required argument. title const string Title of the plotbar. Optional argument. color series color Color of the ohlc bars. You can use constants like 'color=color.blue' or 'color=#2962FF' as well as complex expressions like 'color = close >= open ? color.yellow : color.black'. Optional argument. force_overlay const bool If true, the plotted results will display on the main chart pane, even when the script occupies a separate pane. Optional. The default is false. Return Type
void Example
indicator("Custom Bars Example", overlay=true)
customOpen = open + talib.sma(close, 5) * 0.001
customHigh = high + talib.sma(close, 5) * 0.001
customLow = low - talib.sma(close, 5) * 0.001
customClose = close + talib.sma(close, 5) * 0.001
plotbar(customOpen, customHigh, customLow, customClose, title="Custom Bars")