mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 02:58:05 +00:00
New version merge
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using TradingPlatform.BusinessLayer;
|
||||
using QuanTAlib;
|
||||
|
||||
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}";
|
||||
|
||||
public EmaIndicator() : base()
|
||||
{
|
||||
Name = "EMA - Exponential Moving Average";
|
||||
Description = "Exponential Moving Average";
|
||||
}
|
||||
|
||||
protected override void InitIndicator()
|
||||
{
|
||||
base.InitIndicator();
|
||||
ma = new Ema(period: Period, useSma: UseSma);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user