Files
QuanTAlib/quantower/Volatility/HistoricalIndicator.cs
T
Miha Kralj 30d93e724d RVI
2024-10-04 21:31:25 -07:00

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();
}
}