Class ExponentialMovingAverage
Represents the Exponential Moving Average overlay technical indicator.
Inheritance
Implements
Inherited Members
Namespace: FancyCandles.Indicators
Assembly: FancyCandles.dll
Syntax
[JsonObject(MemberSerialization.OptIn)]
public sealed class ExponentialMovingAverage : OverlayIndicator, INotifyPropertyChanged
Remarks
An Exponential Moving Average is the overlay technical indicator calculated by the following formulae:
EMA(i, Smoothing) = C(i) * Smoothing + EMA(i-1, Smoothing) * (1 - Smoothing), i>0
EMA(0, Smoothing) = C(0)
- EMA(i, Smoothing) is the Exponential Moving Average value at a time period i;
- Smoothing is the constant weighting factor between 0 and 1. A higher Smoothing discounts older observations faster.
- C(i) is the Close price value at a time period i.
Properties
| Improve this Doc View SourceFullName
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
Remarks
The full name of an OverlayIndicator object usually contains some of its property values.
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 |
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
Remarks
This XAML snippet can be loaded dynamically to instantiate a new element - the OverlayIndicator property editor.
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
Remarks
The short name of an OverlayIndicator object usually contains no instance parameter values.
Smoothing
Gets or sets the Smoothing weighting factor.
Declaration
[JsonProperty]
public double Smoothing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The Smoothing weighting factor. The default value is |
Remarks
A higher Smoothing discounts older observations faster. A Smoothing value must be between 0.0
and 1.0
.
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 SourceGetIndicatorValue(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
| Improve this Doc View SourceOnLastCandleChanged()
Declaration
protected override void OnLastCandleChanged()
Overrides
| Improve this Doc View SourceOnNewCandleAdded()
Declaration
protected override void OnNewCandleAdded()
Overrides
| Improve this Doc View SourceOnRender(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
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.
ReCalcAllIndicatorValues()
Declaration
protected override void ReCalcAllIndicatorValues()