Learn the stock market › Test a strategy › Lesson 4 of 5
Costs and tax in the test
The cost per trade
The rule made 589 buys and sells in 98 years; holding made a single purchase. This is how the result changes with a cost on every buy and every sell:
| Cost per buy or sell | The rule | Buy and hold |
|---|---|---|
| 0.0% | 6.9% | 6.1% |
| 0.1% | 6.2% | 6.1% |
| 0.25% | 5.3% | 6.1% |
| 0.5% | 3.7% | 6.1% |
At about 0.12% per trade the rule's lead was already gone.
The cost per trade is several things together:
- Commission, the fee to whoever you trade through. Many US brokers charge none on stocks, as the lesson on trading costs shows, but the other costs remain.
- The spread, the gap between the bid and the ask. It appears on no statement.
- Slippage, the gap between the price the rule counts on and the price you actually get. A rule that trades at the close can rarely get exactly the closing price.
So a test without costs says most about rules that trade rarely.
The tax
In a taxable account a gain is taxed when you sell, and a loss can be set against gains. The rule sells often and pays tax along the way. The holder pays only on selling, and the money that would have gone to tax keeps growing in the meantime. With 15% tax on every gain, and losses set against later gains, the rule returned 5.92% a year against 5.94% for holding and selling at the end.
We used 15%, the rate the IRS says most people pay on long-term gains. A gain on something held a year or less is taxed as ordinary income, usually at a higher rate, and 93% of the rule's trades lasted a year or less. So the real tax on the rule would be higher.
What you don't see without costs
A rule that trades 6 times a year looks good in a test without costs and worse with every cost added. Rules that trade rarely lose less. When you compare two rules, give both the same cost, and test with a higher cost than the one you expect. Otherwise it is easy to fool yourself, as in the lesson on five ways to do it.
Test yourself
Two rules made the same before costs. One makes 4 trades a year, the other 40. Which loses more to costs?
Sources
- IRS, Topic no. 409, Capital gains and losses, read on November 6, 2026.