|
@@ -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:
|