diff --git a/tests/test_fred.py b/tests/test_fred.py index b27ba680d..19c1dba16 100644 --- a/tests/test_fred.py +++ b/tests/test_fred.py @@ -58,6 +58,25 @@ class FredResolutionTests(unittest.TestCase): self.assertEqual(fred._resolve_series_id("Fed Funds Rate"), "FEDFUNDS") self.assertEqual(fred._resolve_series_id("10y-treasury"), "DGS10") + def test_euro_area_aliases_map_to_series_ids(self): + # Euro-area context for non-US tickers (e.g. Euronext .PA): FRED mirrors + # the ECB policy rates, Eurostat HICP/GDP and OECD long-term yields. + expected = { + "ecb_deposit_rate": "ECBDFR", + "ecb_main_refi_rate": "ECBMRRFR", + "euro_hicp": "CP0000EZ19M086NEST", + "euro_core_hicp": "00XEFDEZ19M086NEST", + "euro_real_gdp": "CLVMNACSCAB1GQEA19", + "germany_10y": "IRLTLT01DEM156N", + "france_10y": "IRLTLT01FRM156N", + "eur_usd": "DEXUSEU", + } + for alias, series_id in expected.items(): + with self.subTest(alias=alias): + self.assertEqual(fred._resolve_series_id(alias), series_id) + self.assertEqual(fred._resolve_series_id("ECB Deposit Rate"), "ECBDFR") + self.assertEqual(fred._resolve_series_id("euro-hicp"), "CP0000EZ19M086NEST") + def test_unknown_alias_is_treated_as_raw_series_id(self): # Power users can pass any FRED series ID; we uppercase by convention. self.assertEqual(fred._resolve_series_id("dgs30"), "DGS30") diff --git a/tradingagents/agents/tools.py b/tradingagents/agents/tools.py index b8b323cba..5a4d65cdc 100644 --- a/tradingagents/agents/tools.py +++ b/tradingagents/agents/tools.py @@ -229,7 +229,9 @@ def get_macro_indicators( str, "Macro indicator: a friendly alias such as 'cpi', 'core_pce', " "'unemployment', 'fed_funds_rate', '10y_treasury', 'yield_curve', " - "'real_gdp', 'vix', or a raw FRED series ID such as 'CPIAUCSL'.", + "'real_gdp', 'vix', euro-area aliases such as 'ecb_deposit_rate', " + "'euro_hicp', 'euro_core_hicp', 'euro_real_gdp', 'germany_10y', " + "'france_10y', 'eur_usd', or a raw FRED series ID such as 'CPIAUCSL'.", ], curr_date: Annotated[str, "Current date in yyyy-mm-dd format; the end of the window"], look_back_days: Annotated[ @@ -239,7 +241,8 @@ def get_macro_indicators( ) -> str: """ Retrieve a macroeconomic indicator time series from FRED (Federal Reserve - Economic Data): policy rates, Treasury yields, inflation, labor, and growth. + Economic Data): policy rates, Treasury yields, inflation, labor, and growth, + for the US and, through FRED's mirrored series, the euro area. Returns the series title, units, frequency, the latest value, the change over the window, and a recent observation table. Uses the configured macro_data vendor. diff --git a/tradingagents/dataflows/vendors/fred.py b/tradingagents/dataflows/vendors/fred.py index 86fbea43b..d735615d7 100644 --- a/tradingagents/dataflows/vendors/fred.py +++ b/tradingagents/dataflows/vendors/fred.py @@ -76,6 +76,17 @@ MACRO_SERIES = { "consumer_sentiment": "UMCSENT", "housing_starts": "HOUST", "retail_sales": "RSAFS", + # Euro area (for non-US tickers such as Euronext .PA): FRED mirrors the ECB + # policy rates, Eurostat HICP and GDP, and OECD long-term government yields, + # so the same vintage pinning keeps euro-area data point-in-time. + "ecb_deposit_rate": "ECBDFR", + "ecb_main_refi_rate": "ECBMRRFR", + "euro_hicp": "CP0000EZ19M086NEST", + "euro_core_hicp": "00XEFDEZ19M086NEST", + "euro_real_gdp": "CLVMNACSCAB1GQEA19", + "germany_10y": "IRLTLT01DEM156N", + "france_10y": "IRLTLT01FRM156N", + "eur_usd": "DEXUSEU", }