mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 10:38:05 +00:00
Sonarcloud changes
This commit is contained in:
@@ -29,7 +29,7 @@ public class DEMA_Series : Single_TSeries_Indicator
|
||||
if (_data.Count > 0) { base.Add(_data); }
|
||||
}
|
||||
|
||||
public override void Add((DateTime t, double v) d, bool update = false)
|
||||
public override void Add((DateTime t, double v) TValue, bool update)
|
||||
{
|
||||
|
||||
if (update)
|
||||
@@ -42,10 +42,10 @@ public class DEMA_Series : Single_TSeries_Indicator
|
||||
|
||||
if (this.Count < this._p)
|
||||
{
|
||||
if (update) { _buffer[_buffer.Count - 1] = d.v; }
|
||||
if (update) { _buffer[_buffer.Count - 1] = TValue.v; }
|
||||
else
|
||||
{
|
||||
_buffer.Add(d.v);
|
||||
_buffer.Add(TValue.v);
|
||||
}
|
||||
if (_buffer.Count > this._p) { _buffer.RemoveAt(0); }
|
||||
|
||||
@@ -57,7 +57,7 @@ public class DEMA_Series : Single_TSeries_Indicator
|
||||
}
|
||||
else
|
||||
{
|
||||
_ema1 = d.v * this._k + this._lastema1 * this._k1m;
|
||||
_ema1 = TValue.v * this._k + this._lastema1 * this._k1m;
|
||||
_ema2 = _ema1 * this._k + this._lastema2 * this._k1m;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class DEMA_Series : Single_TSeries_Indicator
|
||||
this._lastema1 = _ema1;
|
||||
this._lastema2 = _ema2;
|
||||
|
||||
var ret = (d.t, this.Count < this._p - 1 && this._NaN ? double.NaN : _dema);
|
||||
var ret = (TValue.t, this.Count < this._p - 1 && this._NaN ? double.NaN : _dema);
|
||||
base.Add(ret, update);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user