Step 1: Write Rules A Computer Could Follow
A backtest can only test what is written down. "Buy when it looks strong" cannot be tested. "Buy when the closing price crosses above the 50-day moving average and volume is above its 20-day average" can.
Write down your market filter, entry rule, stop loss, exit rule and position size. If any rule needs your judgment in the moment, the backtest will not reflect how you actually trade.
- Market and timeframe: for example, large-cap US stocks on the daily chart.
- Entry: the exact condition that opens a trade.
- Stop loss: where you admit the idea is wrong.
- Exit: a target, a trailing stop or a time limit.
- Size: the percentage of the account risked per trade.
