Back to Devexpress

Moving Average and Envelope

wpf-14329-controls-and-libraries-charts-suite-chart-control-series-indicators-moving-average-and-envelope.md

latest3.8 KB
Original Source

Moving Average and Envelope

  • May 28, 2021
  • 2 minutes to read

The Chart control supports different Moving Average indicators that are commonly used with financial series.

This document consists of the following sections:

Available Moving Averages

The table below lists all the Moving Average indicators available in charts.

Moving Average indicatorClass
Simple Moving Average, SMASimpleMovingAverage
Exponential Moving Average, EMAExponentialMovingAverage
Weighted Moving Average, WMAWeightedMovingAverage
Triangular Moving Average, TMATriangularMovingAverage
Triple Exponential Moving Average, TEMATripleExponentialMovingAverageTema

How to Add a Moving Average Indicator to a Chart

The following markup shows how to add a Simple Moving Average indicator to a chart:

xaml
<dxc:StockSeries2D.Indicators>
    <dxc:SimpleMovingAverage MovingAverageKind="MovingAverageAndEnvelope"
                             EnvelopePercent="4"
                             PointsCount="12"
                             ValueLevel="High"
                             Legend="{Binding ElementName=indicatorLegend}"
                             LegendText="Simple Moving Average"            
                             ShowInLegend="True"/>
</dxc:StockSeries2D.Indicators>

The markup uses the following classes and properties:

|

Class or Property

|

Description

| | --- | --- | |

XYSeries2D.Indicators

|

The series collection of indicators.

| |

SimpleMovingAverage

|

The Simple Moving Average indicator.

| |

MovingAverage.MovingAverageKind

|

Specifies the kind of a Moving Average indicator.

| |

MovingAverage.EnvelopePercent

|

Specifies the percentage value that the Moving Average envelopes show.

This property value is actual when MovingAverage.MovingAverageKind is set to Envelope or MovingAverageAndEnvelope.

| |

MovingAverage.PointsCount

|

Specifies the number of points used to build an indicator.

| |

Indicator.Legend

|

The legend that shows the indicator.

| |

Indicator.LegendText

|

The text that identifies the indicator in the legend.

| |

Indicator.ShowInLegend

|

Specifies whether to show the indicator in the legend.

|

See Also

Trend Lines

Regression Lines

Fibonacci Indicators