Sonarcloud changes

This commit is contained in:
Miha
2022-04-20 00:01:33 -07:00
parent df9023b4d6
commit bbea1afb71
34 changed files with 110 additions and 1033 deletions
+5 -5
View File
@@ -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);
}
}