fix: sensitive signal thresholds in Brief + lower Decio risk filter (75%→70%)

- 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())
This commit is contained in:
Hermes
2026-05-17 17:10:39 +00:00
parent 50960bab21
commit 738490ea4f
2 changed files with 25 additions and 19 deletions
+23 -17
View File
@@ -399,35 +399,42 @@ class BriefAgent:
btc_dom = btc_d.get("btc_dominance_pct", 0) btc_dom = btc_d.get("btc_dominance_pct", 0)
rsi = tech.get("rsi", 50) rsi = tech.get("rsi", 50)
macd_h = tech.get("macd_histogram", 0) macd_h = tech.get("macd_histogram", 0)
change_4h = tech.get("change_4h", 0)
# Signal detection # Signal detection
bullish_signals = 0 bullish_signals = 0
bearish_signals = 0 bearish_signals = 0
# RSI # RSI — granular zones
if rsi < 30: bullish_signals += 1 if rsi < 38: bullish_signals += 1
elif rsi > 70: bearish_signals += 1 elif rsi > 62: bearish_signals += 1
# Funding rate # Funding rate — any positive funding = long pressure
if funding > 0.01: bearish_signals += 1 # high funding = long squeeze risk if funding > 0.0001: bearish_signals += 1
elif funding < -0.01: bullish_signals += 1 elif funding < -0.0001: bullish_signals += 1
# Long ratio # Long ratio — tighter around 50
if long_ratio > 60: bearish_signals += 1 # over-leveraged longs if long_ratio > 53: bearish_signals += 1
elif long_ratio < 40: bullish_signals += 1 elif long_ratio < 47: bullish_signals += 1
# Fear&Greed # Fear&Greed — extreme gets 2x
if fg_class in ["Extreme Fear", "Fear"]: bullish_signals += 1 if fg_class in ["Extreme Fear"]: bullish_signals += 2
elif fg_class in ["Extreme Greed", "Greed"]: bearish_signals += 1 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 # MACD histogram — lower threshold for sensitivity
if macd_h > 0: bullish_signals += 1 if macd_h > 5: bullish_signals += 1
elif macd_h < 0: bearish_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 if btc_dom > 55: bullish_signals += 1
elif btc_dom < 45: bearish_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 # Determine signal and confidence
net = bullish_signals - bearish_signals net = bullish_signals - bearish_signals
if net >= 3: if net >= 3:
@@ -441,7 +448,6 @@ class BriefAgent:
confidence = 40 + abs(net) * 5 confidence = 40 + abs(net) * 5
# Change-based confirmation # Change-based confirmation
change_4h = tech.get("change_4h", 0)
change_24h = tech.get("change_24h", 0) change_24h = tech.get("change_24h", 0)
if change_24h > 5 and signal == "NEUTRO": if change_24h > 5 and signal == "NEUTRO":
signal = "ALTA"; confidence = min(confidence + 10, 85) signal = "ALTA"; confidence = min(confidence + 10, 85)
+2 -2
View File
@@ -16,8 +16,8 @@ class DecioAgent:
# ── CORE RULE: confidence < 75% → always HOLD ───────────────────────── # ── CORE RULE: confidence < 75% → always HOLD ─────────────────────────
def _risk_filter(self, confidence, signal): def _risk_filter(self, confidence, signal):
"""Décio is a mathematician: no confidence ≥75%, no operation.""" """Décio is a mathematician: no confidence ≥70%, no operation."""
return confidence < 75 or signal not in ("ALTA", "BAIXA") return confidence < 70 or signal not in ("ALTA", "BAIXA")
# ── Stop Loss / Take Profit ──────────────────────────────────────────────── # ── Stop Loss / Take Profit ────────────────────────────────────────────────
def _calc_levels(self, price, action): def _calc_levels(self, price, action):