|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
CandlestickChart
CandlestickChart[{{date1, {open1, high1, low1, close1}}, ...}]
makes a chart with candles representing open, high, low, and close prices for each date.
CandlestickChart[{"name", daterange}]
makes a candlestick chart for the financial entity
over the date range daterange.
Details and OptionsDetails and Options
- The dates
are considered an ordered sequence of events, and are not shown on an absolute time scale. - The date formats for
are the same as used in DateListPlot. - The
and daterange are the same as used in FinancialData. - Data elements for CandlestickChart can be given in the following forms:
-
{datei,ohlci} a pure date and open-high-low-close (ohlc) pair wi[{datei,ohlci},...] a date ohlc and wrapper 
formi->mi a date ohlc with metadata 
- Data not given in these forms is taken to be missing, and is typically excluded when generating the chart.
- Data for CandlestickChart can be given in the following forms:
-
{e1,e2,...}, {"name",daterange} data without overall wrapper w[{e1,e2,...}], w[{"name",daterange}] data with overall wrapper - The following wrappers can be used for data elements:
-
Annotation[e,label] provide an annotation Button[e,action] define an action to execute when the element is clicked EventHandler[e,...] define a general event handler for the element Hyperlink[e,uri] make the element act as a hyperlink Labeled[e,...] display the element with labeling PopupWindow[e,cont] attach a popup window to the element StatusArea[e,label] display in the status area when the element is moused over Style[e,opts] show the element using the specified styles Tooltip[e,label] attach an arbitrary tooltip to the element - In CandlestickChart, Labeled and Placed allow the following positions:
-
Top,Bottom,Left,Right,Center positions within candlestick Above, Below, Before, After positions outside candlestick "Open","High","Low","Close" open, high, low, and close positions in the candlestick {{bx,by},{lx,ly}} scaled position
in the label at scaled position
in the candlestick - CandlestickChart has the same options as Graphics with the following additions and changes:
-
AspectRatio 1/GoldenRatio overall ratio of width to height Axes True whether to draw axes BarSpacing Automatic spacing between candles ChartBaseStyle Automatic overall style for candles ChartElementFunction Automatic how to generate raw graphics for candlesticks ColorFunction Automatic how to color candles ColorFunctionScaling True whether to normalize arguments to ColorFunction DateFunction Automatic how to convert dates to standard form EventLabels None events to label GridLines Automatic grid lines to draw GridLinesStyle Automatic style for grid lines PerformanceGoal $PerformanceGoal aspects of performance to try to optimize TrendStyle Automatic how to style up and down trends ScalingFunctions None how to scale the
axis - The arguments supplied to ChartElementFunction are the box region
,
, and metadata
. - A list of built-in settings for ChartElementFunction can be obtained from
. - Common settings for ChartElementFunction include
,
, and
. -
- The arguments supplied to ColorFunction are
. - With ScalingFunctions->sy the function
is applied to all prices (open, high, low, close). ScalingFunctions only affects the display and none of the controls. - Style and other specifications from options and other constructs in CandlestickChart are effectively applied in the order TrendStyle, ColorFunction, Style and other wrappers, and ChartElementFunction, with later specifications overriding earlier ones.
ExamplesExamplesopen allclose all
Basic Examples (2)Basic Examples (2)
Chart the prices from a list of values:
| In[1]:= |
| In[2]:= |
| Out[2]= | ![]() |
Use three months of prices from FinancialData entities:
| In[1]:= |
| Out[1]= | ![]() |
| In[2]:= |
| Out[2]= | ![]() |
New in 8
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »



