Afirma + documentation

This commit is contained in:
Miha Kralj
2024-09-24 16:28:16 -07:00
parent 990c7b4cf0
commit 4b25801d52
66 changed files with 8792 additions and 3061 deletions
+25
View File
@@ -0,0 +1,25 @@
using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class AfirmaIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
public int Period { get; set; } = 10;
[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 AfirmaIndicator()
{
Name = "AFIRMA - Adaptive Filtering Integrated Recursive Moving Average";
Description = "Adaptive Filtering Integrated Recursive Moving Average";
}
protected override void InitIndicator()
{
ma = new Afirma(period: Period, alpha: Alpha);
}
}
+4 -2
View File
@@ -5,10 +5,12 @@ public class DsmaIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
public int Period { get; set; } = 10;
[InputParameter("Scale factor", sortIndex: 2, minimum: 0.01, maximum: 1.0, increment: 0.01, decimalPlaces: 2)]
public double Scale { get; set; } = 0.5;
private Dsma? ma;
protected override AbstractBase QuanTAlib => ma!;
public override string ShortName => $"DSMA {Period} : {SourceName}";
public override string ShortName => $"DSMA {Period} : {Scale:F2} : {SourceName}";
public DsmaIndicator()
{
@@ -17,7 +19,7 @@ public class DsmaIndicator : IndicatorBase
protected override void InitIndicator()
{
ma = new Dsma(Period);
ma = new Dsma(Period, Scale);
MinHistoryDepths = ma.WarmupPeriod;
}
}