mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-07-31 10:57:43 +00:00
28 lines
860 B
C#
28 lines
860 B
C#
using TradingPlatform.BusinessLayer;
|
|
namespace QuanTAlib;
|
|
|
|
public class HistoricalIndicator : IndicatorBase
|
|
{
|
|
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
|
|
public int Period { get; set; } = 20;
|
|
|
|
[InputParameter("Annualized", sortIndex: 2)]
|
|
public bool IsAnnualized { get; set; } = true;
|
|
|
|
private Historical? historical;
|
|
protected override AbstractBase QuanTAlib => historical!;
|
|
public override string ShortName => $"Historical Volatility {Period}{(IsAnnualized ? " - Annualized" : "")} : {SourceName}";
|
|
|
|
public HistoricalIndicator() : base()
|
|
{
|
|
Name = "HV - Historical Volatility";
|
|
SeparateWindow = true;
|
|
}
|
|
|
|
protected override void InitIndicator()
|
|
{
|
|
historical = new(Period, IsAnnualized);
|
|
MinHistoryDepths = historical.WarmupPeriod;
|
|
base.InitIndicator();
|
|
}
|
|
} |