Functions
bgcolor()
Shades the pane's background. Like `barcolor` it adds no value to the chart. It differs from `barcolor` in one way that matters: it takes a `force_overlay` argument and `barcolor` does not.
Syntax
bgcolor(series color color, const string title, input int offset, const bool force_overlay) → void
Arguments
color series color The colour applied to the background. Series-form. Optional. title const string The name of the colouring. Const-form. offset input int Shifts the colouring along the chart. Input-form. force_overlay const bool Sets this drawing's overlay, separately from the script-wide setting. Return Type
void Example
indicator("Custom Background Color", overlay=true)
bullish = close > open
bearish = close < open
bgColor = bullish ? color.green : bearish ? color.red : na
bgcolor(bgColor)