Show / Hide Table of Contents

Class SimpleMovingAverage

Represents the Simple Moving Average overlay technical indicator.

Inheritance
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
OverlayIndicator
SimpleMovingAverage
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
OverlayIndicator.TypeName
OverlayIndicator.CandlesSource
OverlayIndicator.PropertyChanged
OverlayIndicator.OnPropertyChanged(String)
Namespace: FancyCandles.Indicators
Assembly: FancyCandles.dll
Syntax
[JsonObject(MemberSerialization.OptIn)]
public sealed class SimpleMovingAverage : OverlayIndicator, INotifyPropertyChanged
Remarks

A Simple Moving Average is the overlay technical indicator calculated by the following formulae:

SMA(i, N) = [C(i) + C(i - 1) + ... + C(i - N + 1)] / N

where:
  • SMA(i, N) is the N-period Simple Moving Average value at a time period i;
  • N is the number of periods over which the average price is calculated;
  • C(i) is the Close price value at a time period i.

Properties

| Improve this Doc View Source

FullName

Gets the full name of this OverlayIndicator object. Implements the FullName abstract property inherited from the OverlayIndicator base class.

Declaration
public override string FullName { get; }
Property Value
Type Description
System.String

The full name of this OverlayIndicator object.

Overrides
OverlayIndicator.FullName
Remarks

The full name of an OverlayIndicator object usually contains some of its property values.

| Improve this Doc View Source

N

Gets or sets the Number of periods over which the average price is calculated.

Declaration
[JsonProperty]
public int N { get; set; }
Property Value
Type Description
System.Int32

The Number of periods over which the average price is calculated. The default value is 1.

| Improve this Doc View Source

Pen

Gets or sets the Pen to draw the indicator chart.

Declaration
[JsonProperty]
public Pen Pen { get; set; }
Property Value
Type Description
System.Windows.Media.Pen

The Pen to draw the indicator chart. The default value is Pen(SolidColorBrush=Black, Thickness=1).

| Improve this Doc View Source

PropertiesEditorXAML

Gets the XAML snippet representing a property editor for this OverlayIndicator object. Implements the PropertiesEditorXAML abstract property inherited from the OverlayIndicator base class.

Declaration
public override string PropertiesEditorXAML { get; }
Property Value
Type Description
System.String

The String of XAML snippet representing a property editor for this OverlayIndicator object.

Overrides
OverlayIndicator.PropertiesEditorXAML
Remarks

This XAML snippet can be loaded dynamically to instantiate a new element - the OverlayIndicator property editor.

| Improve this Doc View Source

ShortName

Gets the short name of this OverlayIndicator object. Implements the ShortName abstract property inherited from the OverlayIndicator base class.

Declaration
public override string ShortName { get; }
Property Value
Type Description
System.String

The short name of this OverlayIndicator object.

Overrides
OverlayIndicator.ShortName
Remarks

The short name of an OverlayIndicator object usually contains no instance parameter values.

| Improve this Doc View Source

StaticName

Gets the static name of this OverlayIndicator.

Declaration
public static string StaticName { get; }
Property Value
Type Description
System.String

The static name of this OverlayIndicator.

Methods

| Improve this Doc View Source

GetIndicatorValue(Int32)

Implements the GetIndicatorValue(Int32) abstract method inherited from the OverlayIndicator base class.

Declaration
public override double GetIndicatorValue(int candle_i)
Parameters
Type Name Description
System.Int32 candle_i

Specifies the time period at which the OverlayIndicator value is calculated.

Returns
Type Description
System.Double

The OverlayIndicator value at a specified time period.

Overrides
OverlayIndicator.GetIndicatorValue(Int32)
| Improve this Doc View Source

OnLastCandleChanged()

Declaration
protected override void OnLastCandleChanged()
Overrides
OverlayIndicator.OnLastCandleChanged()
| Improve this Doc View Source

OnNewCandleAdded()

Declaration
protected override void OnNewCandleAdded()
Overrides
OverlayIndicator.OnNewCandleAdded()
| Improve this Doc View Source

OnRender(DrawingContext, IntRange, CandleExtremums, Double, Double, Double)

Implements the OnRender(DrawingContext, IntRange, CandleExtremums, Double, Double, Double) abstract method inherited from the OverlayIndicator base class.

Declaration
public override void OnRender(DrawingContext drawingContext, IntRange visibleCandlesRange, CandleExtremums visibleCandlesExtremums, double candleWidth, double gapBetweenCandles, double RenderHeight)
Parameters
Type Name Description
System.Windows.Media.DrawingContext drawingContext

Provides methods for drawing lines and shapes on the price chart area.

IntRange visibleCandlesRange

Specifies the time span currently shown on the price chart area. The range of the candles currently visible on the price chart.

CandleExtremums visibleCandlesExtremums

The maximal High and minimal Low of the candles in visibleCandlesRange.

System.Double candleWidth

The Width of candle of the price chart, in device-independent units.

System.Double gapBetweenCandles

The Gap between candles of the price chart, in device-independent units.

System.Double RenderHeight

The height of the price chart area, in device-independent units.

Overrides
OverlayIndicator.OnRender(DrawingContext, IntRange, CandleExtremums, Double, Double, Double)
Remarks

This is an analog of the UIElement.OnRender() method. Participates in rendering operations that are directed by the layout system. The rendering instructions for this indicator are not used directly when this method is invoked, and are instead preserved for later asynchronous use by layout and drawing.

| Improve this Doc View Source

ReCalcAllIndicatorValues()

Declaration
protected override void ReCalcAllIndicatorValues()
Overrides
OverlayIndicator.ReCalcAllIndicatorValues()

Implements

System.ComponentModel.INotifyPropertyChanged

See Also

OverlayIndicator
  • Improve this Doc
  • View Source

Class SimpleMovingAverage

Back to top Generated by DocFX. Copyright Ⓒ Dennis Geller 2019.