This commit is contained in:
Miha Kralj
2024-11-05 05:52:54 -08:00
parent 5b333bd2ec
commit f582db2c4c
23 changed files with 85 additions and 137 deletions
+2 -5
View File
@@ -28,9 +28,7 @@ namespace QuanTAlib;
/// </remarks>
public class Wma : AbstractBase
{
private readonly int _period;
private readonly Convolution _convolution;
private readonly double[] _kernel;
/// <param name="period">The number of data points used in the WMA calculation.</param>
/// <exception cref="ArgumentException">Thrown when period is less than 1.</exception>
@@ -40,11 +38,10 @@ public class Wma : AbstractBase
{
throw new System.ArgumentException("Period must be greater than or equal to 1.", nameof(period));
}
_period = period;
_kernel = GenerateWmaKernel(_period);
double[] _kernel = GenerateWmaKernel(period);
_convolution = new Convolution(_kernel);
Name = "Wma";
WarmupPeriod = _period;
WarmupPeriod = period;
Init();
}