EMA completed

This commit is contained in:
Miha
2024-07-31 09:11:05 -04:00
parent e30701c723
commit 60c2331cc0
10 changed files with 159 additions and 175 deletions
+10 -2
View File
@@ -1,4 +1,7 @@
namespace QuanTAlib;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public class CircularBuffer: IEnumerable<double>
{
@@ -30,7 +33,12 @@ public class CircularBuffer: IEnumerable<double>
}
} else {
// If isNew is false, just update the last item
_buffer[(_start + _size - 1) % Capacity] = item;
if (_size > 0) {
_buffer[(_start + _size - 1) % Capacity] = item;
} else {
_buffer[_start] = item;
_size = 1;
}
}
}