|
@@ -14,11 +14,16 @@ from src.utils.token_display_formatter import get_formatter
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class RiskCleanupManager:
|
|
|
- def __init__(self, trading_engine, notification_manager, market_monitor_cache):
|
|
|
+ def __init__(self, trading_engine, notification_manager, market_monitor_cache, shared_state):
|
|
|
self.trading_engine = trading_engine
|
|
|
self.notification_manager = notification_manager
|
|
|
self.market_monitor_cache = market_monitor_cache
|
|
|
- self.external_stop_losses: Dict[str, Dict[str, Any]] = {}
|
|
|
+ self.shared_state = shared_state
|
|
|
+
|
|
|
+ if 'external_stop_losses' not in self.shared_state:
|
|
|
+ self.shared_state['external_stop_losses'] = {}
|
|
|
+
|
|
|
+ self.external_stop_losses: Dict[str, Dict[str, Any]] = self.shared_state['external_stop_losses']
|
|
|
|
|
|
|
|
|
|