How to Build and Test a Trading Strategy
An untested strategy is just an idea with rules attached. This is the process I'd follow to get from a first idea to a rule set you can trust.
Written By
Karolina Hansen
Key Takeaways
- Your rules should be specific enough that you, or someone who knows what they're looking at, could apply them the same way every time and judge the results.
- Backtesting tells you whether the idea held up in the past. Forward testing tells you whether you can actually trade it live.
- You need both. A great backtest won't save you if you can't stick to the rules when the chart is moving.
- After the first proper test, most strategies need tweaking rather than throwing away.
Building a trading strategy means turning a market idea into a specific set of rules you can repeat: when you get in, when you get out and how much you risk. Those rules need to be precise enough that you, or someone who knows what they're looking at, could apply them the same way each time and judge the results. Testing comes in two parts. First you backtest the rules against history. Then you forward test them on a demo account to see whether you can follow them in real time without drifting. Only after that should real money go anywhere near the idea. Skip either step and you're mostly trading a hunch with extra paperwork.
From Idea to Rules
Most strategies start as a loose observation, something like "price tends to bounce off this level" or "this pattern seems to work." That isn't a strategy yet. It becomes one when you write it down as clear rules with no wiggle room: the exact entry conditions, the exact exit logic and the exact position size. If any part still needs a judgment call in the moment, you haven't finished.
The Four Stages
Define the Idea
One specific market condition or pattern, described in a sentence or two
Write the Rules
Entry, exit and sizing, with as little room for interpretation as you can manage
Backtest It
Run the exact rule set over real historical data
Forward Test It
Trade it on demo in real time, exactly as written, before any real money goes in
What Makes a Rule Set Testable
Vague wording is one of the commonest reasons a strategy falls apart once you test it properly. "Enter when momentum looks strong" can't be tested, because you'd be making a judgment call every single time. "Enter when the 20-period moving average crosses above the 50-period on the 4-hour chart, with price above both" can. Whoever looks at the chart gets the same answer.
A Testable Rule Set
- You can define the entry and exit conditions objectively
- Position size comes from a fixed formula
- Someone else could follow your rules and end up with the same trades
A Rule Set That Isn't There Yet
- Entries depend on "feel" or discretion
- Stops and targets move from trade to trade with no written rule behind them
- You're the only one who can say when a setup is "valid"
Backtesting: How Did It Do in the Past?
Run your exact rules over historical price data and log every trade they would have taken, with entries, exits and results. Be strict about hindsight. It's very tempting to quietly skip the trades you can now see didn't work. Sample size matters too, because a handful of trades tells you very little. No sample size proves an edge on its own. Bigger samples cut the uncertainty, and testing across different market conditions matters as much as the raw count. For a lot of higher-frequency retail setups, 100 trades is a sensible practical milestone, but it isn't a statistical certificate.
Forward Testing: Checking You Can Execute It
A backtest shows whether the rules worked on paper. It can't tell you whether you'll actually follow them in real time, with a live chart moving and that small but very real pressure on you. Forward testing means trading the exact rule set on a demo account, live, as the market moves. That's where you find out about your own execution, separately from how the strategy did historically.
When to Trust It Enough to Go Live
No fixed number of trades makes a strategy "proven." Consistency is the better signal. Can you forward test it on demo without straying from the written rules, over enough occurrences to properly judge your own execution? And do the backtest and forward test results stay reasonably close to each other while you do?
Download the Strategy Template and write entry, exit and sizing rules specific enough to test properly.
Get the TemplateFrequently Asked Questions
There isn't one magic number. A very small sample comes with a lot of uncertainty. How many you need depends on your win rate, how your wins and losses are spread, how often the setup appears and how much results vary, not on a fixed threshold like 30 or 50.
That gap is useful information. Usually it points to one of two things: execution drift (you're not following the rules exactly) or market conditions that have changed since the period your historical data covers.
You can. Backtesting is usually the quicker and cheaper first filter, though, because you can judge an idea without waiting weeks for the same number of demo or live setups to turn up.
Educational content only, not financial advice. Trading involves risk, and past performance does not guarantee future results.
Continue learning
What Is Backtesting, and How Much Is Enough?Backtesting tells you whether an idea has ever actually worked. No fixed number makes a sample 'enough', so here's how to think about it instead.Also worth reading: Who's on the Other Side of Your Trade? How the Market Works · Demo vs Live Account: What Practice Money Can't Teach You · Your First Trade on MT5: A Click-by-Click Walkthrough · Your First Month of Trading: A Calm Four-Week Plan
Related resourceStrategy TemplateA fillable rule set plus a backtesting log summary, following the process above.