stability

This commit is contained in:
Dobromir Popov
2025-08-08 17:32:09 +03:00
parent 78b96c10af
commit f8d3e1c999
4 changed files with 35 additions and 14 deletions

View File

@ -3406,7 +3406,7 @@ class TradingOrchestrator:
"""Evaluate prediction outcome and train model"""
try:
model_name = record["model_name"]
prediction = record["prediction"]
prediction = record.get("prediction") or {}
timestamp = record["timestamp"]
# Convert timestamp string back to datetime if needed
@ -3451,10 +3451,8 @@ class TradingOrchestrator:
return
# Enhanced reward system based on prediction confidence and price movement magnitude
predicted_action = prediction["action"]
prediction_confidence = prediction.get(
"confidence", 0.5
) # Default to 0.5 if missing
predicted_action = prediction.get("action", "HOLD")
prediction_confidence = prediction.get("confidence", 0.5)
# Calculate sophisticated reward based on multiple factors
current_pnl = self._get_current_position_pnl(symbol)