mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 03:58:04 +00:00
Squash
dotcover s1 .sln s1 s1 s2 s3 s4 s5 s1 s2 x x2 x3 x4 x5 x6 x1 sonarcube cleanup1 sonarcube cleanup2 sonarcube cleanup 3 fixes q q q q q q q q q1 q2 q q1 codacy 1
This commit is contained in:
@@ -8,12 +8,13 @@ public class Maaf : AbstractBase
|
||||
{
|
||||
private readonly CircularBuffer _priceBuffer;
|
||||
private readonly CircularBuffer _smoothBuffer;
|
||||
private double _prevFilter, _prevValue2, _threshold;
|
||||
private double _prevFilter, _prevValue2;
|
||||
private readonly double _threshold;
|
||||
private double _p_prevFilter, _p_prevValue2;
|
||||
|
||||
private readonly int _period;
|
||||
|
||||
public Maaf(int Period = 39, double Threshold = 0.002)
|
||||
public Maaf(int Period = 39, double Threshold = 0.002)
|
||||
{
|
||||
_period = Period;
|
||||
_threshold = Threshold;
|
||||
@@ -94,7 +95,10 @@ public class Maaf : AbstractBase
|
||||
length -= 2;
|
||||
}
|
||||
|
||||
if (length < 3) length = 3;
|
||||
if (length < 3)
|
||||
{
|
||||
length = 3;
|
||||
}
|
||||
|
||||
double finalAlpha = 2.0 / (length + 1);
|
||||
double filter = finalAlpha * (smooth - _prevFilter) + _prevFilter;
|
||||
|
||||
Reference in New Issue
Block a user