Nexo-S commited on
Commit
d6da76d
·
verified ·
1 Parent(s): 9e6a403

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -342,6 +342,15 @@ async def predict_signal(symbol, timeframe="1h"):
342
  veto = True
343
  veto_reason = "Tendance macro baissière (Risque Altcoins)."
344
 
 
 
 
 
 
 
 
 
 
345
  if veto:
346
  print(f"🛑 [VETO IA] {symbol} [{timeframe}] refusé : {veto_reason}")
347
  return {
@@ -514,7 +523,7 @@ def run_judge_api():
514
  min_tp_d = min(0.015, min_tp_d * 1.05) # Exige plus de marge de gain
515
 
516
  cursor.execute("UPDATE agent_logic SET tp_mult=?, sl_mult=?, score=score+?, min_prob=?, min_tp_dist=? WHERE timeframe=?",
517
- (max(1.1, tp_m), max(0.5, sl_m), reward, min_p, min_tp_d, t['timeframe']))
518
  cursor.execute("UPDATE signals SET status=? WHERE id=?", (outcome, t['id']))
519
 
520
  # 📦 ON PRÉPARE LE COLIS POUR DISCORD
 
342
  veto = True
343
  veto_reason = "Tendance macro baissière (Risque Altcoins)."
344
 
345
+ # F6: Le Veto de Tendance (Anti-Kamikaze)
346
+ ema200_slope_val = float(last_row["EMA200_slope"].iloc[0])
347
+ if final_p < 0.5 and ema200_slope_val > 0.005: # Si on veut shorter mais que la tendance long terme monte fort
348
+ veto = True
349
+ veto_reason = "Tendance lourde haussière. Interdit de shorter un pump."
350
+ elif final_p > 0.5 and ema200_slope_val < -0.005: # L'inverse
351
+ veto = True
352
+ veto_reason = "Tendance lourde baissière. Interdit d'acheter un dump."
353
+
354
  if veto:
355
  print(f"🛑 [VETO IA] {symbol} [{timeframe}] refusé : {veto_reason}")
356
  return {
 
523
  min_tp_d = min(0.015, min_tp_d * 1.05) # Exige plus de marge de gain
524
 
525
  cursor.execute("UPDATE agent_logic SET tp_mult=?, sl_mult=?, score=score+?, min_prob=?, min_tp_dist=? WHERE timeframe=?",
526
+ ((max(1.1, tp_m), max(1.0, sl_m), reward, min_p, min_tp_d, t['timeframe']))
527
  cursor.execute("UPDATE signals SET status=? WHERE id=?", (outcome, t['id']))
528
 
529
  # 📦 ON PRÉPARE LE COLIS POUR DISCORD