RSI summarizes the balance of recent upward and downward changes. Its conventional thresholds describe momentum conditions, not compulsory orders.
Know what the scale measures
Wilder RSI compares smoothed upward changes with smoothed downward changes, usually over 14 periods. The familiar 70/30 levels are conventional descriptions, not a law of price behavior. In a strong trend, RSI can stay elevated or depressed while price continues in that direction.
Fidelity’s RSI definition is the background source. Our 80-bar synthetic chart shows how a long flat segment followed by gains can produce a high reading. The dataset is deliberately simple and supplies no evidence that a threshold-based strategy makes money.
Background source: Fidelity: RSI definition, formula and trend limitations
Use 14 changes, which need 15 closing prices
For the first RSI14, calculate changes between successive closes, separate gains from absolute losses, and average each over the first 14 changes. That requires 15 closes. In our convention, the first result appears on bar 15. RSI =100 −100/(1 + average gain/average loss).
Subsequent averages use Wilder smoothing: (previous average ×13 + new gain or loss)/14. They are not re-created as a fresh simple average of only the last 14 changes each time. Different smoothing or initialization choices can explain a mismatch with another platform.
Reproduce 70, then 63.1944
The separate hand worksheet starts at 100. Its next 14 changes are seven +1 moves, three −1 moves and four unchanged closes. Total gains are 7 and total absolute losses 3, so the averages are 7/14 and 3/14. Their ratio is 7/3 and the first RSI is 70; the fifteenth close is 104.
One more close at 103 adds a loss of 1. Average gain becomes 6.5/14; average loss becomes 53/196. The next RSI is 100 ×91/144 =63.19444444. This hand worksheet is separate from the 80-bar chart, so do not expect the same bar numbers and prices between the two files.
| Hand example | Input | RSI14 |
|---|---|---|
| First14 changes | +7 total gains,3 total losses | 70.00000000 |
| Next close | 104 →103 | 63.19444444 |
| All flat seed | Zero gains and losses | 50 by stated convention |
Handle flat and one-sided data explicitly
With positive average gains and zero average loss, this implementation returns 100; with zero gains and positive losses it returns 0. If both averages are zero, it displays 50 as an explicit convention rather than dividing zero by zero. Other systems may handle that flat seed differently. Warm-up cells remain blank.
The 80-bar example stays flat long enough to show the convention, then reacts sharply to a gain. That artificial jump is a teaching device. For real comparisons, use the same adjusted data, interval, smoothing and available history; do not interpret every early mismatch as a faulty broker chart.
Read extremes and divergences as conditions
An RSI above 70 means upward changes have dominated its recent smoothed history under the setting. It does not say the next return must be negative. An RSI below 30 likewise does not set a floor on loss. A divergence needs clearly defined price and RSI pivots and can fail or persist.
Before turning a description into a rule, specify the trigger, completed-bar confirmation, costs and invalidation. If a trend keeps making new highs, automatically selling solely because the first reading exceeded 70 could remove a position long before the trend ends; automatically averaging down on 30 can increase exposure to a falling stock.
Combine it with a defined observation
Record the timeframe, price structure and what RSI adds to your explanation. Compare volume separately. MACD and RSI can agree because both are derived from price; their agreement does not prove independent predictive information.
Use the hand CSV to check the formula and the longer CSV to follow the curve. Neither is a live signal service or a Numbrite trade-import file. The next guide explains what activity volume can and cannot tell you.
Download the learning data and worksheets
Put it into practice
Reproduce the short hand sequence first, then compare the longer chart without treating its thresholds as orders.
Read the volume example