This commit is contained in:
Miha Kralj
2024-10-04 21:31:25 -07:00
parent 99a3785d72
commit 30d93e724d
10 changed files with 413 additions and 1 deletions
@@ -0,0 +1,28 @@
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();
}
}