Riy777 commited on
Commit
a8149e3
ยท
verified ยท
1 Parent(s): e37b638

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -1,5 +1,5 @@
1
  # ==============================================================================
2
- # ๐Ÿš€ app.py (V61.3 - GEM-Architect: Full Neural Dashboard Restored)
3
  # ==============================================================================
4
 
5
  import os
@@ -182,7 +182,7 @@ async def auto_pilot_loop():
182
  async def lifespan(app: FastAPI):
183
  global r2, data_manager, ml_processor, adaptive_hub, trade_manager, whale_monitor, news_fetcher, senti_analyzer, sys_state, scheduler
184
 
185
- logger.info("\n๐Ÿš€ [System] Startup Sequence (Titan V61.3 - Full Check)...")
186
  try:
187
  r2 = R2Service()
188
  data_manager = DataManager(contracts_db={}, whale_monitor=None, r2_service=r2)
@@ -359,7 +359,6 @@ async def run_unified_cycle():
359
 
360
  approved_signals = []
361
 
362
- # โœ… TABLE HEADER UPDATED
363
  header = (f"{'SYM':<9} | {'TYPE':<10} | {'L2':<5} | {'TITAN':<5} | {'PATT':<5} | "
364
  f"{'WHALE':<6} | {'MC(A)':<6} | {'FINAL':<6} | {'ORACLE':<6} | {'STATUS'}")
365
 
@@ -382,7 +381,6 @@ async def run_unified_cycle():
382
  sig.update(decision)
383
  approved_signals.append(sig)
384
 
385
- # ุงุณุชุฎุฑุงุฌ ุงู„ู‚ูŠู… ุงู„ุชูุตูŠู„ูŠุฉ ู„ู„ุนุฑุถ
386
  l2_hybrid = sig.get('enhanced_final_score', 0.0)
387
  titan_d = sig.get('titan_score', 0.0)
388
  patt_d = sig.get('patterns_score', 0.0)
@@ -619,6 +617,7 @@ async def check_live_pnl_and_status(selected_view="Dual-Core (Hybrid)"):
619
  tot_ds = stats_data['total']
620
  ds_acc = (stats_data['good'] / tot_ds * 100) if tot_ds > 0 else 0.0
621
 
 
622
  history_md = f"""
623
  <div style='background-color: #1a1a1a; padding: 10px; border-radius: 8px; border: 1px solid #333; font-size: 12px;'>
624
  <h3 style='margin:0 0 5px 0; color:#888; font-size:14px;'>๐Ÿ“Š Performance</h3>
@@ -635,6 +634,7 @@ async def check_live_pnl_and_status(selected_view="Dual-Core (Hybrid)"):
635
  <tr><td>Interventions:</td><td style='text-align:right;'>{tot_ds}</td></tr>
636
  <tr><td>Accuracy:</td><td style='text-align:right; color:#00e5ff;'>{ds_acc:.1f}%</td></tr>
637
  <tr><td>Saved:</td><td style='text-align:right; color:#00ff00;'>${stats_data['saved']:.2f}</td></tr>
 
638
  </table>
639
  </div>
640
  """
@@ -646,7 +646,6 @@ async def check_live_pnl_and_status(selected_view="Dual-Core (Hybrid)"):
646
 
647
  metrics = scheduler.get_status_metrics() if scheduler else {}
648
  sch_w_time = metrics.get("weekly_timer", "Wait")
649
- # โœ… RESTORED MONTHLY METRICS
650
  sch_m_time = metrics.get("monthly_timer", "Wait")
651
 
652
  neural_md = f"""
@@ -746,10 +745,10 @@ async def check_live_pnl_and_status(selected_view="Dual-Core (Hybrid)"):
746
  def create_gradio_ui():
747
  custom_css = ".gradio-container {background:#0b0f19} .dataframe {background:#1a1a1a!important} .html-box {min-height:180px}"
748
 
749
- with gr.Blocks(title="Titan V61.3 (Full Neural Dashboard)") as demo:
750
  gr.HTML(f"<style>{custom_css}</style>")
751
 
752
- gr.Markdown("# ๐Ÿš€ Titan V61.3 (Cybernetic: Dual-Type Engine)")
753
 
754
  with gr.Row():
755
  with gr.Column(scale=3):
 
1
  # ==============================================================================
2
+ # ๐Ÿš€ app.py (V61.4 - GEM-Architect: Full UI Integrity Restored)
3
  # ==============================================================================
4
 
5
  import os
 
182
  async def lifespan(app: FastAPI):
183
  global r2, data_manager, ml_processor, adaptive_hub, trade_manager, whale_monitor, news_fetcher, senti_analyzer, sys_state, scheduler
184
 
185
+ logger.info("\n๐Ÿš€ [System] Startup Sequence (Titan V61.4 - Restoration)...")
186
  try:
187
  r2 = R2Service()
188
  data_manager = DataManager(contracts_db={}, whale_monitor=None, r2_service=r2)
 
359
 
360
  approved_signals = []
361
 
 
362
  header = (f"{'SYM':<9} | {'TYPE':<10} | {'L2':<5} | {'TITAN':<5} | {'PATT':<5} | "
363
  f"{'WHALE':<6} | {'MC(A)':<6} | {'FINAL':<6} | {'ORACLE':<6} | {'STATUS'}")
364
 
 
381
  sig.update(decision)
382
  approved_signals.append(sig)
383
 
 
384
  l2_hybrid = sig.get('enhanced_final_score', 0.0)
385
  titan_d = sig.get('titan_score', 0.0)
386
  patt_d = sig.get('patterns_score', 0.0)
 
617
  tot_ds = stats_data['total']
618
  ds_acc = (stats_data['good'] / tot_ds * 100) if tot_ds > 0 else 0.0
619
 
620
+ # โœ… RESTORED MISSED ROW
621
  history_md = f"""
622
  <div style='background-color: #1a1a1a; padding: 10px; border-radius: 8px; border: 1px solid #333; font-size: 12px;'>
623
  <h3 style='margin:0 0 5px 0; color:#888; font-size:14px;'>๐Ÿ“Š Performance</h3>
 
634
  <tr><td>Interventions:</td><td style='text-align:right;'>{tot_ds}</td></tr>
635
  <tr><td>Accuracy:</td><td style='text-align:right; color:#00e5ff;'>{ds_acc:.1f}%</td></tr>
636
  <tr><td>Saved:</td><td style='text-align:right; color:#00ff00;'>${stats_data['saved']:.2f}</td></tr>
637
+ <tr><td>Missed:</td><td style='text-align:right; color:#ff0000;'>${stats_data['missed']:.2f}</td></tr>
638
  </table>
639
  </div>
640
  """
 
646
 
647
  metrics = scheduler.get_status_metrics() if scheduler else {}
648
  sch_w_time = metrics.get("weekly_timer", "Wait")
 
649
  sch_m_time = metrics.get("monthly_timer", "Wait")
650
 
651
  neural_md = f"""
 
745
  def create_gradio_ui():
746
  custom_css = ".gradio-container {background:#0b0f19} .dataframe {background:#1a1a1a!important} .html-box {min-height:180px}"
747
 
748
+ with gr.Blocks(title="Titan V61.4 (Full Neural Dashboard)") as demo:
749
  gr.HTML(f"<style>{custom_css}</style>")
750
 
751
+ gr.Markdown("# ๐Ÿš€ Titan V61.4 (Cybernetic: Dual-Type Engine)")
752
 
753
  with gr.Row():
754
  with gr.Column(scale=3):