mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-07-28 09:47:43 +00:00
23 lines
627 B
C#
23 lines
627 B
C#
using TradingPlatform.BusinessLayer;
|
|
using QuanTAlib;
|
|
|
|
public class ModeIndicator : IndicatorBase
|
|
{
|
|
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
|
|
public int Period { get; set; } = 50;
|
|
|
|
private Mode? mode;
|
|
protected override AbstractBase QuanTAlib => mode!;
|
|
public override string ShortName => $"MODE {Period} : {SourceName}";
|
|
public ModeIndicator() : base()
|
|
{
|
|
Name = "MODE - Most frequent historical value";
|
|
}
|
|
|
|
protected override void InitIndicator()
|
|
{
|
|
mode = new Mode(Period);
|
|
MinHistoryDepths = mode.WarmupPeriod;
|
|
base.InitIndicator();
|
|
}
|
|
} |