Relative strength index
Whether recent close-to-close moves were mostly up or down, from -1 (all down) to +1 (all up).
Over the last N bars it adds up the close-to-close moves that went up and the ones that went down, then reports (up minus down) divided by (up plus down). +1 means every move in the window went up, -1 every move went down, and 0 an even split. It is the classic RSI ratio rescaled to -1 to +1, but it sums plain rolling totals instead of using Wilder's smoothing, so each bar drops out of the window sharply.
How to read it
- The line sits in its own pane below the price, centred on zero and bounded by -1 and +1.
- Above +0.5 the recent moves were mostly up; below -0.5 mostly down. On SPY one-minute bars with the default 14 bars, it sits beyond ±0.58 about one bar in ten.
- A line pinned near +1 or -1 means one direction dominated the window. It does not by itself say price will reverse.
What it outputs
- RSI
- Net balance of recent close-to-close moves, from -1 (all down) to +1 (all up).
Settings
- Window
- How many bars the up and down totals are summed over. Shorter windows swing hard on single moves and hit +1 or -1 when a few bars agree; longer windows smooth out and leave the middle only on sustained runs.
Pitfalls
- A window with no price change at all reads +1, not 0: the code returns +1 whenever the down total is zero, so a dead-flat stretch looks maximally bullish.
- Unless the optional volume input is connected, each move counts the same whatever its volume.
- The line is near zero whatever the price level (correlation with close about 0.04): it reads the direction of recent moves, not whether price is high or low.