better decision details
This commit is contained in:
@ -2491,7 +2491,14 @@ class CleanTradingDashboard:
|
||||
|
||||
# Extract source information from signal
|
||||
signal_source = 'Unknown'
|
||||
if hasattr(signal, 'reasoning') and signal.reasoning:
|
||||
|
||||
# First try to get source directly from the signal (new method)
|
||||
if hasattr(signal, 'source') and signal.source:
|
||||
signal_source = signal.source
|
||||
elif isinstance(signal, dict) and 'source' in signal and signal['source']:
|
||||
signal_source = signal['source']
|
||||
# Fallback to old method using reasoning.models_used
|
||||
elif hasattr(signal, 'reasoning') and signal.reasoning:
|
||||
models_used = signal.reasoning.get('models_used', [])
|
||||
if models_used:
|
||||
signal_source = ', '.join(models_used)
|
||||
@ -5107,6 +5114,7 @@ class CleanTradingDashboard:
|
||||
'blocked': False,
|
||||
'manual': True, # CRITICAL: Mark as manual for special handling
|
||||
'reason': f'Manual {action} button',
|
||||
'source': 'Manual', # Clear source for manual trades
|
||||
'model_inputs': model_inputs, # Store for training
|
||||
'persistent': True, # MARK for persistent display
|
||||
'chart_priority': 'HIGH' # High priority for chart display
|
||||
@ -8169,7 +8177,9 @@ class CleanTradingDashboard:
|
||||
'symbol': symbol,
|
||||
'confidence': confidence,
|
||||
'timestamp': datetime.now(),
|
||||
'executed': False
|
||||
'executed': False,
|
||||
'source': getattr(decision, 'source', 'Unknown'),
|
||||
'reasoning': getattr(decision, 'reasoning', {})
|
||||
}
|
||||
# Add any other attributes from the decision object
|
||||
for attr in ['price', 'quantity', 'reasoning', 'model_source']:
|
||||
@ -8179,6 +8189,9 @@ class CleanTradingDashboard:
|
||||
dashboard_decision = decision.copy()
|
||||
dashboard_decision['timestamp'] = datetime.now()
|
||||
dashboard_decision['executed'] = False
|
||||
# Ensure source is preserved
|
||||
if 'source' not in dashboard_decision:
|
||||
dashboard_decision['source'] = 'Unknown'
|
||||
|
||||
logger.info(f"[ORCHESTRATOR SIGNAL] Received: {action} for {symbol} (confidence: {confidence:.3f})")
|
||||
|
||||
|
Reference in New Issue
Block a user