My bot performed perfectly in backtest and lost money for four straight months live
This is the most common story in algo trading and it happened to me anyway. The backtest covered 2019 to 2022. The strategy was a mean reversion setup on a major pair, 400 trades in sample, equity curve looked smooth. Live trading started in late 2023 and the edge was simply not there. Spread behavior in live execution was different from the historical data. Slippage on limit entries was not modeled accurately. The market micro-structure the strategy depended on had shifted.
Three things I changed after this:- Added a minimum out-of-sample forward test period of 90 days before any live capital- Modeled worst-case spread at 1.5x average rather than average spread- Reduced position size on live launch to 25% of backtest sizing until 50 live trades completedThe strategy is marginally profitable now. Not what the backtest suggested but not a loss either.