Skip to main content

plot_candle

Syntax Format

plot_candle(open, high, low, close, name="Candles", up_color=color.green, down_color=color.red)

Overview

The plot_candle function creates a candle chart, where you can customize the values, taken into the calculation. The main values of a candle are:

  • Opening price;
  • Closing price;
  • Highest price;
  • Lowest price.

Parameters

The parameters describe all the price values of the candle as well as its appearance.

ParameterTypePurposeDefault Value
openseries or numericCandle open value-
highseries or numericCandle highest value-
lowseries or numericCandle lowest value-
closeseries or numericCandle close value-
namestringPlot name"plot_candle(open,high,low,close)"
candle_colorcolorCandle color-

Example

plot_candle {
open = o,
high = h,
low = l,
close = c,
color = iff (c > o, "green", "red")
}