Commit Graph

39 Commits

Author SHA1 Message Date
caty21 48d3b9c473 feat(COT/Idees): redesign COT chart + NC group + editeur riche IdeesTab
COT :
- Ajoute groupe NC (Non-Commercial Legacy) via Socrata API CFTC
- Graphique bidirectionnel (barres avec gradient, zéro centré, track complet)
- Barre L/S split sous chaque groupe, valeur nette + %L empilés
- Corrige verdict bug : amDominates vérifié avant hfIsShort
- Supprime 'k contrats', ajoute légende ΔL/ΔS/ΔNet

IdeesTab :
- Réécriture NotePane : contentEditable Notion-like avec images inline
- Toolbar riche : gras, italique, souligné, listes, alignement
- Redimensionnement image inline (25/40/60/80/100%)
- Archives : affichage complet screenshot + texte, restauration vers slot actif

Sentiment DXM :
- Affichage brut paire par paire (Myfxbook) pour vérification directe
- SentimentPair type + pairs[] dans SentimentEntry

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 23:33:00 +02:00
caty21 f5e5d51c72 fix: cache no-store sur routes API, EUR emploi, NZD OIS (RBNZ), ReportTab charts 750px
- app/api/*/route.ts : export const dynamic = force-dynamic + Cache-Control no-store
- lib/tecpi.ts : regex emploi EUR (grew/rose/fell), fallback body HTML, unite %/percent
- lib/rateprobability.ts : RBNZ_MEETINGS 2026-2027, buildRBNZPath (mirrors buildSNBPath)
  CHF/NZD skippes du loop Investing.com (SNB/RBNZ rate monitor = 404)
  Taux RBNZ 2.25% (etait 3.25%)
- components/ReportTab.tsx : hauteur charts 400 -> 750px (SPX, VIX, DXY, Gold)
- lib/tradingeconomics.ts, lib/types.ts, lib/newsfeed.ts : correctifs associes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 12:17:11 +02:00
caty21 eca5800372 fix: InvestingLive URL (/centralbank/events), procure.ch PMI title, remove signals badge
- investinglive.ts / expectations/route.ts / fetch-rate-data.mjs : try 4 URL variants
  (/centralbank/ or /news/, events or event) to handle site restructure
- calendar/route.ts: displayTitle catches procure.ch prefix to return PMI Manufacturier
- page.tsx: remove divergenceCount badge and unused Zap import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 10:45:15 +02:00
caty21 67c1811c8f fix: rate-probabilities → European region + stronger browser headers
- preferredRegion: fra1/lhr1/cdg1 to bypass US cloud IP blocks on rateprobability.com
- Better sec-* headers to pass bot detection (same-origin cors mode)
- cache: no-store on fetch to avoid stale null caching
- Log CB count on each invocation for diagnostics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:27:20 +02:00
caty21 886a5b426f fix: force-dynamic on all API routes + PWA manifest & service worker
- Add export const dynamic = "force-dynamic" to routes previously
  pre-rendered as static (rate-probabilities, news, fx, yields, calendar)
  → fixes empty data on Vercel where static pre-render got HTTP 403
- Add PWA: manifest.json, sw.js, icons, layout meta + apple-touch-icon

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 15:19:35 +02:00
caty21 9da463a424 feat: OISEnhancedBlock — rate curve, implied pts, scénarios charts per CB
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:12:05 +02:00
Capucine Gest a3d847ce59 feat: calendar prev week, fullscreen mode, AI weekly highlights
Calendar — "Semaine dernière" tab:
- API now fetches from last Monday (instead of today) and tags events as "prev"
- New tab in CalendarTab with last week's published events (actual values visible)
- fromDate filter bypassed for prev tab; week banner styled in slate

Dashboard — fullscreen:
- Maximize2/Minimize2 button in header using Fullscreen API
- Listens to fullscreenchange to sync icon state

Report — AI "Faits marquants":
- New report_highlights mode in /api/narrative: reads published events from
  prev+current week + drivers, generates 3 structured highlights via Groq
- AiHighlightsButton next to "Faits marquants de la semaine" label
- Parses AI response (-- delimited) into title+body Theme objects

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 20:39:52 +02:00
Capucine Gest f82afe9d5b feat: retail sales MoM (TE scraping), smart cache, IL weekly delta arrows, OIS phase labels
- Retail Sales: switch from FRED OECD series (4-6w lag) to Trading Economics real-time scraping
  for all 8 currencies; label changed to "Retail Sales MoM"
- Cache TTL: 24h → 1h base + 15min hot when ForexFactory detects recent high-impact event
- Rate probability trend arrows: server-side IL weekly delta (current vs previous Dellamotta article)
  with per-metric thresholds (prob ≥3%/10%, bps ≥10/25) and colour coding (sky=dovish, amber=hawkish)
- Cycle phase: replaced FRED trend heuristic with OIS-based logic using peakMeeting.probMovePct,
  probIsCut, and yearEndBps; dynamic descriptions include real market numbers
- investinglive.ts: find both current + previous article to compute week-over-week delta server-side

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 19:41:50 +02:00
Capucine Gest 1a2ea02b22 feat: dashboard v8 — COT, FX Weekly, Report, TvChart, Sentiment, News
Ajout des onglets COT, Weekly Report, TvChart. Refonte Sentiment, News,
Calendar, Drivers. Nouvelles API cot-history et fx-weekly. Intégration FinancialJuice.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 14:33:23 +02:00
Capucine Gest e11d61eb4d auto: sync 2026-06-03 01:04 2026-06-03 01:04:07 +02:00
Capucine Gest 34cd885497 auto: sync 2026-06-03 00:59 2026-06-03 00:59:04 +02:00
Capucine Gest 7874ff16ff auto: sync 2026-06-02 23:52 2026-06-02 23:52:05 +02:00
Capucine Gest f4f85c519f auto: sync 2026-06-02 23:16 2026-06-02 23:16:55 +02:00
Capucine Gest 09f7d49052 auto: sync 2026-06-02 17:27 2026-06-02 17:27:32 +02:00
Capucine Gest 8401b8f16d auto: sync 2026-06-02 17:12 2026-06-02 17:12:29 +02:00
Capucine Gest 22c44db2bf auto: sync 2026-06-02 16:57 2026-06-02 16:57:22 +02:00
Capucine Gest e80f5cb681 auto: sync 2026-06-02 16:41 2026-06-02 16:41:34 +02:00
Capucine Gest db8e086294 auto: sync 2026-06-02 16:31 2026-06-02 16:31:31 +02:00
Capucine Gest 2c522e7bda auto: sync 2026-06-02 16:26 2026-06-02 16:26:29 +02:00
Capucine Gest 28eaa699dc auto: sync 2026-06-02 15:35 2026-06-02 15:35:58 +02:00
Capucine Gest c4d8876dc6 auto: sync 2026-06-02 13:32 2026-06-02 13:32:52 +02:00
Capucine Gest 7db6ee531e auto: sync 2026-06-02 00:53 2026-06-02 00:53:39 +02:00
Capucine Gest 52d531182d auto: sync 2026-06-02 00:03 2026-06-02 00:03:37 +02:00
Capucine Gest ff2fcc9619 auto: sync 2026-06-01 23:56 2026-06-01 23:56:45 +02:00
Capucine Gest 5c6de88604 auto: sync 2026-06-01 23:46 2026-06-01 23:46:41 +02:00
Capucine Gest c1b3e54c28 auto: sync 2026-06-01 23:24 2026-06-01 23:24:32 +02:00
Capucine Gest eb416be780 feat: calendrier économique TE+Investing, OIS SNB, yields 10Y, taux directeurs corrects
Calendrier économique
- Nouvelles sources : TE HTML scraping (483 events/2 sem.) + Investing.com en co-primaires
- Dédupe déterministe par clé currency+category+date (±1j pour policy_rate)
- Filtre catégorie "other", filtre discours CB (fix doublon TE vs Investing)
- CHF/Switzerland via page séparée TE (hors G20)
- Fenêtre 14 jours avec ?startDate=&endDate= passés à TE
- ForexFactory+FRED en secours uniquement si les deux scrapers tombent à vide

Probabilités OIS
- rateprobability.com (7 CBs : FED/ECB/BOJ/BOE/BOC/RBA/RBNZ)
- investinglive.com (Dellamotta) : scan URL-date 14 jours → couvre SNB/CHF manquant
- SNB : 3% probabilité hausse au 19 juin 2026 (source : IL article 2026-05-29)
- rate_expectations.json MAJ : RBNZ 79% hike (corrigé depuis 70% no-change stale)
- Dédup ±1 jour pour policy_rate (fix doublon SNB TE-18/06 vs IL-19/06)

Taux directeurs
- USD : scrapeTeRate() = 3.75% (fin midpoint FRED 3.625%)
- AUD prev : 4.10% (corrigé depuis 4.60%)
- NZD/CHF/JPY/CAD : cohérents avec TE officiel

Yields 10Y souverains
- Nouvelle lib lib/tebonds.ts : scrape TE bonds, données du jour, cache 1h
- Remplace FRED IRLTLT01XXM156N mensuel (JPY/CHF/AUD/NZD avaient 1 mois de retard)
- 8 devises + spread vs USD calculé automatiquement
- /api/yields et /api/drivers utilisent la même lib

Drivers globaux
- BTC : ticker/price Binance (plus précis que 24hr lastPrice)
- HY Spread cache : 86400s → 3600s (données FRED du jour)
- DriversBar : suppression affichage direct US 10Y, tooltip Crb 2-10 affiche US10Y+US2Y

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 23:16:18 +02:00
Capucine Gest 3a39904ce5 fix: CPI/taux/expectations — corrections sources données mai 2026
Indicateurs :
- JPY CPI : null → IMF/IFS DBnomics MoM% (override 0.1% mai 2026)
- AUD CPI : mauvais ID FRED (AUSCPIALLMINMEI→AUSCPIALLQINMEI) + override 1.4% T1 2026
- NZD CPI : mauvais ID FRED (NZLCPIALLMINMEI→NZLCPIALLQINMEI) + override 0.9% T1 2026
- Nouveau data/cpi_overrides.json — surcharge manuelle quand FRED/DBnomics en retard
- Override date-comparé : source auto reprend quand elle dépasse l'override

Taux directeurs :
- GBP : BoE API IUDBEDR primary + IR3TIB01GBM156N fallback FRED (IRSTCB01 inexistant)
- USD/EUR/CAD/NZD : sources déduplicées (DFEDTARU, ECBDFR, BoC Valet, IRSTCB01)

Zone Euro :
- EUR CPI fallback : prc_hicp_mmr (404) → prc_hicp_midx + toIndicatorPct
- EUR chômage : geo=EA21 (2026) + fallback EA20

Expectations :
- data/rate_expectations.json : données correctes 29/05/2026
  (Fed 68bps, ECB 49bps, BoE 53bps, BoJ +32bps, etc.)

UI :
- Tooltip bps : explication "1 bp = 0,01% de taux"
- NarrativeButton : affiche le vrai message d'erreur (était "Erreur Bytez")
- Groq API key manquante : message descriptif avec chemin Vercel

Types :
- IndicatorResult type explicite → corrige erreurs tsc pre-existantes (prev/lastUpdated)
- toPmiIndicator retourne IndicatorResult

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 12:13:05 +02:00
Capucine Gest b833baf495 fix: EUR/GBP data, PMI ForexFactory + TE, localStorage PMI persistence
macro/route.ts :
  - Eurostat EUR CPI : ajout unit=RCH_MOM, freq=M pour que chaque dimension
    ait une seule valeur → position value[]=timeIndex correcte (bug de mapping
    multi-dimensionnel corrigé)
  - Eurostat EUR GDP : passage de CLV10_MEUR (niveaux) à CLV_PCH_PRE (QoQ%
    directement) + toIndicator au lieu de toIndicatorPct
  - Eurostat EUR chômage : ajout freq=M pour unicité de dimension
  - eurostatSorted : fallback automatique EA20 → EA19 si données vides
  - BoE (GBP taux) : ajout User-Agent + Accept → évite la redirection HTML
  - PMI : ForexFactory JSON (semaine courante, données structurées) en source
    primaire + TE scraping enrichi (Accept, Sec-Fetch-*, Pragma) en fallback
  - toPmiIndicator : extrait en fonction globale réutilisable

CurrencyCard.tsx :
  - Préservation des valeurs PMI précédentes du cache localStorage si le
    serveur renvoie null (PMI publié le mois dernier, pas cette semaine)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 23:13:40 +02:00
Capucine Gest 3c6e3bb52a feat: persistance localStorage + stale-if-error serveur
Client — lib/localCache.ts (nouveau) :
  - saveCache / loadCache : wrapper localStorage préfixé "forex_v1_"
  - formatCacheDate : affiche l'âge du cache (< 1h, 2h, 3j…)

Client — CurrencyCard.tsx :
  - Sauvegarde chaque réponse macro réussie dans localStorage (clé macro_{currency})
  - Si l'API échoue → charge la dernière valeur connue depuis localStorage
  - Badge 🗄 "cache Xh" visible dans le header de la carte quand données stale

Client — page.tsx :
  - Même logique pour drivers, expectations, yields
  - Badge cache affiché dans le header à côté de l'heure
  - Footer : Bytez → Groq

Serveur — macro/route.ts :
  - stale-if-error : si tous les indicateurs reviennent null (panne API)
    et qu'un cache serveur précédent existe → le renvoie avec stale:true

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:58:27 +02:00
Capucine Gest ecb815619b feat: WTI/Brent via Stooq, PMI scraping (TE), Groq replace Bytez
- drivers: switch Brent (cb.f) and WTI (cl.f) from stale FRED to Stooq
  near-real-time futures — same stooqMetal() already used for gold/silver
- macro: add scrapePMI() to scrape Trading Economics meta description for
  manufacturing-pmi and services-pmi for all 8 currencies (no API key needed)
- narrative: replace dead Bytez API with Groq (OpenAI-compatible, free tier)
  env var renamed BYTEZ_API_KEY → GROQ_API_KEY, model llama-3.1-8b-instant
- NarrativeButton: rebrand "Erreur Bytez" / "Bytez AI" → "Erreur IA" / "Groq AI"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:52:49 +02:00
Capucine Gest 3fcb72a25e Fix macro indicators: add working retail sales and employment FRED series
Retail Sales: switch all currencies to *SLRTTO01GPSAM format (OECD monthly,
already in MoM%) — covers USD, EUR(DEU proxy), GBP, JPY, CHF, CAD.
Remove retailSales from PCT_FIELDS since values are already percentages.

Employment: add LFEMTTTT*647S series (monthly levels → MoM%) for JPY, CAD,
AUD and quarterly for NZD. These replace null/non-existent FRED series.

PMI stays ⚠ — no free real-time source found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 21:55:51 +02:00
Capucine Gest abf04aabbd Add User-Agent header to Stooq fetch to avoid server-side blocking
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:29:02 +02:00
Capucine Gest ac6ad0da60 Fix gold/silver: switch from invalid FRED series to Stooq real-time API
FRED series GOLDPMGBD228NLBM and SLVPRUSD do not exist on the free tier.
Replace with Stooq XAU/USD and XAG/USD free CSV endpoint (no API key needed).
Delta = intraday change vs session open. Cache 5 min on Vercel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:27:44 +02:00
Capucine Gest ef45a30f2c Fix gold/silver null: increase FRED fredObsDelta limit 2→10 to skip '.' placeholders
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:00:45 +02:00
Capucine Gest dc06c5528f Fix DXY formula + switch market data to FRED 2026-05-28 19:47:26 +02:00
Capucine Gest 0a2daed3bf Fix DXY formula + switch market data to FRED 2026-05-28 19:43:39 +02:00
Capucine Gest 0a779fb4eb Forex Dashboard v8.0 2026-05-27 13:45:06 +02:00
Capucine Gest 236afa3087 Forex Dashboard v8.0 2026-05-27 13:18:45 +02:00