Costs in a backtest
Every trade in our backtests pays a cost, on by default. What is charged, what is not, and why turnover decides how much it matters.
1 min read
Open strategiesOn this page3 sections
A backtest with free trading flatters any rule that trades often. Ours charges a cost on every trade unless you switch it off, and says clearly when it is off.
What is charged
- Each trade pays a number of basis points of the amount bought or sold. One basis point is 0.01%.
- The default is 10 basis points, which is 0.10% of each trade. In the backtester you can set it anywhere from 0 to 200.
- The cost is taken from the portfolio at the moment of the trade, so it compounds.
- The page shows the total drag: how much of the portfolio costs consumed over the whole test.
- Cost: 10 basis points per trade.
- A rule that replaces 20% of the portfolio each month trades about 240% of its value a year on one side, 480% counting both the sells and the buys.
- Yearly cost: about 0.48% of the portfolio.
- The same rule rebalanced quarterly at 20% a time: about 0.16% a year.
What is not charged
- Taxes. Frequent rebalancing in a taxable account turns gains into short-term gains. This can be larger than every other cost combined and depends entirely on you.
- Wider bid-ask spreads on small or thinly traded stocks. Ten basis points is reasonable for large US stocks and optimistic for small ones.
- Price impact. A large order moves the price against itself.
- Interest on cash. Empty slots sit in cash at 0%. Real cash would have earned a little, so this one works against the strategy.
The comparison line pays nothing
SPY is bought once and held, so it has almost no trades to charge. Its own fund fee is already in its price. This is fair: it is what holding the index would really have cost.
Read next
- How each number is computedThe exact definition of total return, CAGR, volatility, Sharpe, max drawdown, hit rate and turnover as our engine calculates them.
- Lookahead, and how trades are timedA backtest cheats if a decision uses a price it could not have known. The exact timing rule our engine follows, and the one place hindsight still gets in.
- CAGR calculatorTurn a starting value, an ending value and a period into a yearly growth rate, and see what a rate does to a starting amount.
Something here wrong or unclear? Tell us. Informational only, not investment advice.