RSI — relative strength index
A line from 0 to 100 that compares the size of recent rises with recent falls.
About
RSI compares the size of recent price rises with the size of recent falls. It shows the result as one number between 0 and 100.
In KAGAMI it is called Relative Strength Index in the Indicators list. On the chart, its short name is RSI. It is free for every account.
What you see on the chart
A chart is made of bars, also called candles. Each bar covers the same amount of time, for example 15 minutes.
- RSI opens in its own pane: a separate strip under the price chart.
- A purple line moves up and down between 0 and 100.
- Three dashed grey lines sit at 70, 50 and 30.
- A light purple band fills the space between 30 and 70.
- The name RSI shows at the top left of its pane, with the current number.
How traders often read it
- RSI near 100 means recent rises were much bigger than recent falls. Near 0 means the opposite.
- Many traders call RSI above 70 overbought: the price rose fast. Below 30, they call it oversold: the price fell fast.
- Some traders watch whether RSI is above or below the middle line at 50.
- Some traders compare highs. The price makes a new high, but RSI makes a lower one. This is called a divergence.
- In a strong trend, RSI can stay high or low for many bars.
An indicator only describes past prices. It cannot tell you what happens next.
The settings
Point at RSI at the top left of its pane. Click the gear icon (Settings). The Inputs tab shows:
- Length — how many bars RSI looks back. It starts at 14. A smaller number makes the line jumpier. A bigger number makes it calmer.
- Smoothing Line — the kind of average for an extra line: SMA, EMA or WMA.
- Smoothing Length — how many bars that extra line averages. It starts at 14.
The extra line is called Smoothed MA. It is the average of RSI itself. It is off at first; turn it on in the Style tab.
RSI always uses the closing price of each bar. There is no setting to change that.
When it can mislead
- 70 and 30 are not signals. RSI can stay above 70 or below 30 while a strong trend goes on.
- The last bar is still forming. RSI moves with the price until that bar closes.
- Too few bars. RSI needs more bars than its Length before it shows anything. Its first values are less settled.
- Gaps count as one move. A jump after a night or a weekend is just one big rise or fall.
- Timeframes differ. RSI on a 5-minute chart and on a daily chart can say very different things.
- Quiet markets. When prices barely move, small moves can still swing RSI a lot.
Charts are for learning, not advice. Read our Risk Disclaimer.
An example
Open NASDAQ:AAPL on a daily chart. These numbers are made up.
- Say that over the last 14 days, rises averaged 2 and falls averaged 1.
- Rises divided by falls is 2 ÷ 1 = 2.
- RSI = 100 − 100 ÷ (1 + 2) = about 66.7.
- That is above 50 and below 70. The line sits in the purple band, near its top.
- Now say a few more strong up days come. The rises grow, the falls shrink, and RSI climbs above 70.
Many traders would call that overbought. It only means recent rises were much bigger than recent falls.
Technical details
For readers who want the exact rules. Relative Strength Index is the chart's built-in TradingView study. The chart computes it in your browser from the bars KAGAMI sends.
The calculation
For each bar, using closing prices:
change = close − close of the bar beforeup = changeif the change is above 0, else0.down = −changeif the change is below 0, else0.- Average
upanddownwith Wilder's smoothing over Length bars. The first average is the plain average of the first Length values. After that:average = (average of the bar before × (Length − 1) + new value) ÷ Length. RSI = 100 − 100 ÷ (1 + average up ÷ average down)- If
average down = 0, RSI is 100. Otherwise, ifaverage up = 0, RSI is 0. - Smoothed MA = an average of RSI (SMA, EMA or WMA, from Smoothing Line) over Smoothing Length bars.
The first RSI value comes on the bar Length bars after the first bar. With Length 14, that is the 15th bar. The chart shows values with 2 decimals.
Inputs
| Name | Default | Range | What it does |
|---|---|---|---|
| Length | 14 | 1 to 2,000 | Bars in the up and down averages |
| Smoothing Line | SMA | SMA, EMA, WMA | The kind of average for Smoothed MA |
| Smoothing Length | 14 | 1 to 10,000 | Bars in the Smoothed MA average |
Lines and colours
| Part | Look |
|---|---|
| RSI line | purple #7E57C2, 1 pixel |
| Upper line | dashed grey #787B86 at 70 |
| Middle line | dashed grey #787B86 at 50 |
| Lower line | dashed grey #787B86 at 30 |
| Background | purple #7E57C2 at 90 % transparency, between 70 and 30 |
| Smoothed MA | off at first |
These are the chart's own defaults. KAGAMI does not change them. You can change them in the Style tab.
When values change
- The newest bar is still forming. Its RSI changes each time the chart refreshes: about every 15 seconds, or every 5 seconds on a seconds chart.
- Closed bars keep their value. The bar that just closed gets its final value on the next refresh.
- The start matters a little. Wilder's smoothing begins at the first loaded bar. So the first values depend on where the data starts. Values far from the start barely depend on it.
Timeframes
- RSI works on every timeframe. It is computed on the bars of the timeframe on screen.
- Seconds timeframes (1, 5, 10, 15 and 30 seconds) exist for crypto only. They reach back about 24 hours.
- US stocks follow US market hours, 09:30 to 16:00 New York time. So a stock's first bar of the day often opens with a gap from the day before. Crypto trades all day, every day (times in UTC).
KAGAMI's own version
KAGAMI also has its own RSI, computed on KAGAMI's servers. It is not in the Indicators list. It is drawn only when a link opens KAGAMI with RSI already asked for. Its length comes from the link; you cannot change it on the chart.
- Length: 14. A link may ask for another length above 0; it is cut to a whole number.
- Maths: the same Wilder RSI as above. The first average is the plain average of the first Length ups and downs. If the average fall is exactly 0, RSI is 100.
- Bars: the server reads the bars the chart asks for, plus 300 bars before them, and never more than 2,000 bars at once. So the line is usually already settled at the chart's left edge.
- Too few bars: with Length bars or fewer, it draws nothing.
- Rounding: values are rounded to 6 decimals.
- The look: one line, 1 pixel, in its own pane at the bottom, with its own scale. Dashed grey lines at 30 and 70, 1 pixel. No line at 50, no background, no Smoothed MA.
- Refresh: about every 15 seconds, like the chart. The newest bar is included while it is still forming.
| Part | Dark theme | Light theme |
|---|---|---|
| RSI line | indigo #6366F1 | indigo #4F46E5 |
| Lines at 30 and 70 | rgba(139,144,168,0.55) | rgba(91,96,122,0.55) |
Differences from the chart's built-in version
The maths is the same in both: Wilder's smoothing, started with a plain average. With the same bars and Length, both give the same values. The differences:
- Where it is computed. KAGAMI's own: on KAGAMI's servers. Built-in: in your browser.
- Where it starts. KAGAMI's own: 300 bars before what the chart shows. Built-in: at the first bar the chart loaded. Only the first values differ.
- Rounding. KAGAMI's own rounds to 6 decimals. The built-in shows 2 decimals.
- The look. KAGAMI's own: an indigo line, lines at 30 and 70 only, no background. Built-in: a purple line, lines at 70, 50 and 30, a purple band.
- Settings. KAGAMI's own takes its length from the link only. The built-in has Length, Smoothing Line and Smoothing Length.
- The extra line. Only the built-in has Smoothed MA.
Edge cases
- Too few bars. With Length bars or fewer, there is no RSI yet.
- No falls at all. If the price has not fallen once since the averages started, RSI is 100.
- No rises at all. If the price has only fallen since the averages started, RSI is 0.
- Flat prices. A bar with the same close as the bar before adds 0 to both averages. Over a long flat stretch, both averages shrink, but RSI keeps the balance from before.
- Gaps. A night or weekend gap is one change, often a big one. It can move RSI sharply on the first bar after it.
- Missing bars. If no trade happened in a bar's time, the data may have no bar for it. RSI then simply uses the next bar.