Commit Graph

50 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 d3c5340f9b feat: marchés 4H + lien TradingView + cache IL + perf chargement
- charts Marchés : interval D/W → 4H (240), hauteur 220 → 420px, grid 2col
- TvAdvancedChart : bouton "↗ TradingView" par chart (outils tracé complets)
- cache fichier IL 2h (data/il-enrichment-cache.json) : API rate-proba 13s → <500ms
- stale-while-revalidate macro : affiche cache immédiatement, refetch 10s background
- seuil cache rate-proba : 48h → 7j pour dev local

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 17:43:49 +02:00
caty21 416c5348f2 fix: GitHub Actions push permission + submodule + dashboard Taux tab
- add permissions: contents: write + persist-credentials to workflow
- git rm --cached Market-Signal-Finder (submodule sans .gitmodules)
- consolide OIS+STIR en onglet Taux (3 sous-onglets: Courbe/Probabilités/Réunions)
- header summary: 1 ligne, fix bug Hold/Hold, taux actuel dans légende chart
- cache stale: seuil 48h → 7j pour dev local
- stale-while-revalidate: affiche cache immédiatement, refetch en arrière-plan (10s)
- redesign tooltip chart Courbe (Actuel/Sem. préc./Δsem. en bps)
- YAxis affiche taux complets (3.63% vs .63 tronqué)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-29 17:05:50 +02:00
caty21 654958ec4d fix(OIS): fusion STIR+IL pour proba 1ere reunion — IL override si ecart >8pp, STIR affiche en tooltip/parenthese 2026-06-29 13:49:52 +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 afd0026f25 fix: Discours BC faux positif titre-only + bouton Analyse en fin de titre
- newsfeed.ts: les catégories Discours BC / Chef d'État ne sont retenues que
  si le nom propre apparaît dans le TITRE de l'article (pas dans le body)
  → un article UK social avec 'Bailey' dans le body ne sera plus taggué BC
- NewsTab: bouton Analyse déplacé après le titre de l'article (en fin de ligne)
  Layout final : [il y a Xh] [Source] [Catégorie]  puis  Titre... [▼ Analyse]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 15:16:05 +02:00
caty21 fa0b5d9c45 fix: faux positif Discours BC ZeroHedge + timestamp devant le journal
- newsfeed.ts: pré-filtre macro obligatoire avant applyRules pour ZeroHedge
  → articles non-financiers (social, politique) rejetés même si un prénom de
    gouverneur (ex: Bailey) apparaît dans le body
- NewsTab: timestamp (il y a Xh) déplacé en première position avant le nom du
  journal sur la ligne de métadonnées; bouton Analyse reste avec le titre

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 15:01:44 +02:00
caty21 2673686743 feat: replace rateprobability.com with CME FedWatch + Investing.com scrapers
- fetch-rate-data.mjs: CME FedWatch (USD), Investing.com rate monitors (all CBs),
  InvestingLive (fallback) — plus aucune dépendance à rateprobability.com
- lib/rateprobability.ts: suppression des appels live rateprobability.com,
  source unique = cache GitHub Actions (data/rate-probabilities.json)
- Logs détaillés pour debugger le premier run GitHub Actions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 13:35:14 +02:00
caty21 cf70e30db6 feat: onglet Marchés + TvMiniChart sans popup + cache RP 48h + OIS default
- page.tsx: onglet '🌍 Marchés' — S&P 500, VIX, DXY, Or (TvMiniChart 2x2)
- TvChart: prop dateRange configurable sur TvMiniChart (défaut 1M)
- ReportTab: TvAdvancedChart → TvMiniChart (plus de popup TV), Or remplace US10Y
  S&P 500/VIX dateRange=12M (daily), DXY/Or dateRange=60M (weekly)
- rateprobability: cache TTL 4h → 48h (OIS revient même sans GitHub Actions hourly)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 22:02:53 +02:00
caty21 ec248744b1 fix: Résumé IA inline color, tooltip Implied Pts custom renderer, tryUrl cancel
- NarrativeButton: style inline pour forcer #94a3b8 (imbattable vs bundle CDN caché)
- CurrencyCard: Tooltip Implied Pts remplacé par custom content renderer (text visible)
- investinglive.ts: res.body.cancel() en fire-and-forget (ne masque plus le succès)
  + console.log article courant/précédent pour diagnostic dans logs Vercel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 20:12:21 +02:00
caty21 a978f19088 fix: Sem. préc. HEAD→GET, prevMeetings cache, remove footer
- investinglive: tryUrl HEAD→GET + res.body?.cancel() (WordPress bloque HEAD)
  fenêtre recherche article préc. élargie 21→28 jours
- rateprobability: CBRatePath + prevMeetings/prevWeekDate, loadPrevWeekCachedBody()
  fetchAllCBPaths enrichit prevMeetings depuis snapshot GitHub Actions
- fetch-rate-data.mjs: rotation current→previousWeek (5–9 jours) pour Rate Curve
- CurrencyCard: rateCurveData préfère prevMeetings (exact/meeting) > ilDelta (approx)
  légende hasPrevCurve pilote affichage ligne bleue et label date
- page.tsx: suppression footer Sources/LLM, remplacement par pb-12

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 19:40:48 +02:00
caty21 82d7775e60 fix: OIS charts — tooltip lisible, légende visuelle, détection article précédent
- Tooltip: ajout color:#e2e8f0 sur les deux charts (texte invisible sur fond sombre)
- Rate Curve: légende visuelle inline (Actuel blanc / Sem. préc. bleu pointillé)
- Implied Pts: légende couleurs barres (vert Hausse / rose Baisse)
- investinglive.ts tryUrl: cache no-store au lieu de revalidate:21600
  (les 404 cachées empêchaient de trouver l'article de la semaine précédente)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 18:47:01 +02:00
caty21 b82c680f83 fix: GitHub Actions cache fallback + diagnostic logging for rate-probabilities
- data/rate-probabilities.json: initial seed (6 CBs fresh from rateprobability.com)
- lib/rateprobability.ts: fallback to cache file when live fetch fails (Vercel block)
  parseCBBody() reuses same parsing logic; cache valid 4h max
- .github/scripts/fetch-rate-data.mjs: fetch script (run manually or via Actions)
- HTTP status now logged for diagnostics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:33:38 +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 5cf5d76601 fix: sort news by recency first, priority items get +3h boost (not fully separated)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 16:20:09 +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 ce53f97b5b feat: redesign OIS block — SOFR live data primary, analyst (IL) secondary
Section 1 (SOFR/OIS live, prominent):
- Large current rate → year-end implied + Δbps in bold colored type
- Probability chart across all meetings
- Per-meeting table: date, HOLD/HIKE?/HIKE, prob%, implied rate
- Peak meeting highlighted in amber

Section 2 (G. Dellamotta / InvestingLive, below):
- Analyst year-end bps + next-meeting direction (from IL article)
- Article date shown
- Weekly delta arrows (vs previous article) — lowered bps threshold to 5bps

Add ILCurrent type to CBRatePath to carry analyst absolute values server-side.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 20:12:18 +02:00
Capucine Gest 764070a63a fix: yearEndImplied now uses last meeting of current year (not 380d window)
Two bugs fixed in fetchAllCBPaths / fetchCBPath:
- yearEndImplied was taking the last meeting within 380 days (~mid-2027) instead
  of the last meeting of the current calendar year (Dec 2026) — caused bps to be
  significantly overstated (e.g. USD showed +40 instead of +29.6)
- IL article bpsYearEnd was overriding rateprobability.com yearEndImplied for all
  currencies; now IL only overrides CHF (no RP coverage); other 7 CBs use live OIS

Dashboard yearEndBps now matches rateprobability.com raw API exactly for all CBs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 19:51:57 +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 fa7f24715c auto: sync 2026-06-03 00:02 2026-06-03 00:02:09 +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 3365b0bfbe auto: sync 2026-06-02 17:07 2026-06-02 17:07:27 +02:00
Capucine Gest 22c44db2bf auto: sync 2026-06-02 16:57 2026-06-02 16:57:22 +02:00
Capucine Gest 6758e425d5 auto: sync 2026-06-02 16:51 2026-06-02 16:51:36 +02:00
Capucine Gest e80f5cb681 auto: sync 2026-06-02 16:41 2026-06-02 16:41:34 +02:00
Capucine Gest 2c522e7bda auto: sync 2026-06-02 16:26 2026-06-02 16:26:29 +02:00
Capucine Gest 1a334fd2c8 auto: sync 2026-06-02 16:21 2026-06-02 16:21:27 +02:00
Capucine Gest 15fde8f783 auto: sync 2026-06-02 15:30 2026-06-02 15:30:56 +02:00
Capucine Gest c4d8876dc6 auto: sync 2026-06-02 13:32 2026-06-02 13:32:52 +02:00
Capucine Gest 9f8defc487 auto: sync 2026-06-02 09:40 2026-06-02 09:40:10 +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 a23a2b1e4b auto: sync 2026-06-01 23:51 2026-06-01 23:51:43 +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 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 0a42e93d01 Fix policy rates: switch IRSTCB01 (stale/missing) to IR3TIB01 (3M interbank)
IRSTCB01AUM156N, IRSTCB01CHM156N, IRSTCB01NZM156N don't exist on FRED.
IRSTCB01JPM156N and IRSTCB01CAM156N exist but stale since 2023-12.
Replace all with IR3TIB01*M156N (3-month interbank rate, updated monthly 2026)
which closely tracks each central bank's policy rate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:27:19 +02:00
Capucine Gest 6310b37a91 Fix GDP/CPI/unemployment FRED series for non-USD currencies
GDP: GBP→NGDPRSAXDCGBQ, CAD→NGDPRSAXDCCAQ, AUD→NGDPRSAXDCAUQ,
     NZD→NAEXKP01NZQ661S (all current level series, replaces non-existent ones)
CHF unemployment: LRHUTTTTCHM156S→LRHUTTTTCHQ156S (monthly N/A, use quarterly)
JPY cpiCore: set to null (FRED series stale since 2021, no free current source)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 22:21:00 +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 236afa3087 Forex Dashboard v8.0 2026-05-27 13:18:45 +02:00