Indicators are special metrics that are commonly used to analyze and process financial data visually.
You can display any number of built-in indicators for the 2D XY Diagram series. The Chart control provides the following indicators:
In this section, you add a Fibonacci Retracement indicator that is shown in the following image:

Specify two points' argument and value levels to add the Fibonacci Retracement indicator to the chart. Note that other indicators can require defining other specific parameters.
XAML |
<dxc:StockSeries2D DisplayName="series">
<dxc:StockSeries2D.Indicators>
<dxc:FibonacciRetracement Argument1="09/12/2016"
ValueLevel1="High"
Argument2="10/18/2016"
ValueLevel2="High"
LegendText="Fibonacci Retracement"
ShowInLegend="True"/>
</dxc:StockSeries2D.Indicators>
<!--...-->
</dxc:StockSeries2D>
|
The markup above uses the following classes and properties:
Indicators that are SeparatePaneIndicator class descendants can be plotted on a separate pane with a secondary y-axis. Below is the list of these indicators:
The following image shows the Standard Deviation indicator in a separate chart pane:

Use the following code to draw an indicator in a separate pane with a secondary axis:
XAML |
<dxc:ChartControl.Legends>
<dxc:Legend x:Name="legend"/>
</dxc:ChartControl.Legends>
<dxc:XYDiagram2D>
<dxc:XYDiagram2D.SecondaryAxesY>
<dxc:SecondaryAxisY2D x:Name="secondaryAxis"
Alignment="Far"/>
</dxc:XYDiagram2D.SecondaryAxesY>
<dxc:XYDiagram2D.Panes>
<dxc:Pane x:Name="pane"/>
</dxc:XYDiagram2D.Panes>
<!-- ... -->
<dxc:StockSeries2D.Indicators>
<dxc:StandardDeviation dxc:XYDiagram2D.IndicatorAxisY="{Binding ElementName=secondaryAxis}"
dxc:XYDiagram2D.IndicatorPane="{Binding ElementName=pane}"
ValueLevel="High"
Legend="{Binding ElementName=legend}"
LegendText="Standard Deviation"
ShowInLegend="True"/>
</dxc:StockSeries2D.Indicators>
<!--...-->
</dxc:XYDiagram2D>
|
The markup above uses the following classes and properties:
You can create a custom color palette to draw indicators instead of the DefaultIndicatorsPalette.

Use the following XAML to configure a custom palette:
XAML |
<dxc:ChartControl.IndicatorsPalette>
<dxc:CustomIndicatorsPalette>
<dxc:CustomIndicatorsPalette.Colors>
<Color>Blue</Color>
<Color>Green</Color>
</dxc:CustomIndicatorsPalette.Colors>
</dxc:CustomIndicatorsPalette>
</dxc:ChartControl.IndicatorsPalette>
|
The markup above uses the following classes and properties:
Note
You can specify a color for each indicator using the Indicator.Brush property.
Also, modify a style of a line that is used to draw an indicator.

For this, use the following code:
XAML |
<dxc:StockSeries2D.Indicators>
<dxc:StandardDeviation dxc:XYDiagram2D.IndicatorAxisY="{Binding ElementName=secAxis}"
dxc:XYDiagram2D.IndicatorPane="{Binding ElementName=pane}"
ValueLevel="High"
Legend="{Binding ElementName=indicatorLegend}"
LegendText="Standard Deviation"
ShowInLegend="True">
<dxc:StandardDeviation.LineStyle>
<dxc:LineStyle Thickness="2">
<dxc:LineStyle.DashStyle>
<DashStyle Dashes="2 1 2"/>
</dxc:LineStyle.DashStyle>
</dxc:LineStyle>
</dxc:StandardDeviation.LineStyle>
</dxc:StandardDeviation>
</dxc:StockSeries2D.Indicators>
|
The code above uses the following classes and properties to configure a line: