Back to Devexpress

Trend Indicators

wpf-115284-controls-and-libraries-charts-suite-chart-control-series-indicators-trend-indicators.md

latest5.1 KB
Original Source

Trend Indicators

  • May 28, 2021
  • 2 minutes to read

Trend Indicators show the tendency of series values to move in a specific direction over time. Trend indicators are commonly used with financial charts.

This document contains the following sections:

Available Trend Indicators

The Chart control supports the following Trend indicators:

|

Trend indicator

|

Class

|

Specific parameters

| | --- | --- | --- | |

Bollinger Bands

|

BollingerBands

|

BollingerBands.StandardDeviationMultiplier

BollingerBands.PointsCount

BollingerBands.ValueLevel

| |

Mass Index

|

MassIndex

|

MassIndex.SumPointsCount

MassIndex.MovingAveragePointsCount

XYDiagram2D.IndicatorPane

XYDiagram2D.IndicatorAxisY

| |

Standard Deviation

|

StandardDeviation

|

StandardDeviation.PointsCount

StandardDeviation.ValueLevel

XYDiagram2D.IndicatorPane

XYDiagram2D.IndicatorAxisY

|

How to Add a Trend Indicator

You can position the Standard Deviation and Mass Index indicators in a separate pane with a secondary y-axis. The following XAML shows how to add the Standard Deviation Indicator:

xaml
<dxc:ChartControl>
    <!--...-->
    <dxc:XYDiagram2D>
        <!--...-->
        <dxc:StockSeries2D DisplayName="Series">
            <dxc:StockSeries2D.Indicators>
                <dxc:StandardDeviation PointsCount="14"
                                       ValueLevel="Close"
                                       dxc:XYDiagram2D.IndicatorPane="{Binding ElementName=indicatorPane}"
                                       dxc:XYDiagram2D.IndicatorAxisY="{Binding ElementName=indicatorAxisY}"
                                       Legend="{Binding ElementName=indicatorLegend}"
                                       LegendText="Standard Deviation"                                           
                                       ShowInLegend="True"/>
            </dxc:StockSeries2D.Indicators>
            <!--...-->
        </dxc:StockSeries2D>
        <dxc:XYDiagram2D.Panes>
            <dxc:Pane x:Name="indicatorPane"/>
        </dxc:XYDiagram2D.Panes>
        <dxc:XYDiagram2D.SecondaryAxesY>
            <dxc:SecondaryAxisY2D x:Name="indicatorAxisY"
                                  Alignment="Far">
                <dxc:SecondaryAxisY2D.WholeRange>
                    <dxc:Range dxc:AxisY2D.AlwaysShowZeroLevel="False"/>
                </dxc:SecondaryAxisY2D.WholeRange>
            </dxc:SecondaryAxisY2D>
        </dxc:XYDiagram2D.SecondaryAxesY>
    </dxc:XYDiagram2D>
</dxc:ChartControl>

The following table lists classes and properties used to add the Standard Deviation indicator to a chart:

Class or PropertyDescription
XYSeries2D.IndicatorsThe series collection of indicators.
StandardDeviationThe Standard Deviation indicator.
StandardDeviation.PointsCountThe number of series points used to build the indicator.
StandardDeviation.ValueLevelSpecifies the point value used to calculate the indicator.
XYDiagram2D.IndicatorPaneSpecifies the pane that contains the indicator.
XYDiagram2D.IndicatorAxisYSpecifies the y-axis used with the indicator.
Indicator.LegendSpecifies the legend that displays the legend.
Indicator.LegendTextThe text that shows with the identifier marker in the legend.
Indicator.ShowInLegendSpecifies whether to show the indicator in the legend.

See Also

Financial Series

Indicators