Riy777 commited on
Commit
fb4f181
·
verified ·
1 Parent(s): 3122efe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -3,6 +3,7 @@
3
  # - Integration: Web3 Whales (Top 10), Two-Tier Monte Carlo, News Sentiment.
4
  # - UI: Full Crash-Proof Gradio Interface with Detailed Tables.
5
  # - Stability: Robust Error Handling & State Management.
 
6
 
7
  import os
8
  import sys
@@ -384,13 +385,20 @@ async def run_unified_cycle():
384
  if d1 and d5 and d15:
385
  entry_p = trade['entry_price']
386
  decision = ml_processor.consult_guardian(d1, d5, d15, entry_p)
387
- log_and_print(f" 📊 Status: {decision.get('action')} ({decision.get('reason')})")
 
 
 
 
 
 
388
 
389
  if decision.get('action') == 'EXIT_HARD':
390
  log_and_print(f" 🚨 FORCE EXIT TRIGGERED!")
391
  await trade_manager.force_exit_by_manager(symbol, reason=f"CYCLE_DETECTED")
392
  except Exception as e:
393
  log_and_print(f" ⚠️ Guardian error: {e}")
 
394
 
395
  sys_state.set_cycle_end(logs=log_buffer.getvalue())
396
  return
 
3
  # - Integration: Web3 Whales (Top 10), Two-Tier Monte Carlo, News Sentiment.
4
  # - UI: Full Crash-Proof Gradio Interface with Detailed Tables.
5
  # - Stability: Robust Error Handling & State Management.
6
+ # - Update: Guardian now displays specific V2/V3 confidence scores.
7
 
8
  import os
9
  import sys
 
385
  if d1 and d5 and d15:
386
  entry_p = trade['entry_price']
387
  decision = ml_processor.consult_guardian(d1, d5, d15, entry_p)
388
+
389
+ # 🛠️ [MODIFIED] Display specific V2/V3 scores instead of generic text
390
+ scores = decision.get('scores', {})
391
+ v2_val = int(scores.get('v2', 0.0) * 100)
392
+ v3_val = int(scores.get('v3', 0.0) * 100)
393
+
394
+ log_and_print(f" 📊 Status: {decision.get('action')} | V2: {v2_val} | V3: {v3_val}")
395
 
396
  if decision.get('action') == 'EXIT_HARD':
397
  log_and_print(f" 🚨 FORCE EXIT TRIGGERED!")
398
  await trade_manager.force_exit_by_manager(symbol, reason=f"CYCLE_DETECTED")
399
  except Exception as e:
400
  log_and_print(f" ⚠️ Guardian error: {e}")
401
+ traceback.print_exc()
402
 
403
  sys_state.set_cycle_end(logs=log_buffer.getvalue())
404
  return