Skip to main content

Moving Average and Envelope

  • 2 minutes to read

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

WPF_MovingAverageIndicator_Introduction

This document consists of the following sections:

Available Moving Averages

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

Moving Average indicator Class
Simple Moving Average, SMA SimpleMovingAverage
Exponential Moving Average, EMA ExponentialMovingAverage
Weighted Moving Average, WMA WeightedMovingAverage
Triangular Moving Average, TMA TriangularMovingAverage
Triple Exponential Moving Average, TEMA TripleExponentialMovingAverageTema

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:

<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