Developer Finds Three Hidden Bugs in AI-Built Trading Backtester After Spotting Suspicious Log
A developer using Claude Code to build a backtesting simulator for a leveraged ETF trading strategy discovered three separate bugs after noticing a suspicious -50% drawdown entry in the trade logs that had actually triggered at just -2.9%. The first bug involved a trigger price formula that used a fixed step-down from average cost instead of the specified 50% threshold, silently invalidating weeks of backtest results. A second bug disguised a price-based reactivation condition as a simple time-based cooldown timer, causing the two behaviors to diverge only on specific price paths and meaningfully altering multi-year strategy simulations. Both bugs produced plausible-looking outputs rather than errors, making them difficult to detect through routine inspection. The author's account highlights how logic errors in simulation engines can quietly distort results without raising any exceptions or obvious warnings.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in