How to backtest a crypto strategy with fees before you risk money
Published · by Hunt4Coin
Backtesting is running a trading rule on past price candles to see what would have happened if you had followed it exactly, including the fees you would have paid on every buy and sell, so you can reject weak ideas before risking real money.
Why fees belong in every backtest
A spot trade pays a fee twice: once to buy and once to sell. At 0.1% per side, every round trip costs about 0.2%. A strategy that makes 100 small trades a year pays that 100 times, roughly 20 percentage points before any profit. Small targets suffer most:
| Fee per side | Round trip | A +1% move nets |
|---|---|---|
| 0.05% | 0.10% | +0.90% |
| 0.10% | 0.20% | +0.80% |
| 0.40% | 0.80% | +0.20% |
| 0.80% | 1.60% | −0.60% |
That's why a backtest without fees can look good while the same rule loses money in real trading.
Step 1: write the rule as one exact sentence
"Buy dips" can't be tested. "Buy when RSI(14) crosses above 30 while price is above the EMA 200; sell at +3% or −2%" can. A testable rule says:
- Entry: which indicator conditions must be true, and whether all of them (AND) or any of them (OR).
- Exit: an exit condition, a take-profit and a stop-loss, or both.
- Direction: long (buy first) or short.
Step 2: pick the coin, timeframe and history
- Timeframe should match how long you plan to hold: 15-minute or 1-hour candles for trades that last hours, 4-hour or daily for swings that last days or weeks.
- History should be long enough to include both rising and falling markets. A rule tested only on a rally will look better than it is.
- Test more than one coin. A rule that only works on one coin over one period is more likely luck than an edge.
Step 3: set fees, position size and starting capital
Use the fee of the exchange you would actually trade on (the base-tier taker fee if you use market orders). Set the position size you would really use; risking a smaller share of the account per trade keeps the test closer to how you'd trade.
Step 4: read the result, not just the profit
- Net profit after fees, and the same test without fees: if the gap is large, the rule trades too often for its edge.
- Buy-and-hold: did the rule beat simply holding the coin over the same period?
- Number of trades: a handful of trades says very little; dozens say more.
- Win rate and profit factor (gross wins divided by gross losses): a low win rate can still work if winners are much larger than losers.
- Maximum drawdown: the deepest fall from a peak. Ask whether you would really have kept following the rule through it.
Step 5: change one thing at a time, then practise
Adjust one setting, run it again and note what changed. When a rule still looks reasonable after fees, on several coins and periods, practise it with pretend money on live prices before using real money.
Common mistakes
- Leaving fees at zero, or using a lower fee than you would really pay.
- Overfitting: tuning settings until the past looks perfect. A rule with many exact numbers often fails on new data.
- Testing a short, one-direction period, such as only a bull run.
- Peeking at the future: rules that use a candle's close but enter at that same candle's open. Filling at the next candle's open avoids this.
- Treating a backtest as a forecast. Past results don't predict future returns.
Try it free
- Open the free Hunt4Coin backtester (what it covers): pick a coin with exchange candles, a timeframe from 5 minutes to 1 month and 500 to 5,000 candles.
- Build entry and optional exit rules from indicators, such as "RSI(14) crosses above 30" or "Price > EMA(200)", combined with AND or OR, then set stop-loss, take-profit, position size and starting capital.
- Pick an exchange's fee under Fee % per side. Orders fill at the next candle's open with fees included, and the results show the same test without fees and how much the fees cost, with a warning if fees turn a profit into a loss.
- Signed in with a free account, you can describe a strategy in plain English and the AI fills in the rules; check them before running. Backtesting docs · Why fees matter · Exchange fees compared.
- Found a rule worth watching? Practise it in paper trading (0.1% fees per side) and use the screener to see which coins match it today.
New to the indicators? Start with how to read RSI and MACD and how to use a crypto screener.
Information only, not financial advice. A backtest shows how a rule behaved on past candles; it doesn't predict future results.