mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-31 17:27:42 +00:00
a9c5df0047
Neue Module für quantitatives EURUSD-Trading: 1. Hurst Exponent Regime Detection (eurusd_regime.py) - Erkennt Marktregime: MEAN_REVERSION, NEUTRAL, TRENDING - R/S-Analyse für 1min EURUSD-Daten optimiert - Trading-Empfehlungen pro Regime 2. BM25 Memory-System (eurusd_memory.py) - Speichert vergangene Trades mit Situation/Ergebnis - Findet ähnliche Setups via BM25-Ähnlichkeit - Persistente JSON-Speicherung - Historische Win-Rate Analyse 3. Volatility-Adjusted Position Sizing (eurusd_risk.py) - ATR-basierte Volatilitätsmessung - Positionsgröße nach Volatilitäts-Percentile (0.4x-1.5x) - Regime-Adjustierung (MEAN_REVERSION/TRENDING/NEUTRAL) - Korrelations-Adjustierung für Forex-Paare 4. Multi-Provider LLM Fallback (eurusd_llm.py) - Automatische Fallback-Kette bei API-Ausfällen - Provider: Qwen3.5 → DeepSeek → Gemini → Ollama - Provider-Statistiken für Monitoring - JSON-Modus für strukturierte Outputs Daten-Pipeline verbessert: - 1-Minuten-Daten korrekt in Qlib integriert - Prompts von 15min auf 1min aktualisiert - generate.py für 1min EURUSD-Daten angepasst Alle Module einzeln und im Integrationstest bestanden.
40 lines
1.1 KiB
Python
Executable File
40 lines
1.1 KiB
Python
Executable File
import qlib
|
|
|
|
# EURUSD 1-Minuten Daten verwenden
|
|
qlib.init(provider_uri="~/.qlib/qlib_data/eurusd_1min_data")
|
|
|
|
from qlib.data import D
|
|
|
|
instruments = D.instruments()
|
|
fields = ["$open", "$close", "$high", "$low", "$volume"]
|
|
|
|
# 1min Daten für EURUSD
|
|
# Start: 2020-01-01, End: 2026-03-20
|
|
data = D.features(instruments, fields, freq="1min").swaplevel().sort_index()
|
|
|
|
data.to_hdf("./daily_pv_all.h5", key="data")
|
|
|
|
|
|
# Debug-Daten: Nur letzte ~100 Instrumente für schnelleres Testing
|
|
fields = ["$open", "$close", "$high", "$low", "$volume"]
|
|
data_debug = (
|
|
D.features(instruments, fields, start_time="2024-01-01", end_time="2024-12-31", freq="1min")
|
|
.swaplevel()
|
|
.sort_index()
|
|
)
|
|
|
|
# Nimm erste 100 unique instruments
|
|
unique_inst = data_debug.reset_index()["instrument"].unique()[:100]
|
|
data_debug = (
|
|
data_debug.swaplevel()
|
|
.loc[unique_inst]
|
|
.swaplevel()
|
|
.sort_index()
|
|
)
|
|
|
|
data_debug.to_hdf("./daily_pv_debug.h5", key="data")
|
|
|
|
print(f"Generated daily_pv_all.h5 with {len(data)} rows")
|
|
print(f"Generated daily_pv_debug.h5 with {len(data_debug)} rows")
|
|
print(f"Date range: {data.index.min()} to {data.index.max()}")
|