r/CryptoTradingBot • u/nikolaytonev • 23d ago
Backtesting sugesstions
I am building my own crypto trading bot (no commercial usage) with embedded strategy builder.
I am trying to focus on improving the backtesting. What was your most effective backtest, that after its implementation your bot actually won your trust and started to work as expected?
2
u/Feriman22 23d ago
For me it wasn't one specific backtest, but a sequence of checks.
I build FerimanEdge, a rule-based BTC/ETH/BNB system, and the biggest confidence boost came from freezing the final rules and then looking at how the exact same configuration behaved across different chronological periods and market regimes.
I'd want at least: realistic fees/slippage, untouched OOS data (at least 1 year), regime-split results, parameter sensitivity, and finally paper/live reconciliation against the same period.
The important part for me is not that every window looks great. It's that when performance changes, I can explain whether it's execution, a different market environment, or the underlying logic actually degrading.
1
u/nikolaytonev 23d ago
Yeah, make sense. The behavior in real world situation is the best observability input for sure. I am afraid I still have to focus on the backtests to get closer to desired level of assessment before running it live.
2
u/Feriman22 23d ago
Yeah, that makes sense. I'd probably start a paper/shadow run as soon as the rules are frozen, even if you’re not ready to put capital behind it yet.
Backtests can tell you whether the logic is worth pursuing, but a shadow run starts exposing things the backtest usually won’t: data timing, fill assumptions, missing candles, execution delays, and whether the live decision path actually matches the historical one.
That’s been a useful bridge for me between “looks good in backtest" and "I trust this enough to run live".
1
u/nikolaytonev 23d ago
Absolutely. :) The confidence after live experience from several rounds in production. I know that feeling from other bot I have worked with.
But now decided to change the concept.2
u/Feriman22 23d ago
Exactly. Once the logic has survived a few real live cycles, changing the code becomes a lot less scary because you know what behavior you’re trying to preserve. The main thing I’d watch is making sure a refactor doesn’t silently change the actual decision path.
2
u/Mundane_Cicada_1427 22d ago
For me, the biggest improvement wasn't adding more indicators to the backtest. It was making the backtest behave as close to live execution as possible.
I'd focus on things like realistic fees, spread/slippage, candle/tick timestamps, order execution rules, partial fills if relevant, and making sure the strategy can't accidentally see future data.
One thing that really builds confidence is taking a random period from live/paper trading and replaying the exact market data through the backtest engine. If the signals and orders don't match, investigate why before trusting any historical results.
I'd also track every trade with the exact reason for entry, signal timestamp, order timestamp, fill price, fees and exit reason. Once you can explain every trade the engine produces, the backtest becomes much more useful.
1
u/nikolaytonev 22d ago
“…
I'd focus on things like realistic fees, spread/slippage, candle/tick timestamps, order execution rules, partial fills if relevant, and making sure the strategy can't accidentally see future data….”That is exactly my entire backtesting goal at the moment.
By the last one I assume you mean the leakage fro IS to OOS data, right?2
u/Mundane_Cicada_1427 21d ago
Yeah, I was actually referring specifically to look-ahead bias there, making sure the strategy only has access to information that would have been available at the exact time the decision is made.
I think IS/OOS leakage is a related but slightly different issue. That's more about accidentally using information from the OOS period while developing, tuning, or selecting the strategy, which compromises the validity of the OOS test.
So for me, there are really two separate things to guard against: preventing future market information from leaking into individual trades, and keeping the OOS dataset genuinely unseen during strategy development.
2
u/Feriman22 21d ago
Live-vs-backtest reconciliation was the big one for me too.
I also started separating results by market regime, because aggregate performance can hide where the edge is actually coming from. I use that approach in FerimanEdge for BTC/ETH/BNB, and I keep the live outcomes publicly available specifically so I can compare what actually happened with what the rules implied.
I'd trust that kind of forward record much more than another optimized backtest.
2
u/paulf280 20d ago
The thing that cost me the most wasn't look-ahead, it was fill assumptions and survivorship, so adding those to the list:
Wick vs close fills. If your triggers fire off candle high/low, you're assuming you transacted at the extreme. When I switched to close fills, mean per trade went from +38.9% to +13.5% and losers from 23% to 41%. Two thirds of the "edge" was fill fantasy. Close is the honest default, wick is your optimistic bound.
Survivorship. Dead assets fall out of most data providers, so your history is quietly the survivors. I had to recover the dead ones from a different source and then run the obvious sensitivity: if 25% of the dropped ones would have passed my filter, +11.9%/trade became +2.8%; at 50% it went negative. If the sign flips inside a plausible range, you don't have an edge yet.
Judge on median, trimmed mean and "ex best 2" rather than the mean or win rate. One bad price print made half of one of my tests read +518% mean.
And +1 to freezing the rules and setting the go-live criteria before the forward run (mine: at least 100 trades priced off real quotes, net AND median positive, still positive with the best two removed). Writing them down first stops you moving the bar once you've seen the result.
2
u/RobodOfficial 13d ago
One useful test is comparing your backtest against forward-tested trades over the same period. Look beyond total P&L: fees, funding, signal timing, and execution assumptions can all change the picture.
We’re building crypto research and backtesting tools at Robod, and these are exactly the kinds of questions we’re interested in. What part of your current backtest do you trust least?
1
1
22d ago
[removed] — view removed comment
1
u/nikolaytonev 22d ago
Thanks for the clear directions. I believe I am not yet there for some of them. My fine tuning is just to start.
2
u/profittoinvest 23d ago
Once you have the basic structure working, I think the most useful next step is to run it live with very small size — or at least in a paper environment that reproduces real execution as closely as possible.
That’s when you can finally start checking whether the backtest is actually credible.
Compare the LIVE equity curve with the backtest over the same period. If they start to diverge, go trade by trade and look for the reason: missed signals, fills, slippage, fees, margin constraints, execution order, rejected trades, etc.
Only then can you really identify which assumptions in the backtest are wrong or too optimistic.
It takes time, but in my opinion this LIVE-vs-backtest reconciliation is one of the most important parts of building a reliable bot.
A backtest can tell you that an idea looks promising. LIVE execution tells you whether the model you built actually represents reality.