← All courses
Intermediate · Free course

Strategy & Backtesting

Turn an idea into a testable rule, then find out whether it actually works. Regimes, one-sentence strategies, honest backtests and position sizing.

5 lessons·28 min read ·No account needed
01Regimes: why the same strategy wins then loses 5 min

Markets alternate between trending and ranging conditions, and almost every strategy is secretly a bet on one of them. Breakout systems make money when price keeps going and bleed when it reverses. Mean-reversion systems do the opposite. Neither is "better"; each is a bet on regime.

This explains the most common beginner experience: a strategy works beautifully for two months, then stops. Nothing broke. The regime changed.

You can measure it. ADX quantifies trend strength; ATR relative to its own average gives volatility state. Our own testing found that gating a Donchian breakout with ADX ≥ 15 lifted profit factor from 1.37 to 1.47 — while the textbook ADX ≥ 25 over-filtered and cut returns below baseline. The conventional number was wrong for this strategy.

The takeaway: do not ask "does this strategy work?" Ask "in which regime does it work, and how will I know I am in that regime?"

02Building a rule you can state in one sentence 6 min

Here is a complete strategy: "Buy when price closes above the highest high of the last 20 bars; stop 2×ATR below entry; trail the stop 3×ATR behind the highest high since entry."

That is a Donchian breakout. It has no indicators you need to buy, no optimisation, and three parameters. You could code it in an afternoon. It is also, in our testing, one of the few structures with a defensible edge on trending instruments.

Note what makes it good: every term is unambiguous. "Highest high of the last 20 bars" has exactly one meaning. Compare that with "buy when momentum confirms" — which requires you, in the moment, to decide what confirmation means.

Parameters are dangerous in proportion to their number. Three is workable. Twelve means you will find something that fits history perfectly and predicts nothing — the definition of curve-fitting.

The takeaway: prefer few parameters and coarse values. If a strategy only works at exactly 20 bars but fails at 18 and 22, it did not find an edge — it found a coincidence.

03Your first backtest, and the lies it tells 6 min

Your first backtest will look amazing. It is almost certainly wrong, in at least four ways.

Look-ahead bias. Using the closing price of the bar you are entering on. In reality you do not know the close until the bar is over. Always signal on bar n−1, enter on bar n.

Ignoring costs. Add spread on entry, and be pessimistic. If your results collapse when you add realistic costs, you never had an edge.

Optimistic fills. If a bar touched both your stop and your target, which happened first? You cannot know from bar data. Assume the stop. Anything else flatters the result.

Survivorship in your own process. If you test thirty variations and report the best, you have not found an edge — you have run a lottery and reported the winner.

The takeaway: a backtest is not evidence that a strategy works. It is evidence that it has not yet been ruled out.

04In-sample, out-of-sample, and the split-half test 6 min

The simplest honest test: cut your history in half. Develop only on the first half. When you are finished — genuinely finished, no more tweaking — run it once on the second half.

If the edge survives, you have something. If it vanishes, you fitted noise. The critical rule is that you get one look. If you go back and adjust after seeing the second half, that half is now in-sample too, and you have no clean test left.

We hold every strategy to a three-part bar: expectancy above zero, a sample of at least 80–100 trades, and both halves positive independently. A strategy that makes all its money in one period is not an edge, it is an episode.

Our Straddle strategy passed this on USD/JPY across 1,710 trades: +0.139R in the older half and +0.101R in the recent half. Consistency across halves, plus a large sample, is what separates a real edge from a lucky cell in a spreadsheet.

The takeaway: one impressive number proves nothing. Consistency across independent periods and configurations is the actual evidence.

05Position sizing: fixed fractional 5 min

Sizing is where most edges die. Get it wrong and a profitable strategy still ruins you.

Fixed fractional is the sane default: risk a constant percentage of equity per trade, typically 0.5–1%. Size follows from the stop distance:

Position size = (Equity × Risk%) ÷ (Stop distance × Value per point)

Because the stop distance varies with volatility, position size varies too — smaller in wild markets, larger in calm ones. That is the mechanism doing its job.

What about Kelly? Kelly sizing maximises long-run growth if you know your edge precisely. You do not. Your win rate and payoff are estimates from a limited sample, and Kelly is brutally sensitive to overestimating them. Half-Kelly or less, and only after hundreds of live trades.

The takeaway: decide risk per trade before you look at the setup. The best setup you have ever seen is not a reason to size up — that instinct is precisely what blows accounts.

This course is free and always will be. It teaches method, not predictions. Nothing here is investment advice, and finishing it will not make you profitable — it will make you able to tell whether a strategy is worth trading. Most retail accounts lose money; the point of this material is to make you harder to fool, including by yourself.
Next

Validation & Deployment

Start Level 03 →