mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
fix on JMA
This commit is contained in:
@@ -1,57 +0,0 @@
|
|||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using TradingPlatform.BusinessLayer;
|
|
||||||
namespace QuanTAlib;
|
|
||||||
|
|
||||||
public class AAA_chart : Indicator {
|
|
||||||
#region Parameters
|
|
||||||
|
|
||||||
[InputParameter("Smoothing period", 0, 1, 999, 1, 1)]
|
|
||||||
private readonly int Period = 10;
|
|
||||||
|
|
||||||
#endregion Parameters
|
|
||||||
|
|
||||||
private TBars bars;
|
|
||||||
private JMA_Series ind_a;
|
|
||||||
private DWMA_Series ind_b;
|
|
||||||
|
|
||||||
public override string ShortName => $"AAA ({this.Period})";
|
|
||||||
|
|
||||||
public AAA_chart() : base()
|
|
||||||
{
|
|
||||||
this.SeparateWindow = false;
|
|
||||||
|
|
||||||
this.Name = "AAA - Test indicator";
|
|
||||||
this.Description = "Test indicator";
|
|
||||||
|
|
||||||
this.AddLineSeries("JMA", Color.RoyalBlue, 3, LineStyle.Solid);
|
|
||||||
this.AddLineSeries("DWMA", Color.OrangeRed, 3, LineStyle.Solid);
|
|
||||||
|
|
||||||
this.SeparateWindow = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnInit()
|
|
||||||
{
|
|
||||||
this.bars = new();
|
|
||||||
|
|
||||||
this.ind_a = new(source: bars.Close, period: this.Period, useNaN: false);
|
|
||||||
this.ind_b = new(source: bars.OHLC4, period: this.Period, useNaN: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnUpdate(UpdateArgs args)
|
|
||||||
{
|
|
||||||
bool update = !(args.Reason == UpdateReason.NewBar || args.Reason == UpdateReason.HistoricalBar);
|
|
||||||
|
|
||||||
this.bars.Add(this.Time(),
|
|
||||||
this.GetPrice(PriceType.Open),
|
|
||||||
this.GetPrice(PriceType.High),
|
|
||||||
this.GetPrice(PriceType.Low),
|
|
||||||
this.GetPrice(PriceType.Close),
|
|
||||||
this.GetPrice(PriceType.Volume),
|
|
||||||
update);
|
|
||||||
|
|
||||||
this.SetValue(this.ind_a.v.Last(), 0);
|
|
||||||
this.SetValue(this.ind_b.v.Last(), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,50 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using TradingPlatform.BusinessLayer;
|
using TradingPlatform.BusinessLayer;
|
||||||
namespace QuanTAlib;
|
namespace QuanTAlib;
|
||||||
|
|
||||||
public class JMA_chart : Indicator
|
public class JMA_chart : Indicator {
|
||||||
{
|
#region Parameters
|
||||||
#region Parameters
|
|
||||||
|
|
||||||
[InputParameter("Smoothing period", 0, 1, 999, 1, 1)]
|
[InputParameter("Smoothing period", 0, 1, 999, 1, 1)]
|
||||||
private int Period = 10;
|
private int Period = 10;
|
||||||
|
|
||||||
[InputParameter("Data source", 1, variants: new object[]
|
[InputParameter("Data source", 1, variants: new object[]
|
||||||
{ "Open", 0, "High", 1, "Low", 2, "Close", 3, "HL2", 4, "OC2", 5,
|
{ "Open", 0, "High", 1, "Low", 2, "Close", 3, "HL2", 4, "OC2", 5,
|
||||||
"OHL3", 6, "HLC3", 7, "OHLC4", 8, "Weighted (HLCC4)", 9 })]
|
"OHL3", 6, "HLC3", 7, "OHLC4", 8, "Weighted (HLCC4)", 9 })]
|
||||||
private int DataSource = 3;
|
private int DataSource = 3
|
||||||
|
;
|
||||||
|
[InputParameter("Slope calc", 2, 2, 10, 1, 1)]
|
||||||
|
private int SlopePeriod = 3;
|
||||||
|
|
||||||
#endregion Parameters
|
|
||||||
|
|
||||||
private TBars bars ;
|
#endregion Parameters
|
||||||
|
|
||||||
///////
|
private TBars bars;
|
||||||
private JMA_Series indicator;
|
|
||||||
///////
|
|
||||||
|
|
||||||
public JMA_chart()
|
///////
|
||||||
{
|
private JMA_Series indicator;
|
||||||
this.SeparateWindow = false;
|
private LINREG_Series slope;
|
||||||
this.Name = "JMA - Jurik Moving Average";
|
///////
|
||||||
this.Description = "Jurik Moving Average description";
|
|
||||||
this.AddLineSeries("JMA", Color.RoyalBlue, 3, LineStyle.Solid);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnInit()
|
public JMA_chart() {
|
||||||
{
|
this.SeparateWindow = false;
|
||||||
this.bars = new();
|
this.Name = "JMA - Jurik Moving Avg";
|
||||||
|
this.Description = "Jurik Moving Average description";
|
||||||
|
this.AddLineSeries("JMA", Color.Blue, 4, LineStyle.Solid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override void OnInit() {
|
||||||
|
this.bars = new();
|
||||||
this.indicator = new(source: bars.Select(this.DataSource), period: this.Period, useNaN: false);
|
this.indicator = new(source: bars.Select(this.DataSource), period: this.Period, useNaN: false);
|
||||||
}
|
this.slope = new(source: this.indicator, period: this.SlopePeriod);
|
||||||
protected override void OnUpdate(UpdateArgs args)
|
}
|
||||||
{
|
|
||||||
bool update = !(args.Reason == UpdateReason.NewBar || args.Reason == UpdateReason.HistoricalBar);
|
|
||||||
this.bars.Add(this.Time(), this.GetPrice(PriceType.Open),
|
|
||||||
this.GetPrice(PriceType.High), this.GetPrice(PriceType.Low),
|
|
||||||
this.GetPrice(PriceType.Close),
|
|
||||||
this.GetPrice(PriceType.Volume), update);
|
|
||||||
|
|
||||||
double result = this.indicator.v.Last();
|
protected override void OnUpdate(UpdateArgs args) {
|
||||||
this.SetValue(result);
|
bool update = !(args.Reason == UpdateReason.NewBar || args.Reason == UpdateReason.HistoricalBar);
|
||||||
}
|
|
||||||
|
this.bars.Add(this.Time(), this.GetPrice(PriceType.Open),
|
||||||
|
this.GetPrice(PriceType.High), this.GetPrice(PriceType.Low),
|
||||||
|
this.GetPrice(PriceType.Close), this.GetPrice(PriceType.Volume), update);
|
||||||
|
double result = this.indicator[this.indicator.Count - 1].v;
|
||||||
|
|
||||||
|
this.LinesSeries[0].SetMarker(offset: 0,color: this.slope > 0 ? Color.FromArgb(0,160,0) : Color.FromArgb(255, 0, 0));
|
||||||
|
this.SetValue(result, lineIndex: 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="TradingPlatform.BusinessLayer">
|
<Reference Include="TradingPlatform.BusinessLayer">
|
||||||
<HintPath>C:\Quantower\TradingPlatform\v1.128.20\bin\TradingPlatform.BusinessLayer.dll</HintPath>
|
<HintPath>C:\Quantower\TradingPlatform\v1.129.11\bin\TradingPlatform.BusinessLayer.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Title>QuanTAlib</Title>
|
<Title>QuanTAlib</Title>
|
||||||
<Version>0.1.27</Version>
|
<Version>0.1.28</Version>
|
||||||
<Product>Library of Technical Indicators for .NET</Product>
|
<Product>Library of Technical Indicators for .NET</Product>
|
||||||
<Description>Quantitative Technical Analysis library for real-time (streaming) data analysis</Description>
|
<Description>Quantitative Technical Analysis library for real-time (streaming) data analysis</Description>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
|
|||||||
@@ -19,51 +19,57 @@ Remark:
|
|||||||
|
|
||||||
public class DEMA_Series : Single_TSeries_Indicator
|
public class DEMA_Series : Single_TSeries_Indicator
|
||||||
{
|
{
|
||||||
private readonly System.Collections.Generic.List<double> _buffer1 = new();
|
private readonly double _k;
|
||||||
private readonly System.Collections.Generic.List<double> _buffer2 = new();
|
private int _len;
|
||||||
private readonly double _k;
|
|
||||||
private readonly bool _useSMA;
|
private readonly bool _useSMA;
|
||||||
|
private double _sum, _lastsum, _lastlastsum;
|
||||||
private double _lastema1, _lastlastema1;
|
private double _lastema1, _lastlastema1;
|
||||||
private double _lastema2, _lastlastema2;
|
private double _lastema2, _lastlastema2;
|
||||||
|
|
||||||
public DEMA_Series(TSeries source, int period, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN)
|
public DEMA_Series(TSeries source, int period, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN)
|
||||||
{
|
{
|
||||||
_k = 2.0 / (_p + 1);
|
_k = 2.0 / (_p + 1);
|
||||||
|
_len = 0;
|
||||||
_useSMA = useSMA;
|
_useSMA = useSMA;
|
||||||
_lastema1 = _lastema2 =0;
|
_sum = _lastema1 = _lastema2 =0;
|
||||||
if (_data.Count > 0) { base.Add(_data); }
|
if (_data.Count > 0) { base.Add(_data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add((DateTime t, double v) TValue, bool update)
|
public override void Add((DateTime t, double v) TValue, bool update)
|
||||||
{
|
{
|
||||||
if (update)
|
if (update) {
|
||||||
{
|
_lastsum = _lastlastsum;
|
||||||
_lastema1 = _lastlastema1;
|
_lastema1 = _lastlastema1;
|
||||||
_lastema2 = _lastlastema2;
|
_lastema2 = _lastlastema2;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
_lastlastsum = _lastsum;
|
||||||
|
_lastlastema1 = _lastema1;
|
||||||
|
_lastlastema2 = _lastema2;
|
||||||
|
_len++;
|
||||||
|
}
|
||||||
|
|
||||||
double _ema1, _ema2, _dema;
|
double _ema1, _ema2, _dema;
|
||||||
if (this.Count < _p && _useSMA)
|
if (this.Count == 0) {
|
||||||
{
|
_ema1 = _ema2 = _sum = TValue.v;
|
||||||
Add_Replace_Trim(_buffer1, TValue.v, _p, update);
|
}
|
||||||
_ema1 = 0;
|
else if (_len <= _period && _useSMA && _period != 0) {
|
||||||
for (int i=0; i<_buffer1.Count; i++) { _ema1 += _buffer1[i]; }
|
_sum += TValue.v;
|
||||||
_ema1 /= _buffer1.Count;
|
if (_period != 0 && _len > _period) {
|
||||||
_ema2 = _ema1;
|
_sum -= (_data[base.Count - _period - (update ? 1 : 0)].v);
|
||||||
}
|
}
|
||||||
else
|
_ema1 = _sum / Math.Min(_len, _period);
|
||||||
{
|
_ema2 = _ema1;
|
||||||
_ema1 = (TValue.v - _lastema1) * _k + _lastema1;
|
}
|
||||||
_ema2 = (_ema1 - _lastema2) * _k + _lastema2;
|
else {
|
||||||
|
_ema1 = (TValue.v - _lastema1) * _k + _lastema1;
|
||||||
|
_ema2 = (_ema1 - _lastema2) * _k + _lastema2;
|
||||||
|
}
|
||||||
|
_dema = 2*_ema1 - _ema2;
|
||||||
|
|
||||||
}
|
_lastema1 = _ema1;
|
||||||
_dema = 2*_ema1 - _ema2;
|
_lastema2 = _ema2;
|
||||||
|
|
||||||
this._lastlastema1 = this._lastema1;
|
base.Add((TValue.t, _dema), update, _NaN);
|
||||||
this._lastlastema2 = this._lastema2;
|
|
||||||
this._lastema1 = _ema1;
|
|
||||||
this._lastema2 = _ema2;
|
|
||||||
|
|
||||||
base.Add((TValue.t, _dema), update, _NaN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,22 +24,23 @@ public class EMA_Series : Single_TSeries_Indicator {
|
|||||||
private double _k;
|
private double _k;
|
||||||
private double _lastema, _lastlastema;
|
private double _lastema, _lastlastema;
|
||||||
private double _sum, _oldsum;
|
private double _sum, _oldsum;
|
||||||
private int _len, _oldlen;
|
private int _len;
|
||||||
private readonly bool _useSMA;
|
private readonly bool _useSMA;
|
||||||
|
|
||||||
public EMA_Series(TSeries source, int period, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN) {
|
public EMA_Series(TSeries source, int period, bool useNaN = false, bool useSMA = true) : base(source, period, useNaN) {
|
||||||
this._k = 2.0 / (this._p + 1);
|
_k = 2.0 / (_p + 1);
|
||||||
_sum = _oldsum = _lastema = _lastlastema = 0;
|
_sum = _oldsum = _lastema = _lastlastema = 0;
|
||||||
_len = _oldlen = 0;
|
_len = 0;
|
||||||
_useSMA = useSMA;
|
_useSMA = useSMA;
|
||||||
if (this._data.Count > 0) { base.Add(this._data); }
|
if (this._data.Count > 0) { base.Add(this._data); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Add((DateTime t, double v) TValue, bool update) {
|
public override void Add((DateTime t, double v) TValue, bool update) {
|
||||||
double _ema = 0;
|
|
||||||
if (update) { _lastema = _lastlastema; _sum = _oldsum; }
|
if (update) { _lastema = _lastlastema; _sum = _oldsum; }
|
||||||
else { _lastlastema = _lastema; _oldsum = _sum; _len++; }
|
else { _lastlastema = _lastema; _oldsum = _sum; _len++; }
|
||||||
|
|
||||||
|
double _ema = 0;
|
||||||
// when period = 0, create cumulative/additive series where _k is progressively larger
|
// when period = 0, create cumulative/additive series where _k is progressively larger
|
||||||
if (_period == 0) { _k = 2.0 / (_len + 1); }
|
if (_period == 0) { _k = 2.0 / (_len + 1); }
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class EMA_Series : Single_TSeries_Indicator {
|
|||||||
_ema = _sum = TValue.v;
|
_ema = _sum = TValue.v;
|
||||||
}
|
}
|
||||||
// if SMA is used for seeding, calculate SMA within period
|
// if SMA is used for seeding, calculate SMA within period
|
||||||
else if (_len <= _period && _useSMA && _p != 0) {
|
else if (_len <= _period && _useSMA && _period != 0) {
|
||||||
_sum += TValue.v;
|
_sum += TValue.v;
|
||||||
if (_period != 0 && _len > _period) {
|
if (_period != 0 && _len > _period) {
|
||||||
_sum -= (_data[base.Count - _period - (update ? 1 : 0)].v);
|
_sum -= (_data[base.Count - _period - (update ? 1 : 0)].v);
|
||||||
@@ -65,6 +66,6 @@ public class EMA_Series : Single_TSeries_Indicator {
|
|||||||
}
|
}
|
||||||
public void Reset() {
|
public void Reset() {
|
||||||
_sum = _oldsum = _lastema = _lastlastema = 0;
|
_sum = _oldsum = _lastema = _lastlastema = 0;
|
||||||
_len = _oldlen = 0;
|
_len = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ public class JMA_Series : Single_TSeries_Indicator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override void Add((System.DateTime t, double v) TValue, bool update) {
|
public override void Add((System.DateTime t, double v) TValue, bool update) {
|
||||||
if (this.Count == 0) { prev_ma1 = TValue.v; }
|
if (this.Count == 0) { prev_ma1 = prev_jma = TValue.v; }
|
||||||
if (update) {
|
if (update) {
|
||||||
upperBand = p_upperBand;
|
upperBand = p_upperBand;
|
||||||
lowerBand = p_lowerBand;
|
lowerBand = p_lowerBand;
|
||||||
@@ -81,6 +81,7 @@ public class JMA_Series : Single_TSeries_Indicator {
|
|||||||
else { volty_10.Add(volty); }
|
else { volty_10.Add(volty); }
|
||||||
if (volty_10.Count > 10) { volty_10.RemoveAt(0); }
|
if (volty_10.Count > 10) { volty_10.RemoveAt(0); }
|
||||||
vsum = prev_vsum + 0.1 * (volty - volty_10.First());
|
vsum = prev_vsum + 0.1 * (volty - volty_10.First());
|
||||||
|
prev_vsum = vsum;
|
||||||
if (update) { vsum_buff[vsum_buff.Count - 1] = vsum; }
|
if (update) { vsum_buff[vsum_buff.Count - 1] = vsum; }
|
||||||
else { vsum_buff.Add(vsum); }
|
else { vsum_buff.Add(vsum); }
|
||||||
if (vsum_buff.Count > (10 * _p)) { vsum_buff.RemoveAt(0); }
|
if (vsum_buff.Count > (10 * _p)) { vsum_buff.RemoveAt(0); }
|
||||||
|
|||||||
+25
-24
@@ -1,22 +1,23 @@
|
|||||||
# EMA: Exponential Moving Average
|
# EMA: Exponential Moving Average
|
||||||
period = 10
|
|
||||||
|
|
||||||

|
Also known as exponentially weighted moving average, as it places greater weight on the most recent data points.
|
||||||
|
EMA reacts more agressively to recent data changes and calculates the current value using just the previous EMA value and current data point. The weight applied to the new value is typically $k = 2 / (period-1)$
|
||||||
EMA needs very short history buffer and calculates the EMA value using just the previous EMA value. The weight of the new datapoint (k) is k = 2 / (period-1)
|
|
||||||
|
|
||||||
## Calculation
|
## Calculation
|
||||||
|
|
||||||
There is an adopted practice to calculate $SMA$ when $n < period$.
|
EMA is a rolling calculation requiring only one historical data point to calculate the current value and is denoted as ${EMA}_{p}{(data)}$ where $p$ represents the period and $data$ represents the list of data points.
|
||||||
|
|
||||||
|
Some implementations of EMA calculate a seeding value of $EMA$ as a ${SMA}_{p}$ when $n < period$ - and start the $EMA$ calculation only after the warm-up period. QuanTAlib offers an option to enable/disable SMA warm-up.
|
||||||
|
|
||||||
$$
|
$$
|
||||||
EMA_n = \left\{ \begin{array}{cl}
|
EMA_n = \left\{ \begin{array}{cl}
|
||||||
\frac{1}{p}\left( data_{n}-data_{n-p}\right)+SMA_{n-1} & : \ n \leq period \\
|
\frac{1}{p}\left( data_{n}-data_{n-p}\right)+SMA_{n-1} & : \ n \leq period \\
|
||||||
{k}\times ({data_{n}} - EMA_{n-1}) + EMA_{n-1} & : \ x > period
|
{k}\times ({data_{n}} - EMA_{n-1}) + EMA_{n-1} & : \ n > period
|
||||||
\end{array} \right.
|
\end{array} \right.
|
||||||
$$
|
$$
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|

|
||||||
|
|
||||||
## Reference Calculation
|
## Reference Calculation
|
||||||
period = 5
|
period = 5
|
||||||
@@ -27,23 +28,23 @@ EMA_Series ema_nan = new(data, 5, useNaN: true);
|
|||||||
for (int i=0; i< data.Count; i++)
|
for (int i=0; i< data.Count; i++)
|
||||||
Console.WriteLine($"{i}\t{data[i].v,7:f2}\t{ema_nan[i].v,7:f3}\t{ema[i].v,7:f3}");
|
Console.WriteLine($"{i}\t{data[i].v,7:f2}\t{ema_nan[i].v,7:f3}\t{ema[i].v,7:f3}");
|
||||||
```
|
```
|
||||||
|#|input|ema_NaN|ema|
|
| #| Input | **QuanTAlib** | _TA-LIB_ | _Skender_ | _Pandas-TA_ | _Tulip_ |
|
||||||
|--|:--:|:--:|:--:|
|
|--|:--:|:--:|:--:|:--:|:--:|:--:|
|
||||||
|0| 81.59| NaN| 81.590|
|
|0| 81.59| **81.590**| _NaN_| _NaN_| _NaN_| _NaN_|
|
||||||
|1| 81.06| NaN| 81.325|
|
|1| 81.06| **81.840**| _NaN_| _NaN_| _NaN_| _NaN_|
|
||||||
|2| 82.87| NaN| 81.840|
|
|2| 82.87| **81.840**| _NaN_| _NaN_| _NaN_| _NaN_|
|
||||||
|3| 83.00| NaN| 82.130|
|
|3| 83.00| **82.130**| _NaN_| _NaN_| _NaN_| _NaN_|
|
||||||
|4| 83.61| 82.426| 82.426|
|
|4| 83.61| **82.426**| _82.426_| _82.426_| _82.426_| _82.426_|
|
||||||
|5| 83.15| 82.667| 82.667|
|
|5| 83.15| **82.667**| _82.667_| _82.667_| _82.667_|_82.667_|
|
||||||
|6| 82.84| 82.725| 82.725|
|
|6| 82.84| **82.725**| _82.725_| _82.725_| _82.725_|_82.725_|
|
||||||
|7| 83.99| 83.147| 83.147|
|
|7| 83.99| **83.147**| _83.147_| _83.147_| _83.147_|_83.147_|
|
||||||
|8| 84.55| 83.614| 83.614|
|
|8| 84.55| **83.614**| _83.614_| _83.614_| _83.614_|_83.614_|
|
||||||
|9| 84.36| 83.863| 83.863|
|
|9| 84.36| **83.863**| _83.863_| _83.863_| _83.863_|_83.863_|
|
||||||
|10| 85.53| 84.419| 84.419|
|
|10| 85.53| **84.419**| _84.419_| _84.419_| _84.419_|_84.419_|
|
||||||
|11| 86.54| 85.126| 85.126|
|
|11| 86.54| **85.126**| _85.126_| _85.126_| _85.126_|_85.126_|
|
||||||
|12| 86.89| 85.714| 85.714|
|
|12| 86.89| **85.714**| _85.714_| _85.714_| _85.714_|_85.714_|
|
||||||
|13| 87.77| 86.399| 86.399|
|
|13| 87.77| **86.399**| _86.399_| _86.399_| _86.399_|_86.399_|
|
||||||
|14| 87.29| 86.696| 86.696|
|
|14| 87.29| **86.696**| _86.696_| _86.696_| _86.696_|_86.696_|
|
||||||
## References
|
## References
|
||||||
|
|
||||||
- https://en.wikipedia.org/wiki/Exponential_smoothing
|
- https://en.wikipedia.org/wiki/Exponential_smoothing
|
||||||
@@ -21,8 +21,6 @@ $$
|
|||||||
- `period`: optional size of a lookback window; if set to 0, SMA calculates cumulative average across the whole source
|
- `period`: optional size of a lookback window; if set to 0, SMA calculates cumulative average across the whole source
|
||||||
- `useNaN`: if set to _true_, SMA_Series will hide values within the initial period with NaN (for compatibility with other libraries)
|
- `useNaN`: if set to _true_, SMA_Series will hide values within the initial period with NaN (for compatibility with other libraries)
|
||||||
|
|
||||||
[Link to source](..\Source\Trends\SMA_Series.cs)
|
|
||||||
|
|
||||||
## Behavior
|
## Behavior
|
||||||

|

|
||||||
## Reference Calculation & Validation
|
## Reference Calculation & Validation
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
* [Home](/)
|
* [Home](/)
|
||||||
|
* [FAQ - Frequently asked questions answered](QA.md)
|
||||||
|
|
||||||
* [List of all Indicators](indicators.md "Indicators coverage")
|
* [List of all Indicators](indicators.md "Indicators coverage")
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 154 KiB |
+1
-1
@@ -54,7 +54,7 @@
|
|||||||
|ALMA - Arnaud Legoux Moving Average|`ALMA_Series`||✔️GetAlma|alma|
|
|ALMA - Arnaud Legoux Moving Average|`ALMA_Series`||✔️GetAlma|alma|
|
||||||
|DEMA - Double EMA Average|`DEMA_Series`|✔️DEMA|✔️GetDema|✔️dema|✔️dema|
|
|DEMA - Double EMA Average|`DEMA_Series`|✔️DEMA|✔️GetDema|✔️dema|✔️dema|
|
||||||
|DWMA - Double WMA Average|`DWMA_Series`|||||
|
|DWMA - Double WMA Average|`DWMA_Series`|||||
|
||||||
|⭐EMA - Exponential Moving Average|`EMA_Series`|✔️EMA|✔️GetEma|✔️ema|✔️ema|
|
|⭐[EMA - Exponential Moving Average](EMA.md)|`EMA_Series`|✔️EMA|✔️GetEma|✔️ema|✔️ema|
|
||||||
|EPMA - Endpoint Moving Average|||GetEpma||
|
|EPMA - Endpoint Moving Average|||GetEpma||
|
||||||
|FRAMA - Fractal Adaptive Moving Average|||||
|
|FRAMA - Fractal Adaptive Moving Average|||||
|
||||||
|FMA - Fibonacci's Weighted Moving Average|`FMA_Series`|||fwma|
|
|FMA - Fibonacci's Weighted Moving Average|`FMA_Series`|||fwma|
|
||||||
|
|||||||
Reference in New Issue
Block a user