Files
QuanTAlib/quantower/Averages/SmaIndicator.cs
T
2024-10-11 18:02:09 -07:00

25 lines
686 B
C#

using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class SmaIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
public int Period { get; set; } = 10;
private Sma? ma;
protected override AbstractBase QuanTAlib => ma!;
public override string ShortName => $"SMA {Period} : {SourceName}";
public SmaIndicator() : base()
{
Name = "SMA - Simple Moving Average";
Description = "Basic moving average that calculates the arithmetic mean of prices over a specified period.";
}
protected override void InitIndicator()
{
ma = new Sma(Period);
base.InitIndicator();
}
}