diff --git a/services/trading/backtest_replay.py b/services/trading/backtest_replay.py index a68b579..89c5b6d 100644 --- a/services/trading/backtest_replay.py +++ b/services/trading/backtest_replay.py @@ -176,7 +176,7 @@ class BacktestReplay: price = rec.get("current_price", 0.0) qty = decision.computed_share_quantity or 0 - if qty > 0 and price > 0: + if qty > 0 and price > 0 and ticker not in simulated_positions: cost = price * qty if cost <= portfolio_state.active_pool: simulated_positions[ticker] = {