adjust weights

This commit is contained in:
Dobromir Popov
2025-07-17 21:50:27 +03:00
parent 23f0caea74
commit 92919cb1ef

View File

@ -424,7 +424,7 @@ class TradingOrchestrator:
if self.rl_agent: if self.rl_agent:
try: try:
rl_interface = RLAgentInterface(self.rl_agent, name="dqn_agent") rl_interface = RLAgentInterface(self.rl_agent, name="dqn_agent")
self.register_model(rl_interface, weight=0.3) self.register_model(rl_interface, weight=0.2)
logger.info("RL Agent registered successfully") logger.info("RL Agent registered successfully")
except Exception as e: except Exception as e:
logger.error(f"Failed to register RL Agent: {e}") logger.error(f"Failed to register RL Agent: {e}")
@ -433,7 +433,7 @@ class TradingOrchestrator:
if self.cnn_model: if self.cnn_model:
try: try:
cnn_interface = CNNModelInterface(self.cnn_model, name="enhanced_cnn") cnn_interface = CNNModelInterface(self.cnn_model, name="enhanced_cnn")
self.register_model(cnn_interface, weight=0.4) self.register_model(cnn_interface, weight=0.25)
logger.info("CNN Model registered successfully") logger.info("CNN Model registered successfully")
except Exception as e: except Exception as e:
logger.error(f"Failed to register CNN Model: {e}") logger.error(f"Failed to register CNN Model: {e}")
@ -528,7 +528,7 @@ class TradingOrchestrator:
return 50.0 # MB return 50.0 # MB
cob_rl_interface = COBRLModelInterfaceWrapper(self.cob_rl_agent, name="cob_rl_model") cob_rl_interface = COBRLModelInterfaceWrapper(self.cob_rl_agent, name="cob_rl_model")
self.register_model(cob_rl_interface, weight=0.15) self.register_model(cob_rl_interface, weight=0.4)
logger.info("COB RL Agent registered successfully") logger.info("COB RL Agent registered successfully")
except Exception as e: except Exception as e:
logger.error(f"Failed to register COB RL Agent: {e}") logger.error(f"Failed to register COB RL Agent: {e}")
@ -769,15 +769,15 @@ class TradingOrchestrator:
async def start_cob_integration(self): async def start_cob_integration(self):
"""Start the COB integration to begin streaming data""" """Start the COB integration to begin streaming data"""
if self.cob_integration and hasattr(self.cob_integration, 'start_streaming'): if self.cob_integration and hasattr(self.cob_integration, 'start'):
try: try:
logger.info("Attempting to start COB integration...") logger.info("Attempting to start COB integration...")
await self.cob_integration.start_streaming() await self.cob_integration.start()
logger.info("COB Integration streaming started successfully.") logger.info("COB Integration started successfully.")
except Exception as e: except Exception as e:
logger.error(f"Failed to start COB integration streaming: {e}") logger.error(f"Failed to start COB integration: {e}")
else: else:
logger.warning("COB Integration not initialized or streaming not available.") logger.warning("COB Integration not initialized or start method not available.")
def _on_cob_cnn_features(self, symbol: str, cob_data: Dict): def _on_cob_cnn_features(self, symbol: str, cob_data: Dict):
"""Callback for when new COB CNN features are available""" """Callback for when new COB CNN features are available"""
@ -885,9 +885,9 @@ class TradingOrchestrator:
if hasattr(self, 'rl_agent') and self.rl_agent: if hasattr(self, 'rl_agent') and self.rl_agent:
self.model_weights["dqn_agent"] = 0.3 self.model_weights["dqn_agent"] = 0.3
# Add COB RL model weight if it exists # Add COB RL model weight if it exists (HIGHEST PRIORITY)
if hasattr(self, 'cob_rl_agent') and self.cob_rl_agent: if hasattr(self, 'cob_rl_agent') and self.cob_rl_agent:
self.model_weights["cob_rl_model"] = 0.2 self.model_weights["cob_rl_model"] = 0.4
# Add extrema trainer weight if it exists # Add extrema trainer weight if it exists
if hasattr(self, 'extrema_trainer') and self.extrema_trainer: if hasattr(self, 'extrema_trainer') and self.extrema_trainer: