How this site’s backtest works: rules, costs and limits
The backtest is a single-stock, long-only, all-in daily-bar backtest: signals are judged after the close and filled at the next open, with fees and transaction tax included. It makes many simplifications, so treat the result only as a reference on history.
Updated:
Basic rules
- Single stock, long only, all in and all out: one stock per run, buying with all the capital on entry and selling everything on exit.
- Daily bars: calculated from daily open, high, low, close and volume.
- No look-ahead bias: a signal is judged after the close of day t and filled at the open of day t+1, never at the same day’s close.
- Adjusted prices: adjusted prices are the default so that ex-dividend dates do not create false gaps (see “Ex-dividend and adjusted prices”).
Entry and exit conditions
- Entry conditions: up to 5, all of which must hold (AND).
- Exit conditions: up to 5, all of which must hold; you can also add a stop-loss, take-profit or maximum holding days.
- Condition types: moving-average crossovers up or down, close above or below an average, RSI above or below a value, single-day change, a new N-day high or low, volume above a multiple of average volume.
Costs
- Brokerage fee: 0.1425% by default, charged on both buy and sell.
- Transaction tax: 0.3% by default, charged on sells.
- Both can be changed in the settings (for example to reflect a broker discount).
- Trading unit: one lot (1,000 shares) by default; if capital cannot buy a lot, that entry signal is skipped and the skipped count is shown. You can switch to odd lots.
Result metrics
- Total return and annualised return (CAGR): over the whole period and converted to per year.
- Maximum drawdown: the largest fall of equity from a peak.
- Trades, win rate and average holding days.
- Exposure: the share of days holding the stock.
- Buy and hold: the return of buying at the start and holding to the end, for comparison.
If still holding at the end, the last close (less selling costs) is used and flagged as an end-of-period valuation.
What this backtest does not consider
- Slippage: it assumes the open price can always be filled; limit up or down, gaps and thin volume that prevent a fill or move the price are not modelled.
- Dividend income tax and supplementary premiums.
- Allocation and multiple stocks: only a single stock is tested.
- Survivorship bias: you choose the stock; picking one that still exists and did well makes results look better than they were.
- Overfitting: conditions and parameters can be tuned until history looks good, which does not mean they work going forward.
Using it sensibly
- Treat it as a tool for seeing what a condition looked like in history, not a forecast.
- Check that results hold up across different stocks and periods.
- Compare with buy and hold, and remember that very few trades carry little statistical weight.
Past backtest results do not guarantee future performance. This article only explains methods and limits; Tenmizu does not provide investment recommendations and this is not investment advice.
See it on this site
Citing and copyright
This article is original content of “Tenmizu FinTech”. You are welcome to cite it; please credit the source and link to this page. Concepts or data that come from others are credited under “Sources”; their copyright belongs to the original authors.