Files
QuanTAlib/quantower/Statistics/PercentileIndicator.cs
T
Miha Kralj 58d72c06ca Squash
dotcover

s1

.sln

s1

s1

s2

s3

s4

s5

s1

s2

x

x2

x3

x4

x5

x6

x1

sonarcube cleanup1

sonarcube cleanup2

sonarcube cleanup 3

fixes

q

q

q

q

q

q

q

q

q1

q2

q

q1

codacy 1
2024-09-23 22:08:40 -07:00

27 lines
790 B
C#

using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class PercentileIndicator : IndicatorBase
{
[InputParameter("Period", sortIndex: 1, 2, 2000, 1, 0)]
public int Period { get; set; } = 20;
[InputParameter("Percent", sortIndex: 2, 0, 100, 1, 0)]
public double Percent { get; set; } = 50;
private Percentile? percentile;
protected override AbstractBase QuanTAlib => percentile!;
public override string ShortName => $"PERCENTILE {Period} {Percent:F0}% : {SourceName}";
public PercentileIndicator()
{
Name = "PERCENTILE - n-th Percentile ";
SeparateWindow = false;
}
protected override void InitIndicator()
{
percentile = new(Period, Percent);
MinHistoryDepths = percentile.WarmupPeriod;
}
}