Periods -> Period, DataSource attribute

This commit is contained in:
Miha Kralj
2024-11-08 17:11:18 -08:00
parent 61a16bd5e3
commit 5bcdf8d614
75 changed files with 370 additions and 1053 deletions
+6 -6
View File
@@ -5,15 +5,15 @@ namespace QuanTAlib;
public class AdxrIndicator : Indicator, IWatchlistIndicator
{
[InputParameter("Periods", sortIndex: 1, 1, 2000, 1, 0)]
public int Periods { get; set; } = 14;
[InputParameter("Period", sortIndex: 1, 1, 2000, 1, 0)]
public int Period { get; set; } = 14;
[InputParameter("Show cold values", sortIndex: 21)]
public bool ShowColdValues { get; set; } = true;
private Adxr? adxr;
protected LineSeries? AdxrSeries;
public int MinHistoryDepths => Math.Max(5, Periods * 4); // Need extra periods for ADXR calculation
public int MinHistoryDepths => Math.Max(5, Period * 4); // Need extra periods for ADXR calculation
int IWatchlistIndicator.MinHistoryDepths => MinHistoryDepths;
public AdxrIndicator()
@@ -22,13 +22,13 @@ public class AdxrIndicator : Indicator, IWatchlistIndicator
Description = "Measures trend strength by comparing current ADX with historical ADX values.";
SeparateWindow = true;
AdxrSeries = new($"ADXR {Periods}", Color.Blue, 2, LineStyle.Solid);
AdxrSeries = new($"ADXR {Period}", Color.Blue, 2, LineStyle.Solid);
AddLineSeries(AdxrSeries);
}
protected override void OnInit()
{
adxr = new Adxr(Periods);
adxr = new Adxr(Period);
base.OnInit();
}
@@ -43,7 +43,7 @@ public class AdxrIndicator : Indicator, IWatchlistIndicator
#pragma warning disable CA1416 // Validate platform compatibility
public override string ShortName => $"ADXR ({Periods})";
public override string ShortName => $"ADXR ({Period})";
public override void OnPaintChart(PaintChartEventArgs args)
{