From 054f3f028f4e6d9a93502d144495cab99da42b59 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 27 Jul 2026 00:57:17 +0000 Subject: [PATCH] [create-pull-request] automated change --- single-page/Quantconnect-Cloud-Platform.html | 60 +- single-page/Quantconnect-Lean-Cli.html | 5 + single-page/Quantconnect-Local-Platform.html | 43 +- .../Quantconnect-Research-Environment.html | 65 +- .../Quantconnect-Writing-Algorithms.html | 4333 +++++++++++++++-- 5 files changed, 4032 insertions(+), 474 deletions(-) diff --git a/single-page/Quantconnect-Cloud-Platform.html b/single-page/Quantconnect-Cloud-Platform.html index 0f5aa0a9ba..e1960e8061 100644 --- a/single-page/Quantconnect-Cloud-Platform.html +++ b/single-page/Quantconnect-Cloud-Platform.html @@ -2822,6 +2822,13 @@

Introduction

The Object Store is shared across the entire organization. Using the same key, you can access data across all projects in an organization.

+

+ The Object Store is available to paid organizations. In Free organizations, algorithms that try to save data log "The current user does not have permission to write to the organization Object Store". To use the Object Store, + + upgrade your organization + + to a paid tier. +

@@ -2951,7 +2958,7 @@

Storage Sizes

- All organizations get 50 MB of free storage in the Object Store. Paid organizations can subscribe to more storage space. The following table shows the cost of the supported storage sizes: + The Object Store is available to paid organizations. Paid organizations get 50 MB of free storage in the Object Store and can subscribe to more storage space. The following table shows the cost of the supported storage sizes:

@@ -36450,6 +36457,11 @@

Asset Classes

Equity Options +
  • + + Index Options + +
  • Futures @@ -36500,6 +36512,9 @@

  • + @@ -36521,6 +36536,9 @@

    + + + + +
    Equity Options + Index Options + Futures green check + green check +
    @@ -36535,6 +36553,8 @@

    +
    @@ -36551,6 +36571,9 @@

    green check + green check +
    @@ -36567,6 +36590,9 @@

    green check + green check +
    @@ -36583,6 +36609,9 @@

    green check + green check +
    @@ -42770,7 +42799,7 @@

    View Live Results

    view all of your live projects - to open the page again. + , open the project, and then click the yellow lightning bolt icon at the top of the IDE to open the page again.

    @@ -43652,20 +43681,14 @@

    View All Live Projects

    The - - Your Strategies - - section of the - - Strategy Explorer + + Live Dashboard - page displays the status of all the live algorithms in your organizations. To view the page, log in to the Algorithm Lab and then, in the left navigation bar, click - - Strategy Explorer - - . + page displays the status of all the live algorithms in your organizations. To view the page, log in to the Algorithm Lab and then, in the left navigation bar, click the lightning bolt icon. +

    +

    + To view the results of one of the algorithms, click its row in the table. The project opens in the Algorithm Lab. To see the live results page, click the yellow lightning bolt icon at the top of the IDE.

    - View live project in algorithm lab @@ -47054,6 +47077,13 @@

    Introduction

    The Object Store is shared across the entire organization. Using the same key, you can access data across all projects in an organization.

    +

    + The Object Store is available to paid organizations. In Free organizations, algorithms that try to save data log "The current user does not have permission to write to the organization Object Store". To use the Object Store, + + upgrade your organization + + to a paid tier. +

    @@ -47183,7 +47213,7 @@

    Storage Sizes

    - All organizations get 50 MB of free storage in the Object Store. Paid organizations can subscribe to more storage space. The following table shows the cost of the supported storage sizes: + The Object Store is available to paid organizations. Paid organizations get 50 MB of free storage in the Object Store and can subscribe to more storage space. The following table shows the cost of the supported storage sizes:

    diff --git a/single-page/Quantconnect-Lean-Cli.html b/single-page/Quantconnect-Lean-Cli.html index 98510d7a66..7345bae1e6 100644 --- a/single-page/Quantconnect-Lean-Cli.html +++ b/single-page/Quantconnect-Lean-Cli.html @@ -25973,6 +25973,11 @@

    Asset Classes

    Equity Options +
  • + + Index Options + +
  • Futures diff --git a/single-page/Quantconnect-Local-Platform.html b/single-page/Quantconnect-Local-Platform.html index e9cfc22902..414a162d54 100644 --- a/single-page/Quantconnect-Local-Platform.html +++ b/single-page/Quantconnect-Local-Platform.html @@ -2203,18 +2203,27 @@

    Extension Settings

    Sync: Local And Cloud Projects
  • @@ -2939,6 +2948,16 @@

    Introduction

    Unless you are working on an anonymous project, Local Platform automatically syncs your local project files with QuantConnect Cloud. Every time you save a file, Local Platform saves the changes in your local project and in the cloud version of the project.

    +

    + To synchronize only the project you currently have open, or to disable synchronization entirely, adjust the + + Sync: Local And Cloud Projects + + + extension setting + + . Disabling synchronization is best when local agents edit your project files and you want to avoid conflicts with the cloud versions of your projects. +

    diff --git a/single-page/Quantconnect-Research-Environment.html b/single-page/Quantconnect-Research-Environment.html index df2ffb2470..ca838c4c79 100644 --- a/single-page/Quantconnect-Research-Environment.html +++ b/single-page/Quantconnect-Research-Environment.html @@ -41610,6 +41610,21 @@

    Available Universes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - - Yes - - to synchronize cloud and local projects. Otherwise, - - No - - . - - No - - is only available for Institution organizations. + The synchronization mode for your local and cloud projects. +
      +
    • + + Synchronize All Projects + + (default): While the extension runs, it synchronizes all your cloud and local projects in the background. +
    • +
    • + + Synchronize Open Project Only + + : The extension only synchronizes the project you currently have open. +
    • +
    • + + Disable Synchronization + + : The extension doesn't synchronize any projects. This mode is best when local agents edit your project files and you want to avoid conflicts with the cloud versions of your projects. +
    • +
    + Spectral Tick Flow Signal + + + SpectralTickFlowSignalUniverse + + + + Learn more + +
    US ETF Constituents @@ -41781,6 +41796,50 @@

    Available Universes

    + OTC Transparency + +
      +
    • + + FINRAShortInterestUniverse + +
    • +
    • + + FINRAWeeklySummaryUniverse + +
    • +
    • + + FINRAMonthlySummaryUniverse + +
    • +
    +
    + + Learn more + +
    + Regulation SHO + + + FINRAShortSaleVolumeUniverse + + + + Learn more + +
    CNBC Trading @@ -45006,11 +45065,11 @@

    Storage Quotas

    - If you use the Research Environment locally, you can store as much data as your hardware will allow. If you use the Research Environment in QuantConnect Cloud, you must stay within your + If you use the Research Environment locally, you can store as much data as your hardware will allow. If you use the Research Environment in QuantConnect Cloud, you need a - storage quota + paid organization - . To find your storage quota programmatically, use the + to access the Object Store and you must stay within your storage quota. To find your storage quota programmatically, use the MaxSize diff --git a/single-page/Quantconnect-Writing-Algorithms.html b/single-page/Quantconnect-Writing-Algorithms.html index c141902e0f..d665d95ac9 100644 --- a/single-page/Quantconnect-Writing-Algorithms.html +++ b/single-page/Quantconnect-Writing-Algorithms.html @@ -168,15 +168,16 @@

    Table of Content

  • 6.2.13 Fear and Greed
  • 6.2.14 International Future Universe
  • 6.2.15 Kraken Crypto Price Data
  • -
  • 6.2.16 US ETF Constituents
  • -
  • 6.2.17 US Equities Short Availability
  • -
  • 6.2.18 US Equity Coarse Universe
  • -
  • 6.2.19 US Equity Option Universe
  • -
  • 6.2.20 US Equity Security Master
  • -
  • 6.2.21 US Future Option Universe
  • -
  • 6.2.22 US Future Universe
  • -
  • 6.2.23 US Futures Security Master
  • -
  • 6.2.24 US Index Option Universe
  • +
  • 6.2.16 Spectral Tick Flow Signal
  • +
  • 6.2.17 US ETF Constituents
  • +
  • 6.2.18 US Equities Short Availability
  • +
  • 6.2.19 US Equity Coarse Universe
  • +
  • 6.2.20 US Equity Option Universe
  • +
  • 6.2.21 US Equity Security Master
  • +
  • 6.2.22 US Future Option Universe
  • +
  • 6.2.23 US Future Universe
  • +
  • 6.2.24 US Futures Security Master
  • +
  • 6.2.25 US Index Option Universe
  • 6.3 AlgoSeek
  • 6.3.1 US Equities
  • 6.3.2 US Equity Options
  • @@ -200,48 +201,55 @@

    Table of Content

  • 6.9.1 US Bureau of Labor Statistics (BLS)
  • 6.10 CoinGecko
  • 6.10.1 Crypto Market Cap
  • -
  • 6.11 EOD Historical Data
  • -
  • 6.11.1 Economic Events
  • -
  • 6.11.2 Macroeconomics Indicators
  • -
  • 6.11.3 Upcoming Dividends
  • -
  • 6.11.4 Upcoming Earnings
  • -
  • 6.11.5 Upcoming IPOs
  • -
  • 6.11.6 Upcoming Splits
  • -
  • 6.12 Energy Information Administration
  • -
  • 6.12.1 US Energy Information Administration (EIA)
  • -
  • 6.13 ExtractAlpha
  • -
  • 6.13.1 Cross Asset Model
  • -
  • 6.13.2 Estimize
  • -
  • 6.13.3 Tactical
  • -
  • 6.13.4 True Beats
  • -
  • 6.14 FRED
  • -
  • 6.14.1 US Federal Reserve (FRED)
  • -
  • 6.15 Federal Reserve Bank of St Louis
  • -
  • 6.15.1 US Interest Rate
  • -
  • 6.16 Kavout
  • -
  • 6.16.1 Composite Factor Bundle
  • -
  • 6.17 Nasdaq
  • -
  • 6.17.1 Data Link
  • -
  • 6.18 Quiver Quantitative
  • -
  • 6.18.1 CNBC Trading
  • -
  • 6.18.2 Corporate Lobbying
  • -
  • 6.18.3 Insider Trading
  • -
  • 6.18.4 US Congress Trading
  • -
  • 6.18.5 US Government Contracts
  • -
  • 6.19 RegAlytics
  • -
  • 6.19.1 US Regulatory Alerts - Financial Sector
  • -
  • 6.20 Securities and Exchange Commission
  • -
  • 6.20.1 US SEC Filings
  • -
  • 6.21 Smart Insider
  • -
  • 6.21.1 Corporate Buybacks
  • -
  • 6.22 Tiingo
  • -
  • 6.22.1 Tiingo News Feed
  • -
  • 6.23 Treasury Department
  • -
  • 6.23.1 US Treasury Yield Curve
  • -
  • 6.24 US Department of Agriculture
  • -
  • 6.24.1 USDA Fruit And Vegetables
  • -
  • 6.25 VIX Central
  • -
  • 6.25.1 VIX Central Contango
  • +
  • 6.11 Commodity Futures Trading Commission
  • +
  • 6.11.1 Commitments of Traders
  • +
  • 6.12 EOD Historical Data
  • +
  • 6.12.1 Economic Events
  • +
  • 6.12.2 Macroeconomics Indicators
  • +
  • 6.12.3 Upcoming Dividends
  • +
  • 6.12.4 Upcoming Earnings
  • +
  • 6.12.5 Upcoming IPOs
  • +
  • 6.12.6 Upcoming Splits
  • +
  • 6.13 Energy Information Administration
  • +
  • 6.13.1 US Energy Information Administration (EIA)
  • +
  • 6.14 ExtractAlpha
  • +
  • 6.14.1 Cross Asset Model
  • +
  • 6.14.2 Estimize
  • +
  • 6.14.3 Tactical
  • +
  • 6.14.4 True Beats
  • +
  • 6.15 FRED
  • +
  • 6.15.1 US Federal Reserve (FRED)
  • +
  • 6.16 Federal Reserve Bank of St Louis
  • +
  • 6.16.1 US Interest Rate
  • +
  • 6.17 Financial Industry Regulatory Authority
  • +
  • 6.17.1 OTC Transparency
  • +
  • 6.17.2 Regulation SHO
  • +
  • 6.18 Kavout
  • +
  • 6.18.1 Composite Factor Bundle
  • +
  • 6.19 Nasdaq
  • +
  • 6.19.1 Data Link
  • +
  • 6.20 Quiver Quantitative
  • +
  • 6.20.1 CNBC Trading
  • +
  • 6.20.2 Corporate Lobbying
  • +
  • 6.20.3 Insider Trading
  • +
  • 6.20.4 US Congress Trading
  • +
  • 6.20.5 US Government Contracts
  • +
  • 6.21 RegAlytics
  • +
  • 6.21.1 US Regulatory Alerts - Financial Sector
  • +
  • 6.22 Securities and Exchange Commission
  • +
  • 6.22.1 US SEC Filings
  • +
  • 6.23 Smart Insider
  • +
  • 6.23.1 Corporate Buybacks
  • +
  • 6.24 Tiingo
  • +
  • 6.24.1 Tiingo News Feed
  • +
  • 6.25 Treasury Department
  • +
  • 6.25.1 US Treasury Yield Curve
  • +
  • 6.26 US Bureau of Economic Analysis
  • +
  • 6.26.1 GDP by Industry
  • +
  • 6.27 US Department of Agriculture
  • +
  • 6.27.1 USDA Fruit And Vegetables
  • +
  • 6.28 VIX Central
  • +
  • 6.28.1 VIX Central Contango
  • 7 Importing Data
  • 7.1 Key Concepts
  • 7.2 Streaming Data
  • @@ -155032,7 +155040,7 @@

    Chain Fundamental and Alternative Data

    fundamental universe and a - + QuiverCNBCsUniverse alternative universe . It stores every US Equity fundamental, intersects them with the names CNBC commentator Jim Cramer mentions, and trades the 100 most liquid intersection members each morning. @@ -155334,7 +155342,7 @@

    Chain ETF and Alternative Data

    ETF universe and a - + QuiverCNBCsUniverse alternative universe . It stores every SPY constituent, intersects them with the names CNBC commentator Jim Cramer mentions, and trades the 100 heaviest-weighted intersection members each morning. Names CNBC mentions but that aren't in SPY are dropped. @@ -155998,52 +156006,62 @@

    Supported Datasets

  • - + Upcoming Dividends
  • - + Upcoming Earnings
  • - + Upcoming IPOs
  • - + Upcoming Splits
  • - + + OTC Transparency + +
  • +
  • + + Regulation SHO + +
  • +
  • + CNBC Trading
  • - + Corporate Lobbying
  • - + Insider Trading
  • - + US Congress Trading
  • - + US Government Contracts
  • - + Corporate Buybacks
  • @@ -156152,7 +156170,7 @@

    Insiders have more information to evaluate the overall prospect of the company, so following their trades can be useful. The following algorithm uses the - + Insider Trading to create a universe of US Equities that insiders have recently purchased. @@ -156272,7 +156290,7 @@

    The following algorithm uses the - + Corporate Buybacks dataset to create a universe of US Equities that have announced an upcoming share buyback program: @@ -166084,8 +166102,19 @@

    +

    - January 2003 + January 2003 +
    + Data Density + + Sparse +
    + Resolution + + Daily +
    + Timezone + + New York +
    + + + +

    Requesting Data

    + + +

    + You don't need any special code to request US Interest Rate data. + + QCAlgorithm + + automatically subscribes to the data by setting its + + default risk free interest rate model + + . +

    + + + +

    Accessing Data

    + + +

    + To get the current US Interest Rate data, call the + + GetInterestRate + + + get_interest_rate + + method of the + + RiskFreeInterestRateModel + + object with the current time. +

    +
    +
    interest_rate = self.risk_free_interest_rate_model.get_interest_rate(self.time)
    +
    var interestRate = RiskFreeInterestRateModel.GetInterestRate(Time);
    +
    + + + +

    Historical Data

    + + +

    + To get the average risk free interest rate for a window of time, call the + + GetRiskFreeRate + + + get_risk_free_rate + + method with the start date and end date. +

    +
    +
    risk_free_rate = RiskFreeInterestRateModelExtensions.get_risk_free_rate(
    +    self.risk_free_interest_rate_model, 
    +    self.time-timedelta(365), self.time
    +)
    +
    var riskFreeRate = RiskFreeInterestRateModel.GetRiskFreeRate(Time.AddDays(-365), Time);
    +
    +

    + To get the average risk free interest rate for a set of dates, call the + + GetAverageRiskFreeRate + + + get_average_risk_free_rate + + method with the list of dates. +

    +
    +
    risk_free_rate = RiskFreeInterestRateModelExtensions.get_average_risk_free_rate(
    +    self.risk_free_interest_rate_model, 
    +    [self.time, self.time-timedelta(180), self.time-timedelta(365)]
    +)
    +
    var riskFreeRate = RiskFreeInterestRateModel.GetAverageRiskFreeRate(
    +    new [] {Time, Time.AddDays(-180), Time.AddDays(-365)}  
    +);
    +
    + + + +

    Example Applications

    + + +

    + The US Interest Rate dataset provides an important economic indicator. Examples include the following applications: +

    + +

    + Classic Algorithm Example +

    +

    + The following example algorithm plots the current interest rate and the last year's average. +

    +
    +
    from AlgorithmImports import *
    +
    +
    +class RiskFreeInterestRateModelAlgorithm(QCAlgorithm):
    +
    +    def initialize(self):
    +        self.set_start_date(2024, 9, 1)
    +        self.set_end_date(2024, 12, 31)
    +        self.set_cash(100000)
    +        self.add_equity("SPY")
    +
    +    def on_end_of_day(self, symbol):
    +        self.set_holdings(symbol, 1)
    +        # Get the average risk free rate of the last year at the current time
    +        risk_free_rate = RiskFreeInterestRateModelExtensions.get_risk_free_rate(self.risk_free_interest_rate_model, self.time - timedelta(365), self.time)
    +        # Plot the current interest rate and the 1-year average rate for comparison
    +        self.plot('Interest', 'EOD', self.risk_free_interest_rate_model.get_interest_rate(self.time))
    +        self.plot('Interest', '1Y-RW', risk_free_rate)
    +
    public class RiskFreeInterestRateModelAlgorithm : QCAlgorithm
    +{
    +    public override void Initialize()
    +    {
    +        SetStartDate(2024, 9, 1);
    +        SetEndDate(2024, 12, 31);
    +        SetCash(100000);
    +        AddEquity("SPY");
    +    }
    +
    +    public override void OnEndOfDay(Symbol symbol)
    +    {
    +        SetHoldings(symbol, 1);
    +        // Plot the current interest rate and the 1-year average rate for comparison
    +        Plot("Interest Rate", "EOD", RiskFreeInterestRateModel.GetInterestRate(Time));
    +        // Get the average risk free rate of the last year at the current time
    +        Plot("Interest Rate", "1-year Window", RiskFreeInterestRateModel.GetRiskFreeRate(Time.AddDays(-365), Time));
    +    }
    +}
    +
    + + + +

     

    + +
    +
    +

    Datasets

    +

    Financial Industry Regulatory Authority

    +
    +
    + + +
    +
    +

    + FINRA (the Financial Industry Regulatory Authority) was created in 2007, when NASD merged with the member regulation arm of the New York Stock Exchange. Its job is to protect investors and keep the markets honest, and it oversees nearly every broker-dealer that does business with the public in the United States. As part of that role, FINRA collects the off-exchange trading and short interest reports those firms are required to file, and publishes the results for free so researchers, investors, and anyone else can get a clearer view of what is happening away from the exchanges. +

    +
    + +
    + + + +

     

    + +
    +
    +

    Financial Industry Regulatory Authority

    +

    OTC Transparency

    +
    +
    +

    Introduction

    + + +

    + The FINRA OTC Transparency dataset by FINRA (the Financial Industry Regulatory Authority) shows you what US stocks are trading away from the exchanges, plus how heavily each one is being shorted. It covers around 59,000 US Equities, goes back to January 2017, and updates daily. FINRA builds it from the off-exchange volume and short interest reports that broker-dealers have to file with them. +

    +

    + For more information about the OTC Transparency dataset, including CLI commands and pricing, see the + + dataset listing + + . +

    +

    +

    + + + +

    About the Provider

    + + +

    + FINRA (the Financial Industry Regulatory Authority) was created in 2007, when NASD merged with the member regulation arm of the New York Stock Exchange. Its job is to protect investors and keep the markets honest, and it oversees nearly every broker-dealer that does business with the public in the United States. As part of that role, FINRA collects the off-exchange trading and short interest reports those firms are required to file, and publishes the results for free so researchers, investors, and anyone else can get a clearer view of what is happening away from the exchanges. +

    + + + +

    Getting Started

    + + +

    + The following snippet demonstrates how to request data from the FINRA OTC Transparency dataset: +

    +
    +
    self.symbol = self.add_equity("AAPL", Resolution.DAILY).symbol
    +self.short_interest = self.add_data(FINRAShortInterest, self.symbol).symbol
    +self.weekly_summary = self.add_data(FINRAWeeklySummary, self.symbol).symbol
    +self.monthly_summary = self.add_data(FINRAMonthlySummary, self.symbol).symbol
    +
    _symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
    +_shortInterest = AddData<FINRAShortInterest>(_symbol).Symbol;
    +_weeklySummary = AddData<FINRAWeeklySummary>(_symbol).Symbol;
    +_monthlySummary = AddData<FINRAMonthlySummary>(_symbol).Symbol;
    +
    + + + +

    Data Summary

    + + +

    + The following table describes the dataset properties: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Property + + Value +
    + Start Date + + January 2017 +
    + Data Points + + 9,360,438 +
    + Asset Coverage + + 59,712 US Equities +
    + Resolution + + Daily +
    + Timezone + + America/New_York +
    + + + +

    Requesting Data

    + + +

    + To add FINRA OTC Transparency data to your algorithm, call the + + AddData + + + add_data + + method. The dataset is linked to US Equities, so pass the equity + + Symbol + + you want the data for. Save a reference to the dataset + + Symbol + + so you can access the data later in your algorithm. +

    +

    + The dataset comes in three classes: + + FINRAShortInterest + + , + + FINRAWeeklySummary + + , and + + FINRAMonthlySummary + + . Subscribe to the ones your strategy needs. +

    +
    +
    class FINRAOtcTransparencyDataAlgorithm(QCAlgorithm):
    +    def initialize(self) -> None:
    +        self.set_start_date(2022, 1, 1)
    +        self.set_end_date(2023, 1, 1)
    +        self.set_cash(100000)
    +
    +        self.symbol = self.add_equity("AAPL", Resolution.DAILY).symbol
    +        self.short_interest = self.add_data(FINRAShortInterest, self.symbol).symbol
    +        self.weekly_summary = self.add_data(FINRAWeeklySummary, self.symbol).symbol
    +        self.monthly_summary = self.add_data(FINRAMonthlySummary, self.symbol).symbol
    +
    public class FINRAOtcTransparencyDataAlgorithm : QCAlgorithm
    +{
    +    private Symbol _symbol, _shortInterest, _weeklySummary, _monthlySummary;
    +
    +    public override void Initialize()
    +    {
    +        SetStartDate(2022, 1, 1);
    +        SetEndDate(2023, 1, 1);
    +        SetCash(100000);
    +
    +        _symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
    +        _shortInterest = AddData<FINRAShortInterest>(_symbol).Symbol;
    +        _weeklySummary = AddData<FINRAWeeklySummary>(_symbol).Symbol;
    +        _monthlySummary = AddData<FINRAMonthlySummary>(_symbol).Symbol;
    +    }
    +}
    +
    + + + +

    Accessing Data

    + + +

    + To get the current FINRA OTC Transparency data, index the current + + + Slice + + + with the dataset + + Symbol + + . + + Slice + + objects deliver unique events to your algorithm as they happen, but the + + Slice + + may not contain data for your dataset at every time step. To avoid issues, check if the + + Slice + + contains the data you want before you index it. +

    +
    +
    def on_data(self, slice: Slice) -> None:
    +    if slice.contains_key(self.short_interest):
    +        data_point = slice[self.short_interest]
    +        self.log(f"{self.short_interest} days to cover at {slice.time}: {data_point.days_to_cover}")
    +
    public override void OnData(Slice slice)
    +{
    +    if (slice.ContainsKey(_shortInterest))
    +    {
    +        var dataPoint = slice[_shortInterest];
    +        Log($"{_shortInterest} days to cover at {slice.Time}: {dataPoint.DaysToCover}");
    +    }
    +}
    +
    +
    +

    + To iterate through all of the dataset objects in the current + + Slice + + , call the + + Get + + method. +

    +
    +
    def on_data(self, slice: Slice) -> None:
    +    for symbol, data_point in slice.get(FINRAShortInterest).items():
    +        self.log(f"{symbol} days to cover at {slice.time}: {data_point.days_to_cover}")
    +
    +    for symbol, data_point in slice.get(FINRAWeeklySummary).items():
    +        self.log(f"{symbol} ATS weekly shares at {slice.time}: {data_point.share_quantity}")
    +
    +    for symbol, data_point in slice.get(FINRAMonthlySummary).items():
    +        self.log(f"{symbol} non-ATS monthly shares at {slice.time}: {data_point.share_quantity}")
    +
    public override void OnData(Slice slice)
    +{
    +    foreach (var kvp in slice.Get<FINRAShortInterest>())
    +    {
    +        Log($"{kvp.Key} days to cover at {slice.Time}: {kvp.Value.DaysToCover}");
    +    }
    +
    +    foreach (var kvp in slice.Get<FINRAWeeklySummary>())
    +    {
    +        Log($"{kvp.Key} ATS weekly shares at {slice.Time}: {kvp.Value.ShareQuantity}");
    +    }
    +
    +    foreach (var kvp in slice.Get<FINRAMonthlySummary>())
    +    {
    +        Log($"{kvp.Key} non-ATS monthly shares at {slice.Time}: {kvp.Value.ShareQuantity}");
    +    }
    +}
    +
    + + + +

    Historical Data

    + + +

    + To get historical FINRA OTC Transparency data, call the + + History + + method with the dataset + + Symbol + + . If there is no data in the period you request, the history result is empty. +

    +
    +
    # DataFrames
    +short_interest_history = self.history(self.short_interest, 100, Resolution.DAILY)
    +weekly_history = self.history(self.weekly_summary, 100, Resolution.DAILY)
    +monthly_history = self.history(self.monthly_summary, 100, Resolution.DAILY)
    +history = self.history([self.short_interest, self.weekly_summary, self.monthly_summary], 100, Resolution.DAILY)
    +
    +# Dataset objects
    +short_interest_bars = self.history[FINRAShortInterest](self.short_interest, 100, Resolution.DAILY)
    +weekly_bars = self.history[FINRAWeeklySummary](self.weekly_summary, 100, Resolution.DAILY)
    +monthly_bars = self.history[FINRAMonthlySummary](self.monthly_summary, 100, Resolution.DAILY)
    +
    // Dataset objects
    +var shortInterestHistory = History<FINRAShortInterest>(_shortInterest, 100, Resolution.Daily);
    +var weeklyHistory = History<FINRAWeeklySummary>(_weeklySummary, 100, Resolution.Daily);
    +var monthlyHistory = History<FINRAMonthlySummary>(_monthlySummary, 100, Resolution.Daily);
    +
    +// Slice objects
    +var history = History(new[] { _shortInterest, _weeklySummary, _monthlySummary }, 100, Resolution.Daily);
    +
    +

    + For more information about historical data, see + + History Requests + + . +

    + + + +

    Universe Selection

    + + +

    + To select a dynamic universe of US Equities based on FINRA OTC Transparency data, call the + + AddUniverse + + + add_universe + + method with one of the dataset's universe classes ( + + FINRAShortInterestUniverse + + , + + FINRAWeeklySummaryUniverse + + , or + + FINRAMonthlySummaryUniverse + + ) and a selection function. The following example selects the most heavily shorted names by days-to-cover: +

    +
    +
    def initialize(self) -> None:
    +    self._universe = self.add_universe(FINRAShortInterestUniverse, self.universe_selection)
    +
    +def universe_selection(self, alt_coarse: List[FINRAShortInterestUniverse]) -> List[Symbol]:
    +    return [d.symbol for d in alt_coarse
    +            if d.days_to_cover is not None and d.days_to_cover > 5]
    +
    private Universe _universe;
    +public override void Initialize()
    +{
    +    _universe = AddUniverse<FINRAShortInterestUniverse>(altCoarse=>
    +    {
    +        return from d in altCoarse.OfType<FINRAShortInterestUniverse>()
    +            where d.DaysToCover > 5m
    +            select d.Symbol;
    +    });
    +}
    +
    +

    + For more information about dynamic universes, see + + Universes + + . +

    + + + +

    Remove Subscriptions

    + + +

    + To remove a subscription, call the + + RemoveSecurity + + method. +

    +
    +
    self.remove_security(self.short_interest)
    +self.remove_security(self.weekly_summary)
    +self.remove_security(self.monthly_summary)
    +
    RemoveSecurity(_shortInterest);
    +RemoveSecurity(_weeklySummary);
    +RemoveSecurity(_monthlySummary);
    +
    +

    + If you subscribe to FINRA OTC Transparency data for assets in a dynamic universe, remove the dataset subscription when the asset leaves your universe. To view a common design pattern, see + + Track Security Changes + + . +

    + + + +

    Example Applications

    + + +

    + The FINRA OTC Transparency dataset lets you see the short positioning and off-exchange order flow behind a stock. Examples include: +

    + +

    + Classic Algorithm Example +

    +

    + The following example algorithm subscribes to the three FINRA OTC Transparency report types for a US Equity and trades it on the change in open short interest: +

    +
    +
    from AlgorithmImports import *
    +
    +class FINRAOtcTransparencyDataAlgorithm(QCAlgorithm):
    +    def initialize(self):
    +        self.set_start_date(2022, 1, 1)
    +        self.set_end_date(2023, 1, 1)
    +        self.set_cash(100000)
    +
    +        aapl = self.add_equity("AAPL", Resolution.DAILY).symbol
    +        self.short_interest = self.add_data(FINRAShortInterest, aapl).symbol
    +        self.weekly_summary = self.add_data(FINRAWeeklySummary, aapl).symbol
    +        self.monthly_summary = self.add_data(FINRAMonthlySummary, aapl).symbol
    +
    +        history = self.history(FINRAShortInterest, self.short_interest, 30, Resolution.DAILY)
    +        self.debug(f"We got {len(history)} items from our history request")
    +
    +    def on_data(self, slice):
    +        # Off-exchange volume prints as an activity signal
    +        for symbol, point in slice.get(FINRAMonthlySummary).items():
    +            self.debug(f"{symbol} non-ATS monthly shares at {slice.time}: {point.share_quantity}")
    +
    +        for symbol, point in slice.get(FINRAShortInterest).items():
    +            if point.change is None:
    +                continue
    +
    +            # Go short when open short interest is building; go long when it is unwinding
    +            if point.change > 0:
    +                self.set_holdings(symbol.underlying, -1)
    +            else:
    +                self.set_holdings(symbol.underlying, 1)
    +
    public class FINRAOtcTransparencyDataAlgorithm : QCAlgorithm
    +{
    +    private Symbol _shortInterest, _weeklySummary, _monthlySummary;
    +
    +    public override void Initialize()
    +    {
    +        SetStartDate(2022, 1, 1);
    +        SetEndDate(2023, 1, 1);
    +        SetCash(100000);
    +
    +        var aapl = AddEquity("AAPL", Resolution.Daily).Symbol;
    +        _shortInterest = AddData<FINRAShortInterest>(aapl).Symbol;
    +        _weeklySummary = AddData<FINRAWeeklySummary>(aapl).Symbol;
    +        _monthlySummary = AddData<FINRAMonthlySummary>(aapl).Symbol;
    +
    +        var history = History<FINRAShortInterest>(_shortInterest, 30, Resolution.Daily);
    +        Debug($"We got {history.Count()} items from our history request");
    +    }
    +
    +    public override void OnData(Slice slice)
    +    {
    +        // Off-exchange volume prints as an activity signal
    +        foreach (var kvp in slice.Get<FINRAMonthlySummary>())
    +        {
    +            Debug($"{kvp.Key} non-ATS monthly shares at {slice.Time}: {kvp.Value.ShareQuantity}");
    +        }
    +
    +        foreach (var kvp in slice.Get<FINRAShortInterest>())
    +        {
    +            var point = kvp.Value;
    +            if (point.Change == null)
    +            {
    +                continue;
    +            }
    +
    +            // Go short when open short interest is building; go long when it is unwinding
    +            if (point.Change > 0)
    +            {
    +                SetHoldings(kvp.Key.Underlying, -1);
    +            }
    +            else
    +            {
    +                SetHoldings(kvp.Key.Underlying, 1);
    +            }
    +        }
    +    }
    +}
    +
    +

    + Framework Algorithm Example +

    +

    + The following example algorithm uses the Algorithm Framework to trade a manually selected universe from FINRA OTC Transparency data. An alpha model subscribes each security to the consolidated short interest feed and emits insights from the change in open short interest: +

    +
    +
    from AlgorithmImports import *
    +
    +class FINRAOtcTransparencyFrameworkAlgorithm(QCAlgorithm):
    +
    +    def initialize(self) -> None:
    +        self.set_start_date(2022, 1, 1)
    +        self.set_end_date(2023, 1, 1)
    +        self.set_cash(100000)
    +
    +        self.universe_settings.resolution = Resolution.DAILY
    +
    +        symbols = [Symbol.create("AAPL", SecurityType.EQUITY, Market.USA)]
    +        self.set_universe_selection(ManualUniverseSelectionModel(symbols))
    +
    +        self.add_alpha(FINRAShortInterestAlphaModel())
    +
    +        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
    +        self.set_execution(ImmediateExecutionModel())
    +
    +
    +class FINRAShortInterestAlphaModel(AlphaModel):
    +
    +    def __init__(self) -> None:
    +        self._symbols_by_security = {}
    +
    +    def update(self, algorithm: QCAlgorithm, data: Slice) -> List[Insight]:
    +        insights = []
    +        for security_symbol, short_interest_symbol in self._symbols_by_security.items():
    +            if short_interest_symbol not in data:
    +                continue
    +            change = data[short_interest_symbol].change
    +            if change is None:
    +                continue
    +            # Building short interest is bearish, unwinding short interest is bullish.
    +            direction = InsightDirection.DOWN if change > 0 else InsightDirection.UP
    +            insights.append(Insight.price(security_symbol, timedelta(days=14), direction))
    +        return insights
    +
    +    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
    +        for security in changes.added_securities:
    +            symbol = security.symbol
    +            short_interest_symbol = algorithm.add_data(FINRAShortInterest, symbol).symbol
    +            self._symbols_by_security[symbol] = short_interest_symbol
    +            history = algorithm.history(FINRAShortInterest, short_interest_symbol, 10, Resolution.DAILY)
    +            algorithm.debug(f"Got {len(history)} historical short interest rows for {symbol}")
    +        for security in changes.removed_securities:
    +            short_interest_symbol = self._symbols_by_security.pop(security.symbol, None)
    +            if short_interest_symbol is not None:
    +                algorithm.remove_security(short_interest_symbol)
    +
    public class FINRAOtcTransparencyFrameworkAlgorithm : QCAlgorithm
    +{
    +    public override void Initialize()
    +    {
    +        SetStartDate(2022, 1, 1);
    +        SetEndDate(2023, 1, 1);
    +        SetCash(100000);
    +
    +        UniverseSettings.Resolution = Resolution.Daily;
    +
    +        var symbols = new[] { QuantConnect.Symbol.Create("AAPL", SecurityType.Equity, Market.USA) };
    +        SetUniverseSelection(new ManualUniverseSelectionModel(symbols));
    +
    +        AddAlpha(new FINRAShortInterestAlphaModel());
    +
    +        SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
    +        SetExecution(new ImmediateExecutionModel());
    +    }
    +}
    +
    +public class FINRAShortInterestAlphaModel : AlphaModel
    +{
    +    private readonly Dictionary<Symbol, Symbol> _symbolsBySecurity = new();
    +
    +    public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)
    +    {
    +        foreach (var kvp in _symbolsBySecurity)
    +        {
    +            var securitySymbol = kvp.Key;
    +            var shortInterestSymbol = kvp.Value;
    +            if (!data.ContainsKey(shortInterestSymbol))
    +            {
    +                continue;
    +            }
    +            var change = data.Get<FINRAShortInterest>(shortInterestSymbol).Change;
    +            if (change == null)
    +            {
    +                continue;
    +            }
    +            // Building short interest is bearish, unwinding short interest is bullish.
    +            var direction = change > 0 ? InsightDirection.Down : InsightDirection.Up;
    +            yield return Insight.Price(securitySymbol, TimeSpan.FromDays(14), direction);
    +        }
    +    }
    +
    +    public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)
    +    {
    +        foreach (var security in changes.AddedSecurities)
    +        {
    +            var symbol = security.Symbol;
    +            var shortInterestSymbol = algorithm.AddData<FINRAShortInterest>(symbol).Symbol;
    +            _symbolsBySecurity[symbol] = shortInterestSymbol;
    +            var history = algorithm.History<FINRAShortInterest>(shortInterestSymbol, 10, Resolution.Daily);
    +            algorithm.Debug($"Got {history.Count()} historical short interest rows for {symbol}");
    +        }
    +        foreach (var security in changes.RemovedSecurities)
    +        {
    +            if (_symbolsBySecurity.Remove(security.Symbol, out var shortInterestSymbol))
    +            {
    +                algorithm.RemoveSecurity(shortInterestSymbol);
    +            }
    +        }
    +    }
    +}
    +
    + + + +

    Data Point Attributes

    + + +

    + The FINRA OTC Transparency dataset provides + + FINRAShortInterest + + , + + FINRAWeeklySummary + + , and + + FINRAMonthlySummary + + objects, each with a matching universe class. +

    +

    + FINRAShortInterest +

    +

    + + FINRAShortInterest + + objects have the following attributes: +

    +
    +
    +

    + FINRAShortInterestUniverse +

    +

    + + FINRAShortInterestUniverse + + objects have the following attributes: +

    +
    +
    +

    + FINRAWeeklySummary +

    +

    + + FINRAWeeklySummary + + objects have the following attributes: +

    +
    +
    +

    + FINRAWeeklySummaryUniverse +

    +

    + + FINRAWeeklySummaryUniverse + + objects have the following attributes: +

    +
    +
    +

    + FINRAMonthlySummary +

    +

    + + FINRAMonthlySummary + + objects have the following attributes: +

    +
    +
    +

    + FINRAMonthlySummaryUniverse +

    +

    + + FINRAMonthlySummaryUniverse + + objects have the following attributes: +

    +
    +
    + + + +

     

    + +
    +
    +

    Financial Industry Regulatory Authority

    +

    Regulation SHO

    +
    +
    +

    Introduction

    + + +

    + The FINRA Reg SHO Daily Short Sale Volume dataset by FINRA (Financial Industry Regulatory Authority) tracks off-exchange short sale volume for US Equities. The data covers around 9,000 US Equities per day, starts in August 2018, and is delivered on a daily frequency. This dataset is created by aggregating the daily short sale volume that broker-dealers report to FINRA's trade reporting facilities under Regulation SHO. +

    +

    + For more information about the Regulation SHO dataset, including CLI commands and pricing, see the + + dataset listing + + . +

    +

    +

    + + + +

    About the Provider

    + + +

    + FINRA (the Financial Industry Regulatory Authority) was created in 2007, when NASD merged with the member regulation arm of the New York Stock Exchange. Its mission is to protect investors and keep the markets honest. FINRA oversees nearly every broker-dealer that does business with the public in the United States, and it publishes the short sale and off-exchange trading data that those firms are required to report. This information is made freely available to researchers, investors, and anyone who wants a clearer view of market activity. +

    + + + +

    Getting Started

    + + +

    + The following snippet demonstrates how to request data from the FINRA Reg SHO Daily Short Sale Volume dataset: +

    +
    +
    self.symbol = self.add_equity("AAPL", Resolution.DAILY).symbol
    +self.short_volume_symbol = self.add_data(FINRAShortSaleVolume, self.symbol).symbol
    +
    _symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
    +_shortVolumeSymbol = AddData<FINRAShortSaleVolume>(_symbol).Symbol;
    +
    + + + +

    Data Summary

    + + +

    + The following table describes the dataset properties: +

    + + + + + + + + + + + + + + + @@ -354580,7 +357031,7 @@

    Data Summary

    Timezone @@ -354592,16 +357043,47 @@

    Requesting Data

    - You don't need any special code to request US Interest Rate data. + To add FINRA Reg SHO Daily Short Sale Volume data to your algorithm, call the + + AddData + + + add_data + + method. The dataset is linked to US Equities, so pass the equity - QCAlgorithm + Symbol - automatically subscribes to the data by setting its - - default risk free interest rate model - - . + you want short sale volume for. Save a reference to the dataset + + Symbol + + so you can access the data later in your algorithm.

    +
    +
    class FINRAShortSaleVolumeDataAlgorithm(QCAlgorithm):
    +    def initialize(self) -> None:
    +        self.set_start_date(2019, 1, 1)
    +        self.set_end_date(2020, 6, 1)
    +        self.set_cash(100000)
    +
    +        self.symbol = self.add_equity("AAPL", Resolution.DAILY).symbol
    +        self.short_volume_symbol = self.add_data(FINRAShortSaleVolume, self.symbol).symbol
    +
    public class FINRAShortSaleVolumeDataAlgorithm : QCAlgorithm
    +{
    +    private Symbol _symbol, _shortVolumeSymbol;
    +
    +    public override void Initialize()
    +    {
    +        SetStartDate(2019, 1, 1);
    +        SetEndDate(2020, 6, 1);
    +        SetCash(100000);
    +
    +        _symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
    +        _shortVolumeSymbol = AddData<FINRAShortSaleVolume>(_symbol).Symbol;
    +    }
    +}
    +
    @@ -354609,22 +357091,68 @@

    Accessing Data

    - To get the current US Interest Rate data, call the - - GetInterestRate + To get the current FINRA Reg SHO Daily Short Sale Volume data, index the current + + + Slice + + + with the dataset + + Symbol - - get_interest_rate + . + + Slice - method of the + objects deliver unique events to your algorithm as they happen, but the - RiskFreeInterestRateModel + Slice - object with the current time. + may not contain data for your dataset at every time step. To avoid issues, check if the + + Slice + + contains the data you want before you index it.

    -
    interest_rate = self.risk_free_interest_rate_model.get_interest_rate(self.time)
    -
    var interestRate = RiskFreeInterestRateModel.GetInterestRate(Time);
    +
    def on_data(self, slice: Slice) -> None:
    +    if slice.contains_key(self.short_volume_symbol):
    +        data_point = slice[self.short_volume_symbol]
    +        self.log(f"{self.short_volume_symbol} short volume at {slice.time}: {data_point.short_volume}")
    +
    public override void OnData(Slice slice)
    +{
    +    if (slice.ContainsKey(_shortVolumeSymbol))
    +    {
    +        var dataPoint = slice[_shortVolumeSymbol];
    +        Log($"{_shortVolumeSymbol} short volume at {slice.Time}: {dataPoint.ShortVolume}");
    +    }
    +}
    +
    +

    + To iterate through all of the dataset objects in the current + + Slice + + , call the + + Get + + method. +

    +
    +
    def on_data(self, slice: Slice) -> None:
    +    for dataset_symbol, data_point in slice.get(FINRAShortSaleVolume).items():
    +        self.log(f"{dataset_symbol} short volume at {slice.time}: {data_point.short_volume}")
    +
    public override void OnData(Slice slice)
    +{
    +    foreach (var kvp in slice.Get<FINRAShortSaleVolume>())
    +    {
    +        var datasetSymbol = kvp.Key;
    +        var dataPoint = kvp.Value;
    +        Log($"{datasetSymbol} short volume at {slice.Time}: {dataPoint.ShortVolume}");
    +    }
    +}
    @@ -354633,117 +357161,354 @@

    Historical Data

    - To get the average risk free interest rate for a window of time, call the - - GetRiskFreeRate + To get historical FINRA Reg SHO Daily Short Sale Volume data, call the + + History - - get_risk_free_rate + method with the dataset + + Symbol - method with the start date and end date. + . If there is no data in the period you request, the history result is empty.

    -
    risk_free_rate = RiskFreeInterestRateModelExtensions.get_risk_free_rate(
    -    self.risk_free_interest_rate_model, 
    -    self.time-timedelta(365), self.time
    -)
    -
    var riskFreeRate = RiskFreeInterestRateModel.GetRiskFreeRate(Time.AddDays(-365), Time);
    +
    # DataFrame
    +history_df = self.history(self.short_volume_symbol, 100, Resolution.DAILY)
    +
    +# Dataset objects
    +history_bars = self.history[FINRAShortSaleVolume](self.short_volume_symbol, 100, Resolution.DAILY)
    +
    var history = History<FINRAShortSaleVolume>(_shortVolumeSymbol, 100, Resolution.Daily);

    - To get the average risk free interest rate for a set of dates, call the + For more information about historical data, see + + History Requests + + . +

    + + + +

    Universe Selection

    + + +

    + To select a dynamic universe of US Equities based on FINRA Reg SHO Daily Short Sale Volume data, call the - GetAverageRiskFreeRate + AddUniverse - get_average_risk_free_rate + add_universe - method with the list of dates. + method with the + + FINRAShortSaleVolumeUniverse + + class and a selection function.

    -
    risk_free_rate = RiskFreeInterestRateModelExtensions.get_average_risk_free_rate(
    -    self.risk_free_interest_rate_model, 
    -    [self.time, self.time-timedelta(180), self.time-timedelta(365)]
    -)
    -
    var riskFreeRate = RiskFreeInterestRateModel.GetAverageRiskFreeRate(
    -    new [] {Time, Time.AddDays(-180), Time.AddDays(-365)}  
    -);
    +
    def initialize(self) -> None:
    +    self._universe = self.add_universe(FINRAShortSaleVolumeUniverse, self.universe_selection)
    +
    +def universe_selection(self, alt_coarse: List[FINRAShortSaleVolumeUniverse]) -> List[Symbol]:
    +    return [d.symbol for d in alt_coarse \
    +                if d.short_volume_ratio is not None \
    +                and d.short_volume_ratio > 0.5]
    +
    private Universe _universe;
    +public override void Initialize()
    +{
    +    _universe = AddUniverse<FINRAShortSaleVolumeUniverse>(altCoarse =>
    +    {
    +        return from d in altCoarse.OfType<FINRAShortSaleVolumeUniverse>()
    +            where d.ShortVolumeRatio > 0.5m
    +            select d.Symbol;
    +    });
    +}
    +

    Remove Subscriptions

    + + +

    + To remove a subscription, call the + + RemoveSecurity + + method. +

    +
    +
    self.remove_security(self.short_volume_symbol)
    +
    RemoveSecurity(_shortVolumeSymbol);
    +
    +

    + If you subscribe to FINRA Reg SHO Daily Short Sale Volume data for assets in a dynamic universe, remove the dataset subscription when the asset leaves your universe. To view a common design pattern, see + + Track Security Changes + + . +

    + + +

    Example Applications

    - The US Interest Rate dataset provides an important economic indicator. Examples include the following applications: + The FINRA Reg SHO Daily Short Sale Volume dataset lets you see how much of a stock's off-exchange flow is short selling. Examples include:

    • - Accurately calculating indicators that are a function of the risk-free rate, like Sharpe ratios. + Fading a stock once its short volume climbs to an unusually large share of total reported volume.
    • - Forming a portfolio of assets that have a history of outperforming when the rate is increasing/decreasing. + Following persistent short pressure when the short volume ratio stays elevated for several days in a row.
    • - Canceling orders in a - - Risk Management model - - when the expected return of the asset is less than the risk-free rate. + Ranking the universe by short volume ratio and rotating toward the most heavily shorted names. +
    • +
    • + Watching short-exempt volume for early signs of aggressive selling around large orders and index events.

    Classic Algorithm Example

    - The following example algorithm plots the current interest rate and the last year's average. + The following example algorithm subscribes to FINRA Reg SHO Daily Short Sale Volume data for a US Equity and trades it on the daily short volume ratio:

    from AlgorithmImports import *
     
    +class FINRAShortSaleVolumeDataAlgorithm(QCAlgorithm):
    +    def initialize(self):
    +        self.set_start_date(2019, 1, 1)
    +        self.set_end_date(2020, 6, 1)
    +        self.set_cash(100000)
     
    -class RiskFreeInterestRateModelAlgorithm(QCAlgorithm):
    +        aapl = self.add_equity("AAPL", Resolution.DAILY).symbol
    +        self.short_volume_symbol = self.add_data(FINRAShortSaleVolume, aapl).symbol
    +        history = self.history(FINRAShortSaleVolume, self.short_volume_symbol, 60, Resolution.DAILY)
     
    -    def initialize(self):
    -        self.set_start_date(2024, 9, 1)
    -        self.set_end_date(2024, 12, 31)
    +        self.debug(f"We got {len(history)} items from our history request")
    +
    +    def on_data(self, slice):
    +        points = slice.get(FINRAShortSaleVolume)
    +        for point in points.values():
    +            # Go short when off-exchange short volume is more than half of total reported volume
    +            if point.short_volume_ratio is not None and point.short_volume_ratio > 0.5:
    +                self.set_holdings(point.symbol.underlying, -1)
    +
    +            # Go long otherwise
    +            else:
    +                self.set_holdings(point.symbol.underlying, 1)
    +
    public class FINRAShortSaleVolumeDataAlgorithm : QCAlgorithm
    +{
    +    public override void Initialize()
    +    {
    +        SetStartDate(2019, 1, 1);
    +        SetEndDate(2020, 6, 1);
    +        SetCash(100000);
    +
    +        var aapl = AddEquity("AAPL", Resolution.Daily).Symbol;
    +        var shortVolumeSymbol = AddData<FINRAShortSaleVolume>(aapl).Symbol;
    +        var history = History<FINRAShortSaleVolume>(shortVolumeSymbol, 60, Resolution.Daily);
    +
    +        Debug($"We got {history.Count()} items from our history request");
    +    }
    +
    +    public override void OnData(Slice slice)
    +    {
    +        var points = slice.Get<FINRAShortSaleVolume>();
    +        foreach (var point in points.Values)
    +        {
    +            // Go short when off-exchange short volume is more than half of total reported volume
    +            if (point.ShortVolumeRatio > 0.5m)
    +            {
    +                SetHoldings(point.Symbol.Underlying, -1);
    +            }
    +            // Go long otherwise
    +            else
    +            {
    +                SetHoldings(point.Symbol.Underlying, 1);
    +            }
    +        }
    +    }
    +}
    +
    +

    + Framework Algorithm Example +

    +

    + The following example algorithm uses the Algorithm Framework to trade a manually selected universe from FINRA Reg SHO Daily Short Sale Volume data. An alpha model subscribes each security to the dataset and emits insights from the daily short volume ratio: +

    +
    +
    from AlgorithmImports import *
    +
    +class FINRAShortSaleVolumeFrameworkAlgorithm(QCAlgorithm):
    +
    +    def initialize(self) -> None:
    +        self.set_start_date(2019, 1, 1)
    +        self.set_end_date(2020, 6, 1)
             self.set_cash(100000)
    -        self.add_equity("SPY")
     
    -    def on_end_of_day(self, symbol):
    -        self.set_holdings(symbol, 1)
    -        # Get the average risk free rate of the last year at the current time
    -        risk_free_rate = RiskFreeInterestRateModelExtensions.get_risk_free_rate(self.risk_free_interest_rate_model, self.time - timedelta(365), self.time)
    -        # Plot the current interest rate and the 1-year average rate for comparison
    -        self.plot('Interest', 'EOD', self.risk_free_interest_rate_model.get_interest_rate(self.time))
    -        self.plot('Interest', '1Y-RW', risk_free_rate)
    -
    public class RiskFreeInterestRateModelAlgorithm : QCAlgorithm
    +        self.universe_settings.resolution = Resolution.DAILY
    +
    +        symbols = [Symbol.create("AAPL", SecurityType.EQUITY, Market.USA)]
    +        self.set_universe_selection(ManualUniverseSelectionModel(symbols))
    +
    +        self.add_alpha(FINRAShortPressureAlphaModel())
    +
    +        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
    +        self.set_execution(ImmediateExecutionModel())
    +
    +
    +class FINRAShortPressureAlphaModel(AlphaModel):
    +
    +    def __init__(self, threshold: float = 0.5) -> None:
    +        self._threshold = threshold
    +        self._symbols_by_security = {}
    +
    +    def update(self, algorithm: QCAlgorithm, data: Slice) -> List[Insight]:
    +        insights = []
    +        for security_symbol, short_volume_symbol in self._symbols_by_security.items():
    +            if short_volume_symbol not in data:
    +                continue
    +            ratio = data[short_volume_symbol].short_volume_ratio
    +            if ratio is None:
    +                continue
    +            direction = InsightDirection.DOWN if ratio > self._threshold else InsightDirection.UP
    +            insights.append(Insight.price(security_symbol, timedelta(days=7), direction))
    +        return insights
    +
    +    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
    +        for security in changes.added_securities:
    +            symbol = security.symbol
    +            short_volume_symbol = algorithm.add_data(FINRAShortSaleVolume, symbol).symbol
    +            self._symbols_by_security[symbol] = short_volume_symbol
    +            history = algorithm.history(FINRAShortSaleVolume, short_volume_symbol, 30, Resolution.DAILY)
    +            algorithm.debug(f"Got {len(history)} historical short sale volume rows for {symbol}")
    +        for security in changes.removed_securities:
    +            short_volume_symbol = self._symbols_by_security.pop(security.symbol, None)
    +            if short_volume_symbol is not None:
    +                algorithm.remove_security(short_volume_symbol)
    +
    public class FINRAShortSaleVolumeFrameworkAlgorithm : QCAlgorithm
     {
         public override void Initialize()
         {
    -        SetStartDate(2024, 9, 1);
    -        SetEndDate(2024, 12, 31);
    +        SetStartDate(2019, 1, 1);
    +        SetEndDate(2020, 6, 1);
             SetCash(100000);
    -        AddEquity("SPY");
    +
    +        UniverseSettings.Resolution = Resolution.Daily;
    +
    +        var symbols = new[] { QuantConnect.Symbol.Create("AAPL", SecurityType.Equity, Market.USA) };
    +        SetUniverseSelection(new ManualUniverseSelectionModel(symbols));
    +
    +        AddAlpha(new FINRAShortPressureAlphaModel());
    +
    +        SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
    +        SetExecution(new ImmediateExecutionModel());
         }
    +}
     
    -    public override void OnEndOfDay(Symbol symbol)
    +public class FINRAShortPressureAlphaModel : AlphaModel
    +{
    +    private readonly decimal _threshold;
    +    private readonly Dictionary<Symbol, Symbol> _symbolsBySecurity = new();
    +
    +    public FINRAShortPressureAlphaModel(decimal threshold = 0.5m)
         {
    -        SetHoldings(symbol, 1);
    -        // Plot the current interest rate and the 1-year average rate for comparison
    -        Plot("Interest Rate", "EOD", RiskFreeInterestRateModel.GetInterestRate(Time));
    -        // Get the average risk free rate of the last year at the current time
    -        Plot("Interest Rate", "1-year Window", RiskFreeInterestRateModel.GetRiskFreeRate(Time.AddDays(-365), Time));
    +        _threshold = threshold;
    +    }
    +
    +    public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)
    +    {
    +        foreach (var kvp in _symbolsBySecurity)
    +        {
    +            var securitySymbol = kvp.Key;
    +            var shortVolumeSymbol = kvp.Value;
    +            if (!data.ContainsKey(shortVolumeSymbol))
    +            {
    +                continue;
    +            }
    +            var ratio = data.Get<FINRAShortSaleVolume>(shortVolumeSymbol).ShortVolumeRatio;
    +            if (ratio == null)
    +            {
    +                continue;
    +            }
    +            var direction = ratio > _threshold ? InsightDirection.Down : InsightDirection.Up;
    +            yield return Insight.Price(securitySymbol, TimeSpan.FromDays(7), direction);
    +        }
    +    }
    +
    +    public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)
    +    {
    +        foreach (var security in changes.AddedSecurities)
    +        {
    +            var symbol = security.Symbol;
    +            var shortVolumeSymbol = algorithm.AddData<FINRAShortSaleVolume>(symbol).Symbol;
    +            _symbolsBySecurity[symbol] = shortVolumeSymbol;
    +            var history = algorithm.History<FINRAShortSaleVolume>(shortVolumeSymbol, 30, Resolution.Daily);
    +            algorithm.Debug($"Got {history.Count()} historical short sale volume rows for {symbol}");
    +        }
    +        foreach (var security in changes.RemovedSecurities)
    +        {
    +            if (_symbolsBySecurity.Remove(security.Symbol, out var shortVolumeSymbol))
    +            {
    +                algorithm.RemoveSecurity(shortVolumeSymbol);
    +            }
    +        }
         }
     }
    +

    Data Point Attributes

    + + +

    + The FINRA Reg SHO Daily Short Sale Volume dataset provides + + FINRAShortSaleVolume + + and + + FINRAShortSaleVolumeUniverse + + objects. +

    +

    + FINRAShortSaleVolume +

    +

    + + FINRAShortSaleVolume + + objects have the following attributes: +

    +
    +
    +

    + FINRAShortSaleVolumeUniverse +

    +

    + + FINRAShortSaleVolumeUniverse + + objects have the following attributes: +

    +
    +
    + + +

     

    -
    +

    Datasets

    Kavout

    @@ -354762,7 +357527,7 @@

    Kavout

    + + + + + + + + + + + + + + + + + + +
    + Property + + Value +
    + Start Date + + August 2018
    - Data Density + Data Points - Sparse + 18,761,559 +
    + Asset Coverage + + 22,073 US Equities
    - New York + America/New_York
    - January 1990 + January 1990 +
    + Coverage + + 1 Dataset +
    + Data Density + + Sparse +
    + Resolution + + Daily +
    + Timezone + + New York +
    + + + +

    Requesting Data

    + + +

    + To add US Treasury Yield Curve data to your algorithm, call the + + AddData + + + add_data + + method. Save a reference to the dataset + + Symbol + + so you can access the data later in your algorithm. +

    +
    +
    class QuiverCongressDataAlgorithm(QCAlgorithm):
    +    def initialize(self) -> None:
    +        self.set_start_date(2019, 1, 1)
    +        self.set_end_date(2020, 6, 1)
    +        self.set_cash(100000)
    +
    +        self.dataset_symbol = self.add_data(USTreasuryYieldCurveRate, "USTYCR").symbol
    +
    public class USTreasuryYieldCurveDataAlgorithm : QCAlgorithm
    +{
    +    private Symbol _datasetSymbol;
    +
    +    public override void Initialize()
    +    {
    +        SetStartDate(2019, 1, 1);
    +        SetEndDate(2020, 6, 1);
    +        SetCash(100000);
    +
    +        _datasetSymbol = AddData<USTreasuryYieldCurveRate>("USTYCR").Symbol;
    +    }
    +}
    +
    + + + +

    Accessing Data

    + + +

    + To get the current US Treasury Yield Curve data, index the current + + + Slice + + + with the dataset + + Symbol + + . Slice objects deliver unique events to your algorithm as they happen, but the + + Slice + + may not contain data for your dataset at every time step. To avoid issues, check if the + + Slice + + contains the data you want before you index it. +

    +
    +
    def on_data(self, slice: Slice) -> None:
    +    if slice.contains_key(self.dataset_symbol):
    +        data_point = slice[self.dataset_symbol]
    +        self.log(f"{self.dataset_symbol} one month value at {slice.time}: {data_point.one_month}")
    +
    public override void OnData(Slice slice)
    +{
    +    if (slice.ContainsKey(_datasetSymbol))
    +    {
    +        var dataPoint = slice[_datasetSymbol];
    +        Log($"{_datasetSymbol} one month value at {slice.Time}: {dataPoint.OneMonth}");
    +    }
    +}
    +
    +
    + + + +

    Historical Data

    + + +

    + To get historical US Treasury Yield Curve data, call the + + History + + + history + + method with the dataset + + Symbol + + . If there is no data in the period you request, the history result is empty. +

    +
    +
    # DataFrame
    +history_df = self.history(self.dataset_symbol, 100, Resolution.DAILY)
    +
    +# Dataset objects
    +history_bars = self.history[USTreasuryYieldCurveRate](self.dataset_symbol, 100, Resolution.DAILY)
    +
    var history = History<USTreasuryYieldCurveRate>(_datasetSymbol, 100, Resolution.Daily);
    +
    +

    + For more information about historical data, see + + History Requests + + . +

    + + + +

    Remove Subscriptions

    + + +

    + To remove your subscription to US Treasury Yield Curve data, call the + + RemoveSecurity + + + remove_security + + method. +

    +
    +
    self.remove_security(self.dataset_symbol)
    +
    RemoveSecurity(_datasetSymbol);
    +
    + + + +

    Example Applications

    + + +

    + The US Treasury Yield Curve dataset enables you to monitor the yields of bonds with numerous maturities in your strategies. Examples include the following strategies: +

    +
      +
    • + Short selling SPY when the yield curve inverts +
    • +
    • + Buying short-term Treasuries and short selling long-term Treasuries when the yield curve becomes steeper (aka curve steepener trade) +
    • +
    +

    + Classic Algorithm Example +

    +

    + The following example algorithm short sells SPY for two years when the yield curve inverts: +

    +
    +
    from AlgorithmImports import *
    +
    +
    +class USTreasuryDataAlgorithm(QCAlgorithm):
    +
    +    def initialize(self) -> None:
    +
    +        self.set_start_date(2024, 9, 1)
    +        self.set_end_date(2024, 12, 31)
    +        self.set_cash(100000)
    +
    +        # Request SPY as the market representative for trading
    +        self.spy_symbol = self.add_equity("SPY", Resolution.HOUR).symbol
    +
    +        # Requesting yield curve data for trade signal generation (inversion)
    +        self.yield_curve_symbol = self.add_data(USTreasuryYieldCurveRate, "USTYCR").symbol
    +
    +        # Historical data
    +        history = self.history(USTreasuryYieldCurveRate, self.yield_curve_symbol, 60, Resolution.DAILY)
    +        self.debug(f"We got {len(history)} items from our history request")
    +        
    +        self.last_inversion = datetime.min
    +
    +    def on_data(self, slice: Slice) -> None:
    +        # Trade only based on updated yield curve data
    +        if not slice.contains_key(self.yield_curve_symbol):
    +            return
    +        rates = slice[self.yield_curve_symbol]
    +        
    +        # Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    +        if (self.time - self.last_inversion < timedelta(days=365)):
    +            return
    +
    +        # Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    +        # But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    +        # if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    +        if (not self.portfolio.invested and rates.two_year > rates.ten_year):
    +            self.debug(f"{self.time} - Yield curve inversion! Shorting the market for two years")
    +            self.set_holdings(self.spy_symbol, -0.5)
    +            self.last_inversion = self.time
    +            return
    +        
    +        # If two years have passed, liquidate our position in SPY assuming the market starts resilience
    +        if (self.time - self.last_inversion >= timedelta(days=365 * 2)):
    +            self.liquidate(self.spy_symbol)
    +
    public class USTreasuryDataAlgorithm : QCAlgorithm
    +{
    +    private Symbol _spySymbol;
    +    private Symbol _yieldCurveSymbol;
    +    private DateTime _lastInversion = DateTime.MinValue;
    +    
    +    public override void Initialize()
    +    {
    +        SetStartDate(2024, 9, 1);
    +        SetEndDate(2024, 12, 31);
    +        SetCash(100000);
    +
    +        // Request SPY as the market representative for trading
    +        _spySymbol = AddEquity("SPY", Resolution.Hour).Symbol;
    +
    +        // Requesting yield curve data for trade signal generation (inversion)
    +        _yieldCurveSymbol = AddData<USTreasuryYieldCurveRate>("USTYCR").Symbol;
    +
    +        // Historical data
    +        var history = History<USTreasuryYieldCurveRate>(_yieldCurveSymbol, 60, Resolution.Daily);
    +        Debug($"We got {history.Count()} items from our history request");
    +    }
    +    
    +    
    +    public override void OnData(Slice slice)
    +    {
    +        // Trade only based on updated yield curve data
    +        if (!slice.TryGetValue(_yieldCurveSymbol, out var rates))
    +        {
    +            return;
    +        }
    +        
    +        // Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    +        if (Time - _lastInversion < TimeSpan.FromDays(365))
    +        {
    +            return;
    +        }
    +        
    +        // Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    +        // But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    +        // if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    +        if (!Portfolio.Invested && rates.TwoYear > rates.TenYear)
    +        {
    +            Debug($"{Time} - Yield curve inversion! Shorting the market for two years");
    +            SetHoldings(_spySymbol, -0.5); 
    +                _lastInversion = Time;
    +            return;
    +        }
    +        
    +        
    +        // If two years have passed, liquidate our position in SPY assuming the market starts resilience
    +        if (Time - _lastInversion >= TimeSpan.FromDays(365 * 2))
    +        {
    +            Liquidate(_spySymbol);
    +        }
    +    }
    +}
    +
    +

    + Framework Algorithm Example +

    +

    + The following example algorithm short sells SPY for two years when the yield curve inverts: +

    +
    +
    from AlgorithmImports import *
    +
    +
    +class USTreasuryDataAlgorithm(QCAlgorithm):
    +
    +    def initialize(self) -> None:
    +        self.set_start_date(2024, 9, 1)
    +        self.set_end_date(2024, 12, 31)
    +        self.set_cash(100000)
    +
    +        self.universe_settings.resolution = Resolution.HOUR
    +        # Universe only have SPY as the market representative for trading
    +        symbols = [Symbol.create("SPY", SecurityType.EQUITY, Market.USA)]
    +        self.add_universe_selection(ManualUniverseSelectionModel(symbols))   
    +        # Custom alpha model that emit insight according to US Treasury data
    +        self.add_alpha(USTreasuryAlphaModel(self))
    +        # Use insight weighting PCM to limit the size of investment, reduce the fluctuation of the portfolio value
    +        self.set_portfolio_construction(InsightWeightingPortfolioConstructionModel(lambda time: None))
    +        
    +
    +class USTreasuryAlphaModel(AlphaModel):
    +
    +    spy_symbol = None
    +    last_inversion = datetime.min
    +    
    +    def __init__(self, algorithm: QCAlgorithm) -> None:
    +        # Requesting yield curve data for trade signal generation (inversion)
    +        self.yield_curve_symbol = algorithm.add_data(USTreasuryYieldCurveRate, "USTYCR").symbol
    +
    +        # Historical data
    +        history = algorithm.history(self.yield_curve_symbol, 60, Resolution.DAILY)
    +        algorithm.debug(f"We got {len(history)} items from our history request")
    +
    +    def update(self, algorithm: QCAlgorithm, slice: Slice) -> List[Insight]:
    +        # Trade only based on updated yield curve data
    +        if not (slice.contains_key(self.yield_curve_symbol) and self.spy_symbol is not None):
    +            return []
    +        rates = slice[self.yield_curve_symbol]
    +        
    +        # Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    +        if (slice.time - self.last_inversion < timedelta(days=365)):
    +            return []
    +        
    +        # Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    +        # But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    +        # if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    +        if (not algorithm.portfolio.invested and rates.two_year > rates.ten_year):
    +            algorithm.debug(f"{slice.time} - Yield curve inversion! Shorting the market for two years")
    +            self.last_inversion = slice.time
    +            return [Insight.price(self.spy_symbol, slice.time + timedelta(days=2*365), InsightDirection.DOWN, None, None, None, 0.5)]
    +        return []
    +        
    +    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
    +        for security in changes.added_securities:
    +            self.spy_symbol = security.symbol
    +
    +
    public class USTreasuryYieldCurveDataAlgorithm : QCAlgorithm
    +{
    +    public override void Initialize()
    +    {
    +        SetStartDate(2024, 9, 1);
    +        SetEndDate(2024, 12, 31);
    +        SetCash(100000);
    +
    +        UniverseSettings.Resolution = Resolution.Hour;
    +        // Universe only have SPY as the market representative for trading
    +        var symbols = new[] {QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA)};
    +        AddUniverseSelection(new ManualUniverseSelectionModel(symbols));
    +        // Custom alpha model that emit insight according to US Treasury data
    +        AddAlpha(new USTreasuryAlphaModel(this));
    +        // Use insight weighting PCM to limit the size of investment, reduce the fluctuation of the portfolio value
    +        SetPortfolioConstruction(new InsightWeightingPortfolioConstructionModel((time) => null));
    +    }
    +}
    +
    +public class USTreasuryAlphaModel : AlphaModel
    +{
    +    private Symbol? _spySymbol = null;
    +    private Symbol _yieldCurveSymbol;
    +    private DateTime _lastInversion = DateTime.MinValue;
    +    
    +    public USTreasuryAlphaModel(QCAlgorithm algorithm)
    +    {
    +        // Requesting yield curve data for trade signal generation (inversion)
    +        _yieldCurveSymbol = algorithm.AddData<USTreasuryYieldCurveRate>("USTYCR").Symbol;
    +
    +        // Historical data
    +        var history = algorithm.History<USTreasuryYieldCurveRate>(_yieldCurveSymbol, 60, Resolution.Daily);
    +        algorithm.Debug($"We got {history.Count()} items from our history request");
    +    }
    +
    +    public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice slice)
    +    {
    +        var insights = new List<Insight>();
    +
    +        // Trade only based on updated yield curve data
    +        if (!slice.TryGetValue(_yieldCurveSymbol, out var rates) || _spySymbol == null)
    +        {
    +            return insights;
    +        }
    +        
    +        // Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    +        if (slice.Time - _lastInversion < TimeSpan.FromDays(365))
    +        {
    +            return insights;
    +        }
    +        
    +        // Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    +        // But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    +        // if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    +        if (!algorithm.Portfolio.Invested && rates.TwoYear > rates.TenYear)
    +        {
    +            algorithm.Debug($"{slice.Time} - Yield curve inversion! Shorting the market for two years");
    +            _lastInversion = slice.Time;
    +            insights.Add(Insight.Price(_spySymbol, slice.Time + TimeSpan.FromDays(2*365), InsightDirection.Down, null, null, null, 0.5));
    +        }
    +        
    +        return insights;
    +    }
    +
    +    public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)
    +    {
    +        foreach (var security in changes.AddedSecurities)
    +        {
    +            _spySymbol = security.Symbol;
    +        }
    +    }
    +}
    +
    + + + +

    Data Point Attributes

    + + +

    + The US Treasury Yield Curve dataset provides + + USTreasuryYieldCurveRate + + objects, which have the following attributes: +

    +
    +
    + + + +

     

    + +
    +
    +

    Datasets

    +

    US Bureau of Economic Analysis

    +
    +
    + + +
    + + + +

     

    + +
    +
    +

    US Bureau of Economic Analysis

    +

    GDP by Industry

    +
    +
    +

    Introduction

    + + +

    + The GDP by Industry dataset by the US Bureau of Economic Analysis (BEA) breaks US gross domestic product down by industry, showing how much each industry contributes to output through its value added, gross output, and intermediate inputs. The data covers 100 US industries, starts in January 2005, and is delivered on a quarterly cadence. This dataset is created by processing the official BEA Industry Economic Accounts from the public BEA API. +

    +

    + For more information about the GDP by Industry dataset, including CLI commands and pricing, see the + + dataset listing + + . +

    +

    +

    + + + +

    About the Provider

    + + +

    + The Bureau of Economic Analysis (BEA) is an agency of the US Department of Commerce that produces the nation's official economic statistics, including gross domestic product. Through its Industry Economic Accounts, the BEA measures how each industry contributes to the economy and publishes the results as a public record, released free of charge through the BEA API. +

    + + + +

    Getting Started

    + + +

    + The following snippet demonstrates how to request data from the GDP by Industry dataset: +

    +
    +
    self.dataset_symbol = self.add_data(BEAGDPByIndustry, BEA.Industries.MANUFACTURING, Resolution.DAILY).symbol
    +
    _datasetSymbol = AddData<BEAGDPByIndustry>(BEA.Industries.Manufacturing, Resolution.Daily).Symbol;
    +
    + + + +

    Data Summary

    + + +

    + The following table describes the dataset properties: +

    + + + + + + + + + + + + + + + @@ -363613,7 +366947,7 @@

    Data Summary

    Resolution @@ -363626,6 +366960,9 @@

    Data Summary

    + Property + + Value +
    + Start Date + + January 2005
    - Coverage + Data Points - 1 Dataset + 8,500 +
    + Asset Coverage + + 100 US Industries
    - Daily + Daily*
    +

    + * The BEA publishes these accounts quarterly. We check the source daily and deliver each release on the day it lands. +

    @@ -363633,38 +366970,46 @@

    Requesting Data

    - To add US Treasury Yield Curve data to your algorithm, call the + To add GDP by Industry data to your algorithm, call the AddData add_data - method. Save a reference to the dataset + method. The dataset is unlinked, so you pass a BEA industry code from the + + BEA.Industries + + helper instead of a security + + Symbol + + . Save a reference to the dataset Symbol so you can access the data later in your algorithm.

    -
    class QuiverCongressDataAlgorithm(QCAlgorithm):
    +   
    class BEAGDPByIndustryDataAlgorithm(QCAlgorithm):
         def initialize(self) -> None:
             self.set_start_date(2019, 1, 1)
    -        self.set_end_date(2020, 6, 1)
    +        self.set_end_date(2020, 12, 31)
             self.set_cash(100000)
     
    -        self.dataset_symbol = self.add_data(USTreasuryYieldCurveRate, "USTYCR").symbol
    -
    public class USTreasuryYieldCurveDataAlgorithm : QCAlgorithm
    +        self.dataset_symbol = self.add_data(BEAGDPByIndustry, BEA.Industries.MANUFACTURING, Resolution.DAILY).symbol
    +
    public class BEAGDPByIndustryDataAlgorithm : QCAlgorithm
     {
         private Symbol _datasetSymbol;
     
         public override void Initialize()
         {
             SetStartDate(2019, 1, 1);
    -        SetEndDate(2020, 6, 1);
    +        SetEndDate(2020, 12, 31);
             SetCash(100000);
     
    -        _datasetSymbol = AddData<USTreasuryYieldCurveRate>("USTYCR").Symbol;
    +        _datasetSymbol = AddData<BEAGDPByIndustry>(BEA.Industries.Manufacturing, Resolution.Daily).Symbol;
         }
     }
    @@ -363675,7 +367020,7 @@

    Accessing Data

    - To get the current US Treasury Yield Curve data, index the current + To get the current GDP by Industry data, index the current Slice @@ -363685,7 +367030,11 @@

    Accessing Data

    Symbol - . Slice objects deliver unique events to your algorithm as they happen, but the + . + + Slice + + objects deliver unique events to your algorithm as they happen, but the Slice @@ -363699,16 +367048,40 @@

    Accessing Data

    def on_data(self, slice: Slice) -> None:
         if slice.contains_key(self.dataset_symbol):
             data_point = slice[self.dataset_symbol]
    -        self.log(f"{self.dataset_symbol} one month value at {slice.time}: {data_point.one_month}")
    + self.log(f"{self.dataset_symbol} value added at {slice.time}: {data_point.value_added}")
    public override void OnData(Slice slice)
     {
         if (slice.ContainsKey(_datasetSymbol))
         {
             var dataPoint = slice[_datasetSymbol];
    -        Log($"{_datasetSymbol} one month value at {slice.Time}: {dataPoint.OneMonth}");
    +        Log($"{_datasetSymbol} value added at {slice.Time}: {dataPoint.ValueAdded}");
         }
    -}
    -
    +} + +

    + To iterate through all of the dataset objects in the current + + Slice + + , call the + + Get + + method. +

    +
    +
    def on_data(self, slice: Slice) -> None:
    +    for dataset_symbol, data_point in slice.get(BEAGDPByIndustry).items():
    +        self.log(f"{dataset_symbol} value added at {slice.time}: {data_point.value_added}")
    +
    public override void OnData(Slice slice)
    +{
    +    foreach (var kvp in slice.Get<BEAGDPByIndustry>())
    +    {
    +        var datasetSymbol = kvp.Key;
    +        var dataPoint = kvp.Value;
    +        Log($"{datasetSymbol} value added at {slice.Time}: {dataPoint.ValueAdded}");
    +    }
    +}
    @@ -363717,26 +367090,23 @@

    Historical Data

    - To get historical US Treasury Yield Curve data, call the - + To get historical GDP by Industry data, call the + History - - history - method with the dataset Symbol - . If there is no data in the period you request, the history result is empty. + . If there is no data in the period you request, the history result is empty. The accounts are quarterly, so a request counted in daily bars covers far fewer data points than the number you pass.

    # DataFrame
     history_df = self.history(self.dataset_symbol, 100, Resolution.DAILY)
     
     # Dataset objects
    -history_bars = self.history[USTreasuryYieldCurveRate](self.dataset_symbol, 100, Resolution.DAILY)
    -
    var history = History<USTreasuryYieldCurveRate>(_datasetSymbol, 100, Resolution.Daily);
    +history_bars = self.history[BEAGDPByIndustry](self.dataset_symbol, 100, Resolution.DAILY) +
    var history = History<BEAGDPByIndustry>(_datasetSymbol, 100, Resolution.Daily);

    For more information about historical data, see @@ -363752,13 +367122,10 @@

    Remove Subscriptions

    - To remove your subscription to US Treasury Yield Curve data, call the - + To remove your subscription to GDP by Industry data, call the + RemoveSecurity - - remove_security - method.

    @@ -363768,127 +367135,209 @@

    Remove Subscriptions

    +

    Supported Industries

    + + +

    + Every industry in the accounts has a readable named constant in the + + BEA.Industries + + helper, which resolves to the BEA NAICS-based industry code you pass to + + AddData + + + add_data + + . Type + + BEA.Industries. + + in the editor and autocomplete will list them all. The following table shows a few examples: +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Constant + + Industry +
    + + BEA.Industries.Manufacturing + + + BEA.Industries.MANUFACTURING + + + Manufacturing +
    + + BEA.Industries.Construction + + + BEA.Industries.CONSTRUCTION + + + Construction +
    + + BEA.Industries.FinanceAndInsurance + + + BEA.Industries.FINANCE_AND_INSURANCE + + + Finance and insurance +
    + + BEA.Industries.RetailTrade + + + BEA.Industries.RETAIL_TRADE + + + Retail trade +
    + + BEA.Industries.OilAndGasExtraction + + + BEA.Industries.OIL_AND_GAS_EXTRACTION + + + Oil and gas extraction +
    + + BEA.Industries.GrossDomesticProduct + + + BEA.Industries.GROSS_DOMESTIC_PRODUCT + + + Gross domestic product (all industries) +
    +

    + Not every metric applies to every industry in every quarter, so a field can be empty. The fields are nullable, so check for a missing value before you use it. +

    + + +

    Example Applications

    - The US Treasury Yield Curve dataset enables you to monitor the yields of bonds with numerous maturities in your strategies. Examples include the following strategies: + The GDP by Industry dataset lets you trade on the composition of growth instead of just its headline. Examples include the following strategies:

    • - Short selling SPY when the yield curve inverts + Rotating into cyclical exposure when an industry's real value added turns up quarter over quarter, and out when it turns down.
    • - Buying short-term Treasuries and short selling long-term Treasuries when the yield curve becomes steeper (aka curve steepener trade) + Ranking industries by the change in real gross output to tilt a sector portfolio toward the fastest-growing parts of the economy. +
    • +
    • + Reading an industry's price index as an industry-level inflation gauge to time rate-sensitive positions.

    Classic Algorithm Example

    - The following example algorithm short sells SPY for two years when the yield curve inverts: + The following example algorithm uses BEA GDP by Industry as a macro signal. It reads Manufacturing real value added each quarter and buys SPY when it rises quarter over quarter, then moves to cash when it falls.

    from AlgorithmImports import *
     
    -
    -class USTreasuryDataAlgorithm(QCAlgorithm):
    -
    -    def initialize(self) -> None:
    -
    -        self.set_start_date(2024, 9, 1)
    -        self.set_end_date(2024, 12, 31)
    +class BEAGDPByIndustryDataAlgorithm(QCAlgorithm):
    +    def initialize(self):
    +        self.set_start_date(2019, 1, 1)
    +        self.set_end_date(2020, 12, 31)
             self.set_cash(100000)
     
    -        # Request SPY as the market representative for trading
    -        self.spy_symbol = self.add_equity("SPY", Resolution.HOUR).symbol
    -
    -        # Requesting yield curve data for trade signal generation (inversion)
    -        self.yield_curve_symbol = self.add_data(USTreasuryYieldCurveRate, "USTYCR").symbol
    -
    -        # Historical data
    -        history = self.history(USTreasuryYieldCurveRate, self.yield_curve_symbol, 60, Resolution.DAILY)
    -        self.debug(f"We got {len(history)} items from our history request")
    -        
    -        self.last_inversion = datetime.min
    +        self._spy = self.add_equity("SPY", Resolution.DAILY).symbol
    +        self._manufacturing = self.add_data(BEAGDPByIndustry, BEA.Industries.MANUFACTURING, Resolution.DAILY).symbol
    +        self._previous_real_value_added = None
     
    -    def on_data(self, slice: Slice) -> None:
    -        # Trade only based on updated yield curve data
    -        if not slice.contains_key(self.yield_curve_symbol):
    -            return
    -        rates = slice[self.yield_curve_symbol]
    -        
    -        # Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    -        if (self.time - self.last_inversion < timedelta(days=365)):
    +    def on_data(self, slice):
    +        if not slice.contains_key(self._manufacturing):
                 return
     
    -        # Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    -        # But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    -        # if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    -        if (not self.portfolio.invested and rates.two_year > rates.ten_year):
    -            self.debug(f"{self.time} - Yield curve inversion! Shorting the market for two years")
    -            self.set_holdings(self.spy_symbol, -0.5)
    -            self.last_inversion = self.time
    -            return
    -        
    -        # If two years have passed, liquidate our position in SPY assuming the market starts resilience
    -        if (self.time - self.last_inversion >= timedelta(days=365 * 2)):
    -            self.liquidate(self.spy_symbol)
    -
    public class USTreasuryDataAlgorithm : QCAlgorithm
    +        # Real value added rising quarter over quarter is expansionary: go long, otherwise flat.
    +        real = slice[self._manufacturing].real_value_added
    +        if self._previous_real_value_added is not None and real is not None:
    +            if real > self._previous_real_value_added:
    +                self.set_holdings(self._spy, 1)
    +            else:
    +                self.liquidate(self._spy)
    +        self._previous_real_value_added = real
    +
    public class BEAGDPByIndustryDataAlgorithm : QCAlgorithm
     {
    -    private Symbol _spySymbol;
    -    private Symbol _yieldCurveSymbol;
    -    private DateTime _lastInversion = DateTime.MinValue;
    -    
    +    private Symbol _spy, _manufacturing;
    +    private decimal? _previousRealValueAdded;
    +
         public override void Initialize()
         {
    -        SetStartDate(2024, 9, 1);
    -        SetEndDate(2024, 12, 31);
    +        SetStartDate(2019, 1, 1);
    +        SetEndDate(2020, 12, 31);
             SetCash(100000);
     
    -        // Request SPY as the market representative for trading
    -        _spySymbol = AddEquity("SPY", Resolution.Hour).Symbol;
    -
    -        // Requesting yield curve data for trade signal generation (inversion)
    -        _yieldCurveSymbol = AddData<USTreasuryYieldCurveRate>("USTYCR").Symbol;
    -
    -        // Historical data
    -        var history = History<USTreasuryYieldCurveRate>(_yieldCurveSymbol, 60, Resolution.Daily);
    -        Debug($"We got {history.Count()} items from our history request");
    +        _spy = AddEquity("SPY", Resolution.Daily).Symbol;
    +        _manufacturing = AddData<BEAGDPByIndustry>(BEA.Industries.Manufacturing, Resolution.Daily).Symbol;
         }
    -    
    -    
    +
         public override void OnData(Slice slice)
         {
    -        // Trade only based on updated yield curve data
    -        if (!slice.TryGetValue(_yieldCurveSymbol, out var rates))
    -        {
    -            return;
    -        }
    -        
    -        // Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    -        if (Time - _lastInversion < TimeSpan.FromDays(365))
    +        if (!slice.ContainsKey(_manufacturing))
             {
                 return;
             }
    -        
    -        // Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    -        // But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    -        // if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    -        if (!Portfolio.Invested && rates.TwoYear > rates.TenYear)
    -        {
    -            Debug($"{Time} - Yield curve inversion! Shorting the market for two years");
    -            SetHoldings(_spySymbol, -0.5); 
    -                _lastInversion = Time;
    -            return;
    -        }
    -        
    -        
    -        // If two years have passed, liquidate our position in SPY assuming the market starts resilience
    -        if (Time - _lastInversion >= TimeSpan.FromDays(365 * 2))
    +
    +        // Real value added rising quarter over quarter is expansionary: go long, otherwise flat.
    +        var real = slice.Get<BEAGDPByIndustry>(_manufacturing).RealValueAdded;
    +        if (_previousRealValueAdded.HasValue && real.HasValue)
             {
    -            Liquidate(_spySymbol);
    +            if (real > _previousRealValueAdded)
    +            {
    +                SetHoldings(_spy, 1);
    +            }
    +            else
    +            {
    +                Liquidate(_spy);
    +            }
             }
    +        _previousRealValueAdded = real;
         }
     }
    @@ -363896,126 +367345,93 @@

    Framework Algorithm Example

    - The following example algorithm short sells SPY for two years when the yield curve inverts: + The following example algorithm implements the same Manufacturing signal in the algorithm framework. It uses a manual universe of SPY, an alpha model that emits insights from BEA GDP by Industry, and equal-weighting portfolio construction.

    from AlgorithmImports import *
     
    -
    -class USTreasuryDataAlgorithm(QCAlgorithm):
    -
    -    def initialize(self) -> None:
    -        self.set_start_date(2024, 9, 1)
    -        self.set_end_date(2024, 12, 31)
    +class BEAGDPByIndustryFrameworkAlgorithm(QCAlgorithm):
    +    def initialize(self):
    +        self.set_start_date(2019, 1, 1)
    +        self.set_end_date(2020, 12, 31)
             self.set_cash(100000)
     
    -        self.universe_settings.resolution = Resolution.HOUR
    -        # Universe only have SPY as the market representative for trading
    +        self.universe_settings.resolution = Resolution.DAILY
             symbols = [Symbol.create("SPY", SecurityType.EQUITY, Market.USA)]
    -        self.add_universe_selection(ManualUniverseSelectionModel(symbols))   
    -        # Custom alpha model that emit insight according to US Treasury data
    -        self.add_alpha(USTreasuryAlphaModel(self))
    -        # Use insight weighting PCM to limit the size of investment, reduce the fluctuation of the portfolio value
    -        self.set_portfolio_construction(InsightWeightingPortfolioConstructionModel(lambda time: None))
    -        
    +        self.set_universe_selection(ManualUniverseSelectionModel(symbols))
    +        self.add_alpha(BEAGDPByIndustryAlphaModel(self))
    +        self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
     
    -class USTreasuryAlphaModel(AlphaModel):
    +class BEAGDPByIndustryAlphaModel(AlphaModel):
    +    def __init__(self, algorithm):
    +        self._manufacturing = algorithm.add_data(BEAGDPByIndustry, BEA.Industries.MANUFACTURING, Resolution.DAILY).symbol
    +        self._previous_real_value_added = None
    +        self._tradable_symbols = []
     
    -    spy_symbol = None
    -    last_inversion = datetime.min
    -    
    -    def __init__(self, algorithm: QCAlgorithm) -> None:
    -        # Requesting yield curve data for trade signal generation (inversion)
    -        self.yield_curve_symbol = algorithm.add_data(USTreasuryYieldCurveRate, "USTYCR").symbol
    +    def update(self, algorithm, slice):
    +        insights = []
    +        if not slice.contains_key(self._manufacturing):
    +            return insights
     
    -        # Historical data
    -        history = algorithm.history(self.yield_curve_symbol, 60, Resolution.DAILY)
    -        algorithm.debug(f"We got {len(history)} items from our history request")
    +        real = slice[self._manufacturing].real_value_added
    +        if self._previous_real_value_added is not None and real is not None:
    +            direction = InsightDirection.UP if real > self._previous_real_value_added else InsightDirection.DOWN
    +            insights = [Insight.price(symbol, timedelta(days=90), direction) for symbol in self._tradable_symbols]
    +        self._previous_real_value_added = real
    +        return insights
     
    -    def update(self, algorithm: QCAlgorithm, slice: Slice) -> List[Insight]:
    -        # Trade only based on updated yield curve data
    -        if not (slice.contains_key(self.yield_curve_symbol) and self.spy_symbol is not None):
    -            return []
    -        rates = slice[self.yield_curve_symbol]
    -        
    -        # Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    -        if (slice.time - self.last_inversion < timedelta(days=365)):
    -            return []
    -        
    -        # Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    -        # But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    -        # if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    -        if (not algorithm.portfolio.invested and rates.two_year > rates.ten_year):
    -            algorithm.debug(f"{slice.time} - Yield curve inversion! Shorting the market for two years")
    -            self.last_inversion = slice.time
    -            return [Insight.price(self.spy_symbol, slice.time + timedelta(days=2*365), InsightDirection.DOWN, None, None, None, 0.5)]
    -        return []
    -        
    -    def on_securities_changed(self, algorithm: QCAlgorithm, changes: SecurityChanges) -> None:
    +    def on_securities_changed(self, algorithm, changes):
             for security in changes.added_securities:
    -            self.spy_symbol = security.symbol
    -
    -
    public class USTreasuryYieldCurveDataAlgorithm : QCAlgorithm
    +            if security.symbol != self._manufacturing:
    +                self._tradable_symbols.append(security.symbol)
    +        for security in changes.removed_securities:
    +            if security.symbol in self._tradable_symbols:
    +                self._tradable_symbols.remove(security.symbol)
    +
    public class BEAGDPByIndustryFrameworkAlgorithm : QCAlgorithm
     {
         public override void Initialize()
         {
    -        SetStartDate(2024, 9, 1);
    -        SetEndDate(2024, 12, 31);
    +        SetStartDate(2019, 1, 1);
    +        SetEndDate(2020, 12, 31);
             SetCash(100000);
     
    -        UniverseSettings.Resolution = Resolution.Hour;
    -        // Universe only have SPY as the market representative for trading
    -        var symbols = new[] {QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA)};
    -        AddUniverseSelection(new ManualUniverseSelectionModel(symbols));
    -        // Custom alpha model that emit insight according to US Treasury data
    -        AddAlpha(new USTreasuryAlphaModel(this));
    -        // Use insight weighting PCM to limit the size of investment, reduce the fluctuation of the portfolio value
    -        SetPortfolioConstruction(new InsightWeightingPortfolioConstructionModel((time) => null));
    +        UniverseSettings.Resolution = Resolution.Daily;
    +        var symbols = new[] { QuantConnect.Symbol.Create("SPY", SecurityType.Equity, Market.USA) };
    +        SetUniverseSelection(new ManualUniverseSelectionModel(symbols));
    +        AddAlpha(new BEAGDPByIndustryAlphaModel(this));
    +        SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
         }
     }
     
    -public class USTreasuryAlphaModel : AlphaModel
    +public class BEAGDPByIndustryAlphaModel : AlphaModel
     {
    -    private Symbol? _spySymbol = null;
    -    private Symbol _yieldCurveSymbol;
    -    private DateTime _lastInversion = DateTime.MinValue;
    -    
    -    public USTreasuryAlphaModel(QCAlgorithm algorithm)
    -    {
    -        // Requesting yield curve data for trade signal generation (inversion)
    -        _yieldCurveSymbol = algorithm.AddData<USTreasuryYieldCurveRate>("USTYCR").Symbol;
    +    private readonly Symbol _manufacturing;
    +    private decimal? _previousRealValueAdded;
    +    private readonly List<Symbol> _tradableSymbols = new();
     
    -        // Historical data
    -        var history = algorithm.History<USTreasuryYieldCurveRate>(_yieldCurveSymbol, 60, Resolution.Daily);
    -        algorithm.Debug($"We got {history.Count()} items from our history request");
    +    public BEAGDPByIndustryAlphaModel(QCAlgorithm algorithm)
    +    {
    +        _manufacturing = algorithm.AddData<BEAGDPByIndustry>(BEA.Industries.Manufacturing, Resolution.Daily).Symbol;
         }
     
         public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice slice)
         {
             var insights = new List<Insight>();
    -
    -        // Trade only based on updated yield curve data
    -        if (!slice.TryGetValue(_yieldCurveSymbol, out var rates) || _spySymbol == null)
    +        if (!slice.ContainsKey(_manufacturing))
             {
                 return insights;
             }
    -        
    -        // Only advance if a year has gone by, since the inversion signal indicates longer term market regime that will not revert in a short period
    -        if (slice.Time - _lastInversion < TimeSpan.FromDays(365))
    -        {
    -            return insights;
    -        }
    -        
    -        // Normally, 10y yield should be greater than 2y yield due to default risk accumulation
    -        // But if an inversion occurs, it means the market expects a recession in short term such that the near-expiry bond is more likely to default
    -        // if there is a yield curve inversion after not having one for a year, short sell SPY for two years for the expected down market
    -        if (!algorithm.Portfolio.Invested && rates.TwoYear > rates.TenYear)
    +
    +        var real = slice.Get<BEAGDPByIndustry>(_manufacturing).RealValueAdded;
    +        if (_previousRealValueAdded.HasValue && real.HasValue)
             {
    -            algorithm.Debug($"{slice.Time} - Yield curve inversion! Shorting the market for two years");
    -            _lastInversion = slice.Time;
    -            insights.Add(Insight.Price(_spySymbol, slice.Time + TimeSpan.FromDays(2*365), InsightDirection.Down, null, null, null, 0.5));
    +            var direction = real > _previousRealValueAdded ? InsightDirection.Up : InsightDirection.Down;
    +            foreach (var symbol in _tradableSymbols)
    +            {
    +                insights.Add(Insight.Price(symbol, TimeSpan.FromDays(90), direction));
    +            }
             }
    -        
    +        _previousRealValueAdded = real;
             return insights;
         }
     
    @@ -364023,7 +367439,14 @@ 

    { foreach (var security in changes.AddedSecurities) { - _spySymbol = security.Symbol; + if (security.Symbol != _manufacturing) + { + _tradableSymbols.Add(security.Symbol); + } + } + foreach (var security in changes.RemovedSecurities) + { + _tradableSymbols.Remove(security.Symbol); } } }

    @@ -364035,13 +367458,13 @@

    Data Point Attributes

    - The US Treasury Yield Curve dataset provides + The GDP by Industry dataset provides - USTreasuryYieldCurveRate + BEAGDPByIndustry objects, which have the following attributes:

    -
    +
    @@ -364049,7 +367472,7 @@

    Data Point Attributes

     

    -
    +

    Datasets

    US Department of Agriculture

    @@ -364067,7 +367490,7 @@

    US Department of Agriculture