mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-21 12:08:05 +00:00
Periods -> Period, DataSource attribute
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user