About US Federal Reserve (FRED)
The Federal Reserve Economic Data (FRED) by the Research Division of the Federal Reserve bank of St. Louis, MO provides various time series relating to macro-economic data. The data covers 560 datasets, starts in January 1999, and is delivered on a daily frequency. The data is created by aggregating daily updates from more than 85 public and proprietary sources.
About FRED
The Research Division of the Federal Reserve bank of St. Louis, MO expands the frontier of economic knowledge by producing high-quality original research in the areas of macroeconomics, money and banking, and applied microeconomics. They contribute to monetary policy discussions by advising the Bank president on a range of topics, especially in preparation for Federal Open Market Committee (FOMC) meetings. The Research Division is in the top 1% of all economics research departments worldwide.
About QuantConnect
QuantConnect was founded in 2012 to serve quants everywhere with the best possible algorithmic trading technology. Seeking to disrupt a notoriously closed-source industry, QuantConnect takes a radically open-source approach to algorithmic trading. Through the QuantConnect web platform, more than 50,000 quants are served every month.
Algorithm Example
from AlgorithmImports import *
from QuantConnect.DataSource import *
class FredAlternativeDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2000, 1, 1)
self.set_end_date(2023, 12, 31)
self.set_cash(100000)
self.spy = self.add_equity("SPY", Resolution.DAILY).symbol
# Requesting FED US peak-to-trough OECD recession indicators for trade signal generation
self.fred_peak_to_trough = self.add_data(Fred, Fred.OECDRecessionIndicators.united_states_from_peak_through_the_trough, Resolution.DAILY).symbol
# Historical data
history = self.history(self.fred_peak_to_trough, 60, Resolution.DAILY)
self.debug(f"We got {len(history)} items from our history request")
def on_data(self, slice: Slice) -> None:
# Trade with updated FED peak-to-trough indicator
if slice.contains_key(self.fred_peak_to_trough) and slice.contains_key(self.spy):
peak_to_trough = slice.Get(Fred, self.fred_peak_to_trough).value
# Buy SPY if peak to trough value is 0, which is the expansionary period
if peak_to_trough == 0 and not self.portfolio.invested:
self.set_holdings(self.spy, 1)
# Liquidate holdings if peak to trough value is 1, which is recessionary period
elif peak_to_trough == 1 and self.portfolio.invested:
self.liquidate(self.spy)
Example Applications
The FRED dataset enables you to accurately design strategies utilizing macroeconomic indicators. Examples include the following strategies:
- Trading on macroeconomic factors
- Macroeconomic risk modeling
Pricing
Cloud Access
Harness FRED Economic data in the QuantConnect Cloud for your backtesting and live trading purposes.
Download On Premise
FRED Economic data archived in LEAN format for on premise backtesting and research. One file per ticker.
Explore Other Datasets
Corporate Lobbying
Dataset by Quiver Quantitative
US Congress Trading
Dataset by Quiver Quantitative
Bitfinex Crypto Price Data
Dataset by CoinAPI