diff --git a/.kiro/specs/multi-modal-trading-system/tasks.md b/.kiro/specs/multi-modal-trading-system/tasks.md index be0b4d9..22ec8fa 100644 --- a/.kiro/specs/multi-modal-trading-system/tasks.md +++ b/.kiro/specs/multi-modal-trading-system/tasks.md @@ -199,6 +199,7 @@ - [x] 5.2. Implement persistent inference history storage + - Create InferenceHistoryStore class for persistent storage - Store complete input data packages with each prediction - Include timestamp, symbol, input features, prediction outputs, confidence scores diff --git a/core/orchestrator.py b/core/orchestrator.py index a4483e6..d664319 100644 --- a/core/orchestrator.py +++ b/core/orchestrator.py @@ -224,7 +224,7 @@ class TradingOrchestrator: logger.info(f"Training enabled: {self.training_enabled}") logger.info(f"Confidence threshold: {self.confidence_threshold}") # logger.info(f"Decision frequency: {self.decision_frequency}s") - logger.info(f"Symbols: {self.symbols}") + logger.info(f"Primary symbol: {self.symbol}, Reference symbols: {self.ref_symbols}") logger.info("Universal Data Adapter integrated for centralized data flow") # Start centralized data collection for all models and dashboard @@ -366,7 +366,7 @@ class TradingOrchestrator: from core.extrema_trainer import ExtremaTrainer self.extrema_trainer = ExtremaTrainer( data_provider=self.data_provider, - symbols=self.symbols + symbols=[self.symbol] # Only primary trading symbol ) # Load checkpoint and capture initial state @@ -618,7 +618,7 @@ class TradingOrchestrator: async def start_continuous_trading(self, symbols: Optional[List[str]] = None): """Start the continuous trading loop, using a decision model and trading executor""" if symbols is None: - symbols = self.symbols + symbols = [self.symbol] # Only trade the primary symbol if not self.realtime_processing_task: self.realtime_processing_task = asyncio.create_task(self._trading_decision_loop()) @@ -639,9 +639,9 @@ class TradingOrchestrator: logger.info("Trading decision loop started") while self.running: try: - for symbol in self.symbols: - await self.make_trading_decision(symbol) - await asyncio.sleep(1) # Small delay between symbols + # Only make decisions for the primary trading symbol + await self.make_trading_decision(self.symbol) + await asyncio.sleep(1) await asyncio.sleep(self.decision_frequency) except Exception as e: @@ -768,7 +768,7 @@ class TradingOrchestrator: if COB_INTEGRATION_AVAILABLE and COBIntegration is not None: try: self.cob_integration = COBIntegration( - symbols=self.symbols, + symbols=[self.symbol] + self.ref_symbols, # Primary + reference symbols data_provider=self.data_provider ) logger.info("COB Integration initialized") @@ -1498,12 +1498,22 @@ class TradingOrchestrator: async def _trigger_model_training(self, symbol: str): """Trigger training for models based on previous inference data""" try: - if not self.training_enabled or symbol not in self.inference_history: + if not self.training_enabled: + logger.debug("Training disabled, skipping model training") return - # Get recent inference records - recent_records = list(self.inference_history[symbol]) - if len(recent_records) < 2: + # Check if we have any inference history for any model + if not self.inference_history: + logger.debug("No inference history available for training") + return + + # Get recent inference records from all models (not symbol-based) + all_recent_records = [] + for model_name, model_records in self.inference_history.items(): + all_recent_records.extend(list(model_records)) + + if len(all_recent_records) < 2: + logger.debug("Not enough inference records for training") return # Need at least 2 records to compare # Get current price for outcome evaluation