Docs

ta.rci

Measure how steadily a series has risen or fallen over the last n bars, from -100 to 100.

itm
ta.rci(source, length)

Rank correlation index: the Spearman correlation between the rank of the value and the rank of time over the last length bars, scaled to -100..100. It reads +100 when every bar is higher than the one before and -100 when every bar is lower. Equal values share the mean of the ranks they span. A window of one repeated value has no order and gives na. length must be at least 2.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeDefaultRangeDescription
sourceSeriesnumber--The series to read.
lengthConstantnumber92 to 10000Window in observed bars.

Output

NameType
valuenumber

Warm-up and missing values

Warm-up
length bars. Names in the warm-up are this operator’s parameters.
Missing values
Returns na until length consecutive non-na observations are in the window. An na resets the accumulation. A window of one repeated value also gives na.

Example

itm
ta.rci(close, 9)
itm
plot(ta.rci(close, 9), "Rank correlation 9")