What is backtesting
Backtesting replays trading rules over historical data to see how they would have behaved. Learn the three parts that make a test trustworthy, and the traps that make one lie.
Part of the Backtesting and Research track on Agenticks. About 9 minutes, written for a advanced reader.
A backtest is a test that takes a fixed set of trading rules and runs them over past price data to see how they would have behaved. That is the whole idea, and it is more honest than it sounds. You are not predicting anything. You are asking a narrow question: if I had followed these exact rules across this stretch of history, what would have happened? The reason this matters is that most trading opinions are untestable. "This setup works" is a feeling. A backtest forces the feeling into something measurable, then lets the numbers, not your memory, decide whether the idea has any structure.
Backtesting is three honest parts
Past data, plus strict rules, plus honest evaluation. Drop any one of the three and the test stops meaning anything. Real history keeps it grounded. Strict rules keep you from quietly changing your mind. Honest evaluation keeps a lucky run from being mistaken for an edge.
The strict rules part is where most people cheat without noticing. A rule has to be written down precisely enough that a computer, or a stranger, could follow it the same way every time. "Buy when it looks strong" is not a rule. "Enter long when price closes above the prior day's high, exit at a fixed stop or the close of the session" is a rule. If you cannot write the entry and exit as something mechanical, there is nothing to test yet. You are still describing a vibe. Turning the vibe into a rule set is the real work, and it usually exposes how vague the original idea was.
The historical data part sounds boring and is quietly the most dangerous. A test is only as trustworthy as the data behind it. Gaps, bad ticks, the wrong timeframe, or a sample that only covers one calm market can all produce a clean-looking result that means nothing. And a backtest only ever describes the past. It is not a forecast. The market regime can change, your fills will differ, and costs you ignored in the simulation are real when money is live. A backtest tells you whether an idea ever had structure. It does not promise that structure repeats.
Honest evaluation is the hardest part
A single rising equity line is easy to fall in love with. Honest evaluation means asking the uncomfortable questions instead: How many trades is this based on? What was the worst losing stretch? Would the average win still cover the average loss if I had been a little less lucky? The math, not the screenshot, has the final say.
Two numbers do most of the early work. Sample size is how many trades the result rests on. With ten trades, luck dominates and the numbers mean almost nothing. With a few hundred across different conditions, you can start to believe them, though never with certainty. Expectancy is the average amount you would expect to win or lose per trade over many trades, given how often you win and how big your wins and losses are. A positive expectancy across a large sample means the rules lean in your favor mathematically. A negative one means they do not, no matter how good a few cherry-picked trades looked.
There is one more number you cannot skip: the worst peak-to-trough drop in the account, the drawdown. Even a profitable set of rules can put you through a losing stretch deep enough that most people would quit before it recovered. A result that looks great on paper but only survives if you can stomach a brutal dip is not really usable. The size of the worst stretch is part of whether an idea is tradeable at all.
rules data honest
- Backtest
- Replaying fixed rules over past price data
- Expectancy
- Average win or loss expected per trade
- Sample size
- How many trades the result rests on
- Drawdown
- The worst peak-to-trough drop in the account
Put the backtesting steps in the order you should actually do them.
- Write the idea as strict, mechanical rules
- Run the rules over real historical data
- Read sample size, expectancy, and drawdown
- Decide honestly whether the idea is worth more work
Which statement is the most honest description of what a backtest tells you? Whether a set of rules had structure over the past data you tested Exactly. A backtest describes the past. It can show structure, but it cannot promise the structure repeats.
A results screen is where the numbers live: trade count, expectancy, and the worst drawdown all sit next to the equity curve, so you read them together.
You understand what a backtest really is
Past data, strict rules, and honest evaluation. You can now tell the difference between a real test and a good-looking screenshot.
Common questions
- What is backtesting in simple terms?
- Backtesting is replaying a fixed set of trading rules over past price data to see how those rules would have behaved. You define the entries, exits, and risk, then step through history bar by bar and collect the results.
- Does a good backtest predict future profit?
- No. A backtest describes the past only. It can tell you whether an idea ever had structure, but it cannot promise the same behavior will repeat, because future conditions and your own execution will differ.
- Why do so many backtests fail when traded live?
- Common reasons include too few trades, rules tuned to fit past noise rather than a real pattern, and real-world costs like fees and slippage that the simulation ignored. Honest evaluation guards against all three.
Terms defined in this lesson
Continue
Sources