Home › Guides › RSI Indicator

WHY BOTS FAILFREENO ACCOUNTAUTOMATED TRADE BOTSRSI IndicatorThe arithmetic of how bots failEDUCATION ONLY | NO SIGNALSEXAMPLE NUMBERS ARE LABELLEDAUTOMATED TRADE BOTSautomatedtradebots.com
A free page on rsi indicator. Education only, with example numbers labelled.
WHY BOTS FAIL

RSI Indicator

Short answer

RSI, the relative strength index, compares the average gain with the average loss over a number of bars, usually 14, and scales the result from 0 to 100.

The relative strength index turns recent price changes into one number from 0 to 100. The arithmetic is simple, and so are the ways a bot misuses it.

The page explains the idea in plain words, works through the arithmetic with a table, and shows how it hits grid, martingale and DCA bots, then tells you what to check before you run one.

  • A worked example with real arithmetic
  • How it hits grid, martingale and DCA bots
  • How to check for it before you run a bot
  • No advice, no signals, no profit promises

Last reviewed 28 October 2026. Education only, not advice.

Free, no account Runs in your browser Worked numbers shown Not advice Examples labelled

Ready to go further

Next: test a rule honestly

The backtesting guide sets out the steps and the traps, including the one that catches most indicator rules.

Reading time4 minutes
Worked exampleExact arithmetic
Tools linked1 on this page
Reviewed28 Oct 2026

What is included

  • What it is, in plain words
  • The formula or mechanism, with exact arithmetic
  • How it hits grid, martingale and DCA bots
  • A check you can run before you switch a bot on

Who it is for

  • People who run or plan to run a trading bot
  • Anyone reading a backtest or a bot sales page
  • Readers who want the numbers, not the pitch
  • Not advice, and not a signal service
RSI (14) of a made-up price path that rises, then falls0305070100141822257030Bar numberMade-up closes. Wilder smoothing, 14 bars. Calculated by us on 28 Oct 2026, exact.
The picture for this page. Example numbers are made up unless the page says they were calculated.

Key facts

  • RSI, the relative strength index, compares the average gain with the average loss over a number of bars, usually 14, and scales the result from 0 to 100.
  • It is a description of recent movement, not a forecast. A high reading means recent gains were large against recent losses, and a low reading means the reverse.
  • In the made-up path below the first 14-bar RSI is 70.6, from an average gain of 0.857 and an average loss of 0.357 (calculated by us on 28 Oct 2026, exact).
  • In a steady fall RSI stays at 0.0. A low reading can stay low for as long as the price keeps falling, so "oversold" is not a reason to buy.
  • A bot that buys below 30 and sells above 70 is a bet that the price returns to its range. It fails when the price trends.

The formula

RSI looks at the last N price changes, usually N = 14. It adds up the gains and the losses separately and averages each. The ratio of the two averages, the relative strength, is then squeezed into a 0 to 100 scale.

Relative strength (RS) = average gain / average loss
RSI = 100 - 100 / (1 + RS)
If the average loss is zero, RSI = 100

The first average is a plain average of the first 14 changes. After that, the common method (Wilder smoothing) updates each average: new average = (previous average x 13 + this bar's value) / 14. Some tools use a plain moving average instead, so values differ a little between platforms.

A worked example

Take the made-up closes in the picture, starting 100, 101, 102, 101, 103. Over the first 14 changes the total gain is 12.0 and the total loss is 5.0. The average gain is 0.857 and the average loss is 0.357. RS = 0.857 / 0.357 = 2.400, so RSI = 100 - 100 / (1 + 2.400) = 70.6.

The price then falls from 108 to 88 over several bars. As losses enter the averages and gains drop out, RSI falls to a low of 28.3 at bar 24. That is below 30, the usual oversold line. At that bar the close was 88 and one bar later it is 89, so in this short made-up path the low reading happened to mark the low. In the straight fall in the next picture it does not: the reading stays at the floor while the price keeps dropping.

RSI of a steady fall by bar (made-up, falls $1 every bar)0.0Bar 14RSI0.0Bar 16RSI0.0Bar 19RSIPrice falls by 1 on every bar, so there are no gains and RSI sits at 0.0 the whole way. Calculated by us on 28 Oct 2026, exact.
In a straight fall there are no gains, so RSI sits at the floor and stays there. A rule that buys when RSI is low would buy at every bar of this fall.

How a bot misuses it

  • Buying oversold in a downtrend. The reading can stay low for as long as the price keeps falling. A bot that adds at each oversold signal is averaging down, so it grows into a loss. See average down and the DCA bot.
  • The same 30 and 70 everywhere. The lines are conventions, not laws. The right levels, if any, depend on the market and the time frame, and finding them by trial is overfitting.
  • Costs. A bot that trades every time RSI crosses a line trades often. Each trade pays the spread.
  • Settings that change the number. A shorter period makes RSI jumpier, and a longer one smoother. Tuning the period to fit the past is a classic way to build a good-looking backtest that fails later.

How to check a rule that uses RSI

Test it across more than one kind of market: a range, an uptrend and a downtrend. Count the trades, and look at the average result per trade after costs and the worst losing run. Check the max drawdown. Then keep a part of the data back and test once, as in backtesting. The result in a downtrend is the one that tells you the most about the rule.

Reading it together with the trend

A common refinement is to use RSI only in the direction of a longer trend: take low readings as pauses inside an uptrend, and ignore them in a downtrend. That is a second rule, with its own settings, such as how the trend is measured and over what length. Each extra setting is another chance to fit the past, so the same tests apply to the pair of rules as to one. Compare the pair with the plain buy-and-hold result and with doing nothing, after costs, on data it has not seen.

What it does not tell you

It does not say where the price goes next. It summarises the last 14 bars and nothing more. No setting of it removes risk, and this page is education, not a signal.

FAQ

Frequently Asked Questions

What does RSI measure?

The size of recent gains compared with recent losses over a number of bars, scaled from 0 to 100. It describes recent movement and does not forecast the next move.

What do 30 and 70 mean on RSI?

They are conventional lines. Below 30 is called oversold and above 70 overbought. A price can stay beyond either line for a long time in a trend.

How is RSI calculated?

RS is the average gain divided by the average loss over N bars, usually 14. RSI is 100 - 100 / (1 + RS). Later bars update the averages with Wilder smoothing.

Can I run a bot on RSI alone?

You can, but a rule that buys oversold and sells overbought fails when the price trends. Test it in rising, falling and flat markets, with full costs, before trusting it.

Why do different platforms show different RSI values?

Some use Wilder smoothing and some use a plain moving average, and the starting bar can differ. The values are close but not identical.

Are the numbers on this page real?

Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.

Can I use this to decide whether to run a bot?

It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.

Is this financial advice?

No. It is general education about a calculation. The prices are made up and it is not a signal.

Know the Risk Before You Run It

Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.

Trading carries a risk of loss