Functions
plotcandle()
Draws candles from four series of your own rather than from the chart's bars. All four price series are required. The body, the wick and the border take separate colours, and each of the three is series-form.
Syntax
plotcandle(series float open, series float high, series float low, series float close, const string title, series color color, series color wickcolor, series color bordercolor, const bool force_overlay) → void
Arguments
open required series float The open of each candle. Required. high required series float The high of each candle. Required. low required series float The low of each candle. Required. close required series float The close of each candle. Required. title const string The name of the drawing. Const-form. color series color The body's colour. Series-form. wickcolor series color The wick's colour. Series-form. bordercolor series color The border's colour. Series-form. force_overlay const bool Sets this drawing's overlay, separately from the script-wide setting. Return Type
void Example
indicator("Plot Candle Example", overlay=true)
openSeries = open
highSeries = high + talib.sma(close, 5) * 0.001
lowSeries = low - talib.sma(close, 5) * 0.001
closeSeries = close + talib.sma(close, 5) * 0.001
upColor = color.new(color.green, 0)
downColor = color.new(color.red, 0)
wickColor = color.new(color.gray, 0)
plotcandle(openSeries, highSeries, lowSeries, closeSeries, title="Custom Candles", color=closeSeries >= openSeries ? upColor : downColor, wickcolor=wickColor)