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
+4 -4
View File
@@ -23,10 +23,10 @@ public class VAR_Series : Single_TSeries_Indicator
}
private readonly System.Collections.Generic.List<double> _buffer = new();
public override void Add((System.DateTime t, double v) d, bool update)
public override void Add((System.DateTime t, double v) TValue, bool update)
{
if (update) { this._buffer[this._buffer.Count - 1] = d.v; }
else { this._buffer.Add(d.v); }
if (update) { this._buffer[this._buffer.Count - 1] = TValue.v; }
else { this._buffer.Add(TValue.v); }
if (this._buffer.Count > this._p && this._p != 0) { this._buffer.RemoveAt(0); }
double _sma = 0;
@@ -37,7 +37,7 @@ public class VAR_Series : Single_TSeries_Indicator
for (int i = 0; i < this._buffer.Count; i++) { _svar += (this._buffer[i] - _sma) * (this._buffer[i] - _sma); }
_svar /= (this._buffer.Count > 1) ? this._buffer.Count - 1 : 1; // Bessel's correction
var result = (d.t, (this.Count < this._p - 1 && this._NaN) ? double.NaN : _svar);
var result = (TValue.t, (this.Count < this._p - 1 && this._NaN) ? double.NaN : _svar);
base.Add(result, update);
}
}