DEV Community

maymay5692
maymay5692

Posted on

Why Your Backtest Lies: I Got 491% Returns in Testing, Then Broke Even in Production

Why Your Backtest Lies: I Got 491% Returns in Testing, Then Broke Even in Production

I deployed a strategy that showed 491% returns in backtests. Three months later: breakeven. The first month was all red.

This is not financial advice. This is a post-mortem of my own mistakes, written with $33 worth of lessons learned. Trading crypto carries substantial risk of loss — don't trade with money you can't afford to lose.

Credit where it's due: The multi-agent system I use for development is built on @shio_shoppaize's multi-agent-shogun project.

The Setup

I built a backtesting engine in Python. Tested 49 strategies on BTC/USDT daily candles, 2023–2026. The top performer — multi_timeframe — returned 546% with a Sharpe of 1.50. Second place was EMA Crossover at 491%.

I picked EMA Crossover for live trading. Funded the account with 33 USDT (about $33). Set DRY_RUN=false. Waited.

What the Backtest Doesn't Tell You

The biggest lie is about execution. In a backtest, every order fills at the closing price. Instantly. No slippage. No partial fills. No "the exchange was down for maintenance."

# Backtest world
entry_price = df['close'].iloc[i]  # Perfect fill

# Real world
order = exchange.create_market_buy_order('BTC/USDT', amount)
actual_price = order['average']  # 0.05–0.3% off
Enter fullscreen mode Exit fullscreen mode

That 0.05–0.3% doesn't sound like much. But a strategy that trades 30 times a month bleeds 1–2% monthly just from slippage. Over a year, that's 10–20% of your returns — gone before you even look at fees.

Fees are their own problem. I set commission at 0.1% in my backtests because that's what Bitget publishes. But my bot uses market orders, so I'm always paying the taker rate. And the taker rate changes with volume tiers, promotions, and whether Mercury is in retrograde.

Factor Backtest Reality
Commission 0.1% fixed 0.075–0.1% (taker)
Slippage 0% 0.05–0.3%
Round-trip cost 0.2% 0.25–0.5%

Then there's the stuff you don't think about until it bites you. Exchange maintenance — Bitget goes down 1–2 times a month for a few hours. If your exit signal fires during that window, you're holding a position you can't close. Backtests assume the market never sleeps. The market takes naps.

Looking at the Top 12 With Honest Eyes

Here's a selection from my top 12 strategies (full results in my previous article):

Rank Strategy Sharpe Return Max DD Win% Trades Live Reality
1 multi_timeframe 1.50 546% -32% 100% 2 ❌ Overfitted
2 ema_crossover 1.30 491% -34% 35% 34 △ Breakeven
3 parabolic_sar 1.25 456% -37% 36% 94 △ Fee drag
7 atr_trailing_stop 1.11 275% -49% 100% 1 ❌ Overfitted
8 momentum 1.07 283% -32% 36% 135 ❌ Fee drag

multi_timeframe was my top-ranked strategy. Sharpe 1.50. Sounds amazing. It made exactly two trades in three years and won both. That's not a strategy — that's a coin flip that got lucky. In three months of live trading, it made zero trades. The "best" strategy sat there doing nothing.

momentum is the opposite problem — too many trades. 135 trades means 135 chances for fees and slippage to eat your returns:

135 trades × 0.1% fee × 2 (round trip) = 27%
135 trades × 0.1% slippage × 2 = 27%
Total drag: ~54%

Backtest said 283%. After costs: 229%.
Enter fullscreen mode Exit fullscreen mode

Still positive, but that 283% headline is doing a lot of heavy lifting.

ema_crossover ended up being the most honest strategy. 34 trades, 35% win rate — nothing flashy. But it's a trend follower that wins big when it wins, and the low trade count means fees don't destroy it. The reason it broke even over 3 months? Daily timeframe strategies produce maybe 1–2 signals per month. With a 35% win rate, a bad quarter is just... normal variance.

The Thing Backtests Can't Simulate

Five consecutive losses.

At 35% win rate, a 5-loss streak has about a 12% probability. Over enough trades, it's guaranteed to happen. The backtest chart shows multiple drawdown periods — you can see them right there in the equity curve.

But when it's your money — even just $33 — watching five trades go red in a row does something to your brain. "Maybe this strategy doesn't work." "Maybe I should switch." "Maybe I should stop."

I stuck with it because $33 isn't life-changing money. If it had been $1,000, I'm pretty sure I would have pulled the plug during that losing streak. And that's the thing — the backtest doesn't model the person running the bot.

What I Changed

Doubled the costs in my backtest config. Set commission to 0.2% and slippage to 0.3%. Four of the top 12 strategies dropped out immediately. Harsh but useful — the survivors are the ones worth testing live.

config = {
    'commission': 0.002,    # 2× actual fees
    'slippage': 0.003,      # worst-case slippage
}
Enter fullscreen mode Exit fullscreen mode

Started at $1. Not $33 — one dollar. The $1 phase caught bugs that no backtest could: minimum order sizes I didn't know existed, API response formats that differed from the docs, timeout handling that only matters when real money is on the line.

Learned to read the numbers differently. My personal experience (limited to $33, BTC/USDT daily, on Bitget) suggests that live returns run about half of backtest returns. The EMA Crossover's 491% is a 3-year cumulative number — the CAGR is about 80%. Cut that in half for live and you get roughly 40% annually.

On a $33 account, 40% per year is about $13. A bit over $1 per month.

That's a depressing number. But without the backtest, I wouldn't even have that dollar — I'd be down $33.

The Honest Summary

Backtest Live
Slippage 0% 0.05–0.3%
Fees Fixed Variable
Fills 100% Exchange goes down sometimes
Your brain Not modeled Will betray you
Returns Face value 50–70% of face value

I tested 49 strategies. Kept 12. Deployed the best one. Got breakeven. Started over with harsher backtest parameters. The strategies that survive both rounds — backtesting and live trading — are probably worth scaling. Probably. I haven't gotten there yet.


Built with Claude Code. The backtesting engine runs 49+ strategies on BTC/USDT daily data. This article reflects the author's limited experience with a $33 account — your results will differ. The author may have financial interests in platforms mentioned.

Top comments (0)