Securities and Exchange Commission

US SEC Filings

Introduction

The US SEC Filings dataset provides the quarterly financial earning reports that the United States Securities and Exchange Commission (SEC) requires from publicly traded companies in the US. The data covers 15,000 US Equities, starts in January 1998, and is delivered on a daily frequency. The data is sourced from the SEC's Electronic Data Gathering, Analysis, and Retrieval (EDGAR) system. QuantConnect downloads and formats the Quarterly Financial Reports (10-Q) and Annual Financial Report (8-K) filings of companies into a format for easy consumption by LEAN.

For more information about the US SEC Filings dataset, including CLI commands and pricing, see the dataset listing.

About the Provider

The mission of the U.S. Securities and Exchange Commission is to protect investors, maintain fair, orderly, and efficient markets, and facilitate capital formation. The SEC oversees the key participants in the securities world, including securities exchanges, securities brokers and dealers, investment advisors, and mutual funds. The SEC is concerned primarily with promoting the disclosure of important market-related information, maintaining fair dealing, and protecting against fraud.

Getting Started

The following snippet demonstrates how to request data from the US SEC Filings dataset:

self.symbol = self.AddEquity("AAPL", Resolution.Minute).Symbol
self.report_8k_symbol = self.AddData(SECReport8K, self.symbol).Symbol
self.report_10k_symbol = self.AddData(SECReport10K, self.symbol).Symbol
self.report_10q_symbol = self.AddData(SECReport10Q, self.symbol).Symbol
_symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
_report8KSymbol = AddData<SECReport8K>(_symbol, Resolution.Daily).Symbol;
_report10KSymbol = AddData<SECReport10K>(_symbol, Resolution.Daily).Symbol;
_report10QSymbol = AddData<SECReport10Q>(_symbol, Resolution.Daily).Symbol;

Data Summary

The following table describes the dataset properties:

PropertyValue
Start DateJanuary 1998
Asset Coverage15,000 US Equities
Data DensitySparse
ResolutionDaily
TimezoneUTC

Data Point Attributes

The US SEC Filings dataset provides SECReport8K, SECReport10K, and SECReport10Q objects.

Report 8K Attributes

SECReport8K objects have the following attributes:

Report 10K Attributes

SECReport10K objects have the following attributes:

Report 10Q Attributes

SECReport10Q objects have the following attributes:

Requesting Data

To add US SEC Filings data to your algorithm, call the AddData method. Save a reference to the dataset Symbol so you can access the data later in your algorithm.

class SECReportAlgorithm(QCAlgorithm):
    def Initialize(self) -> None:
        self.SetStartDate(2019, 1, 1)
        self.SetEndDate(2019, 8, 21)
        self.SetCash(100000)

        self.symbol = self.AddEquity("AAPL", Resolution.Minute).Symbol
        self.report_8k_symbol = self.AddData(SECReport8K, self.symbol).Symbol
        self.report_10k_symbol = self.AddData(SECReport10K, self.symbol).Symbol
        self.report_10q_symbol = self.AddData(SECReport10Q, self.symbol).Symbol
namespace QuantConnect
{
    public class SECReportAlgorithm : QCAlgorithm
    {
        private Symbol _symbol, _report8KSymbol, _report10KSymbol, _report10QSymbol;

        public override void Initialize()
        {
            SetStartDate(2019, 1, 1);
            SetEndDate(2019, 8, 21);
            SetCash(100000);

            _symbol = AddEquity("AAPL", Resolution.Daily).Symbol;
            _report8KSymbol = AddData<SECReport8K>(_symbol, Resolution.Daily).Symbol;
            _report10KSymbol = AddData<SECReport10K>(_symbol, Resolution.Daily).Symbol;
            _report10QSymbol = AddData<SECReport10Q>(_symbol, Resolution.Daily).Symbol;
        }
    }
}

Accessing Data

To get the current US SEC Filings 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 OnData(self, slice: Slice) -> None:
    if slice.ContainsKey(self.report_8k_symbol):
        data_point = slice[self.report_8k_symbol]
        self.Log(f"{self.report_8k_symbol} report count at {slice.Time}: {len(data_point.Report.Documents)}")

    if slice.ContainsKey(self.report_10k_symbol):
        data_point = slice[self.report_10k_symbol]
        self.Log(f"{self.report_10k_symbol} report count at {slice.Time}: {len(data_point.Report.Documents)}")

    if slice.ContainsKey(self.report_10q_symbol):
        data_point = slice[self.report_10q_symbol]
        self.Log(f"{self.report_10q_symbol} report count at {slice.Time}: {len(data_point.Report.Documents)}")
public override void OnData(Slice slice)
{
    if (slice.ContainsKey(_report8KSymbol))
    {
        var dataPoint = slice[_report8KSymbol];
        Log($"{_report8KSymbol} report count at {slice.Time}: {data_point.Report.Documents.Count}");
    }

    if (slice.ContainsKey(_report10KSymbol))
    {
        var dataPoint = slice[_report10KSymbol];
        Log($"{_report10KSymbol} report count at {slice.Time}: {data_point.Report.Documents.Count}");
    }

    if (slice.ContainsKey(_report10QSymbol))
    {
        var dataPoint = slice[_report10QSymbol];
        Log($"{_report10QSymbol} report count at {slice.Time}: {data_point.Report.Documents.Count}");
    }
}

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

def OnData(self, slice: Slice) -> None:
    for dataset_symbol, data_point in slice.Get(SECReport8K).items():
        self.Log(f"{dataset_symbol} report count at {slice.Time}: {len(data_point.Report.Documents)}")

    for dataset_symbol, data_point in slice.Get(SECReport10K).items():
        self.Log(f"{dataset_symbol} report count at {slice.Time}: {len(data_point.Report.Documents)}")

    for dataset_symbol, data_point in slice.Get(SECReport10Q).items():
        self.Log(f"{dataset_symbol} report count at {slice.Time}: {len(data_point.Report.Documents)}")
public override void OnData(Slice slice)
{
    foreach (var kvp in slice.Get<SECReport8K>())
    {
        var datasetSymbol = kvp.Key;
        var dataPoint = kvp.Value;
        Log($"{datasetSymbol} report count at {slice.Time}: {dataPoint.Report.Documents.Count}");
    }

    foreach (var kvp in slice.Get<SECReport10K>())
    {
        var datasetSymbol = kvp.Key;
        var dataPoint = kvp.Value;
        Log($"{datasetSymbol} report count at {slice.Time}: {dataPoint.Report.Documents.Count}");
    }

    foreach (var kvp in slice.Get<SECReport10Q>())
    {
        var datasetSymbol = kvp.Key;
        var dataPoint = kvp.Value;
        Log($"{datasetSymbol} report count at {slice.Time}: {dataPoint.Report.Documents.Count}");
    }
}

Historical Data

To get historical US SEC Filings 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
report_8k_history_df = self.History(self.report_8k_symbol, 100, Resolution.Daily)
report_10k_history_df = self.History(self.report_10k_symbol, 100, Resolution.Daily)
report_10q_history_df = self.History(self.report_10q_symbol, 100, Resolution.Daily)
history_df = self.History([self.report_8k_symbol, 
                           self.report_10k_symbol,
                           self.report_10q_symbol], 100, Resolution.Daily)

# Dataset objects
report_8k_history_bars = self.History[SECReport8K](self.report_8k_symbol, 100, Resolution.Daily)
report_10k_history_bars = self.History[SECReport10K](self.report_10k_symbol, 100, Resolution.Daily)
report_10q_history_bars = self.History[SECReport10Q](self.report_10q_symbol, 100, Resolution.Daily)
// Dataset objects
var report8KHistory = History<SECReport8K>(_report8KSymbol, 100, Resolution.Daily);
var report10KHistory = History<SECReport10K>(_report10KSymbol, 100, Resolution.Daily);
var report10QHistory = History<SECReport10Q>(_report10QSymbol, 100, Resolution.Daily);

// Slice objects
var history = History(new[] {_report8KSymbol, _report10KSymbol, _report10QSymbol}, 100, Resolution.Daily);

For more information about historical data, see History Requests.

Remove Subscriptions

To remove a subscription, call the RemoveSecurity method.

self.RemoveSecurity(self.report_8k_symbol)
self.RemoveSecurity(self.report_10k_symbol)
self.RemoveSecurity(self.report_10q_symbol)
RemoveSecurity(_report8KSymbol);
RemoveSecurity(_report10KSymbol);
RemoveSecurity(_report10QSymbol);

If you subscribe to US SEC Filings 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 SEC Filings dataset enables you to create strategies using information from SEC reports. Examples include the following strategies:

  • Extracting information about corporate earnings from the documents for further analysis
  • Applying sentiment analysis to the text content of the documents (for example, keyword scoring and ranking)

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: