KagiChart
KagiChart[{{date1,p1},{date2,p2},…}]
makes a Kagi chart with prices pi at date datei.
KagiChart[{"name",daterange}]
makes a Kagi chart of closing prices for the financial entity "name" over the date range daterange.
KagiChart[{…},rt]
makes a Kagi chart with reversal threshold rt.
Details and Options
- A Kagi chart is drawn as a series of vertical lines connected by horizontal lines. Prices are drawn in a column until the price reverses by more than the threshold rt, when a new column is started with a horizontal line connecting to the previous column.
- The style of the lines changes when the price rises above the high of the previous column or drops below the low of the previous column.
- KagiChart[…] is equivalent to KagiChart[…,{"Relative",0.02}] for a reversal threshold of 2% of the average price.
- The following arguments can be used to specify the reversal threshold rt:
-
{"Percent",p} percent of previous price {"Relative",p} fraction of price range (default) {"Absolute",p} absolute price change - The dates datei are considered an ordered sequence of events and are not shown on an absolute time scale.
- The date formats for datei are the same as used in DateListPlot.
- The "name" and daterange are the same as used in FinancialData.
- Data elements for KagiChart can be given in the following forms:
-
{datei,pi} a pure date-price pair {datei,Quantity[pi,ui]} a date-price pair with a unit wi[{datei,pi},…] a date-price pair and wrapper wi formi->mi a date-price pair with metadata mi - A line segment may represent several date-price pairs, and the corresponding wrappers will apply to the entire line segment.
- Data not given in these is taken to be missing and typically is excluded when generating the chart.
- Data for KagiChart can be given in the following forms:
-
{e1,e2,…} list of elements with or without wrappers TimeSeries[…],EventSeries[…],TemporalData[…] time series, event series, and temporal data w[{e1,e2,…}] wrapper applied to the whole data - 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 KagiChart, Labeled and Placed allow the following positions:
-
Above, Below, Before, After positions outside point or figure {lx,ly} scaled position {lx,ly} in the label - KagiChart has the same options as Graphics with the following additions and changes: [List of all options]
-
AspectRatio 1/GoldenRatio overall ratio of height to width Axes True whether to draw axes ChartBaseStyle Automatic overall style for bars 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 PlotTheme $PlotTheme overall theme for the chart ScalingFunctions None how to scale the y axis TargetUnits Automatic units to display in the chart TrendStyle Automatic how to style up and down trends - With ScalingFunctions->sy, the function sy is applied to the prices. ScalingFunctions only affects the display and none of the controls.
- Style and other specifications from options and other constructs in KagiChart are effectively applied in the order TrendStyle, Style and other wrappers, with later specifications overriding earlier ones.
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1/GoldenRatio overall ratio of height to width Axes True whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ChartBaseStyle Automatic overall style for bars ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DateFunction Automatic how to convert dates to standard form Epilog {} primitives rendered after the main plot EventLabels None events to label FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GridLines Automatic grid lines to draw GridLinesStyle Automatic style for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotRange All range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the chart PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame ScalingFunctions None how to scale the y axis TargetUnits Automatic units to display in the chart Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks TrendStyle Automatic how to style up and down trends
List of all options
Examples
open allclose allBasic Examples (2)
Chart the prices from a list of values:
Use three months of prices from FinancialData entities:
Scope (25)
Data and Wrappers (16)
Automatically get quarterly data for a financial entity:
Get data for a specific date range:
Get data from FinancialData:
Reversal threshold by default is a fraction of the price range:
Use thresholds relative to the overall price range:
Use thresholds that are a percentage of the current price:
Data can be TimeSeries, EventSeries, or TemporalData:
Use wrappers on individual data:
Use wrappers on entire datasets:
Override the default tooltips:
Use PopupWindow to provide additional drilldown information:
Button can be used to trigger any action:
Styling and Appearance (6)
Specify styles for up and down trends:
ChartBaseStyle can be used to set a style for the entire chart:
Style can be used to override styles:
Use a theme with simple ticks and grid lines in a bright color scheme:
Use a theme with a dark background in a high-contrast color scheme:
Options (25)
ChartBaseStyle (1)
Use ChartBaseStyle to apply overall styles to lines:
EventLabels (3)
GridLines (4)
GridLinesStyle (4)
By default, GridLinesStyle uses dotted grid lines:
Year grid lines are emphasized:
GridLines overrides GridLinesStyle:
PerformanceGoal (3)
Generate a KagiChart with interactive highlighting:
Emphasize performance by disabling interactive behaviors:
Typically, less memory is required for non-interactive charts:
PlotRange (3)
PlotTheme (2)
TrendStyle (4)
TrendStyle combines with ChartBaseStyle:
With TrendStyle set to None, ChartBaseStyle is used:
Properties & Relations (7)
Larger thresholds filter out more noise:
KagiChart only shows time periods with significant change in price:
Use CandlestickChart to visualize the financial data:
Use TradingChart to visualize and analyze financial data:
Use InteractiveTradingChart to visualize and interactively analyze financial data:
Use PointFigureChart, LineBreakChart, and RenkoChart to analyze the relation of financial prices and time:
Use DateListPlot to visualize financial data:
Text
Wolfram Research (2010), KagiChart, Wolfram Language function, https://reference.wolfram.com/language/ref/KagiChart.html (updated 2014).
CMS
Wolfram Language. 2010. "KagiChart." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/KagiChart.html.
APA
Wolfram Language. (2010). KagiChart. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KagiChart.html