Explorar el Código

Refactor update_order_status method in TradingStats for enhanced parameter flexibility.

- Updated the update_order_status method to support additional parameters including order_db_id, bot_order_ref_id, and amount_filled_increment, allowing for more comprehensive order management.
- Delegated the updated method to OrderManager, ensuring consistent handling of order status updates across the application.
Carles Sentis hace 1 semana
padre
commit
63ce665836
Se han modificado 2 ficheros con 14 adiciones y 5 borrados
  1. 13 4
      src/stats/trading_stats.py
  2. 1 1
      trading_bot.py

+ 13 - 4
src/stats/trading_stats.py

@@ -124,10 +124,19 @@ class TradingStats:
         """Record order cancellation."""
         return self.order_manager.record_order_cancelled(exchange_order_id, reason, timestamp)
     
-    def update_order_status(self, exchange_order_id: str, new_status: str, 
-                           notes: Optional[str] = None, timestamp: Optional[str] = None) -> bool:
-        """Update order status."""
-        return self.order_manager.update_order_status(exchange_order_id, new_status, notes, timestamp)
+    def update_order_status(self, order_db_id: Optional[int] = None, bot_order_ref_id: Optional[str] = None, 
+                            exchange_order_id: Optional[str] = None, new_status: Optional[str] = None, 
+                            amount_filled_increment: Optional[float] = None, set_exchange_order_id: Optional[str] = None,
+                            notes: Optional[str] = None, timestamp: Optional[str] = None) -> bool:
+        """Update order status - delegates to OrderManager with full parameter support."""
+        return self.order_manager.update_order_status(
+            order_db_id=order_db_id,
+            bot_order_ref_id=bot_order_ref_id,
+            exchange_order_id=exchange_order_id,
+            new_status=new_status,
+            amount_filled_increment=amount_filled_increment,
+            set_exchange_order_id=set_exchange_order_id
+        )
     
     def get_order_by_exchange_id(self, exchange_order_id: str) -> Optional[Dict[str, Any]]:
         """Get order by exchange ID."""

+ 1 - 1
trading_bot.py

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