瀏覽代碼

Increment BOT_VERSION to 2.2.137 and refine stop loss order handling in MarketMonitor.

- Updated BOT_VERSION for the upcoming release.
- Simplified parameters in the execute_stop_loss_order method, removing the lifecycle ID reference as it is now handled internally by the trading engine.
- Enhanced clarity in the code by streamlining the stop loss order execution process.
Carles Sentis 2 天之前
父節點
當前提交
babfdc0234
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 3 4
      src/monitoring/market_monitor.py
  2. 1 1
      trading_bot.py

+ 3 - 4
src/monitoring/market_monitor.py

@@ -1445,10 +1445,9 @@ class MarketMonitor:
                             # The execute_stop_loss_order should create the 'pending_trigger' order in the DB
                             # and return details, including the DB ID of this 'pending_trigger' order.
                             sl_result = await self.trading_engine.execute_stop_loss_order(
-                                token=token, # Assuming token is enough for execute_stop_loss_order
-                                stop_price=stop_loss_price,
-                                # Pass lifecycle_id or other refs if needed by trading_engine to create the DB order
-                                trade_lifecycle_id_for_sl=lifecycle_id 
+                                token=token, 
+                                stop_price=stop_loss_price
+                                # trade_lifecycle_id_for_sl=lifecycle_id # REMOVED: TE.execute_stop_loss_order handles linking
                             )
                             
                             if sl_result.get('success'):

+ 1 - 1
trading_bot.py

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