The relative strength index, RSI, is the indicator that comes up when someone says a stock is "oversold". It is a number between 0 and 100, drawn under the chart, and it has two folk readings that contradict each other. One says a low RSI means the price has fallen too far and will bounce. The other says a high RSI means strength and the trend will continue. Both are repeated with confidence. Here I compute RSI by hand from real closes so you see where the number comes from, write both readings as exact rules, test them on the Nifty 50 price index with costs, and report what happened, including that all of them trailed holding. Education, not advice.

6By the end you can

  1. Compute Wilder's RSI(14) step by step from a list of closes, including the smoothing step.
  2. Say what RSI measures, and what a reading of 30 or 70 does and does not mean.
  3. Write the oversold rule, a momentum reading and a short period RSI(2) rule as exact entry and exit lines.
  4. Read six rules against buy and hold on the same dates and count their trades.
  5. Explain why the same indicator can be a reversal signal at one horizon and a momentum signal at another.
  6. Say why a rule that is in the market 9% of the time has too few trades to judge.
A single ray of light passes through a tilted glass slab and fans out into teal, blue and violet bands

What RSI measures

J. Welles Wilder Jr. introduced the relative strength index in his 1978 book New Concepts in Technical Trading Systems, published by Trend Research, and suggested a period of 14. The name is confusing, since it does not compare one stock with another. It compares a stock with itself: among recent daily moves, how large were the gains compared with the losses?

Relative strength index
RS = average gain
/ average loss
RSI = 100 - 100 / (1 + RS)
Gains and losses are daily changes in the close, counted as positive numbers. If the average loss is zero, RSI is 100; equal average gains and losses give 50.
Read one more paragraph, 57 words

If the average gain equals the average loss, RS is 1 and RSI is 50. If gains are three times losses, RS is 3 and RSI is 75. If the stock only fell, the average gain is zero and RSI is 0. So RSI is a bounded way of saying what share of recent movement was upward.

RSI by hand, from real closes

Here is RSI(14) worked from the first 15 closes in the file, 1 Jan 2021 to 21 Jan 2021. Fourteen daily changes give fourteen gains or losses. The first column is the date, then the close, then the gain on days when the index rose and the loss on days when it fell. Points of the index, not percent.

Date (2021)CloseGainLoss
4 Jan14,132.90114.400.00
5 Jan14,199.5066.600.00
6 Jan14,146.250.0053.25
7 Jan14,137.350.008.90
8 Jan14,347.25209.900.00
11 Jan14,484.75137.500.00
12 Jan14,563.4578.700.00
13 Jan14,564.851.400.00
14 Jan14,595.6030.750.00
15 Jan14,433.700.00161.90
18 Jan14,281.300.00152.40
19 Jan14,521.15239.850.00
20 Jan14,644.70123.550.00
21 Jan14,590.350.0054.35

The term this section turns on: RSI

The term this section turns on: RSIThe term this section turns on: RSI. RSI: Relative strength index: 100 - 100 / (1 + RS), where RS is the average gain divided by the average loss over n days.RSIRelative strength index: 100 - 100 / (1 + RS),where RS is the average gain divided by theaverage loss over n days.
From the module glossary; every term is in the Learn glossary too. Source: Module 23.4, RSI as a Rule.

Test script module-23-4. Nifty 50 price index closes, the first 15 in the file (the 1 Jan 2021 close, 14,018.50, is the starting point for the first change). Gain and loss in index points.

1
Add the gains and the losses
The 14 gains add to 1,002.65 points and the 14 losses to 430.80 points. Days with no move in one direction count as zero.
2
Average them over 14 days
Average gain 1,002.65 / 14 = 71.6179. Average loss 430.80 / 14 = 30.7714.
3
Form RS and RSI
RS = 71.6179 / 30.7714 = 2.3274. RSI = 100 - 100 / (1 + 2.3274) = 69.95.
Wilder's smoothing
New average gain =
(old avg gain x 13
+ new gain) / 14
(same for the loss)
For a period n, replace 13 and 14 with n - 1 and n. The first average is the plain average of the first n changes, as above.
Read 5 more paragraphs, 327 words

That is the first RSI(14) in the series, on 21 Jan 2021: 69.95, just under the 70 line that is called overbought. Notice what it says in words: in the last 14 sessions, the average up day was about 2.3 times the average down day.

From the next day on, Wilder smooths instead of recomputing the sums. Each new day's average is 13 parts of the old average plus one part of the new day.

The next session, 22 Jan 2021, closed at 14,371.90, down 218.45 points. The gain for the day is zero and the loss is 218.45. New average gain: (71.6179 x 13 + 0) / 14 = 66.5023. New average loss: (30.7714 x 13 + 218.45) / 14 = 44.1770. RS = 66.5023 / 44.1770 = 1.5054, and RSI = 100 - 100 / (1 + 1.5054) = 60.09. One bad day took the reading from 69.95 to 60.09. The script computes the same two values independently, which is how I check my arithmetic.

Two properties follow from the smoothing. The RSI never reaches 0 or 100 on a long series, because old gains and losses fade and never vanish. And it depends on the whole history from the start, though the weight of old days falls quickly, so the first few readings of a series differ a little from what another system, started on a different day, would show.

The period n sets how fast the gauge moves. With n = 14, one big day shifts the average by a fourteenth of its size. With n = 2, a single day moves the average by half its size, which is why RSI(2) can swing from high to very low within two sessions. A longer period smooths the line and gives fewer readings in the extreme zones; a shorter one swings and gives many. Neither is the correct period. The period is a parameter, and the rest of the module treats it as one.

How often the levels occur

Over all 1,406 closes from 21 Jan 2021 to 30 Sep 2026, the script counts how often RSI(14) crossed the usual lines.

LevelSessionsSeparate episodes
RSI(14) below 303616
RSI(14) below 4020153
RSI(14) above 5086476
RSI(14) above 7013932
The RupeeCase terminal on sample data: Broker positions and gaps: does my broker hold what the app says?
Watch in the terminal: does my broker hold what the app says? A short tutorial on sample data.

Test script module-23-4. Nifty 50 price index, all closes from 21 Jan 2021 to 30 Sep 2026. An episode is a run of consecutive sessions at or past the level.

Read 2 more paragraphs, 128 words

Below 30 happened on 36 sessions out of 1,406, in 16 separate episodes. The lowest reading was 21.8 on 4 Mar 2025 and the highest was 85.6 on 16 Sep 2021. On the last close of the window, 30 Sep 2026, RSI(14) was 25.3 and RSI(2) was 5.6. By the folk rule, the index was oversold on the last day of the data. I will show you what the rule did with signals like that.

The point of the table is that the "oversold" event is rare on an index. A stock can be oversold often. An index of 50 large companies moves more slowly, so RSI(14) below 30 needs a sustained slide. Any rule built on it will make few trades, and few trades give few facts.

Three ideas, six rules

I wrote six rules, from three ideas. All are measured over the same dates, 25 Oct 2021 to 30 Sep 2026, because the longest of them needs a 200 day average. In that window buy and hold earned 4.57% a year with a maximum drawdown of -16.5%.

Idea 1: the oversold rule
In: RSI(14) < 30
Out: RSI(14) > 50
Else: stay as you are
A reversal reading. Signal at the close of day t, trade at the close of day t+1, 0.1% per side, cash at 0% when out.
Idea 2: the momentum reading
A: in while RSI(14) > 50
B: in at > 60, out at < 40
A trend reading: strength continues. A has no memory; B waits for a clearer signal before switching. Same timing and costs.
Idea 3: the short period reversal
In: RSI(2) < 10
Out: RSI(2) > 70
Variant 1: only if close >
SMA(200) to enter
Variant 2: out when close
> SMA(5)
A two day RSI is a very fast gauge: two down days in a row can push it near zero. The rule bets on a bounce within days. Same timing and costs.
Read one more paragraph, 50 words

These thresholds are the common textbook ones. I did not tune them, and I tried no others. That matters, because RSI invites tuning: change 30 to 25 and 70 to 75 and the result changes. Every such choice is a coin flip of the kind described in module 23.1.

₹100 in Allcap became about ₹424 in the model

₹100 in Allcap became about ₹424 in the modelAllcap: from 100 at 25 Nov 2022 to 424 at 30 Sep 2026, high 431 at 31 Aug 2026, low 90.8 at 28 Feb 2023. Nifty 50, same window: from 100 at 25 Nov 2022 to 122 at 30 Sep 2026, high 142 at 30 Nov 2025, low 93.5 at 28 Feb 2023.AllcapNifty 50, same window100200300400Jan 2023Jan 2024Jan 2025Jan 2026424122
Allcap, the strategy this path applies, rebased to 100, after charges. The Nifty 50 TRI is drawn as its CAGR line, not the daily index. Model, back tested, not actual client returns. Source: RupeeCase published model record (lineup.json), monthly. As of 30 Sep 2026.

The results

RuleCAGRMax drawdownTrades
Buy and hold4.57%-16.5%1
RSI(14) < 30 in, > 50 out1.28%-10.0%15
RSI(14) > 50-2.85%-21.2%130
RSI(14) > 60 in, < 40 out1.85%-15.4%28
RSI(2) < 10 in, > 70 out-5.57%-29.5%114
RSI(2) rule, 200 filter-2.27%-16.7%84
RSI(2) < 10, SMA(5) exit-6.71%-32.2%126

Test script module-23-4. Nifty 50 price index, 25 Oct 2021 to 30 Sep 2026, signal at close t, trade at close t+1, 0.1% per side, cash at 0%. Dividends not included. Six rules tried, one window.

₹10,00,000 held through the window ended at ₹12,46,749; the six RSI rules ended between ₹7,10,106 and ₹10,94,849
  1. Buy and hold₹12,46,749
  2. RSI(14) > 60 in, < 40 out₹10,94,849
  3. RSI(14) < 30 in, > 50 out₹10,64,870
  4. RSI(2) rule, 200 filter₹8,93,041
  5. RSI(14) > 50₹8,67,067
  6. RSI(2) < 10 in, > 70 out₹7,53,809

Test script module-23-4, rupee section: ₹10,00,000 at the close of 25 Oct 2021, value at 30 Sep 2026, 0.1% per side, cash at 0%, price index. The RSI(2) rule with the SMA(5) exit ended at ₹7,10,106 and is not shown. Not a forecast.

Every RSI rule trailed buy and hold on return. Four of the six lost money outright over almost five years, in a window where the index itself rose. The one drawdown that looks good, -10.0% for the oversold rule, comes with a CAGR of 1.28% and 9.0% of the time in the market, which I look at next.

CAGR: the largest is Buy and hold at 4.57%

CAGR: the largest is Buy and hold at 4.57%CAGR: the largest is Buy and hold at 4.57%: Buy and hold 4.57%; RSI(14) 50 out 1.28%; RSI(14) > 50 -2.85%; RSI(14) > 60 in, < 40 out 1.85%; RSI(2) 70 out -5.57%; RSI(2) rule, 200 filter -2.27%; RSI(2) < 10, SMA(5) exit -6.71%.Buy and hold4.57%RSI(14) 50 out1.28%RSI(14) > 50-2.85%RSI(14) > 60 in,< 40 out1.85%RSI(2) 70 out-5.57%RSI(2) rule, 200filter-2.27%RSI(2) < 10,SMA(5) exit-6.71%
The CAGR column of the table above, drawn to scale. Source: Module 23.4, RSI as a Rule, the table above.

The oversold rule in detail

RSI(14) below 30 in, above 50 out. The oversold rule made 15 trades: 7 closed round trips and one trip still open at the end. It was in the market 9.0% of the time. Here are the trips, all net of costs:

EntryExitNet return
13 May 202231 May 20224.9%
17 Jun 20227 Jul 20225.3%
27 Oct 20237 Nov 20231.7%
28 Oct 202426 Nov 2024-0.8%
25 Feb 202519 Mar 20251.4%
21 Jan 20264 Feb 20262.3%
5 Mar 20269 Apr 2026-4.2%
10 Sep 202630 Sep 2026 (open)-3.7%

Test script module-23-4. Every trip of RSI(14) below 30 in, above 50 out. The last trip is still open and valued at the 30 Sep 2026 close, with no exit cost.

Read 2 more paragraphs, 154 words

Five of the seven closed trips won. The average winner earned 3.10% and the average loser lost 2.49%, with a top trip of 5.3% and a worst of -4.2%; the average trip lasted 13.9 sessions. A reader seeing this table alone could conclude that oversold works: five of seven. But look at the totals. The rule earned 1.28% a year because it sat in cash for 91% of the window. Its drawdown was the shallowest in the test, -10.0%, but only because it was rarely exposed.

And seven trips are not evidence. I would not build anything on seven events. What the table does show is the shape of the risk: small gains, small losses, a trade lasting under three weeks on average. The open trip, entered on 10 Sep 2026, was at -3.7% on the last close, so as I write the data ends the rule is in a position that is losing.

The momentum reading

The opposite folk reading says an RSI above 50 means the bulls are in charge. Rule A, in while RSI(14) is above 50, made 130 trades and 65 round trips, of which 20 won and 45 lost, with an average winner of 2.94% and an average loser of -1.56%; the average trip lasted 11.0 sessions. The CAGR was -2.85% and the maximum drawdown -21.2%. It was in the market 58.4% of the time.

Two terms to hold on to from 23.4

Two terms to hold on to from 23.4Two terms to hold on to from 23.4. Wilder smoothing: After the first plain average, each new average is (old average x (n - 1) + new value) / n. Oversold: A folk label for a low RSI, often below 30, taken to mean the price fell too far. It is a reading, not a forecast.Wilder smoothingAfter the first plain average, each newaverage is (old average x (n - 1) + new value)/ n.OversoldA folk label for a low RSI, often below 30,taken to mean the price fell too far. It is areading, not a forecast.
From the module glossary. Source: Module 23.4, RSI as a Rule.
Read 2 more paragraphs, 150 words

A has no memory: RSI(14) can hover around 50 for weeks and each cross costs 0.2% round trip. Rule B adds a gap, in at 60 and out at 40, and the trade count fell from 130 to 28, with 14 round trips, half of them winners (7 and 7). Average winner 5.32%, average loser -3.74%, CAGR 1.85% and drawdown -15.4%. Same indicator, same data, and the result moved from -2.85% to 1.85% by adding a gap. That is the whipsaw lesson of module 23.2 in another costume: a gap trades signal speed for fewer false starts.

Of the two readings, in this window the momentum reading with a gap did better than the oversold rule on CAGR (1.85% against 1.28%) and the oversold rule did better on drawdown (-10.0% against -15.4%). I would not read a ranking into either. Both trailed buy and hold, and both are single tests.

The short period RSI(2) rule

Short term traders favour a two day RSI because it reacts to two consecutive down days. The thinking: a sharp fall in a rising market tends to bounce within a few days, so enter on a very low RSI(2) and exit when it recovers. That is a bet on short term reversal. It is not new, and I wanted to see how it fares on this index.

Read 3 more paragraphs, 215 words

RSI(2) below 10 in and above 70 out made 114 trades (57 round trips), earned -5.57% a year, and had a maximum drawdown of -29.5%, almost double the index's. It was in the market 29.1% of the time. Of the 57 round trips, 25 won and 32 lost; the average winner earned 1.05% and the average loser lost 1.66%; the top trip was 2.6% and the worst -7.7%; the average trip lasted 6.2 sessions.

Add the 200 day filter, entering only if the close is above its 200 day SMA, and the trades fall to 84 and the CAGR improves to -2.27%, the drawdown to -16.7%. The idea of the filter is to avoid catching a falling knife in a downtrend. It helped, but not enough to turn a loss into a gain. The SMA(5) exit variant, which leaves as soon as the close is above its five day average, made 126 trades and earned -6.71% with a -32.2% drawdown.

Look at the average winner, 1.05%, against 0.2% to enter and exit. When trades are this small, cost is a large share of them. With the run of 114 trades, a ₹10,00,000 account pays about ₹1,000 on every entry or exit, which is a large charge to carry for an average gain near one percent.

Five sessions after a signal

The test of a trading rule mixes the signal with its exit, its costs and its path. To look at the signal alone I measured what happened to the index over the five sessions after each signal day, from the trade close (day t+1) to five sessions later, with no costs. This is a descriptive measure.

Signal dayWindowsAverage five sessionsUp
Any day1,2140.12%54.0%
RSI(2) below 101610.15%52.8%
RSI(2) below 10, close above SMA(200)920.29%55.4%
RSI(2) below 10, close at or below SMA(200)69-0.04%49.3%

Test script module-23-4. Nifty 50 price index, signal days from 25 Oct 2021, five sessions from the close of day t+1. No costs. Consecutive days overlap, so the windows are not independent.

A radar sweep in teal over a polar grid dotted with lit points
Read one more paragraph, 98 words

The average five session return after an RSI(2) below 10 was 0.15%, against 0.12% for any day. With the 200 day filter it was 0.29%; below the 200 day it was -0.04%. The ordering matches the folk story: bounces were a little better in an uptrend. But the differences are fractions of a percent, on overlapping windows, and a round trip costs 0.2%. The signal carries something small, and it is smaller than the cost of trading it. This is what I mean when I say an indicator can have a statistical edge and not a tradable one.

Why one indicator has two readings

RSI reads the balance of recent gains and losses. A high reading means the stock rose a lot in the lookback. What follows depends on the horizon you ask about.

  • Over days to a few weeks, short term reversal is the common story: a stock or index that dropped sharply tends to bounce a little, and one that rose sharply tends to give some back. A low RSI is read as a reversal signal at this horizon.
  • Over months, the story flips: past winners tend to keep gaining, as the momentum research in module 23.3 describes. A high RSI sustained over months is read as a trend signal.
Read one more paragraph, 70 words

So "should I read RSI as a reversal or a momentum signal?" has no answer without a horizon and a market, and the answer can change from one period to the next. A rule has to say which, and in what lookback, before it can be tested. This is the single most useful thing the exercise taught me: the indicator is the same number and the rule is a choice.

What this does and does not say

It says: on the Nifty 50 price index from 25 Oct 2021 to 30 Sep 2026, with the common thresholds, 0.1% per side and cash at 0%, none of six RSI rules beat holding the index, four lost money in a window when the index rose, and the short period rules made over a hundred trades and paid for them.

Read one more paragraph, 56 words

It does not say RSI is useless. Individual stocks, with larger swings, may give more signals, and I did not test them. The window is under five years with one regime. The oversold rule made seven closed trips, which is far too few to judge. And I did not search for settings that would flatter RSI.

Where this section sits in module 23.4

Where this section sits in module 23.4Where this section sits in module 23.4. 1. Why one indicator has two readings 2. What this does and does not say 3. Where this meets how RupeeCase works 4. Common mistakes 5. What I'd keep from this 6. Questions readers ask01Why one indicator has two readings02What this does and does not say03Where this meets how RupeeCaseworks04Common mistakes05What I'd keep from this06Questions readers ask
Sections 10 to 15 of 15; the highlighted one is next. Source: Module 23.4, RSI as a Rule.

Where this meets how RupeeCase works

An RSI rule on one index is a timing rule. RupeeCase strategies are not timing rules: they hold baskets of stocks ranked by a stated score and rebalance on a published calendar, with the record shown as model, back tested, with its date. Module 23.8 covers how indicators are combined and checked, and module 2.3 the drawdown and return measures used in the tables.

Common mistakes

  • Treating 30 and 70 as laws. They are Wilder's conventions. RSI(14) went below 30 on only 36 of 1,406 sessions here, so an oversold rule has few trades to judge.
  • Calling an index oversold on one reading. RSI(14) was 25.3 on 30 Sep 2026 and the open trip was at -3.7%.
  • Reading five wins in seven as an edge. The oversold rule earned 1.28% a year and spent 91% of the time in cash.
  • Forgetting costs on a fast rule. 114 trades at 0.1% per side is a large charge against a 1.05% average winner.
  • Mixing the two readings. The same rule cannot read RSI as both reversal and momentum.
  • Tuning the thresholds. Each setting tried is one more coin.
A field of glowing teal nodes on navy, linked into a rising index line that ends in a bright point

What I'd keep from this

  • RSI = 100 - 100 / (1 + RS), with RS the average gain over the average loss. From 14 closes on 21 Jan 2021 the RSI(14) was 69.95, and after the next day's fall, with Wilder's smoothing, 60.09.
  • RSI(14) was below 30 on 36 of 1,406 sessions. The lowest reading was 21.8 on 4 Mar 2025.
  • From 25 Oct 2021 to 30 Sep 2026, buy and hold earned 4.57%. The six RSI rules earned between -6.71% and 1.85%.
  • The oversold rule won 5 of 7 closed trips but was in the market 9.0% of the time and earned 1.28%.
  • The RSI(2) rule made 114 trades and earned -5.57% with a -29.5% drawdown. A 200 day filter lifted it to -2.27%.
  • The signal after RSI(2) below 10 was a few hundredths of a percent over five sessions, below the cost of a round trip.

Questions readers ask

How is RSI calculated?

Take the daily changes in the close, split them into gains and losses, average each over n days (14 is Wilder's period), form RS as the average gain over the average loss, and compute RSI = 100 - 100 / (1 + RS). After the first average, Wilder smooths: new average = (old average x (n - 1) + the new value) / n.

Does RSI below 30 mean a stock will rise?

No. It means the recent average loss was more than twice the average gain. On the Nifty 50, RSI(14) below 30 happened on 36 of 1,406 sessions. A rule that entered below 30 and left above 50 earned 1.28% a year from 25 Oct 2021 to 30 Sep 2026, against 4.57% for buy and hold, and spent 91% of the time in cash.

What is RSI(2)?

A relative strength index over two days instead of 14. It swings between extremes quickly and is used for short term reversal rules. On this file the RSI(2) rule made 114 trades and earned -5.57% a year after 0.1% per side.

Is RSI a momentum or a reversal indicator?

It is a number, and the reading depends on the horizon. Over days, a low value is often read as a bounce signal; over months, a high value as a trend signal. A testable rule has to pick one and say which lookback it uses.

The RupeeCase terminal on sample data: Growth per year: how fast did the model grow?
Watch in the terminal: how fast did the model grow? A short tutorial on sample data.

Rules and figures in this module were last verified on 27 Nov 2026. Tax and regulatory rules change; check the source before acting.