CPI, core CPI, core PCE, payrolls, unemployment, jobless claims, industrial production and retail sales from FRED, each under a conservative release date.
Data sourceNetwork: fred.stlouisfed.orgDesktop onlyv1.0.0
Inflation, the labour market and activity set the backdrop for rates, the dollar and equity indices. This plugin brings eight US headline series into a backtest as feeds, for regime filters such as "no new longs while CPI inflation is above 4 percent".
Before a run, it downloads each series from FRED and writes the level plus its changes: fred_cpiaucsl (CPI, all items), fred_cpilfesl (core CPI), fred_pcepilfe (core PCE prices), fred_indpro (industrial production) and fred_rsafs (retail sales), each with _yoy and _mom in percent; fred_payems (nonfarm payrolls, thousands) with _yoy and _chg (jobs added, thousands); fred_unrate (unemployment rate) with _chg (percentage points); fred_icsa (initial jobless claims, weekly) with _yoy and _chg (week over week).
FRED dates a value by the period it describes, but it came out weeks later. Every value here is stored under the day after its release, worked out per series from the release dates FRED lists itself, so a strategy never reads a figure before it was published.
Configuration
Field
Type
Default
Description
cache_daysRefetch after (days)
number
1
Days before the plugin downloads a series again. Within that time a run reads the cached feeds and needs no network.
Use it in a strategy
pythonbars = ctx.bars(1)
if bars:
inflation = ctx.data("fred_cpiaucsl_yoy", bars[-1].ts) # CPI, percent over a year
if inflation is not None and inflation > 4.0:
ctx.signal("EXIT")
The feeds are refreshed before a run whose strategy reads ctx.data, or when "Fetch external data (news and plugin feeds)" is ticked. A run on the server never fetches. To trade the release itself, use the economic calendar (ctx.news_window), not these feeds.
What it provides
fred_cpiaucsl, fred_cpilfesl, fred_pcepilfeFeed
CPI, core CPI and core PCE price indices (index levels), each with _yoy and _mom: the change against a year and a month earlier, in percent.
fred_indpro, fred_rsafsFeed
Industrial production (index) and retail and food services sales (millions of dollars), each with _yoy and _mom in percent.
fred_payems, fred_unrateFeed
Nonfarm payrolls (thousands) with _yoy in percent and _chg, the jobs added in the month (thousands); the unemployment rate (percent) with _chg in percentage points.
fred_icsaFeed
Initial jobless claims of a week (persons, seasonally adjusted) with _yoy in percent against 52 weeks earlier and _chg against the week before.
Source: BLS, BEA, U.S. Census Bureau, Federal Reserve Board and U.S. Department of Labor via FRED, Federal Reserve Bank of St. Louis
Rate limit
Eight downloads of a few KB per refresh, paced half a second apart; FRED forbids access that is excessive or disruptive.
Hosts it may reach: fred.stlouisfed.org
When values are known
Each value is stored under the day after its release and carried forward until the next release, for at most 70 days. The release date comes from a rule per series that is never earlier than the real release in FRED's release date lists since 1994 (CPI known from the 17th of the next month since the December 2017 index, the 1st of the month after next before that; payrolls and unemployment from the 14th, industrial production and retail sales from the 20th, core PCE from the 9th of the month after next, claims from the Saturday after the week), plus a table of releases that came later, among them the shutdowns of 1995/96, 2013, 2018/19 and 2025. Before 1994 the rules are coarser and later still. A strategy usually sees a figure a few days after it came out, never before.
Limits
Values are FRED's latest revisions, not the figures first published: payrolls, retail sales and the seasonally adjusted indices are revised for months and years. A backtest sees today's view of the past at the day of the first release, which flatters any rule that trades on surprises.
Not for trading the release: a figure is known from the next day, and the dates are conservative. For the event and the consensus, use the economic calendar (ctx.news_window).
A release delayed after this version was written (a new shutdown) is stored under its regular rule and can show up too early; the late release table in the code is where to add it.
FRED's terms: downloads are for personal, non-commercial use, and the terms prohibit storing or caching FRED content, while this plugin keeps a local cache of the series on your machine. The series themselves are public domain US government data; commercial users should take them from the primary publishers (BLS, BEA, Census Bureau, Federal Reserve, Department of Labor).
With your own FRED API key under Settings, API keys, a strategy can read any FRED series itself with ctx.source("fred"), under FRED's API terms; that route needs no plugin.
October 2025 has no CPI and no unemployment rate (not collected during the shutdown); a change against a missing month is left out rather than guessed.