@ -237,35 +237,6 @@ class TradingSession:
|
||||
'open_positions': len(self.positions),
|
||||
'trade_history': self.trade_history
|
||||
}
|
||||
|
||||
def clear_session_performance(self):
|
||||
"""Reset session performance metrics while keeping session ID"""
|
||||
try:
|
||||
# Log session summary before clearing
|
||||
summary = self.get_session_summary()
|
||||
logger.info(f"CLEARING SESSION PERFORMANCE:")
|
||||
logger.info(f"Session: {summary['session_id']}")
|
||||
logger.info(f"Duration: {summary['duration']}")
|
||||
logger.info(f"Final P&L: ${summary['total_pnl']:+.2f}")
|
||||
logger.info(f"Total Trades: {summary['total_trades']}")
|
||||
logger.info(f"Win Rate: {summary['win_rate']:.1%}")
|
||||
|
||||
# Reset all performance metrics
|
||||
self.start_time = datetime.now()
|
||||
self.current_balance = self.starting_balance
|
||||
self.total_pnl = 0.0
|
||||
self.total_fees = 0.0
|
||||
self.total_trades = 0
|
||||
self.winning_trades = 0
|
||||
self.losing_trades = 0
|
||||
self.positions.clear() # Close all positions
|
||||
self.trade_history.clear()
|
||||
self.last_action = None
|
||||
|
||||
logger.info(f"SESSION PERFORMANCE CLEARED - Fresh start with ${self.starting_balance:.2f}")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error clearing session performance: {e}")
|
||||
|
||||
class RealTimeScalpingDashboard:
|
||||
"""Real-time scalping dashboard with WebSocket streaming and ultra-low latency"""
|
||||
|
Reference in New Issue
Block a user