Files
QuanTAlib/quantower/Averages/EmaIndicator.cs
T

27 lines
715 B
C#
Raw Normal View History

2024-09-22 17:31:24 -07:00
using TradingPlatform.BusinessLayer;
2024-09-23 22:08:40 -07:00
namespace QuanTAlib;
2024-09-22 17:31:24 -07:00
public class EmaIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
public int Period { get; set; } = 10;
[InputParameter("Use SMA for warmup", sortIndex: 5)]
public bool UseSma { get; set; } = false;
private Ema? ma;
protected override AbstractBase QuanTAlib => ma!;
public override string ShortName => $"EMA {Period} : {SourceName}";
2024-09-23 22:08:40 -07:00
public EmaIndicator()
2024-09-22 17:31:24 -07:00
{
Name = "EMA - Exponential Moving Average";
Description = "Exponential Moving Average";
}
protected override void InitIndicator()
{
ma = new Ema(period: Period, useSma: UseSma);
}
}