diff --git a/core/orchestrator.py b/core/orchestrator.py index 16d29e2..1ddf2b5 100644 --- a/core/orchestrator.py +++ b/core/orchestrator.py @@ -2503,7 +2503,8 @@ class TradingOrchestrator: except Exception as e: logger.error(f"Error checking signal confirmation for {symbol}: {e}") return None - def _initialize_checkpoint_manager(self): + + def _initialize_checkpoint_manager(self): """Initialize the checkpoint manager for model persistence""" try: from utils.checkpoint_manager import get_checkpoint_manager @@ -2520,8 +2521,9 @@ class TradingOrchestrator: logger.info("Checkpoint manager initialized for model persistence") except Exception as e: logger.error(f"Error initializing checkpoint manager: {e}") - self.checkpoint_manager = None de -f _save_training_checkpoints(self, models_trained: List[str], performance_score: float): + self.checkpoint_manager = None + + def _save_training_checkpoints(self, models_trained: List[str], performance_score: float): """Save checkpoints for trained models if performance improved This is CRITICAL for preserving training progress across restarts. diff --git a/web/clean_dashboard.py b/web/clean_dashboard.py index b1f7c6e..9fcd0f4 100644 --- a/web/clean_dashboard.py +++ b/web/clean_dashboard.py @@ -650,7 +650,8 @@ class CleanTradingDashboard: # Apply current leverage to unrealized P&L 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') size = self.current_position.get('size', 0) entry_price = self.current_position.get('price', 0) @@ -664,7 +665,7 @@ class CleanTradingDashboard: # Apply current leverage to unrealized P&L 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') size = self.current_position.get('size', 0) entry_price = self.current_position.get('price', 0)