Trading Edge

How to Backtest a Strategy by Hand, Without Code

You do not need to write code to backtest. You need a chart you can scroll back on, your rules written down, and the patience to log each test trade honestly. Here is how.

M

Milo Maebe

You have a setup idea. You want to know if it would have worked. Every guide you find starts with a programming language.

You do not need one. Traders were testing ideas by hand long before charting software could run code. It takes longer, and it has one advantage: you see every trade with your own eyes.

What is manual backtesting?

It is trying your rules on old charts, by hand. You go back to a date in the past, hide everything after it, and move forward candle by candle. Each time your setup appears, you take the trade on paper and note what happens.

At the end you have a list of test trades. That list tells you how the rules would have done.

Step one: write your rules before you look

This is the step people skip, and it ruins most backtests.

Write down, exactly, what has to be true for you to enter. Where the stop goes. Where the target goes, or how you decide to exit. Which hours you trade.

If you start scrolling before the rules are written, you will bend them without noticing. A setup that "almost" formed and then ran will start to look like it counts. A setup that formed perfectly and then lost will start to look like it didn't.

Written rules protect you from your own hindsight. What is confluence in trading? helps you turn your setup into a short list of checks you can answer yes or no.

Step two: hide the future

Pick a date some months back. Make sure you cannot see what came after it.

Many charting platforms have a replay mode that does this for you. TradingView calls it Bar Replay. You pick a start point, the chart cuts off there, and you press a button to reveal the next candle. If your platform has nothing like it, you can cover the right side of the screen with a sheet of paper and slide it along. It sounds silly. It works.

Step three: step forward and take every valid trade

Move forward one candle at a time. When every rule on your list is met, take the trade. Write down the entry, the stop and the target before you reveal the next candle.

Then keep stepping until the stop or the target is hit. Write down the result.

Take every trade the rules allow, not only the ones that look good. Skipping trades that feel wrong is the backtest version of hindsight.

Step four: log each test trade like a live one

Use the same fields you use for real trades: the date, the market, what you checked, your entry, stop and exit, and the result.

Write the result in R. R is your result in units of risk. If the trade made twice what you risked, it was two R. If it hit the stop, it was minus one R. Measuring in R lets you compare test trades and live trades fairly later.

Mark every one of these trades as a backtest. Keep them apart from your real trades. If they mix, your real record looks better than it is, because some trades were picked with knowledge you did not have at the time.

Step five: test across different markets

A few weeks of charts may all be one kind of market. If the market was trending the whole time, a trend setup will look brilliant, and you learn nothing about how it handles a sideways stretch.

Spread your test across periods that look different: rising, falling and flat. If the setup works in one and fails in another, that is useful. You now know when to use it.

How many test trades do you need?

More than you think. A few dozen trades gives you a hunch. You want well past that before the result means much. How many trades you need before you can trust a setup explains why small groups of trades fool you.

Watch out for one trap. If you test a version, change a rule, test again, and keep the best, you are tuning the rules to the past. Count how many versions you tried. The more you tried, the more likely the winner is partly luck.

What comes after the backtest?

A forward test. Trade the same rules, unchanged, on new price action, with small size. A backtest tells you whether an idea is worth testing. A forward test tells you whether it holds up when you cannot see the future and the money is real. How to turn your trading journal into a trading plan shows the freeze-and-test step.

Short answers

Can I backtest smart money or price action setups by hand?

Yes. Manual backtesting suits setups that are hard to put into code. Write the rules clearly enough to answer yes or no on each candle.

How long does manual backtesting take?

Hours, not minutes. Many traders do a session of one or two hours at a time, and build up a test over a few weeks.

Is a manual backtest reliable?

It is as reliable as your honesty while doing it. Hiding the future and writing rules first make the biggest difference.

Read next:

In EdgeFlow you can log a test trade with the same boxes as a live trade and mark it as backtest. It then stays out of your real numbers unless you turn it on. When you move to live trades, you keep using the same boxes. See how it finds what works. A good backtest is still a starting point, not proof.

Continue reading

Related articles