feat: Phase 3 — indicateurs techniques calibrés par horizon option

- technical_indicators.py (nouveau) : compute_indicators() calcule RSI, MA fast/slow,
  Bollinger Bands, ATR — périodes calibrées automatiquement selon horizon_days
- config.py : endpoints GET/PUT /config/tech-indicators (activé, liste, auto-calibration)
- useApi.ts : useTechIndicatorsConfig + useSaveTechIndicatorsConfig hooks
- Config.tsx : carte "Indicateurs techniques" dans Options—Paramètres avec toggles
- auto_cycle.py : compute top-5 tickers à chaque cycle si tech_indicators_enabled=true
- ai_analyzer.py : tech_indicators_block injecté dans suggestion + scoring prompts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-20 16:41:42 +02:00
parent d5e31bc897
commit 50ba75e468
6 changed files with 357 additions and 2 deletions

View File

@@ -119,3 +119,31 @@ def save_options_gate(req: OptionsGateRequest):
if req.iv_gate_skew_threshold is not None:
set_config("iv_gate_skew_threshold", str(req.iv_gate_skew_threshold))
return {"status": "ok"}
# ── Tech Indicators config ──────────────────────────────────────────────────
class TechIndicatorsRequest(BaseModel):
tech_indicators_enabled: Optional[bool] = None
tech_indicators_list: Optional[str] = None # comma-separated: "rsi,ma,bollinger,atr"
tech_indicators_auto_calibrate: Optional[bool] = None
@router.get("/tech-indicators")
def get_tech_indicators():
return {
"tech_indicators_enabled": (get_config("tech_indicators_enabled") or "true").lower() == "true",
"tech_indicators_list": get_config("tech_indicators_list") or "rsi,ma,bollinger,atr",
"tech_indicators_auto_calibrate": (get_config("tech_indicators_auto_calibrate") or "true").lower() == "true",
}
@router.put("/tech-indicators")
def save_tech_indicators(req: TechIndicatorsRequest):
if req.tech_indicators_enabled is not None:
set_config("tech_indicators_enabled", "true" if req.tech_indicators_enabled else "false")
if req.tech_indicators_list is not None:
set_config("tech_indicators_list", req.tech_indicators_list)
if req.tech_indicators_auto_calibrate is not None:
set_config("tech_indicators_auto_calibrate", "true" if req.tech_indicators_auto_calibrate else "false")
return {"status": "ok"}