Nexo-S commited on
Commit
ed2b570
·
verified ·
1 Parent(s): 1109825

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -494,7 +494,9 @@ def run_judge_api(live_prices_json="{}"):
494
  live_prices = {}
495
 
496
  with sqlite3.connect(DB_NAME, timeout=10) as conn:
497
- conn.row_factory, cursor = sqlite3.Row, conn.cursor()
 
 
498
 
499
  # ==============================================================
500
  # 🧹 1. PURGE DES SIGNAUX ORPHELINS (Le Bras était éteint)
@@ -592,7 +594,7 @@ def run_judge_api(live_prices_json="{}"):
592
  if nouveau_sl != sl_dyn:
593
  print(f"🛡️ [CLOUD-SL] {t['symbol']} ID {t['id']} | Le SL monte à {round(nouveau_sl, 5)} (Prog: {round(progression*100,1)}%)")
594
 
595
- outcome, reward = None,
596
  if t['direction'] == 'HAUSSIER':
597
  if current_price >= t['tp']: outcome, reward = "GAGNÉ ✅", 3
598
  elif current_price <= nouveau_sl: outcome, reward = ("GAGNÉ (PARTIEL) 💸", 1) if nouveau_sl > t['price'] else ("PERDU ❌", -5)
 
494
  live_prices = {}
495
 
496
  with sqlite3.connect(DB_NAME, timeout=10) as conn:
497
+ # 🚀 LE FIX : On sépare en deux lignes strictes
498
+ conn.row_factory = sqlite3.Row
499
+ cursor = conn.cursor()
500
 
501
  # ==============================================================
502
  # 🧹 1. PURGE DES SIGNAUX ORPHELINS (Le Bras était éteint)
 
594
  if nouveau_sl != sl_dyn:
595
  print(f"🛡️ [CLOUD-SL] {t['symbol']} ID {t['id']} | Le SL monte à {round(nouveau_sl, 5)} (Prog: {round(progression*100,1)}%)")
596
 
597
+ outcome, reward = None, 0
598
  if t['direction'] == 'HAUSSIER':
599
  if current_price >= t['tp']: outcome, reward = "GAGNÉ ✅", 3
600
  elif current_price <= nouveau_sl: outcome, reward = ("GAGNÉ (PARTIEL) 💸", 1) if nouveau_sl > t['price'] else ("PERDU ❌", -5)