ta.rci
Measure how steadily a series has risen or fallen over the last n bars, from -100 to 100.
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.
| Name | Kind | Type | Default | Range | Description |
|---|---|---|---|---|---|
source | Series | number | - | - | The series to read. |
length | Constant | number | 9 | 2 to 10000 | Window in observed bars. |
Output
| Name | Type |
|---|---|
value | number |
Warm-up and missing values
- Warm-up
lengthbars. Names in the warm-up are this operator’s parameters.- Missing values
- Returns na until
lengthconsecutive non-na observations are in the window. An na resets the accumulation. A window of one repeated value also gives na.
Example
ta.rci(close, 9)plot(ta.rci(close, 9), "Rank correlation 9")