Edgoro
Analysis · Free tool

RSI Calculator

Compute Wilder's RSI from pasted closing prices the way TradingView does, with average gain, average loss and the RSI zone.

Order of the list
RSI (14)
37.77
ReadingNeutral, below 50
Average gain0.18027
Average loss0.29698
RS (gain ÷ loss)0.6070
Last change+0.4686
Previous RSI33.08
Closes read33

Wilder's RSI, as ta.rsi on TradingView: RS = average gain ÷ average loss, each smoothed with α = 1 ÷ N; RSI = 100 − 100 ÷ (1 + RS). Paste at least 140 closes for values that match your chart.

Last 20 values, newest first

BarCloseChangeAvg gainAvg lossRSI (14)
3343.1314+0.46860.180270.2969837.77
3242.6628-0.75770.158090.3198233.08
3143.4205-1.14670.170250.2861437.30
3044.5672+0.34910.183350.2199445.46
2944.2181+0.03980.170600.2368641.87
2844.1783+0.14950.180660.2550841.46
2744.0288-1.32600.183060.2747039.99
2645.3548-0.42870.197140.1938350.42
2545.7835-0.66800.212300.1757654.71
2446.4515+0.73780.228630.1379062.38
2345.7137-0.53840.189470.1485156.06
2246.2521+0.03990.204040.1185263.26
2146.2122+0.56830.216670.1276362.93
2045.6439-0.57830.189620.1374557.97
1946.2222-0.18940.204200.1035466.36
1846.4116+0.37880.219910.0969469.41
1746.0328+0.03000.207690.1043966.55
1646.0028-0.27920.221360.1124266.32
1546.28200.00000.238390.0995970.53
1446.2820+0.6680———

Trading involves substantial risk of loss and is not suitable for every investor. Edgoro is a software tool, not a broker or financial adviser: nothing it produces is investment advice, and past or backtested performance does not guarantee future results.

What the RSI calculator does

The Relative Strength Index, introduced by J. Welles Wilder in 1978, compares the size of recent up-moves with recent down-moves and scales the result between 0 and 100. Paste closing prices and the calculator returns the current RSI together with the numbers behind it: the average gain, the average loss and their ratio RS, the overbought or oversold reading, and a table of the last 20 values.

It uses Wilder's smoothing exactly as TradingView's ta.rsi does, so you can verify a value on your chart, in a spreadsheet or in code you wrote.

How to use it

  1. Paste closing prices separated by commas, spaces or new lines. Dates and headers are skipped.
  2. Choose the order of the list: oldest first or newest first.
  3. Set the length. Wilder used 14 periods, still the default on most platforms.
  4. Adjust the overbought and oversold levels if you use others than 70 and 30; some traders prefer 80 and 20 on fast markets.

RSI(14) needs at least 15 closes, because it works on the 14 changes between them. For values that match a chart to the decimal, paste about ten times the length or more, 140 closes for RSI(14).

The formula

change  = close − previous close
gain    = change if it is positive, otherwise 0
loss    = −change if it is negative, otherwise 0

first average gain = mean of the first N gains        (same for losses)
next average gain  = (previous average × (N − 1) + gain) ÷ N

RS  = average gain ÷ average loss
RSI = 100 − 100 ÷ (1 + RS)

The recursive step is Wilder's smoothing, an exponential average with α = 1 ÷ N (ta.rma in Pine Script). When the average loss is zero, RSI is 100; when the average gain is zero, it is 0.

Worked example

The sample loaded in the calculator is the classic 33-close series used to illustrate Wilder's RSI, with a length of 14:

  • The first 14 changes give an average gain of 0.2384 and an average loss of 0.0996. RS ≈ 2.394, so the first RSI is 100 − 100 ÷ 3.394 = 70.53, right on the overbought line.
  • The next close falls by 0.2792. The average gain becomes (0.2384 × 13 + 0) ÷ 14 = 0.2214 and the average loss (0.0996 × 13 + 0.2792) ÷ 14 = 0.1124, so RSI drops to 66.32.
  • After the sell-off at the end of the list, the RSI bottoms at 33.08 and ends at 37.77 with a last gain of 0.4686: weak, but not oversold.

How to read the RSI

  • Above 70: gains have clearly outweighed losses over the window, the "overbought" zone. In a strong uptrend RSI can stay above 70 for a long time; it measures momentum, not a turning point.
  • Below 30: the "oversold" zone, with the same caveat in downtrends.
  • Around 50: gains and losses are balanced. Some traders use above or below 50 as a momentum filter for other signals.
  • Divergence: price makes a new high while RSI makes a lower high, or the reverse. It shows fading momentum, and it can last a long time before price turns. See how to build an RSI divergence indicator.

Any rule built on these readings is a hypothesis until it is backtested with costs. Size each trade from its stop distance, not from the RSI value, with the position size calculator.

Why your chart may show a slightly different RSI

  • Smoothing memory. Wilder's averages keep a fading memory of every earlier change, shrinking by a factor of (1 − 1 ÷ N) per bar. With 140 closes for RSI(14), the starting point's weight falls below 0.01%, invisible at two decimals. With only 30 closes, the first values can differ from a chart that has years of history.
  • Another method. Some spreadsheets and platforms use simple averages of gains and losses (Cutler's RSI) or an EMA with α = 2 ÷ (N + 1). Both give different numbers from Wilder's RSI.
  • An open bar. The RSI of the current bar keeps moving until the bar closes.
  • Different data. Brokers' feeds differ slightly, and daily forex bars close at different hours depending on the feed.

Common mistakes

  • Selling every reading above 70. In trends, the overbought zone is where momentum is strongest.
  • Comparing RSIs of different lengths. RSI(7) reaches the extremes far more often than RSI(21).
  • Too few closes. The calculator shows a value from N + 1 closes, but it only settles once enough history is behind it.

Frequently asked questions

What RSI length should I use?

Fourteen periods, Wilder's original choice, is the default on most platforms. Shorter lengths such as 7 or 9 reach the extremes more often; longer ones such as 21 are smoother. No length is best in general, so test the one you use on your market and timeframe.

Is an RSI above 70 a sell signal?

Not by itself. A reading above 70 means gains have dominated recent price changes. In a strong uptrend RSI can stay above 70 for a long time, so many traders combine it with trend, structure or divergence, and test the combination first.

Why doesn't my RSI match TradingView exactly?

Wilder's smoothing remembers earlier price changes, so the result depends on how much history is included. Paste about ten times the length in closes (140 for RSI 14) and the values match to two decimals. Also check that both use the same closes and that the last bar has closed.

How many closing prices do I need?

At least the length plus one: 15 closes for RSI(14), which give 14 price changes. For a value that matches a chart with long history, paste around ten times the length.

What is the difference between Wilder's RSI and Cutler's RSI?

Wilder's RSI smooths gains and losses recursively, so older changes keep a fading influence. Cutler's RSI uses plain averages of the last N gains and losses, so it depends only on that window. TradingView's built-in RSI is Wilder's version.

Related guides

All guides
All free tools

Let AI build the indicator behind your numbers.

Turn the rules you just calculated into a TradingView indicator, an MT5 bot or a crypto bot. Instant access, with a 7-day money-back guarantee.