mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 12:38:06 +00:00
EMA update
This commit is contained in:
@@ -29,6 +29,7 @@ public class SMA_Series : Single_TSeries_Indicator {
|
||||
public override void Add((DateTime t, double v) TValue, bool update) {
|
||||
if (update) { _sum = _oldsum; }
|
||||
else { _oldsum = _sum; _len++; }
|
||||
|
||||
_sum += TValue.v;
|
||||
if (_period != 0 && _len > _period) {
|
||||
_sum -= (_data[base.Count - _period - (update ? 1 : 0)].v);
|
||||
|
||||
Reference in New Issue
Block a user