Quellcode durchsuchen

Increment bot version to 2.6.302 and update position size calculation in PositionTracker

- Updated BOT_VERSION to 2.6.302.
- Modified position size calculation logic in PositionTracker to clarify the handling of 'sell' and 'buy' trades, ensuring accurate sign representation for simulated positions.
Carles Sentis vor 22 Stunden
Ursprung
Commit
b58994f2e5
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 1 1
      src/monitoring/position_tracker.py
  2. 1 1
      trading_bot.py

+ 1 - 1
src/monitoring/position_tracker.py

@@ -117,7 +117,7 @@ class PositionTracker:
                     side = trade.get('side', '').lower()
                     
                     simulated_position = {
-                        'size': amount if side == 'long' else -amount,  # Maintain proper sign
+                        'size': -amount if side == 'sell' else amount,  # sell=short(negative), buy=long(positive)
                         'entry_px': entry_price,
                         'unrealized_pnl': 0,  # Will be calculated
                         'margin_used': 0,

+ 1 - 1
trading_bot.py

@@ -14,7 +14,7 @@ from datetime import datetime
 from pathlib import Path
 
 # Bot version
-BOT_VERSION = "2.6.301"
+BOT_VERSION = "2.6.302"
 
 # Add src directory to Python path
 sys.path.insert(0, str(Path(__file__).parent / "src"))