mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 13:38:05 +00:00
COVAR
semver fix VAR test fix new: COVAR, ZSCORE, CORR, LINREG versioning refactoring
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
namespace QuanTAlib;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
/* <summary>
|
||||
ZLEMA: Zero Lag Exponential Moving Average
|
||||
@@ -45,18 +46,8 @@ public class ZLEMA_Series : Single_TSeries_Indicator
|
||||
{ this._lastema = this._lastlastema; }
|
||||
if (this.Count < this._p)
|
||||
{
|
||||
if (update)
|
||||
{ this._buffer[this._buffer.Count - 1] = _zl; }
|
||||
else
|
||||
{
|
||||
this._buffer.Add(_zl);
|
||||
}
|
||||
if (this._buffer.Count > this._p)
|
||||
{ this._buffer.RemoveAt(0); }
|
||||
|
||||
for (int i = 0; i < this._buffer.Count; i++)
|
||||
{ _ema += this._buffer[i]; }
|
||||
_ema /= this._buffer.Count;
|
||||
Add_Replace_Trim(_buffer, _zl, _p, update);
|
||||
_ema = _buffer.Average();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -66,7 +57,6 @@ public class ZLEMA_Series : Single_TSeries_Indicator
|
||||
this._lastlastema = this._lastema;
|
||||
this._lastema = _ema;
|
||||
|
||||
var ret = (TValue.t, this.Count < this._p - 1 && this._NaN ? double.NaN : _ema);
|
||||
base.Add(ret, update);
|
||||
}
|
||||
base.Add((TValue.t, _ema), update, _NaN);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user