If you have read three beginner guides to algorithmic trading and come away knowing what it is but not whether it works, this is for you. The problem with those guides is not that they are wrong. It is that nobody in them measured anything.
So here is a different kind of guide. Eight rules, and every one of them is a number I measured on this site rather than a thing people say. Where the received wisdom holds up, I will say so. Where it does not, I will show you the number that kills it.
Start with the one that matters most, because it is the one no beginner is told.
TL;DR — the answer box
- On data with no edge at all, the median best of a 384-variant search is 9.2% a year. Optimising 384 ordinary RSI variants on three years of shuffled, drift-free data, where a true edge cannot exist, produced a median best result of 9.2% a year, and a 1-in-20 result of 20.8%. Your backtest is only worth what it earns above that.
- Making money is common. Beating the market is not. Of 5,472 tested strategy variants, 2,626 were profitable. Only 473 of those 2,626 beat simply buying and holding the same market, an 18.0% pass rate among the profitable ones and 8.6% of everything tested.
- Which way you trade matters far more than which indicator you use. Across 33,792 variants: long 89.7% profitable versus short 8.8%. The choice between three different oscillators moved the odds by a fraction of that.
- A high win rate is not a profit. Five variants won more than 60% of their trades and still lost money. The worst case above a 55% win rate won 55.1% of its trades and lost $21,637.
- One check does almost all the work. With no checks, 63.7% of strategies were still profitable on data they had never seen. Requiring every parameter setting one grid step either side of yours, diagonal combinations included, to be profitable too takes that to 91.7%, which is 95.4% of the precision gain the four-check list reaches.
How I built this guide
This page runs no backtest of its own, and that is deliberate.
Every number above and below is recomputed from a study already published on this site, pulled straight out of that study's committed result files by a script (research/compute_facts.py). Ten source files across five studies. Nothing here is hand-typed, and if one of those studies is ever re-run, the numbers in this guide follow it.
The studies behind it cover 5,472 strategy variants in one case and 33,792 in another, on US index ETFs and a handful of futures markets, tested on daily bars. All of them run one unit, no leverage, no stops, and frictionless unless a cost is explicitly charged. They are not all long-only: the oscillator study and the RSI study both test long and short, which is where the direction splits below come from. Real trading is none of those things, which is why the limits section near the end is not optional reading.
One more piece of housekeeping. "Out-of-sample" throughout means history that was deliberately held back and never used to build the strategy. It is the closest thing to a fair test you can run without waiting years. It is still not the future.
What is algorithmic trading, actually?
A set of rules, written down in advance, tested on history, and executed without you deciding anything in the moment.
That is the whole idea. The "algorithmic" part sounds like machine learning and microwave towers. For a retail trader it means something much plainer: you decide what you would do, before the market makes you feel anything, and then you do exactly that.
The appeal is obvious. No hesitation, no revenge trades, no talking yourself out of a plan at the worst moment. The catch is less obvious, and it is the entire subject of this guide: the moment you can test a rule on history, you can also fool yourself with history. Everything that follows is about the second part.
Why does a backtest look good even when there is nothing there?
Because searching is not the same as finding. This is overfitting, and Bailey, Borwein, Lopez de Prado and Zhu (2014) showed how severe it gets in backtesting specifically: try enough variants and an impressive in-sample result is the expected outcome even when the data contains no edge at all, which is exactly what the shuffled test below demonstrates from the other direction.
I took an ordinary RSI strategy, shuffled the price data so no sequence remained, and removed the upward drift, leaving data where a true edge is impossible by construction. Then I optimised 384 variants on it, exactly as a beginner would, and kept the best.
| Years of data | Variants tried | Median best CAGR | 1-in-20 best CAGR |
|---|---|---|---|
| 3 | 384 | 9.2% | 20.8% |
| 5 | 384 | 6.6% | 15.9% |
| 10 | 384 | 4.6% | 10.7% |
| 20 | 384 | 3.1% | 7.8% |
Read the top row again. Three years of data, 384 variants, no edge available, and the median best of those searches still returns 9.2% a year. One search in twenty produced a best of 20.8%.
That number is your noise floor, and it is the most useful thing in this guide. A backtest is not good because it made money. It is good because it made money above what nothing makes. On three years, 9.2% a year is nothing. On twenty years, the same search only manufactures 3.1%, which is why longer tests are harder to fake.
Short backtest, many variants, spectacular result. That result alone is not evidence of an edge. It is a search.
Can a beginner actually beat the market?
Rarely, measured on strategies rather than traders: of the variants tested here, 8.6% beat buy-and-hold. That is the number that should reset your expectations before you spend a year on this. That difficulty is what the efficient-market hypothesis predicts in its weaker forms, and it is worth reading the SEC's own investor education on day trading before risking money, because the regulator's framing of the risks is blunter than most trading education.
Of 5,472 strategy variants tested across eight markets:
| Stage | Survivors | Share of all tested |
|---|---|---|
| Backtested | 5,472 | 100% |
| Profitable in-sample | 2,626 | 48.0% |
| Beat buy-and-hold | 473 | 8.6% |
| Survived all seven robustness filters | 262 | 4.8% |
Nearly half made money. Under a fifth of those beat simply owning the thing — an 18.0% pass rate — and 262 survived a full robustness gauntlet.
So: making money is common, and it is also not the goal. If a strategy returns 6% a year while the index returns 9%, you did a lot of work to underperform a decision you could have made once and forgotten. The benchmark is not zero. The benchmark is buy-and-hold, and most strategies do not beat it.
Which indicator should I start with?
Wrong question, and the data is unusually blunt about it.
I ran 33,792 variants across three different oscillators — RSI, Stochastic and Williams %R — on four index ETFs. Here is what actually moved the outcome:
| The choice | Option A | Option B | Gap |
|---|---|---|---|
| Direction | Long 89.7% profitable | Short 8.8% | 81 points |
| Entry style | Mean-reversion 55.7% | Breakout 42.9% | 13 points |
| Indicator (setup fixed) | Williams %R 100.0% | RSI 89.6% | ~10 points |
Deciding to trade long rather than short moved the odds by 81 percentage points. Choosing between three completely different indicators, once the setup was fixed to long mean-reversion, moved it by about ten — and all three still worked, with Stochastic at 99.8%.
In this 33,792-variant grid, choosing among the three oscillators moved the profitable share less than direction or entry style did. The setup, meaning which direction you trade and whether you are buying dips or chasing moves, is where the outcome in this grid was decided.
Buying a better set of golf clubs does not fix your swing. Same shape of mistake.
Is a high win rate a good sign?
Not on its own, and this is the trap that catches people who are otherwise being careful.
Across 1,856 RSI mean-reversion variants, five of them won more than 60% of their trades and still lost money. The worst case with a win rate above 55%: it won 55.1% of its trades and lost $21,637.
Win rate tells you how often you are right. It says nothing about how much you make when you are right versus how much you lose when you are wrong. A strategy that wins most of its trades in small increments and loses catastrophically in the rest is a losing strategy with a comforting statistic on the front of it.
Look at the money, not the hit rate.
How many trades does a backtest need?
More than you have been told. The usual advice is thirty. Thirty is far too few.
| In-sample trades | Variants | Still profitable out-of-sample |
|---|---|---|
| Under 30 | 1,256 | 70.3% |
| 30–99 | 1,408 | 85.2% |
| 100–299 | 993 | 87.0% |
| 300–999 | 225 | 95.6% |
A strategy built on fewer than thirty trades survived out-of-sample 70.3% of the time. One built on 300 to 999 trades survived 95.6% of the time. That is the difference between a coin you are fairly confident about and one you can actually plan around.
If your beautiful backtest rests on eleven trades, you have not tested a strategy. You have looked at eleven things that happened.
How bad will the drawdown get?
Worse than the backtest said, in the one strategy I resampled.
I took one winning strategy — 470 trades — and resampled the order of those trades 10,000 times. Same observed trades, different sequence, which is the one thing you have no control over in live trading.
- Backtested worst drawdown: 27.4%.
- That figure sat at only the 29th percentile of possible orderings — meaning most sequences were worse.
- One run in twenty reached 37.6% or worse.
- The worst of 10,000 reached 65.1%.
- 2.4% of orderings drew down more than 1.5 times the backtested figure.
Your backtest shows you one draw from a deck. In the one strategy resampled here it was not the worst card, and it was not the median one either: it sat at the 29th percentile.
Size your position off the tail, not off the backtest. If a 27.4% drawdown is your limit, a strategy that backtests at 27.4% is already too big for you — that number was only the 29th percentile of its own outcomes.
What is the minimum I should check before risking money?
One check. Not eleven, one.
I scored eleven common validation checks by how well each predicted whether a strategy still worked on history it had never touched. The short lists were picked on a separate, earlier slice of history, keeping only lists that let through at least 30% of the strategies that survived there, then scored on a final quarter no check saw:
| Checks applied | Still profitable out-of-sample | Candidates passing |
|---|---|---|
| None | 63.7% | 100% |
| Every parameter neighbour also profitable | 91.7% | 53.1% |
| 2 checks | 92.4% | 41.6% |
| 3 checks | 93.0% | 40.5% |
| 4 checks | 93.1% | 39.0% |
One check takes you from 63.7% to 91.7%, which is 95.4% of the precision gain the four-check list reaches. Each check the short lists added after it bought under a point, and every one shrank the pool you get to trade.
The check itself: move each parameter one grid step either side of your setting, diagonal combinations included. If any of those neighbours, or your own setting, was not profitable over the sample you built on, drop the strategy.
The obvious alternative is to keep adding whichever check raises the hit rate most. That route takes a development Sharpe of at least 0.5 first (94.5%), then at least 100 trades (97.5%), and ties what all eleven checks deliver together. It also leaves you 6.5% of your candidates and keeps 10.0% of the strategies that went on to survive.
That is good news for a beginner. You do not need a professional validation stack to start. The neighbour check runs on the sample you built on. What it buys you is measured on the history you held back, and that is where the 91.7% comes from. One limit: on the earlier slice where the lists were picked, every longer list scored higher than the single check, so stopping at one is my reading of the final quarter that also scores it.
What does the market do on its own?
Before you try to beat it, know what you are beating — and what it will put you through.
Since 1871 the S&P 500 has had 32 declines of 10% or more. 17 of those reached 20% or worse. For those 17:
- Median depth: −36.1%.
- Deepest on record: −86.2%.
- Median time from peak to trough: 517 days.
- Median time back to the old high: 639 days.
Every one of them recovered. That last sentence is true and it is also the most dangerous sentence in this guide, because it is the survivor's history of one index that happened to win. It is not a law of markets.
The useful reading is the first four numbers. Taken one median at a time across those 17 declines, the depth is about a third of your money, the fall takes roughly seventeen months, and the climb back takes well over a year. That is the thing you are volunteering to improve on.
The verdict — and the honest limits
Some rule-based strategies survive the tests: 262 of 5,472 variants here cleared all seven robustness filters. That is 4.8%, and it is not how the guides sell it.
Where the standard advice is right, in my experience rather than in these numbers: rules beat improvisation, testing beats opinion, and the process is learnable without a computer science degree. Nothing in the data argues against any of that.
Where it is wrong, going by the numbers in these five studies:
- Backtest results are not evidence until you subtract the noise floor. A three-year search over a few hundred variants manufactures 9.2% a year from nothing.
- Beating the index is the actual bar, and only 8.6% of tested variants cleared it.
- The choice between the three oscillators tested moved the odds least, well behind the direction and the entry style.
- You need far more trades than thirty, and a bigger drawdown budget than your backtest suggests: resampling the trade order of one 470-trade strategy put one run in twenty past 37.6% against its backtested 27.4%.
Limits. Read these before using any number above. This is historical measurement and education, not investment advice. Every backing study runs one unit, no leverage, no stops, no position sizing, and frictionless unless a cost is explicitly charged; adding any of those changes the results. They are not all long-only: the oscillator study and the RSI study both test long and short. The strategy studies run on US index ETFs and a handful of futures, so if you trade something else, assume the numbers move. "Out-of-sample" means held-back history, not the future. And this guide is a synthesis: it runs no new test, so its authority is entirely borrowed from the five studies it cites, each of which is linked and each of which states its own limits.
What this means for you
- Compute your noise floor before you celebrate. Shuffle your own data, strip the drift, re-run your identical optimisation, and write down the best result. On three years, a 384-variant RSI search on shuffled, drift-free data returned a median best of 9.2% a year. Your edge is your result minus your own version of that number.
- Benchmark against buy-and-hold every single time. Only 473 of 5,472 variants beat it. If yours does not, you have built an expensive way to underperform a decision you could make once.
- Fix the setup before you touch the indicator. Direction was worth 81 percentage points; the indicator choice, about ten.
- Ignore win rate until you have seen the money. Five variants won over 60% of their trades and still lost.
- Demand trades. Under thirty in-sample trades, 70.3% survive; at 300 to 999, 95.6%.
- Budget for 1.5 times your backtested drawdown, a rule drawn from one strategy. In that strategy only 2.4% of 10,000 resampled orderings drew down more than 1.5 times the backtested 27.4%, which sat at the 29th percentile. One run in twenty hit 37.6%.
- Run one check, not eleven. Make sure every parameter setting one grid step either side of yours, diagonal combinations included, is also profitable. That takes you from 63.7% to 91.7%, and each check the study's longer lists added after it bought under a point.
Everything above has a study behind it. If you want the deep version of any one rule, the next reads in order are why most traders fail the robustness test, the one-check validation checklist, which oscillator actually matters, whether the "better" RSIs are better, what Monte Carlo says about your drawdown, and every S&P 500 drawdown since 1870.
And if you would rather ask about any of this than read about it, the StatOasis community is free to join and is where the research behind these eight rules gets discussed in the open.








