From 738490ea4ffe4890552acac9563ca8a3acf5fb92 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sun, 17 May 2026 17:10:39 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20sensitive=20signal=20thresholds=20in=20B?= =?UTF-8?q?rief=20+=20lower=20Decio=20risk=20filter=20(75%=E2=86=9270%)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RSI threshold: 35/65 → 38/62 - Funding: 0.001 → 0.0001 (any positive = bearish signal) - Long ratio: 48-52 → 47-53 (tighter) - MACD: 10 → 5 (more sensitive) - BTC dominance: 57.5 → 55 - 4h change: 1.5% → 1% - Decio risk filter: 75% → 70% to allow 74% signals through - Fix UnboundLocalError on change_4h (defined earlier in run()) --- agents/brief.py | 40 +++++++++++++++++++++++----------------- agents/decio.py | 4 ++-- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/agents/brief.py b/agents/brief.py index b459bd0..f79d221 100644 --- a/agents/brief.py +++ b/agents/brief.py @@ -399,35 +399,42 @@ class BriefAgent: btc_dom = btc_d.get("btc_dominance_pct", 0) rsi = tech.get("rsi", 50) macd_h = tech.get("macd_histogram", 0) + change_4h = tech.get("change_4h", 0) # Signal detection bullish_signals = 0 bearish_signals = 0 - # RSI - if rsi < 30: bullish_signals += 1 - elif rsi > 70: bearish_signals += 1 + # RSI — granular zones + if rsi < 38: bullish_signals += 1 + elif rsi > 62: bearish_signals += 1 - # Funding rate - if funding > 0.01: bearish_signals += 1 # high funding = long squeeze risk - elif funding < -0.01: bullish_signals += 1 + # Funding rate — any positive funding = long pressure + if funding > 0.0001: bearish_signals += 1 + elif funding < -0.0001: bullish_signals += 1 - # Long ratio - if long_ratio > 60: bearish_signals += 1 # over-leveraged longs - elif long_ratio < 40: bullish_signals += 1 + # Long ratio — tighter around 50 + if long_ratio > 53: bearish_signals += 1 + elif long_ratio < 47: bullish_signals += 1 - # Fear&Greed - if fg_class in ["Extreme Fear", "Fear"]: bullish_signals += 1 - elif fg_class in ["Extreme Greed", "Greed"]: bearish_signals += 1 + # Fear&Greed — extreme gets 2x + if fg_class in ["Extreme Fear"]: bullish_signals += 2 + elif fg_class == "Fear": bullish_signals += 1 + elif fg_class == "Greed": bearish_signals += 1 + elif fg_class in ["Extreme Greed"]: bearish_signals += 2 - # MACD histogram - if macd_h > 0: bullish_signals += 1 - elif macd_h < 0: bearish_signals += 1 + # MACD histogram — lower threshold for sensitivity + if macd_h > 5: bullish_signals += 1 + elif macd_h < -5: bearish_signals += 1 - # BTC dominance (high = BTC season, alt risk) + # BTC dominance if btc_dom > 55: bullish_signals += 1 elif btc_dom < 45: bearish_signals += 1 + # Price momentum (4h change) + if change_4h > 1.0: bullish_signals += 1 + elif change_4h < -1.0: bearish_signals += 1 + # Determine signal and confidence net = bullish_signals - bearish_signals if net >= 3: @@ -441,7 +448,6 @@ class BriefAgent: confidence = 40 + abs(net) * 5 # Change-based confirmation - change_4h = tech.get("change_4h", 0) change_24h = tech.get("change_24h", 0) if change_24h > 5 and signal == "NEUTRO": signal = "ALTA"; confidence = min(confidence + 10, 85) diff --git a/agents/decio.py b/agents/decio.py index e8acc16..9d7de11 100644 --- a/agents/decio.py +++ b/agents/decio.py @@ -16,8 +16,8 @@ class DecioAgent: # ── CORE RULE: confidence < 75% → always HOLD ───────────────────────── def _risk_filter(self, confidence, signal): - """Décio is a mathematician: no confidence ≥75%, no operation.""" - return confidence < 75 or signal not in ("ALTA", "BAIXA") + """Décio is a mathematician: no confidence ≥70%, no operation.""" + return confidence < 70 or signal not in ("ALTA", "BAIXA") # ── Stop Loss / Take Profit ──────────────────────────────────────────────── def _calc_levels(self, price, action):