Neues Modul: Visuelle Chartmuster-Erkennung (core/patterns.py) — reine Anzeige

Erkennt aus M30-Swing-Pivots: Doppeltop/-boden, Kopf-Schulter/inverse SKS,
Tasse+Henkel/invers, auf-/absteigendes+symmetrisches Dreieck. Je Muster Richtung,
Trigger/Nackenlinie, Measured-Move-Ziel, Status (bildet sich/bestätigt/ungültig),
Güte. Dashboard-Karte #card-patterns + Disclaimer (v=116). KEIN Signal, kein
Verdict-Gewicht — Signal-Einfluss erst nach Backtest (Muster-Klasse 2x verworfen,
hohe Beweislast). Live getestet: findet bestätigten Doppeltop.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Axel Hocks
2026-07-27 18:49:40 +02:00
co-authored by Claude Opus 4.8
parent cd8ee5b01b
commit e5589da08b
6 changed files with 310 additions and 3 deletions
+5
View File
@@ -41,6 +41,7 @@ from core.market_hours import session_state
from core.daily_levels import DailyLevels
from core.gaps import GapAnalyzer
from core.structure import MarketStructure
from core.patterns import PatternDetector
from core.candle_logger import CandleLogger
from core.wave_rec import (_atr as _wr_atr, _ema_last,
_EMA_FAST, _EMA_SLOW, _TREND_DEADBAND, _STRETCH_MAX)
@@ -146,6 +147,7 @@ class TradingEngine:
self.wave.set_dead_hours([h.strip() for h in _dh.split(",") if h.strip()])
self.elliott = ElliottAnalyzer(mt5.TIMEFRAME_M5)
self.structure = MarketStructure() # Marktstruktur (M30) — reine Anzeige
self.patterns = PatternDetector() # visuelle Chartmuster (M30) — reine Anzeige
self.candles = CandleLogger(HISTORY_DB_FILE) # M1-Candle-Log (Daten-Sammlung)
# News: eigener Fetch-Loop (versorgt UI /api/news UND Agent-Kontext)
tcfg = self.cfg["translation"]
@@ -475,6 +477,8 @@ class TradingEngine:
except Exception as ee: log.warning(f"elliott.refresh_market: {ee}")
try: self.structure.refresh_market(self.data.symbol)
except Exception as se2: log.warning(f"structure.refresh_market: {se2}")
try: self.patterns.refresh_market(self.data.symbol)
except Exception as pe2: log.warning(f"patterns.refresh_market: {pe2}")
try: self.candles.log(self.data.symbol) # M1-Candle-Log (~55 s)
except Exception as ce: log.warning(f"candles.log: {ce}")
try: self._evaluate_pbreak_predictions() # ~alle 5 min, self-throttled
@@ -2048,6 +2052,7 @@ class TradingEngine:
"daily_levels": self.daily.snapshot(),
"gaps": self.gaps.snapshot(),
"structure": self.structure.snapshot(),
"patterns": self.patterns.snapshot(),
"stats_compact": {"week": self._compact_stats("week"),
"all": self._compact_stats("all")},
"close_alert_count": self._close_alert_count,