Main Content

candle (fts)

Time series candle plot

candle (fts) is not recommended. Use candle instead.

Use fts2timetable to convert a fints object to a timetable object.


candle(tsobj,color,dateform,'ParameterName',ParameterValue, ...)
hcdl = candle(tsobj,color,dateform,'ParameterName',ParameterValue, ...) 



Financial time series object


(Optional) A three-element row vector representing RGB or a color identifier. (See plot.)


(Optional) Date character vector format used as the x-axis tick labels. (See datetick.) You can specify a dateform only when tsobj does not contain time-of-day data. If tsobj contains time-of-day data, dateform is restricted to 'dd-mmm-yyyy HH:MM'.


candle(tsobj) generates a candle plot of the data in the financial time series object tsobj. tsobj must contain at least four data series representing the high, low, open, and closing prices. These series must have the names High, Low, Open, and Close (case-insensitive).

candle(tsobj,color) additionally specifies the color of the candle box.

candle(tsobj,color,dateform) additionally specifies the date character vector format used as the x-axis tick labels. See datestr for a list of date character vector formats.

candle(tsobj,color,dateform,'ParameterName',ParameterValue, ...) indicates the actual names of the required data series if the data series do not have the default names. 'ParameterName' can be

  • HighName: high prices series name

  • LowName: low prices series name

  • OpenName: open prices series name

  • CloseName: closing prices series name

hcdl = candle(tsobj, color, dateform, 'ParameterName', ParameterValue, ...) returns the handle to the patch objects and the line object that make up the candle plot. hdcl is a three-element column vector representing the handles to the two patches and one line that forms the candle plot.


collapse all

This example shows how to create a candle plot for Disney stock for the dates March 31, 1998 through April 30, 1998.

load disney.mat
Warning: FINTS is not recommended. Use TIMETABLE instead. For more information, see <a href="matlab:web(fullfile(docroot, 'finance/convert-from-fints-to-timetables.html'))">Convert Financial Time Series Objects (fints) to Timetables</a>.
Warning: Low prices must be less than or equal to the corresponding opening prices.
title('Disney 3/31/98 to 4/30/98')

Figure contains an axes object. The axes object with title Disney 3/31/98 to 4/30/98 contains 24 objects of type line, patch.

See Also

| | |

Introduced before R2006a