Browse Source

Fix logging format in TradingStats - Updated the logging statement to ensure proper formatting of the average entry price, improving clarity in position enhancement messages.

Carles Sentis 4 days ago
parent
commit
4e09f49d4e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/trading/trading_stats.py

+ 1 - 1
src/trading/trading_stats.py

@@ -299,7 +299,7 @@ class TradingStats:
         
         side_log = "LONG" if new_contracts > 0 else "SHORT" if new_contracts < 0 else "FLAT"
         if new_contracts != 0:
-            logger.info(f"📊 Enhanced position ({action_type}): {symbol} {side_log} {abs(new_contracts):.6f} @ avg ${new_avg_entry:.2f if new_avg_entry else 0.0:.2f}")
+            logger.info(f"📊 Enhanced position ({action_type}): {symbol} {side_log} {abs(new_contracts):.6f} @ avg ${(new_avg_entry if new_avg_entry else 0.0):.2f}")
         
         return action_type