Procházet zdrojové kódy

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 před 22 hodinami
rodič
revize
b58994f2e5
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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"))