Browse Source

Increment BOT_VERSION to 2.2.133 and update MarketMonitor to fetch recent fills without symbol and limit arguments.

- Updated BOT_VERSION for the upcoming release.
- Modified MarketMonitor to retrieve all recent fills without specifying symbol and limit, enhancing flexibility in fill processing.
- Adjusted filtering logic to ensure correct symbol-specific fills are obtained from the broader recent fills dataset.
Carles Sentis 2 ngày trước cách đây
mục cha
commit
6f02c85338
2 tập tin đã thay đổi với 8 bổ sung4 xóa
  1. 7 3
      src/monitoring/market_monitor.py
  2. 1 1
      trading_bot.py

+ 7 - 3
src/monitoring/market_monitor.py

@@ -1718,6 +1718,8 @@ class MarketMonitor:
             if not stats:
                 return
 
+            formatter = get_formatter()
+
             exchange_positions = self.cached_positions or [] # Use fresh cache
             synced_count = 0
 
@@ -1848,7 +1850,7 @@ class MarketMonitor:
                     # Attempt to find a recent closing fill from the exchange
                     try:
                         # Fetch all recent fills for the account, then filter by symbol
-                        all_recent_fills = self.trading_engine.get_recent_fills(limit=20) # Increased limit slightly
+                        all_recent_fills = self.trading_engine.get_recent_fills() # Increased limit slightly
                         if all_recent_fills:
                             symbol_specific_fills = [f for f in all_recent_fills if f.get('symbol') == symbol]
                             if symbol_specific_fills:
@@ -1926,7 +1928,9 @@ class MarketMonitor:
             entry_fill_side = 'buy' if side == 'long' else 'sell'
             formatter = get_formatter()
             token = symbol.split('/')[0] if '/' in symbol else symbol
-            recent_fills = self.trading_engine.get_recent_fills(symbol=symbol, limit=20)
+            all_recent_fills = self.trading_engine.get_recent_fills() # Removed symbol and limit arguments
+            recent_fills = [f for f in all_recent_fills if f.get('symbol') == symbol] # Filter by symbol
+
             if recent_fills:
                 symbol_side_fills = [
                     fill for fill in recent_fills 
@@ -2079,7 +2083,7 @@ class MarketMonitor:
 
                         try:
                             # Fetch all recent fills, then filter by symbol
-                            all_recent_fills_for_startup_sync = self.trading_engine.get_recent_fills(limit=20) # Fetch more to increase chance
+                            all_recent_fills_for_startup_sync = self.trading_engine.get_recent_fills() # Fetch more to increase chance
                             if all_recent_fills_for_startup_sync:
                                 symbol_specific_fills_startup = [f for f in all_recent_fills_for_startup_sync if f.get('symbol') == symbol]
                                 if symbol_specific_fills_startup:

+ 1 - 1
trading_bot.py

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