mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-17 01:58:06 +00:00
ZLEMA bug + crossovers example
This commit is contained in:
@@ -36,9 +36,10 @@ public class ZLEMA_Series : Single_TSeries_Indicator
|
||||
|
||||
public override void Add((System.DateTime t, double v) TValue, bool update)
|
||||
{
|
||||
int _lag = (int)((_p - 1) * 0.5);
|
||||
_lag = (this.Count - _lag < 0) ? 0 : this.Count - _lag;
|
||||
double _zl = TValue.v + (TValue.v - _data[_lag].v);
|
||||
int _lag = (int)((_p-1) * 0.5);
|
||||
_lag = (this.Count-_lag < 0) ? 0 : this.Count-_lag;
|
||||
double _zl = TValue.v + (TValue.v - _data[_lag].v);
|
||||
|
||||
double _ema = 0;
|
||||
if (update)
|
||||
{ this._lastema = this._lastlastema; }
|
||||
@@ -59,7 +60,7 @@ public class ZLEMA_Series : Single_TSeries_Indicator
|
||||
}
|
||||
else
|
||||
{
|
||||
_ema = TValue.v * this._k + this._lastema * this._k1m;
|
||||
_ema = _zl * this._k + this._lastema * this._k1m;
|
||||
}
|
||||
|
||||
this._lastlastema = this._lastema;
|
||||
|
||||
Reference in New Issue
Block a user