This commit is contained in:
Dobromir Popov
2025-07-22 20:23:17 +03:00
parent 9b72b18eb7
commit 630bc644fa
2 changed files with 8 additions and 5 deletions

View File

@ -2503,7 +2503,8 @@ class TradingOrchestrator:
except Exception as e: except Exception as e:
logger.error(f"Error checking signal confirmation for {symbol}: {e}") logger.error(f"Error checking signal confirmation for {symbol}: {e}")
return None return None
def _initialize_checkpoint_manager(self):
def _initialize_checkpoint_manager(self):
"""Initialize the checkpoint manager for model persistence""" """Initialize the checkpoint manager for model persistence"""
try: try:
from utils.checkpoint_manager import get_checkpoint_manager from utils.checkpoint_manager import get_checkpoint_manager
@ -2520,8 +2521,9 @@ class TradingOrchestrator:
logger.info("Checkpoint manager initialized for model persistence") logger.info("Checkpoint manager initialized for model persistence")
except Exception as e: except Exception as e:
logger.error(f"Error initializing checkpoint manager: {e}") logger.error(f"Error initializing checkpoint manager: {e}")
self.checkpoint_manager = None de self.checkpoint_manager = None
f _save_training_checkpoints(self, models_trained: List[str], performance_score: float):
def _save_training_checkpoints(self, models_trained: List[str], performance_score: float):
"""Save checkpoints for trained models if performance improved """Save checkpoints for trained models if performance improved
This is CRITICAL for preserving training progress across restarts. This is CRITICAL for preserving training progress across restarts.

View File

@ -650,7 +650,8 @@ class CleanTradingDashboard:
# Apply current leverage to unrealized P&L # Apply current leverage to unrealized P&L
leveraged_unrealized_pnl = raw_pnl_per_unit * size * self.current_leverage leveraged_unrealized_pnl = raw_pnl_per_unit * size * self.current_leverage
total_session_pnl += leveraged_unrealized_pnlent_position and current_price:ent_position and current_price:ent_position and current_price:ent_position and current_price:ent_position and current_price: total_session_pnl += leveraged_unrealized_pnl
side = self.current_position.get('side', 'UNKNOWN') side = self.current_position.get('side', 'UNKNOWN')
size = self.current_position.get('size', 0) size = self.current_position.get('size', 0)
entry_price = self.current_position.get('price', 0) entry_price = self.current_position.get('price', 0)
@ -664,7 +665,7 @@ class CleanTradingDashboard:
# Apply current leverage to unrealized P&L # Apply current leverage to unrealized P&L
leveraged_unrealized_pnl = raw_pnl_per_unit * size * self.current_leverage leveraged_unrealized_pnl = raw_pnl_per_unit * size * self.current_leverage
total_session_pnl += leveraged_unrealized_pnlent_position and current_price: total_session_pnl += leveraged_unrealized_pnl
side = self.current_position.get('side', 'UNKNOWN') side = self.current_position.get('side', 'UNKNOWN')
size = self.current_position.get('size', 0) size = self.current_position.get('size', 0)
entry_price = self.current_position.get('price', 0) entry_price = self.current_position.get('price', 0)