RankCorrelationIndex

StockSharp.Algo.Indicators

Rank Correlation Index (Spearman's Rank Correlation Coefficient). Compares price movement ranking vs time ranking inside the window.

Inherits: DecimalLengthIndicator

Constructors

RankCorrelationIndex
public RankCorrelationIndex()
rankCorrelationIndex = RankCorrelationIndex()

Initializes a new instance of the RankCorrelationIndex.

Properties

Measure
public override IndicatorMeasures Measure { get; }
value = rankCorrelationIndex.Measure

IndicatorMeasures.

Methods

CalculateSpearmanCorrelation
private static decimal CalculateSpearmanCorrelation(decimal[] ranks1, decimal[] ranks2)
result = RankCorrelationIndex.CalculateSpearmanCorrelation(ranks1, ranks2)

Pearson correlation between two rank arrays (works with ties).

GetRanks
private static decimal[] GetRanks(IList<decimal> values)
result = RankCorrelationIndex.GetRanks(values)

Produce rank array with average rank for ties.

OnProcess
protected override IIndicatorValue OnProcess(IIndicatorValue input)
result = rankCorrelationIndex.OnProcess(input)

To handle the input value.

input
The input value.

Returns: The resulting value.