AgentTrading
How it works Pricing Blog FAQ Log in

RSI backtest: test an RSI 14 trading strategy, the 30/70 levels and swing trading rules

Say the rule the way you would say it out loud, such as "buy SPY when the 14-day RSI drops under 30 and sell when it climbs back over 55", and the bench restates it as an explicit rule card, warms the indicator up on prior history before the first trade is allowed, then tests it on 20+ years of split- and dividend-adjusted daily data with every assumption printed.

See pricing
20+ yrs adjusted data Every assumption shown No code
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
Type for a real run
01 THESIS · AS A TESTABLE RULE

02 EVIDENCE · FUNDAMENTALS

03 BACKTEST · GROWTH OF $10,000
Strategy Buy & hold

04 RISK · IN PLAIN ENGLISH

05 VERDICT · HISTORICAL, NOT PREDICTIVE

Sample scenarios, not a live backtest of what you typed. Past performance does not guarantee future results. Educational analysis only, not financial advice.

In short

An RSI backtest applies a relative strength index rule to historical prices and reports what it would have done, and the part most tools skip is warming the indicator up before the first trade. RSI is recursive: Wilder's smoothing carries a share of its own starting value forward, so the RSI(14) printed on any given day depends on how far back the calculation began. StockCharts states that a formula "will need at least 250 data points to replicate our RSI numbers" and that "RSI values may differ based on the total calculation period"; AAII puts the same rule at "at least 252 bars of data". Neither publishes the arithmetic behind it, so we did: the weight still sitting on the seed after k bars is (13/14)^k, which is 35% at 14 bars, 10.8% at 30, under 1% at 62, and about eight parts per billion at 250. That is where the one-year convention comes from. Type an RSI rule here and the bench shows the rule card it built, including the RSI period and both thresholds, loads history before the test window so the oscillator is converged when the first signal fires, charges 0.1% per trade by default, and stamps an honest verdict including UNDERPERFORMED when buying and holding beat it, which on a broad index it frequently does. Plans start at $19 a month. This is educational analysis only: it executes no trades, connects to no brokerage, and gives no personalized advice. Past performance does not guarantee future results.

Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.

ONE INDICATOR, AND IT IS NOT ONE NUMBER

How much of your RSI(14) is still the starting guess?

Wilder's RSI is a recursive average: each reading is built from the one before it, so the value never fully forgets where the calculation started. Two reputable sources tell you to load about a year of data before trusting an RSI, and neither one shows the math. The math is short, so here it is. The weight remaining on the seed after k bars is (13/14) raised to the power k.

History before the signal Share of the reading still coming from the seed What that window is in practice What it means for a backtest
14 bars 35.4% The first bar on which an RSI(14) can be printed at all Over a third of that first reading is your starting assumption rather than the market.
30 bars 10.8% About six weeks. Trade Ideas describes the history behind its OddsMaker backtester as "typically six weeks worth". Roughly a tenth of every reading is an artifact of where the data file happened to begin.
62 bars 1.0% About one calendar quarter of daily bars The first window where the seed stops being able to move a 30 or 70 crossing.
126 bars 0.009% Half a trading year Comfortably converged for ordinary 30/70 work on daily bars.
250 to 252 bars About 8 parts per billion One trading year. StockCharts: "at least 250 data points". AAII: "at least 252 bars of data". The industry rule of thumb, and this is the reason for it.

Two consequences follow, and both cost money. First, a platform that cannot hold a year of history before your test window starts cannot give you a converged RSI, no matter how good its engine is. Second, this is one reason the same rule returns different numbers on different products. A public QuantConnect forum thread records a trader replicating a simple RSI mean reversion strategy and getting 85% for calendar 2023 against 240% on Composer for the same year and the same rule, a gap of 155 percentage points that the thread never resolved; the staff reply pointed at data normalization and indicator update logic rather than at the strategy. Before you conclude that an RSI idea works or fails, check that the tool warmed the indicator up, and check what it did to the price series underneath.

Seed weights are computed from Wilder's published smoothing formula, (13/14)^k, and you can reproduce every figure in one line of arithmetic. Third-party quotations were checked on August 30, 2026 and are reproduced for comparison, not measured by us. Vendors revise their documentation, so verify at the source. Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.

WHAT YOU GET - RSI BACKTEST

RSI backtest, run on the bench

The oscillator is converged before the first trade

History is loaded ahead of the test window so the RSI has stopped carrying its starting value by the time a signal is allowed to fire. A rule whose first two years of trades came from a half-formed indicator is not a tested rule, and most no-code backtesters never say which they gave you.

Period and both thresholds stay yours

14, 30 and 70 are Wilder's defaults from 1978, not findings. Test RSI(2), RSI(21), 20/80, or an asymmetric exit at 55, and see how much of the result was the idea and how much was three numbers everybody inherited.

Costs charged, and mean reversion trades a lot

An RSI rule on a choppy name can fire dozens of times a year, which is exactly where fees quietly eat the edge. Every trade is charged 0.1% by default and the trade count is printed on the result, so a rule that only works when trading is free exposes itself immediately.

Benchmarked against doing nothing at all

The comparison that settles an RSI rule is holding the same ticker straight through. Verdicts are stamped HELD UP, MIXED or UNDERPERFORMED, and buying oversold readings on a strong index is one of the rules that most often comes back UNDERPERFORMED.

HOW IT WORKS - 4 STEPS

From a sentence to a stamped verdict

01

Describe the RSI rule

One sentence with the parts that matter: the ticker, the RSI period, the entry level and the exit level. "Buy SPY when the 14-day RSI closes under 30 and sell when it closes over 55" is a complete specification here.

02

Check the rule card

The bench restates it as Entry: RSI(14) < 30, Exit: RSI(14) > 55, and prints every default it filled in, including the warm-up window, the date range and the cost per trade. If it misread you, you see that before anything runs.

03

Run it on adjusted history

The rule is tested on 20+ years of split- and dividend-adjusted daily data with dividends treated as reinvested, and the equity curve is drawn against simply holding the same ticker.

04

Read the verdict and the risk panel

You get the trade count, the worst peak-to-trough drawdown and how long recovery took, whether the result depended on one market regime, and an honest verdict. A rule that traded 9 times in 20 years is labeled as the small sample it is.

Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.

On the same bench

An RSI rule is the best known member of the mean reversion family, and the premise behind it is explained on mean reversion trading, with the indicator itself walked through on the RSI trading strategy. The opposite premise, buying strength rather than weakness, has its own bench station on momentum backtest, and the most common trend entry of all is tested on the moving average crossover backtest. The general engine behind all of them is described on backtesting software, the rule card comes from the trading strategy builder, and the adjusted 20-year series every run depends on is documented on historical stock data. Once a rule produces a result, the drawdown behind it is read on investment risk analysis, and how long a test window needs to be is answered on how long you should backtest. For the platform comparison, see the best RSI backtesting software for swing traders; plans start at $19 a month.

QUESTIONS - ASKED AND ANSWERED

RSI backtest: the common questions

What is the best RSI setting for swing trading?

There is no setting that is best across tickers, and the honest answer is that you have to test the ones you care about. Wilder's 14 periods with 30 and 70 is the default nearly every platform ships, short-term traders often shorten the period to 2 to 5 to get more signals, and swing traders frequently keep 14 but move the exit down to 50 or 55 so trades close on a return to normal rather than waiting for an overbought reading that may never arrive.

Is buying an ETF with RSI above 90 a good strategy?

Buying strength that extreme is a momentum bet, not the mean reversion trade RSI is usually associated with, and the two have opposite premises. The relevant caution is that oscillators do not cap a trend: StockCharts states plainly that momentum oscillators "can become overbought (oversold) and remain so in a strong up (down) trend". A reading over 90 on a broad ETF is rare enough that any backtest of it will rest on very few signals, so check the trade count before you believe the result.

How many years should you backtest an RSI strategy?

Long enough to cover several different market regimes and to accumulate enough completed trades that the result is not noise, which in practice means decades rather than months. An RSI mean reversion rule fires far more often than a crossover, so you can reach a few hundred trades in 10 to 20 years on one liquid name. Separately, load at least a year of history before the test window starts so the indicator itself is converged.

Does RSI 14 mean the same thing on every platform?

No, and this surprises people. Wilder's original uses a recursive smoothed average, while Cutler's RSI uses a simple moving average of gains and losses specifically because Cutler objected that Wilder's version depends on where the data began. The two agree at bar 14 and drift apart after it. AAII puts it directly: "the ending value will be dependent on how far back the data is initially referencing for its first calculation".

Why do two platforms give different backtest results for the same RSI rule?

Usually the difference is underneath the strategy rather than in it: how much history seeded the indicator, whether prices were split and dividend adjusted, and how trades were priced and charged. A public QuantConnect forum thread records the same simple RSI mean reversion rule producing 85% in one product and 240% in another for calendar 2023, and the discussion closed without resolving the gap. Before trusting either number, check the warm-up and the price series.

Can you backtest RSI on thinkorswim?

You can build RSI studies and strategies in thinkScript on a Schwab account at no extra cost, and the platform will mark signals and run a strategy report on a single chart. What it will not do is test many symbols at once or sweep the period and thresholds for you, and Schwab's own thinkorswim page does not market the product as a backtester. It is a good place to look at one rule on one chart, not to judge a rule.

Does RSI work in a strong trend?

It works poorly as a reversal signal in one, which is the single most common way RSI loses money. In a sustained uptrend the oscillator can sit above 70 for months while price keeps rising, so selling every overbought reading means selling the best part of the move. StockCharts notes that "divergences are misleading in a strong trend" and that a strong uptrend "can show numerous bearish divergences before a top materializes". Test the rule through a trending stretch specifically, not only through a choppy one.

Is RSI 30/70 or 20/80 better?

They trade off frequency against selectivity, and which wins is a property of the ticker rather than a general truth. The 30/70 pair fires often and catches shallow pullbacks along with the deep ones; 20/80 waits for genuine extremes, produces far fewer signals, and can leave you with too small a sample to judge. Run both on the same symbol over the same window and compare the trade counts alongside the returns.

Can you backtest RSI for free?

Yes, with tradeoffs on every free option. QuantConnect has a free tier with unlimited backtests if you write Python or C#, TradingView will run an RSI strategy in a few lines of Pine on a free account with limited history, and Composer will build and backtest without a subscription in a no-code editor. One popular free tool will not: Portfolio Visualizer's market timing model offers moving averages and relative strength momentum, which ranks assets by past return and is not the RSI oscillator despite the similar name.

Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.

Your next idea deserves a verdict, not a hunch.

Bring a thesis or a ticker. AgentTrading restates the rule, shows the evidence, runs 20+ years of history, and stamps an honest verdict. You decide.

Past performance does not guarantee future results. For educational and informational purposes only. Not financial advice. Consult a licensed advisor.