mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-14 16:48:04 +00:00
Periods -> Period, DataSource attribute
This commit is contained in:
@@ -5,15 +5,15 @@ namespace QuanTAlib;
|
||||
|
||||
public class CviIndicator : Indicator, IWatchlistIndicator
|
||||
{
|
||||
[InputParameter("Periods", sortIndex: 1, 1, 2000, 1, 0)]
|
||||
public int Periods { get; set; } = 20;
|
||||
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
|
||||
public int Period { get; set; } = 20;
|
||||
|
||||
[InputParameter("Show cold values", sortIndex: 21)]
|
||||
public bool ShowColdValues { get; set; } = true;
|
||||
|
||||
private Cvi? cvi;
|
||||
protected LineSeries? CviSeries;
|
||||
public int MinHistoryDepths => Math.Max(5, Periods * 2);
|
||||
public int MinHistoryDepths => Math.Max(5, Period * 2);
|
||||
int IWatchlistIndicator.MinHistoryDepths => MinHistoryDepths;
|
||||
|
||||
public CviIndicator()
|
||||
@@ -22,13 +22,13 @@ public class CviIndicator : Indicator, IWatchlistIndicator
|
||||
Description = "Measures the volatility of a financial instrument by comparing the spread between the high and low prices.";
|
||||
SeparateWindow = true;
|
||||
|
||||
CviSeries = new($"CVI {Periods}", color: IndicatorExtensions.Volatility, 2, LineStyle.Solid);
|
||||
CviSeries = new($"CVI {Period}", color: IndicatorExtensions.Volatility, 2, LineStyle.Solid);
|
||||
AddLineSeries(CviSeries);
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
cvi = new Cvi(Periods);
|
||||
cvi = new Cvi(Period);
|
||||
base.OnInit();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CviIndicator : Indicator, IWatchlistIndicator
|
||||
|
||||
#pragma warning disable CA1416 // Validate platform compatibility
|
||||
|
||||
public override string ShortName => $"CVI ({Periods})";
|
||||
public override string ShortName => $"CVI ({Period})";
|
||||
|
||||
public override void OnPaintChart(PaintChartEventArgs args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user