Files
QuanTAlib/quantower/Averages/JmaIndicator.cs
T

27 lines
710 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 JmaIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 2, 2000, 1, 0)]
public int Period { get; set; } = 10;
[InputParameter("Phase", sortIndex: 2, -100, 100, 1, 0)]
2024-09-24 16:41:26 -07:00
public int Phase { get; set; } = 0;
2024-09-22 17:31:24 -07:00
private Jma? ma;
protected override AbstractBase QuanTAlib => ma!;
public override string ShortName => $"JMA {Period} : {Phase} : {SourceName}";
2024-09-24 16:41:26 -07:00
public JmaIndicator() : base()
2024-09-22 17:31:24 -07:00
{
Name = "JMA - Jurik Moving Average";
}
protected override void InitIndicator()
{
ma = new Jma(period: Period, phase: (double)Phase);
2024-09-24 16:41:26 -07:00
base.InitIndicator();
2024-09-22 17:31:24 -07:00
}
}