Intent-Code Divergence
Medium
- Confidence
- 98% confidence
- Finding
- The backtesting engine records BUY/SELL trades and computes portfolio value, but `_buy` never updates `self.position` and `_sell` iterates over positions that were never populated. This means reported holdings, equity curve, drawdown, and win-rate can be materially wrong, creating misleading research outputs that could drive unsafe trading decisions. In a quantitative trading skill, incorrect backtest state handling is more dangerous because users are likely to rely on the reported metrics for real capital allocation.
