Intent-Code Divergence
Medium
- Confidence
- 97% confidence
- Finding
- `Portfolio.update_market_value()` computes `total_return` as `(self.total_value / (self.cash + pos_value)) - 1`, but `self.total_value` was just set to `self.cash + pos_value`, so the result is always 0. In a quantitative backtesting tool, silently reporting incorrect returns can mislead users into trusting invalid strategy performance and risk results, which is a real integrity issue even though it is not code-execution related.
