diff --git a/trader.py b/trader.py index 8f0cc67..76d98a3 100644 --- a/trader.py +++ b/trader.py @@ -523,7 +523,7 @@ def compute_trades(holdings: dict, cash: float, target_weights: dict, "shares_delta": int(round(delta)) if integer_shares else round(delta, 4), "direction": "BUY" if delta > 0 else "SELL", "est_value": round(trade_value, 2), - "price": round(price, 2), + "price": round(price, 6), "target_shares": int(round(target_shares)) if integer_shares else round(target_shares, 4), "current_shares": int(current_shares) if integer_shares else round(current_shares, 4), }) @@ -620,7 +620,7 @@ def execute_trades(state: dict, trades: list[dict], prices: dict, "action": "BUY" if delta > 0 else "SELL", "ticker": ticker, "shares": abs(delta) if integer_shares else round(abs(delta), 4), - "price": round(price, 2), + "price": round(price, 6), "value": round(cost, 2), "commission": round(commission, 2), }) @@ -650,7 +650,7 @@ def record_daily_snapshot(state: dict, date_str: str, prices: dict, p = prices.get(ticker, 0.0) positions[ticker] = { "shares": shares, - "price": round(p, 2), + "price": round(p, 6), "value": round(shares * p, 2), } @@ -662,7 +662,7 @@ def record_daily_snapshot(state: dict, date_str: str, prices: dict, "action": t["direction"], "ticker": t["ticker"], "shares": abs(t["shares_delta"]), - "price": round(p, 2), + "price": round(p, 6), "value": round(abs(t["shares_delta"]) * p, 2), })