浏览代码

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 1 天之前
父节点
当前提交
b58994f2e5
共有 2 个文件被更改,包括 2 次插入2 次删除
  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"))