367 Commits

Author SHA1 Message Date
OpenSquared
4be3ad9ce3 feat: market event 2026-06-29 11:15:08 +02:00
OpenSquared
9f90c97461 feat: market event 2026-06-29 11:05:25 +02:00
OpenSquared
bcdf1fbf2e feat: causal lab 2026-06-29 10:32:18 +02:00
OpenSquared
67bfd8e777 feat: tab bar 2026-06-29 09:23:26 +02:00
OpenSquared
45e5504256 feat: tab bar 2026-06-29 08:56:10 +02:00
OpenSquared
97077af369 feat: market event 2026-06-29 08:14:25 +02:00
OpenSquared
5e65424500 feat: instrument analysis 2026-06-29 00:06:14 +02:00
OpenSquared
3bcecdab09 feat: instrument analysis 2026-06-28 23:43:52 +02:00
OpenSquared
3d7b3e47c9 feat: instrument analysis 2026-06-28 23:28:21 +02:00
OpenSquared
5a0aa30d60 feat: instrument analysis 2026-06-28 23:07:20 +02:00
OpenSquared
aba599cec7 feat: causal lab 2026-06-28 18:15:56 +02:00
OpenSquared
6ebbf4326e feat: causal lab 2026-06-28 18:08:09 +02:00
OpenSquared
c286c7c000 feat: desk IA 2026-06-28 17:14:40 +02:00
OpenSquared
bab09a1b09 feat: causal lab 2026-06-28 17:03:37 +02:00
OpenSquared
6a683411ed feat: instrument analysis 2026-06-28 16:57:16 +02:00
OpenSquared
e4e17330b4 feat: instrument analysis 2026-06-28 16:36:28 +02:00
OpenSquared
0693d41d91 feat: causal lab 2026-06-28 15:50:51 +02:00
OpenSquared
1e44557551 feat:: causal lab 2026-06-28 15:38:19 +02:00
OpenSquared
863ba67610 feat: causal lab 2026-06-28 14:18:43 +02:00
OpenSquared
20f1897211 feat: instrument analysis 2026-06-28 13:52:34 +02:00
OpenSquared
b5d4eb71e7 feat: instrument analysis 2026-06-28 13:35:29 +02:00
OpenSquared
6d31ec973a feat: instrument analysis 2026-06-28 13:26:14 +02:00
OpenSquared
b94291623d feat: instrument analysis 2026-06-28 13:04:24 +02:00
OpenSquared
79d4a9f741 Calendar synchro 2026-06-28 12:15:25 +02:00
OpenSquared
98d6be8212 feat: temporal params (lag/diffusion/decay) sur aretes causales
- CausalEdge: lag_min, diffusion_min, decay_days
- SVG: labels +Xm (jaune, source) et decay (gris, cible) sur les aretes
- Editeur: champs lag/diffusion/decay dans add-edge et edit-edge
- Bibliotheque: section Parametres temporels avec grille editable + sauvegarde PATCH
- Backend: _drift_metrics utilise lag_min pour decaler fenetre intraday 5min
- analyze: calcule effective_lag depuis aretes → market_asset, retourne dans resultat

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:47:04 +02:00
OpenSquared
cb33fa0dd7 fix: delete button visible pour tous les templates (grise si systeme) 2026-06-28 11:35:23 +02:00
OpenSquared
1117e9ee8a feat: causal lab - delete template + observable mapping + edge editing
- TabLibrary: bouton Supprimer (templates user uniquement)
- TabEditor: inputMapping dans EditorState, panneau mapping visible quand noeud observable selectionne
- TabEditor: edition d aretes (cliquer sur arête pour modifier style/force/signe/label)
- Backend: GET /api/causal-lab/data-sources (prices/macro_series/ff_events)
- analyze: auto-fetch market_watchlist+economic_events+ff_calendar depuis input_mapping
- TabAnalyze: affiche inputs auto-recuperes vs manuels dans les resultats

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 10:53:50 +02:00
OpenSquared
dd31f92aaf feat: causal lab - bouton Mettre a jour + PATCH endpoint
- TabEditor: updateExisting() + bouton bleu visible si templateId set
- Bouton Creer renomme en copie pour clarifier
- PATCH /api/causal-lab/template/{id} pour graph_json + metadonnees

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 10:02:28 +02:00
OpenSquared
e8fb7c13aa feat: causal lab — éditeur visuel, types nœuds, force/signe arêtes, NFP v2 2026-06-28 09:28:43 +02:00
OpenSquared
83a8e8c5be fix: causal lab — URL relative /api (pas localhost:8000) 2026-06-27 23:38:38 +02:00
OpenSquared
7a0263989a feat: causal lab — debug endpoint + error display in UI 2026-06-27 23:36:22 +02:00
OpenSquared
a7f5369d7b Causal lab v2 2026-06-27 23:25:59 +02:00
OpenSquared
9ac3ebb4b5 causal lab 2026-06-27 21:45:10 +02:00
OpenSquared
c764bcba8c fix: seuil fedFwdC/ecbFwdC 0.4→0.08 — PMI EU/US colorise le nœud CPI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 23:36:01 +02:00
OpenSquared
48e8d0de37 fix: SVG causal chain — tous les nœuds dynamiques
Bugs corrigés :
- VIX : hardcodé gris → rouge si > base (risk-off = bearish EUR), valeur affichée dans le nœud, flèche épaisseur dynamique
- CPI US/NFP : hardcodé gris/unidirectionnel → fedFwdC bidirectionnel (rouge si hawkish, vert si dovish)
- CPI EU/PMI : idem → ecbFwdC bidirectionnel
- FED : utilisait fedRateC (rate only) → fedC combinant rate + tone (réagit au ton seul)
- BCE : idem → ecbC combiné
- Flèches CPI→FED/BCE : utilisaient la couleur du canal taux → corrigé vers canal forward guidance (tirets)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 23:32:18 +02:00
OpenSquared
6b850091eb fix: PMI US — coloration dynamique + ajout dans fed_fwd_signal
PMI US colorisé rouge/vert selon déviation vs 50 dans le SVG
Flèche PMI US → FED prend la même couleur que le nœud
PMI US ajouté dans fed_fwd_signal (+0.18 par pt) pour symétriser avec PMI EU
Les deux canaux PMI US sont maintenant visibles : CB expectations (→10Y) + direct c_pmi (croissance diff)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 23:25:48 +02:00
OpenSquared
91e624aa56 Simu EUR/USD 2026-06-26 23:19:28 +02:00
OpenSquared
e27ff72c1c feat: simulateur EUR/USD — canaux taux/ton séparés + saisie directe sliders
Modèle causal refactorisé en deux canaux distincts :
- Canal taux (solid) : variations taux directeurs → principalement 2Y (ancrage court terme)
- Canal ton/anticipations (tirets) : discours CB + surprises CPI/NFP → principalement 10Y (anticipations long terme)

Slider : clic sur la valeur affichée → input éditable (Enter/Blur pour valider, Escape pour annuler)

Backend : endpoint /api/simulator/baseline expose us_10y et eu_10y (yfinance ^TNX + GE10YT=RR)

SVG mis à jour : 4 nœuds de taux (2Y/10Y US+EU), 2 nœuds différentiels, flèches solides/tirets
Strip métrique : 6 cellules (US 2Y, US 10Y, Bund 2Y, Bund 10Y, Δ 2Y, Δ 10Y)
Décomposition : séparation "Δ 2Y — taux directeurs" / "Δ 10Y — anticipations/ton"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 23:08:08 +02:00
OpenSquared
fe86cc1994 feat: EUR/USD simulator — live baseline from market data
Backend (routers/simulator.py):
- GET /api/simulator/baseline aggregates current market values:
  1. macro_gauge_snapshots → VIX, Brent oil
  2. FRED economic_events  → FEDFUNDS, ECBDFR, DFII10 (real yield)
  3. yfinance live         → EURUSD=X, ^IRX+^FVX interpolated US 2Y,
                             DE2YT=RR EU 2Y (or ECB rate +15bps fallback),
                             ^VIX, BZ=F
- Returns sources dict so frontend can show data provenance

Frontend (EuroSimulator.tsx):
- Fetch /api/simulator/baseline on mount; use as base anchors
- compute(p, base) now takes dynamic base instead of hardcoded constants
- Reset button returns to today's live baseline, not hardcoded fallback
- Live/Fallback status badge with fetch date
- Sources panel showing data origin per field
- Chart reference line updates to show live base values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 22:42:18 +02:00
OpenSquared
e00b78f2f6 fix: add position tick on colorize sliders so cursor is visible at baseline
At baseline (deviation=0) the colored bar had width=0 and disappeared.
Added a 2px vertical tick mark at the current slider position so the
handle location is always visible even when there's no deviation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 22:31:12 +02:00
OpenSquared
3133e073f7 Vix barre 2026-06-26 22:27:26 +02:00
OpenSquared
c36f11ad32 fix: VIX slider bar overflow — clamp pivot to range, add center prop
Slider was computing mid = (0 - 10) / (60 - 10) * 100 = -20% for VIX
(0 outside the 10-60 range), causing the colored track to start at a negative
left position and overflow the container.

Fix: add overflow-hidden on the track div; add center prop (defaults 0)
that the caller sets to the actual baseline value when 0 is out of range.
VIX now pivots at 18, real yield US at 2.1.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 22:24:31 +02:00
OpenSquared
a24cac38ad feat: eco desk enhanced config + EUR/USD causal simulator
Eco desk (market_event_detector.py + AIDesks.tsx):
- Add currencies filter (USD via FRED, EUR/GBP/JPY/etc via ff_calendar)
- Add min_impact filter (high / high+medium / all levels)
- Add create_market_event toggle — detect surprises without creating events
- Add lookback_releases — inject last N historical releases into event description
- New _check_ff_calendar_surprises() for non-USD surprising releases
- Frontend EcoConfig: currency chips, impact dropdown, releases input, toggle

EUR/USD Simulator (EuroSimulator.tsx):
- Pure frontend causal model — no API calls, no historical data
- 3-column layout: controls | causal chain SVG | results
- FED/BCE rate sliders + hawkish/dovish tone selector
- CPI/NFP/PMI surprise inputs
- SVG causal chain: CPI→CB→2Y→ΔRate→EURUSD with dynamic colors
- Real-time pip decomposition by factor, sensitivity bars
- Route /simulator + sidebar entry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 22:17:33 +02:00
OpenSquared
dd2876325a chore: remove FMP panel — economic calendar not available on free plan
FMP /economic_calendar endpoint returns 403 on free plan (requires Starter
at $14.99/month). The panel adds clutter without value. Removed component,
its import, and the TEKeyStatus type that was only used by it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 20:57:10 +02:00
OpenSquared
87ded9434f feat: import Trading Economics HTML calendar — 993 events with forecasts
Adds a one-click upload+parse flow for the TE calendar page HTML.
The TE page (tradingeconomics.com/calendar) contains ~1000 events with
actuals, previous, and analyst consensus (forecast) values.

- Add backend/services/te_html_parser.py:
  - parse_html(html): extracts events from <tr data-event> rows
  - Maps 14 countries to major currencies (all Eurozone → EUR)
  - Impact inferred from data-category (high/medium/low)
  - Times converted from Europe/Zurich (CET/CEST) → UTC via zoneinfo
  - Actual=td[5], Forecast=td[7] (analyst consensus), Previous=td[6]
- Add POST /api/eco/te-html-upload (saves file to /tmp)
- Add POST /api/eco/te-html-import + GET /status (background parse)
- Add "Import TE HTML" upload button in CalendarPage ImportPanel

Tested locally: 993 events parsed, 854 with forecast, 861 with actual,
date range 2025-03-31 → 2026-06-17, timezone conversion verified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 18:15:02 +02:00
OpenSquared
bdbb87962d feat: FXStreet calendar — free upcoming events with forecasts (no API key)
FXStreet calendar.fxstreet.com/eventdate/ returns ~300-400 events over
6 weeks including consensus forecasts, no authentication required.
FF HTML scraper is blocked by Cloudflare even on residential IPs.
FMP free plan returns 403 on /economic_calendar (requires Starter plan).

- Add backend/services/fxstreet_calendar.py: single GET request returning
  all major currencies; maps Volatility 0/1/2 → low/medium/high
- Add POST /api/eco/fxs-sync + GET /api/eco/fxs-sync/status endpoints
- Add FXStreet to daily background sync in main.py (runs every 24h)
- Add "Sync Upcoming (FXStreet)" button in ImportPanel (no key needed)
- Fix FMP 403 error message to say endpoint requires Starter plan
- Keep FMP panel for users who upgrade to FMP Starter ($14.99/month)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:54:15 +02:00
OpenSquared
5c86d6e715 feat: replace Trading Economics with FMP for upcoming calendar forecasts
TE costs $199/month and its Economic Calendar is not in the free tier.
FMP (Financial Modeling Prep) offers a free API key (250 req/day) with
full economic calendar coverage including consensus estimates (forecasts).

- Add backend/services/fmp_calendar.py: fetches upcoming events from
  GET /api/v3/economic_calendar (one request, all countries, date range)
- Replace /api/eco/te-key + te-sync endpoints with fmp-key + fmp-sync
- Update daily background sync in main.py to use fmp_calendar
- Replace TEPanel with FMPPanel in CalendarPage.tsx (link to FMP docs)
- Remove broken Cloudflare-blocked FF HTML scrape button from ImportPanel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:42:09 +02:00
OpenSquared
ec6fcc1e3d feat: Trading Economics API for upcoming events with forecasts
- New services/te_calendar.py: fetch_upcoming(weeks_ahead) calls TE API
  for 9 countries (USD/EUR/GBP/JPY/AUD/CAD/NZD/CHF/CNY), converts to
  ff_calendar format, upserts with source='te_api'
- New endpoints: GET/POST /api/eco/te-key, POST /api/eco/te-sync,
  GET /api/eco/te-sync/status
- Daily scheduler in main.py: FF live sync + TE sync (if key configured)
  run 60s after startup then every 24h
- CalendarPage: TEPanel with key input (password field, Enter to save,
  "Get free key" link to tradingeconomics.com/api/login),
  "Sync upcoming (6 weeks)" button with polling

FF HTML scraper kept as fallback but TE API is the primary source
for upcoming forecasts (no Cloudflare blocking on server IPs).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:30:16 +02:00
OpenSquared
d9762deca7 feat: custom date range filter on calendar page
- Backend: /api/eco/calendar accepts date_from + date_to query params
  when period=custom; get_calendar() uses them directly without override
  Limit raised to 5000 for wide date ranges
- Frontend: "Custom" tab at end of period list; shows two date inputs
  (from/to) with Apply button; displays day count; fetches on Apply click
  (not on every keystroke to avoid hammering the API)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:17:01 +02:00
OpenSquared
c36b2b2198 feat: FF HTML scraper for upcoming weeks with forecasts
- scrape_upcoming(weeks_ahead=5) in ff_calendar.py:
  fetches forexfactory.com/calendar?week=... HTML for N weeks ahead,
  parses calendar__table (date/time/currency/impact/event/forecast/previous),
  converts ET times to UTC, upserts into ff_calendar
- Daily scheduler in main.py: runs scrape_upcoming at startup (after 30s delay)
  then every 24h — no manual action needed
- New endpoints: POST /api/eco/ff-scrape?weeks=5, GET /api/eco/ff-scrape/status
- CalendarPage: "Scrape Upcoming (5w)" button (indigo) with polling + result

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 17:14:00 +02:00