About US SEC Filings

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.


About Securities and Exchange Commission

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.


About QuantConnect

QuantConnect was founded in 2012 to serve quants everywhere with the best possible algorithmic trading technology. Seeking to disrupt a notoriously closed-source industry, QuantConnect takes a radically open-source approach to algorithmic trading. Through the QuantConnect web platform, more than 50,000 quants are served every month.


Algorithm Example

class SECReport8KAlgorithm(QCAlgorithm):

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

        self.mappings = {}
        self.UniverseSettings.Resolution = Resolution.Minute
        self.AddUniverse(self.CoarseSelector)

        # Request underlying equity data.
        ibm = self.AddEquity("IBM", Resolution.Minute).Symbol
        # Add news data for the underlying IBM asset
        earningsFiling = self.AddData(SECReport10Q, ibm, Resolution.Daily).Symbol
        # Request 120 days of history with the SECReport10Q IBM custom data Symbol
        history = self.History(SECReport10Q, earningsFiling, 120, Resolution.Daily)
        # Count the number of items we get from our history request
        self.Debug(f"We got {len(history)} items from our history request")

    def CoarseSelector(self, coarse: List[CoarseFundamental]) -> List[Symbol]:
        coarse = sorted([cf for cf in coarse if cf.HasFundamentalData],
            key=lambda cf: cf.DollarVolume, reverse=True)[:10]
        return [cf.Symbol for cf in coarse]

    def OnData(self, slice: Slice) -> None:
        # Store the symbols we want to long in a list
        # so that we can have an equal-weighted portfolio
        longEquitySymbols = []

        # Get all SEC data and loop over it
        for report in slice.Get(SECReport8K).Values:
            # Get the length of all contents contained within the report
            reportTextLength = sum([len(i.Text) for i in report.Report.Documents])

            if reportTextLength > 20000:
                longEquitySymbols.append(report.Symbol.Underlying)

        for equitySymbol in longEquitySymbols:
            self.SetHoldings(equitySymbol, 1.0 / len(longEquitySymbols))

    def OnSecuritiesChanged(self, changes: SecurityChanges) -> None:
        for symbol in [s.Symbol for s in changes.AddedSecurities]:
            self.mappings[symbol] = self.AddData(SECReport8K, symbol).Symbol

        for symbol in [s.Symbol for s in changes.RemovedSecurities]:
            # If removed from the universe, liquidate and remove the custom data from the algorithm
            self.Liquidate(symbol)
            reportSymbol = self.mappings.pop(symbol, None)
            if reportSymbol:
                self.RemoveSecurity(reportSymbol)

Example Applications

The US SEC Filings dataset enables you to create strategies using information from SEC reports. Examples include the following strategies: