
The backtest showed 240% a year. Live, the same bot lost money for four months before I shut it off. Nothing in the code had changed. The market hadn't turned. The strategy was the same one that looked flawless on a chart. The gap was two numbers I'd rounded down to zero: slippage and fees. Here's what that actually means. A backtest fills your order at the exact price you asked for, instantly, every time. Live markets don't work like that. Slippage is the difference between the price you expected and the price you actually got, and it exists because the order book only has so much liquidity sitting at any given level. On major crypto pairs it averages somewhere between 0.05% and 0.30% per trade. During a news spike it can blow past 1%. Fees stack on top — a taker fill on most exchanges runs around 0.10% unless you're a high-volume account. Neither number sounds like much. That's the trap. Run a strategy that trades often and those small costs compound into something that eats your edge alive. When people finally add realistic assumptions, reported returns tend to drop 30 to 50%. Those lower numbers aren't pessimism. They're just the honest version of the same test. A study of 1,243 trading-forum posts found that 57% of backtest-to-live failures traced back to one thing: slippage that was modeled badly or not at all. I learned this the expensive way. My bot was scalping — dozens of trades a day, each grabbing a tiny move. On paper the math was gorgeous. In reality, every entry cost me a fraction of a percent I hadn't accounted for, and every exit did the same. The profit per trade was so thin that a 0.2% round-trip cost turned a winner into a scratch and a small loser into a real one. The strategy wasn't broken. My accounting was. Most traders get this wrong in a specific way: they assume the cost is small because each individual number is small. But cost per trade times number of trades is the figure that matters, and a high-frequency strategy multiplies your exposure to it. A system that trades twice a month barely notices slippage. A system that trades twenty times a day lives and dies by it. Same 0.2% cost, wildly different outcomes. The other mistake is testing on liquid conditions and trading in thin ones. Backtests average everything out. They don't know that your bot loves to fire right when volatility spikes and the order book empties — exactly when slippage is worst. So the live fills land in the fat part of the cost distribution while the backtest quietly assumed the median. You're not comparing the same thing. Here's the practical fix, and it costs you nothing but a little humility. Before you trust any backtest, add a pessimistic cost assumption and run it again. Use the taker fee for your exchange plus at least 0.1% to 0.2% of slippage per side, more if your strategy trades in fast conditions. If the edge survives that haircut, you might have something real. If it evaporates, you never had an edge — you had a rounding error that looked like one. Better to find that out in a spreadsheet than in your account. The strategies that hold up under honest cost modeling are almost always the ones that trade less and hold longer. That's not a coincidence. Fewer trades means fewer times you pay the toll, so the edge per trade only has to clear the cost once in a while instead of every hour
View original source — Hacker Noon ↗

