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

@@ -353,6 +353,7 @@ def score_patterns_with_context(
iv_context: str = "",
risk_context: str = "",
cycle_meta: Optional[Dict] = None,
tech_indicators_block: str = "",
) -> List[Dict[str, Any]]:
"""Score all patterns with rich context (news, prices, IV, risk clusters) using GPT-4o."""
if not get_client():
@@ -571,11 +572,14 @@ Instructions de notation:
f"⚠️ Tiens compte du délai depuis le dernier cycle pour évaluer si les news sont déjà intégrées.\n"
)
_tech_sc_section = f"\n{tech_indicators_block}\n" if tech_indicators_block else ""
user = f"""CONTEXTE GLOBAL:
- Score risque géopolitique: {geo_score.get('score', 50)}/100 ({geo_score.get('level', 'medium')})
- Top risques: {geo_score.get('top_risks', [])}
{temporal_section_sc}
{macro_section}
{_tech_sc_section}
TEMPLATE DE NOTATION:
{scoring_template}
@@ -964,6 +968,7 @@ def suggest_patterns_from_market_context(
reliability_map: Optional[Dict] = None,
iv_context: str = "",
cycle_meta: Optional[Dict] = None,
tech_indicators_block: str = "",
) -> List[Dict]:
"""Ask GPT-4o to propose new patterns based on current geo/market + macro regime context."""
_cycle_meta = cycle_meta or {}
@@ -1109,12 +1114,14 @@ Règles supplémentaires:
"## Actualités géopolitiques du moment (triées par impact)\n" + news_block
)
tech_block_section = f"\n{tech_indicators_block}\n" if tech_indicators_block else ""
user = f"""Tu es un stratège géopolitique et financier senior, expert en options.
{macro_block}{geo_block}{lessons_block}{reliability_block}{iv_block}
{temporal_news_block}
## Prix des marchés (variation J-1)
{market_block}
{tech_block_section}
## Calendrier économique à venir
{cal_block}