Explorar o código

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 hai 22 horas
pai
achega
b58994f2e5
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  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"))