In questa pagina
"Buy when RSI drops below 30" sounds like a strategy. It isn't — it's half of one, and the half that's missing is the part that decides whether it makes money. Backtesting is how you find out before risking capital. This walkthrough takes an RSI idea from a one-line hunch to a result you can actually trust, and points out the three places almost everyone fools themselves.
Step 1: turn the idea into complete rules
A backtestable strategy answers four questions, not one: when do you enter, when do you exit, how much do you risk, and under what conditions is the whole thing allowed to trade. "RSI below 30" only answers the first, and weakly. Before you can test anything you need to make every decision explicit.
For a mean-reversion RSI rule that means: an entry trigger (RSI crosses below a threshold), an exit (RSI recovers past a level, or a fixed target), a stop-loss so a losing trade has a floor, and — most importantly — a regime filter. RSI mean reversion only works when the market is ranging; in a strong trend, "oversold" keeps getting more oversold. A filter such as ADX below 20 keeps the rule out of trends where it bleeds.
Step 2: get clean historical data
Your backtest is only as honest as its data. You want real OHLCV candles for the exact symbol, timeframe, and exchange you intend to trade, over a window long enough to include more than one market regime — a bull leg, a bear leg, and a chop phase. Testing RSI mean reversion only on a 2021 bull run will flatter it; the chop and the crash are where the rule earns or loses its keep.
Step 3: run it and read the right metrics
Total return is the worst metric to judge a strategy by, because it says nothing about the risk you took to get it. Read these instead: maximum drawdown (the worst peak-to-trough fall — the pain you'd have to sit through), the Sharpe ratio (return per unit of risk), profit factor (gross wins over gross losses), and win rate alongside average win/loss. An RSI rule with a 70% win rate and tiny wins but occasional huge losses is a losing strategy wearing a flattering hat.
Here is a complete, testable version of the rule — entry, exit, stop, and the regime filter that makes RSI mean reversion viable:
strategy:
name: rsi_meanrevert
indicators:
- { id: rsi, kind: RSI, period: 14 }
- { id: adx, kind: ADX, period: 14 }
rules:
entry:
all:
- { type: below, left: adx, right: 20 } # ranging market only
- { type: crosses_below, left: rsi, right: 30 }
exit:
any:
- { type: above, left: rsi, right: 55 }
risk:
size_pct: 0.5
stop_loss_atr: 2.0Step 4: the test that actually matters — walk-forward
A single backtest over all your history is the easiest result to fake, because you can keep nudging the RSI period and threshold until the curve looks great. That isn't a strategy, it's a memory of the past. Walk-forward optimization fixes this: it tunes the parameters on an early window, then tests them on the *next* window the optimizer never saw, and rolls forward. If RSI-13 only works because it was hand-picked on the whole history, walk-forward exposes it. If the edge survives on unseen data, you have something worth paper-trading.
This is where the overfitting check earns its place. The goal of a backtest is not the prettiest equity curve — it's the most honest one.
Do it in Noon Barbari
You can build every step above without code. Add RSI and ADX from the indicator library, wire the entry/exit/stop in the visual designer, and run the backtest over years of crypto data in seconds. Then run walk-forward to see whether the RSI period is a real parameter or just noise. The free tier covers one full strategy end to end — enough to test this exact rule and see the robustness score for yourself.
Provalo con i tuoi dati
Ogni concetto visto sopra è implementato nella piattaforma. Backtest, walk-forward, paper trading, poi passa al live — stesso set di regole in ogni fase.