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.

Add US Federal Reserve (FRED)

Add Dataset Create Free QuantConnect Account

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(2003, 1, 1)
        self.set_end_date(2019, 10, 11)
        self.set_cash(100000)

        self.spy = self.add_equity("SPY", Resolution.DAILY).symbol
        
        # Requesting data
        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:
        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 1
            if peak_to_trough == 1 and not self.portfolio.invested:
                self.set_holdings(self.spy, 1)
                
            # Liquidate holdings if peak to trough value is 0
            elif peak_to_trough == 0 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: