diff --git a/Economic Calendar2906.txt b/Economic Calendar2906.txt new file mode 100644 index 0000000..3ede66c --- /dev/null +++ b/Economic Calendar2906.txt @@ -0,0 +1,1086 @@ + * + +// + + + + + +Calendar News +Markets <#> + + * Commodities + * Indexes + * Shares + * Currencies + * Crypto + * Bonds + * Earnings + +Indicators Countries +Forecasts <#> + + * Commodities + * Indexes + * Currencies + * Crypto + * Bonds + * Countries + * Indicators + + * + +// +// <#offcanvasGuest> + + + *Members* + +*// DATA PORTAL* +Download historical data for 20 million indicators using your browser. + +Access Data | Plans | Features + +*//API GATEWAY* +Direct access to our data from your apps using any programing language. + +Features | Docs + | Developer +*// ALERTS* +Manage your notifications for calendar releases and financial markets. + +*// Profile* +*// Logout* +// +// + + +/ + +/Calendar +/ + +/News +/ + +/Markets +/ + +/ + + * Commodities + * Indexes + * Shares + * Currencies + * Crypto + * Bonds + * Earnings + * Holidays + +/ + +/Countries +/ + +/ + + * United States + * United Kingdom + * Euro Area + * Australia + * Canada + * Japan + * China + * Brazil + * Russia + * India + * //More Countries + +/ + +/Indicators +/ + +/ + + * Interest Rate + * Inflation Rate + * Unemployment Rate + * GDP Growth + * GDP per Capita + * Current Account + * Gold Reserves + * Government Debt + * Crude Oil Production + * Gasoline Prices + * Credit Rating + * //More Indicators + +/ + +/Forecasts +/ + +/ + + * Markets & Indicators + * Countries + * Countries + * Indicators + * Commodities + * Indexes + * Currencies + * Crypto + * Bonds + +/ + +/Apps +/ + +/ + + * App Store + * Google Play + * Twitter + +/ + +/About +/ + +/ + + * Customers + * Investors + * Careers + * About us + * Contact + +// This Month + + * Recent + * Today + * Tomorrow + * This Week + * Next Week + * This Month + * Next Month + * + * Yesterday + * Previous Week + * Previous Month + * + * // Custom <#> + +/ + +/ +/ + +/ +/ + +/ Impact + + * // + * //// + * ////// + +// Countries + +// Category + + * All Events + * Interest Rate + * Prices & Inflation + * Labour Market + * GDP Growth + * Foreign Trade + * Government + * Business Confidence + * Consumer Sentiment + * Housing Market + * Bond Auctions + * Energy + * Holidays + * Earnings + + +// Download // API <#> + + +From Until Submit +Chart is Loading + +All Major Africa America Asia Europe +Clear +Close +// Save + + * Afghanistan + * Albania + * Algeria + * Angola + * Argentina + * Armenia + * Australia + * Austria + * Azerbaijan + * Bahrain + * Bangladesh + * Belarus + * Belgium + * Bolivia + * Bosnia and Herzegovina + * Botswana + * Brazil + * Brunei + * Bulgaria + * Cambodia + * Cameroon + * Canada + * Cape Verde + * Chile + * China + * Colombia + * Congo + * Costa Rica + * Croatia + * Cuba + * Cyprus + * Czech Republic + * Denmark + * East Timor + * Ecuador + * Egypt + + * El Salvador + * Estonia + * Ethiopia + * Euro Area + * Finland + * France + * Georgia + * G20 + * G7 + * Germany + * Ghana + * Greece + * Honduras + * Hong Kong + * Hungary + * Iceland + * India + * Indonesia + * IMF + * Iran + * Ireland + * Israel + * Italy + * Ivory Coast + * Jamaica + * Japan + * Jordan + * Kazakhstan + * Kenya + * Kosovo + * Kuwait + * Kyrgyzstan + * Latvia + * Lebanon + * Lithuania + * Luxembourg + + * Macau + * Macedonia + * Madagascar + * Malawi + * Malaysia + * Mali + * Malta + * Mauritius + * Mexico + * Moldova + * Mongolia + * Montenegro + * Morocco + * Mozambique + * Myanmar + * Namibia + * Netherlands + * New Zealand + * Nicaragua + * Nigeria + * Norway + * Oman + * OPEC + * Pakistan + * Palestine + * Panama + * Paraguay + * Peru + * Philippines + * Poland + * Portugal + * Puerto Rico + * Qatar + * Republic of the Congo + * Romania + * Russia + + * Rwanda + * Sao Tome and Principe + * Saudi Arabia + * Senegal + * Serbia + * Sierra Leone + * Singapore + * Slovakia + * Slovenia + * Somalia + * South Africa + * South Korea + * Spain + * Sri Lanka + * Sudan + * Sweden + * Switzerland + * Taiwan + * Tajikistan + * Tanzania + * Thailand + * Trinidad and Tobago + * Tunisia + * Turkey + * Uganda + * Ukraine + * United Arab Emirates + * United Kingdom + * United States + * Uruguay + * Uzbekistan + * Venezuela + * Vietnam + * Zambia + * Zimbabwe + + +Monday June 01 2026 Actual Previous Consensus Forecast +Monday June 01 2026 Actual Previous Consensus Forecast +03:45 AM + CN + + RatingDog Manufacturing PMI MAY 51.4 51.5 +04:00 PM + US + + ISM Manufacturing PMI MAY 54.0 52.7 53 53 + +Tuesday June 02 2026 Actual Previous Consensus Forecast +Tuesday June 02 2026 Actual Previous Consensus Forecast +11:00 AM + EA + + Inflation Rate YoY Flash MAY 3.2% 3% 3.2% 3.4% + +04:00 PM + US + + JOLTs Job Openings APR 7.618M 6.887M ® 6.88M 6.8M + +Wednesday June 03 2026 Actual Previous Consensus Forecast +Wednesday June 03 2026 Actual Previous Consensus Forecast +03:30 AM + AU + + GDP Growth Rate QoQ +Q1 0.3% 0.9% ® +0.5% 0.5% + +04:00 PM + US + + ISM Services PMI MAY 54.5 53.6 53.8 53 + +Thursday June 04 2026 Actual Previous Consensus Forecast +Thursday June 04 2026 Actual Previous Consensus Forecast +03:30 AM + AU + + Balance of Trade APR A$1.791B A$-1.024B ® A$1.8B A$-1.3B + +Friday June 05 2026 Actual Previous Consensus Forecast +Friday June 05 2026 Actual Previous Consensus Forecast +12:30 PM + IN + + GDP Growth Rate YoY Q1 7.8% + 8% ® 7.2% 7.5% + + +02:30 PM + CA + + Unemployment Rate MAY 6.6% + 6.9% 6.9% +6.9% + +02:30 PM + US + + Non Farm Payrolls MAY 172K 179K ® 85K 102.0K + +02:30 PM + US + + Unemployment Rate MAY 4.3% 4.3% 4.3% 4.4% + +04:00 PM + CA + + Ivey PMI s.a +MAY 58.2 +57.7 55 51 + + +Tuesday June 09 2026 Actual Previous Consensus Forecast +Tuesday June 09 2026 Actual Previous Consensus Forecast + +02:30 AM + AU + + Westpac Consumer Confidence Change JUN -2.9% 3.5% -1.2% + +03:30 AM + AU + + NAB Business Confidence MAY -14 -23 ® -22 + +05:00 AM + CN + + Balance of Trade +MAY $105.43B +$84.8B ® $92.1B +$89.0B + +05:00 AM + CN + + Exports YoY MAY 19.4% + 14.1% 15% + +05:00 AM + CN + + Imports YoY MAY 27.4% + 25.3% 25% + +08:00 AM + DE + + Balance of Trade APR €14.5B €14.7B ® €15B €13.6B + +04:00 PM + US + + Existing Home Sales MAY 4.17M 4.04M ® 4.07M 4.04M + +Wednesday June 10 2026 Actual Previous Consensus Forecast +Wednesday June 10 2026 Actual Previous Consensus Forecast +03:30 AM + CN + + Inflation Rate YoY +MAY 1.2% 1.2% 1.3% + 1.4% + +02:30 PM + US + + Core Inflation Rate MoM MAY 0.2% 0.4% 0.3% 0.3% + + +02:30 PM + US + + Core Inflation Rate YoY MAY 2.9% 2.8% 2.9% 2.9% + +02:30 PM + US + + Inflation Rate MoM MAY 0.5% 0.6% 0.5% 0.4% + +02:30 PM + US + + Inflation Rate YoY MAY 4.2% 3.8% 4.2% 4.0% + +03:45 PM + CA + + BoC Interest Rate Decision 2.25% 2.25% 2.25% + 2.25% + +Thursday June 11 2026 Actual Previous Consensus Forecast +Thursday June 11 2026 Actual Previous Consensus Forecast +02:15 PM + EA + + Deposit Facility Rate 2.25% 2% 2.25% 2.25% + +02:15 PM + EA + + ECB Interest Rate Decision 2.4% 2.15% 2.4% 2.4% + +02:30 PM + US + + PPI MoM MAY 1.1% 1.1% ® 0.7% 0.7% + + +02:45 PM + EA + + ECB Press Conference +Friday June 12 2026 Actual Previous Consensus Forecast +Friday June 12 2026 Actual Previous Consensus Forecast +08:00 AM + GB + + GDP MoM +APR -0.1% + 0.3% -0.1% 0.1% + +04:00 PM + US + + Michigan Consumer Sentiment Prel JUN 48.9 44.8 46 46 + +Tuesday June 16 2026 Actual Previous Consensus Forecast +Tuesday June 16 2026 Actual Previous Consensus Forecast +04:00 AM + CN + + Industrial Production YoY MAY 4.5% 4.1% 4.3% 4.7% + +04:00 AM + CN + + Retail Sales YoY MAY -0.6% 0.2% 0% 0.8% + +05:00 AM + JP + + BoJ Interest Rate Decision 1% +0.75% 1.0% 1.0% + + +06:30 AM + AU + + RBA Interest Rate Decision 4.35% 4.35% 4.35% 4.35% + +11:00 AM + DE + + ZEW Economic Sentiment Index JUN 10.5 -10.2 -6 -8 + +02:30 PM + US + + Building Permits Prel MAY 1.413M 1.423M 1.42M 1.41M + +02:30 PM + US + + Housing Starts MAY 1.177M 1.392M ® 1.43M 1.44M + +Wednesday June 17 2026 Actual Previous Consensus Forecast +Wednesday June 17 2026 Actual Previous Consensus Forecast +01:50 AM + JP + + Balance of Trade +MAY ¥-378.7B +¥299.3B ® ¥-564.6B ¥-400.0B + +08:00 AM + GB + + Inflation Rate YoY MAY 2.8% 2.8% 3% 3.1% + +02:30 PM + US + + Retail Sales MoM MAY 0.9% 0.4% ® 0.5% 0.6% + +08:00 PM + US + + Fed Interest Rate Decision 3.75% 3.75% 3.75% 3.75% + +08:00 PM + US + + FOMC Economic Projections +08:30 PM + US + + Fed Press Conference +Thursday June 18 2026 Actual Previous Consensus Forecast +Thursday June 18 2026 Actual Previous Consensus Forecast +08:00 AM + GB + + Unemployment Rate APR 4.9% 5% 5% 5.0% + +01:00 PM + GB + + BoE Interest Rate Decision 3.75% 3.75% 3.75% 3.75% + +Friday June 19 2026 Actual Previous Consensus Forecast +Friday June 19 2026 Actual Previous Consensus Forecast +01:30 AM + JP + + Inflation Rate YoY +MAY 1.5% 1.4% + 1.6% + +08:00 AM + GB + + Retail Sales MoM MAY 1.2% -1% ® 0.5% 0.5% + +Monday June 22 2026 Actual Previous Consensus Forecast +Monday June 22 2026 Actual Previous Consensus Forecast +02:30 PM + CA + + Inflation Rate YoY +MAY 3.2% 2.8% 3% + 2.9% + +Tuesday June 23 2026 Actual Previous Consensus Forecast +Tuesday June 23 2026 Actual Previous Consensus Forecast +09:30 AM + DE + + S&P Global Manufacturing PMI Flash JUN 50.5 49.8 +10:30 AM + GB + + S&P Global Manufacturing PMI Flash JUN 53.8 53.4 +10:30 AM + GB + + S&P Global Services PMI Flash JUN 50.5 49.7 +Wednesday June 24 2026 Actual Previous Consensus Forecast +Wednesday June 24 2026 Actual Previous Consensus Forecast +10:00 AM + DE + + Ifo Business Climate JUN 85.6 85.0 ® 85.6 85.5 + +Thursday June 25 2026 Actual Previous Consensus Forecast +Thursday June 25 2026 Actual Previous Consensus Forecast +08:00 AM + DE + + GfK Consumer Confidence JUL -29.2 -29.7 ® -27.6 -29 + +02:30 PM + US + + Core PCE Price Index MoM MAY 0.3% 0.3% ® 0.3% 0.2% + + +02:30 PM + US + + Durable Goods Orders MoM MAY -4.5% 8.5% ® -4.5% -4.0% + + +02:30 PM + US + + GDP Growth Rate QoQ Final Q1 2.1% 0.5% 1.6% 1.6% + +02:30 PM + US + + Personal Income MoM MAY 0.7% 0% ® 0.4% 0.3% + +02:30 PM + US + + Personal Spending MoM MAY 0.7% 0.4% ® 0.6% 0.7% + +Tuesday June 30 2026 Actual Previous Consensus Forecast +Tuesday June 30 2026 Actual Previous Consensus Forecast +03:30 AM + AU + + RBA Meeting Minutes +03:30 AM + CN + + NBS Manufacturing PMI JUN 50 50.1 50.3 + +08:45 AM + FR + + Inflation Rate YoY Prel JUN 2.4% +2.4% + +11:00 AM + IT + + Inflation Rate YoY Prel JUN 3.2% +3.4% + +02:00 PM + DE + + Inflation Rate YoY Prel JUN 2.6% 2.5% 2.6% + +04:00 PM + US + + JOLTs Job Openings MAY 7.618M 7.28M 7.4M + +Wednesday July 01 2026 Actual Previous Consensus Forecast +Wednesday July 01 2026 Actual Previous Consensus Forecast +01:50 AM + JP + + Tankan Large Manufacturers Index Q2 17 16 13 + +03:45 AM + CN + + RatingDog Manufacturing PMI JUN 51.7 51.4 +07:00 AM + JP + + Consumer Confidence JUN 33.6 34 32 + +11:00 AM + EA + + Inflation Rate YoY Flash JUN 3.2% 3% 3.1% + +03:00 PM + US + + Fed Chair Warsh Speech // +04:00 PM + US + + ISM Manufacturing PMI JUN 54.0 53.7 53.6 + + + + + +About our calendar + +Trading Economics provides its users with a near real-time economic +calendar updated 24 hours a day. *Actual values* are based on official +sources, not third party data providers. *Previous values* are available +before an economic indicator is reported and marked as revised (*) +accordingly. *Survey consensus* figures are provided displaying the +average forecast among a representative group of economists. We also +provide *forecasts* which are driven by our analysts’ expectations and +technically projected using an autoregressive integrated moving average +(ARIMA) model. + +The event release time is colored according to its importance. +Low Medium High + +The Trading Economics *API* provides you with *direct access* to our +calendar and historical data on thousands of indicators. The API can be +used to feed a website, off-the-shelf software like Microsoft Excel or a +custom developed application. Providing several request methods to query +our databases, it is the best way to export data in JSON, CSV or HTML +format and to keep your events calendar up to date. + +To learn more about our Calendar API documentation . + + + + + + Economic Calendar + + + This page displays a table with actual values, consensus figures, + forecasts, statistics and historical data charts for - Economic + Calendar. This calendar provides events for 196 countries including + data releases for 300.000 economic indicators, actual values, + consensus figures and proprietary forecasts. + + + + +Indicators +Homepage +Countries +Indicators +Calendar +Forecasts +Ratings +Solutions +Data Subscriptions +API Access +Excel Add-In +Developer Account +Documentation +Pricing + +About Us +Customers +Careers +Investors +Advertisers +About us +Privacy +IOs app on Apple Android app on Google Play + +English +Español +Português +Français +Deutsch +Italiano +Polski +Indonesian +Русский +Türkçe +العربية +简体中文 +日本語 +한국어 + + +Copyright ©2026 TRADING ECONOMICS +All Rights Reserved + + + diff --git a/backend/routers/causal_lab.py b/backend/routers/causal_lab.py index e0f07a9..f8b3466 100644 --- a/backend/routers/causal_lab.py +++ b/backend/routers/causal_lab.py @@ -1125,6 +1125,108 @@ def _build_graph_json_from_spec(spec: dict) -> dict: } +def auto_assign_template(event_id: int) -> dict: + """ + Auto-assign or auto-create a causal template for a market event. + Called by the eco detector when auto_template=True in desk config. + Returns {"template_id": int, "action": "assigned"|"created", "name": str} or {"error": ...} + """ + try: + from services.database import get_conn, get_config + from services.causal_graphs import get_templates, init_tables, seed_templates + import openai + + key = get_config("openai_api_key") or "" + if not key: + return {"error": "Clé OpenAI manquante"} + + conn = get_conn() + init_tables(conn) + seed_templates(conn) + + ev_row = conn.execute("SELECT * FROM market_events WHERE id = ?", (event_id,)).fetchone() + if not ev_row: + conn.close() + return {"error": f"Event {event_id} introuvable"} + + event = dict(ev_row) + templates = get_templates(conn) + + # Step 1 — recommend an existing template + recommendation = _gpt4o_recommend(event, templates) + tmpl_id = recommendation.get("template_id") + confidence = float(recommendation.get("confidence") or 0.0) + + if tmpl_id and confidence >= 0.6: + conn.execute("UPDATE market_events SET template_id = ? WHERE id = ?", (tmpl_id, event_id)) + conn.commit() + row = conn.execute("SELECT name FROM causal_graph_templates WHERE id = ?", (tmpl_id,)).fetchone() + conn.close() + return {"template_id": tmpl_id, "action": "assigned", "name": row["name"] if row else "", "confidence": confidence} + + # Step 2 — no good match → generate a new template + conn.close() + + client = openai.OpenAI(api_key=key) + prompt = f"""Tu es un analyste financier spécialisé en graphes causaux macro. +Crée un graphe causal pour l'événement suivant. + +Événement : +- Nom : {event.get('name')} +- Catégorie : {event.get('category')} / {event.get('sub_type', '')} +- Description : {(event.get('description') or '')[:400]} +- Réel : {event.get('actual_value')} | Attendu : {event.get('expected_value')} | Surprise % : {event.get('surprise_pct')} + +Retourne UNIQUEMENT ce JSON (sans commentaire ni markdown) : +{{ + "name": "", + "category": "macro_us", + "description": "<1 phrase décrivant le mécanisme>", + "input_node": {{"id": "", "label": "