Connors RSI
Install and import#
npm install fintech-algorithmsimport { connorsRsi } from "fintech-algorithms/technical-indicators/momentum/connors-rsi";Signature#
connorsRsi(close, pp, sp, rp)The average of three components: RSI of price, RSI of the up/down streak length, and the percentile rank of the latest return. Designed for short-horizon mean reversion rather than trend.
Parameters#
| Name | Type | Notes |
|---|---|---|
close | number[] | Per-bar closing prices, chronological. |
pp | number | RSI period applied to price. min: 1 · integer: true |
sp | number | RSI period applied to the streak-length series. min: 1 · integer: true |
rp | number | Lookback for the percentile rank of the most recent return. min: 1 · integer: true |
Returns#
Record<string, (number | null)[]> · length same-as-input
Parallel series: price_rsi, streak, streak_rsi, percent_rank and connors_rsi.
Warm-up#
The first the longest of the three components positions are null.
Errors#
- When any period is < 1 or is not an integer — throws RangeError
Complexity: time O(n × rp),
space O(n).
Worked example#
executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.
Input#
[100, 100.999214, 102.324548, 103.755998, 105.030823, 105.911843]Showing 6 of 120 elements.
Call#
connorsRsi(close, pp, sp, rp)Returns#
object with 5 fields: price_rsi, streak, streak_rsi, percent_rank, connors_rsi
{
"price_rsi": [null, null, null, 100, 100, 100],
"streak": [0, 1, 2, 3, 4, 5],
"streak_rsi": [null, null, 100, 100, 100, 100],
"percent_rank": [null, null, null, null, null, null],
"connors_rsi": [null, null, null, null, null, null]
}Other exports#
This module also exports
rsi, stochastic, stochasticRsi, williamsR, cci, ultimateOscillator, tsi. Every module additionally exports run as an alias of its
primary function, and a meta object carrying its catalog id, domain, family,
shape and article URL.
Diagrams#
Calculation flow#
Calculation flow
flowchart LR
A["Finalized strictly positive finalized close"] --> B["Validate order, alignment, and finite values"]
B --> C["Price RSI"]
C --> D["Streak and streak RSI"]
D --> E["Prior-only return rank"]
E --> F{"History and denominator valid?"}
F -- "No · short history" --> G["warming-up + reason"]
F -- "No · no finite scale" --> H["undefined + reason"]
F -- "Yes" --> I["Three-way mean"]
I --> J["ready + aligned component trace"]
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- ConnorsRelativeStrengthIndex.cs — QuantConnect LEAN
- New Concepts in Technical Trading Systems — J. Welles Wilder / Windsor Books
- Claim-role ledger
- Evidence boundary