mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-07 21:47:43 +00:00
dependabot
This commit is contained in:
@@ -3,23 +3,35 @@ namespace QuanTAlib;
|
||||
|
||||
public class AfirmaIndicator : IndicatorBase
|
||||
{
|
||||
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
|
||||
public int Period { get; set; } = 10;
|
||||
[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;
|
||||
|
||||
[InputParameter("Alpha", sortIndex: 2, 0.01, 0.99, 0.01, 2)]
|
||||
public double Alpha { get; set; } = 0.1;
|
||||
private Afirma? ma;
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"AFIRMA {Period} : {SourceName}";
|
||||
public override string ShortName => $"AFIRMA {Taps}:{Periods}:{Window} : {SourceName}";
|
||||
|
||||
public AfirmaIndicator()
|
||||
{
|
||||
Name = "AFIRMA - Adaptive Filtering Integrated Recursive Moving Average";
|
||||
Description = "Adaptive Filtering Integrated Recursive Moving Average";
|
||||
Name = "AFIRMA - Adaptive Finite Impulse Response Moving Average";
|
||||
Description = "Adaptive Finite Impulse Response Moving Average with ARMA component";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
ma = new Afirma(period: Period, alpha: Alpha);
|
||||
ma = new Afirma(periods: Periods, taps: Taps, window: Window);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using TradingPlatform.BusinessLayer;
|
||||
namespace QuanTAlib;
|
||||
|
||||
public class AmaIndicator : IndicatorBase
|
||||
{
|
||||
[InputParameter("Period", sortIndex: 1, 2, 2000, 1, 0)]
|
||||
public int Period { get; set; } = 10;
|
||||
|
||||
[InputParameter("Alpha", sortIndex: 2, minimum: -0.01, maximum: 1.0, increment: 0.01, decimalPlaces: 2)]
|
||||
public double Alpha { get; set; } = 0.1;
|
||||
private Ama? ma;
|
||||
protected override AbstractBase QuanTAlib => ma!;
|
||||
public override string ShortName => $"AMA {Period} : {Alpha} : {SourceName}";
|
||||
|
||||
|
||||
public AmaIndicator()
|
||||
{
|
||||
Name = "AMA - Adaptive Moving Average";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
ma = new Ama(period: Period, alpha: Alpha);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user