There is no evidence-backed 'best' RSI setting — changing the length or the overbought/oversold bands changes signal frequency and smoothness, not the underlying edge, and the magic numbers promoted in broker content are in-sample optimization artifacts. This article explains what each setting mathematically does, why 'RSI 7 with 80/20' claims collapse under the multiple-testing lens of Bailey, López de Prado, White, and Hansen, and provides a validated Pine Script v6 testbed so you can evaluate any setting yourself. Educational material only, not financial advice: no setting turns RSI into a profit engine, backtests are not forecasts, and trading carries a real risk of loss.
There are no evidence-backed "best" RSI settings — not for the 5-minute chart, not for scalping, not for any timeframe. Changing the RSI length or the overbought/oversold bands changes how often the indicator signals and how smooth it is, not whether those signals carry an edge. The famous 14-period, 70/30 configuration is simply the default J. Welles Wilder published in New Concepts in Technical Trading Systems (1978) — a starting point from the era of hand calculation, not an optimized truth.
That answer is unsatisfying next to the confident broker articles claiming RSI 7 with 80/20 bands is "best for scalping" or RSI 21 is "best for swing trading," so it is worth saying plainly what those claims actually are: the output of trying several settings on some historical window and reporting the winner. Try enough combinations and one of them must look best in that sample — by arithmetic, not by merit. Whether that winner means anything out of sample is precisely the question such articles never test, and the statistics literature on backtest overfitting (covered below) says the default expectation should be that it does not.
What this article offers instead: an explanation of what each parameter mathematically does, so you understand the trade-offs you are actually choosing between; the research-grade reasons magic-number claims fail scrutiny; and a validated Pine Script v6 strategy with the length and bands exposed as inputs, so you can test any configuration yourself on your instrument, with your costs — which is the only version of this question with an honest answer. Educational material only; nothing here is financial advice.
RSI measures the balance of recent up-moves against recent down-moves, smoothed with Wilder's own moving average (the ta.rma() in Pine terms), and maps it onto a 0–100 scale. The length parameter sets the smoothing window, and its effect is mechanical:
The band choice (70/30 versus 80/20 versus 75/25) is the same dial from the other end: wider bands demand more extremity before signalling, trading frequency away for selectivity. Note the interaction — a short length reaches extreme readings so easily that 80/20 with RSI(7) can fire about as often as 70/30 with RSI(14). The two parameters jointly set a signal-frequency budget; neither manufactures predictive power.
And one behaviour no setting fixes: in a strong trend, RSI pins near an extreme and stays there. Mean-reversion readings during a persistent trend generate a stream of losing counter-trend signals whether the length is 7 or 21. That is a regime problem, and it lives entirely outside the settings menu. Choosing RSI parameters is a design decision about trade frequency and holding period — it is not, and cannot be, an edge discovery.
Claims of a best setting fail for a reason with a formal name: multiple testing. Evaluate many parameter combinations on one historical sample and the best performer is partly — often mostly — selected luck. The expected best of N random configurations improves with N even when none has any real edge, so "we tested many settings and this one won" is, by itself, evidence of almost nothing.
This is not a fringe caution; it is quantified in the core research. Halbert White's Reality Check for Data Snooping (Econometrica, 2000) and Peter Hansen's Test for Superior Predictive Ability (2005) built the formal machinery for asking whether a best-of-many rule beat a benchmark by more than selection luck — and technical trading rules were a motivating application. David Bailey, Jonathan Borwein, Marcos López de Prado and Qiji Zhu, in Pseudo-Mathematics and Financial Charlatanism (2014) and The Probability of Backtest Overfitting (2017), showed how quickly an optimized backtest becomes statistically meaningless as the number of trials grows, and Bailey and López de Prado's Deflated Sharpe Ratio (2014) provides the correction: discount the winning configuration's performance by the number of configurations searched. Under that discipline, a mild in-sample advantage for RSI(7) over RSI(14) — the entire evidentiary basis of most "best settings" articles — typically deflates to nothing.
Add the practical tells: the recommended numbers differ from one broker blog to the next; the testing window, instrument, and costs are rarely disclosed; and transaction costs — which bite hardest at exactly the higher signal frequencies short settings produce — are usually omitted. A parameter choice whose superiority vanishes when you account for search breadth and costs is not a finding. It is a headline.
The honest replacement for someone else's magic number is a testbed where every parameter is an input you can vary on your instrument, your timeframe, and your cost assumptions. The following Pine Script v6 strategy exposes the RSI length, both bands, and a stop-loss — and the stop input is genuinely wired into strategy.exit(), not decoration:
//@version=6
// Educational only — validate before trading; not financial advice.
strategy("RSI settings testbed", overlay = false)
rsiLen = input.int(14, "RSI length", minval = 2)
obLevel = input.int(70, "Overbought level", minval = 50, maxval = 99)
osLevel = input.int(30, "Oversold level", minval = 1, maxval = 50)
stopPct = input.float(2.0, "Stop-loss (%)", minval = 0.1)
r = ta.rsi(close, rsiLen)
longSig = ta.crossover(r, osLevel)
exitSig = ta.crossunder(r, obLevel)
if longSig and barstate.isconfirmed and strategy.position_size == 0
strategy.entry("Long", strategy.long)
if exitSig and barstate.isconfirmed and strategy.position_size > 0
strategy.close("Long")
// Wire the declared stop input into the exit — no dead risk inputs.
if strategy.position_size > 0
strategy.exit("Stop", "Long",
stop = strategy.position_avg_price * (1 - stopPct / 100))
plot(r, "RSI", color = color.new(color.purple, 0))
hline(obLevel, "Overbought")
hline(osLevel, "Oversold")Mechanics worth noting: entries use ta.crossover() on the band rather than a raw level comparison, so each signal fires once per crossing instead of every bar spent below the band; both entry and exit are gated on barstate.isconfirmed, so nothing acts on a still-forming bar; and before comparing settings you should set realistic commission and slippage in the strategy Properties — cost assumptions move the ranking of short versus long lengths more than almost anything else. Run it with 7/80/20, 9/75/25, 14/70/30, 21/70/30 and watch what actually changes: mostly trade count and holding period.
Once the testbed produces numbers, the discipline is in the interpretation. Four habits separate an honest read from self-deception.
Look for plateaus, not spikes. Chart performance across neighbouring lengths. If 12 through 16 all behave similarly, the region is at least stable; if length 9 shines while 8 and 10 are mediocre, you have almost certainly photographed noise. A real property of the market should not evaporate one parameter step away — this is the practical, visual counterpart of the overfitting statistics from earlier.
Count your trials and discount accordingly. Every combination you evaluated is a lottery ticket, and the deflated-Sharpe logic applies to you exactly as it applies to a broker blog: the more settings you searched, the better the best one must look before it means anything. Twenty combinations tried means the winner earned most of its shine from selection alone.
Hold data out. Choose settings on one segment of history and evaluate them untouched on a later segment — or walk the split forward through time. The routine result is sobering: the in-sample winner regresses toward the pack out of sample. That regression is not bad luck; it is the overfit component washing out, and seeing it firsthand is the fastest education in this entire subject.
Price the frequency. Shorter settings multiply trade count, and every extra trade pays spread and slippage. A configuration that edges ahead gross can rank last net. Any comparison run at zero cost is fiction.
After all of that, the honest default is unglamorous: treat 14/70/30 as the null hypothesis and deviate only when a change survives out-of-sample testing at realistic costs. Educational only, not financial advice — no RSI setting turns the indicator into an edge, a backtest is never a forecast, and trading carries a real risk of loss.
Educational only — not financial advice. Trading involves substantial risk of loss.