Files
QuanTAlib/quantower/Statistics/MaxIndicator.cs
T

29 lines
823 B
C#
Raw Normal View History

2024-09-22 17:31:24 -07:00
using TradingPlatform.BusinessLayer;
2024-09-22 20:10:05 -07:00
namespace QuanTAlib;
2024-09-22 17:31:24 -07:00
public class MaxIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
public int Period { get; set; } = 50;
[InputParameter("Decay to mean", sortIndex: 1, minimum: 0.00, maximum: 100.0, increment: 0.01, decimalPlaces: 2)]
public double Decay { get; set; } = 0.1;
private Max? ma;
protected override AbstractBase QuanTAlib => ma!;
public override string ShortName => $"MAX {Period} : {Decay:F2} : {SourceName}";
2024-09-24 16:41:26 -07:00
public MaxIndicator() : base()
2024-09-22 17:31:24 -07:00
{
Name = "MAX - Maximum value (with decay) ";
}
protected override void InitIndicator()
{
ma = new Max(Period, Decay);
MinHistoryDepths = ma.WarmupPeriod;
Source = 2;
2024-09-24 16:41:26 -07:00
base.InitIndicator();
2024-09-22 17:31:24 -07:00
}
}