Files
QuanTAlib/quantower/Averages/AfirmaIndicator.cs
T

37 lines
1.2 KiB
C#
Raw Normal View History

2024-09-24 16:28:16 -07:00
using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class AfirmaIndicator : IndicatorBase
{
2024-09-26 10:44:09 -07:00
[InputParameter("Taps (number of weights)", sortIndex: 1, 1, 2000, 1, 0)]
public int Taps { get; set; } = 6;
[InputParameter("Periods for lowpass cutoff", sortIndex: 2, 1, 2000, 1, 0)]
public int Periods { get; set; } = 6;
[InputParameter("Window Type", sortIndex: 3, variants: [
"Rectangular", Afirma.WindowType.Rectangular,
"Hanning", Afirma.WindowType.Hanning1,
"Hamming", Afirma.WindowType.Hanning2,
"Blackman", Afirma.WindowType.Blackman,
"Blackman-Harris", Afirma.WindowType.BlackmanHarris
])]
public Afirma.WindowType Window { get; set; } = Afirma.WindowType.Hanning1;
2024-09-24 16:28:16 -07:00
private Afirma? ma;
protected override AbstractBase QuanTAlib => ma!;
2024-09-26 10:44:09 -07:00
public override string ShortName => $"AFIRMA {Taps}:{Periods}:{Window} : {SourceName}";
2024-09-24 16:28:16 -07:00
public AfirmaIndicator()
{
2024-09-26 10:44:09 -07:00
Name = "AFIRMA - Adaptive Finite Impulse Response Moving Average";
Description = "Adaptive Finite Impulse Response Moving Average with ARMA component";
2024-09-24 16:28:16 -07:00
}
protected override void InitIndicator()
{
2024-09-26 10:44:09 -07:00
ma = new Afirma(periods: Periods, taps: Taps, window: Window);
2024-09-24 16:28:16 -07:00
}
}