Slope and Curvature

This commit is contained in:
Miha Kralj
2024-09-30 18:59:05 -07:00
parent 697fa19cfa
commit 11100b0685
7 changed files with 328 additions and 23 deletions
@@ -0,0 +1,24 @@
using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class CurvatureIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 2, 2000, 1, 0)]
public int Period { get; set; } = 20;
private Curvature? curvature;
protected override AbstractBase QuanTAlib => curvature!;
public override string ShortName => $"CURVATURE {Period} : {SourceName}";
public CurvatureIndicator()
{
Name = "CURVATURE - Rate of Change of Slope";
SeparateWindow = true;
}
protected override void InitIndicator()
{
curvature = new(Period);
MinHistoryDepths = curvature.WarmupPeriod;
}
}
+24
View File
@@ -0,0 +1,24 @@
using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class SlopeIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 2, 2000, 1, 0)]
public int Period { get; set; } = 20;
private Slope? slope;
protected override AbstractBase QuanTAlib => slope!;
public override string ShortName => $"SLOPE {Period} : {SourceName}";
public SlopeIndicator()
{
Name = "SLOPE - Trend Slope";
SeparateWindow = true;
}
protected override void InitIndicator()
{
slope = new(Period);
MinHistoryDepths = slope.WarmupPeriod;
}
}