Welcome to the Quantamental Screening GitHub repository. This project aims to classify firms based on Benjamin Graham's criteria as detailed in "The Intelligent Investor" by leveraging financial statement data from the SEC (Securities and Exchange Commission) website. The repository includes multiple methods to retrieve and process this data, enabling robust financial analysis.
This repository utilizes four different methods to connect to the SEC website to retrieve financial statements (balance sheet, income statement, and statement of cash flows) for selected financial metrics (e.g., Revenues, COGS, Goodwill, Current Assets, CFO, CFI) from 10-Q documents for over 8000 unique tickers. These methods allow for the classification of firms based on the following conditions derived from Benjamin Graham's criteria:
- Total revenues >= $2000 million
- Total current assets >= 2 * total current liabilities
- Net current assets >= long-term debt
- EPS growth: last EPS >= 1.33 * previous EPS
- Current price <= 1.5 * BVPS
- Current price <= 2/3 * intrinsic value
- Current ratio between 1.2 and 4
- Multiplier PB <= 22.5
- Total current assets >= 1.5 * total current liabilities
- Net current assets >= total debt * 1.1
- Positive net income
- Current price < 1.2 * TBVPS
Net current asset value >= current price
Utilizes customized URLs to get selected facts for all firms. This method is relatively fast but provides more "instantaneous" data rather than quarterly data, making it useful for market signal adjustments but insufficient for classification due to limited data.
Adjusts URLs based on CIK to scrape selected facts. Recommended for a balance between accuracy and reduced runtime. This method is less precise but faster than the "concept" method.
Creates URLs based on combinations of CIK and fact, generating over 300,000 unique URLs. This method is the most precise and suitable for historical data but requires the longest runtime.
Naive method that scrapes the SEC website by identifying patterns in the URLs of the 10-Q reports and extracting account numbers from the HTML source. This method is detailed and customizable. Initially tested on 20 firms, but more can be added. It's highly detailed but requires customization for additional firms and facts.
- CompanyScreeningTechniques.ipynb: Combines all methods into a single workflow.
- CompanyFrames.ipynb: Implementation of the "frames" method.
- CompanyFacts.ipynb: Implementation of the "facts" method.
- CompanyConcept.ipynb: Implementation of the "concept" method.
- CompanySeleniumMultiple.ipynb: Implementation of the "selenium" method for multiple firms.
- CompanySeleniumSingle.ipynb: Test file for single firm using the "selenium" method.
- Quantamental_functions.py: Contains all functions used in the Jupyter notebooks.
- DataRaw: Contains the Excel file with all selected facts.
- DataDerived: Contains all pickle files for quick data loading.
- DataSummaries: Contains Excel files with classification results for each method and a comprehensive classification analysis (by method, industry, market cap bucket and P/E ratio bucket).
- Clone the repository:
git clone https://github.com/miindisponi99/Quantamental-Screening.git
- Navigate to the repository:
cd Quantamental-Screening
- Run the Jupyter notebooks to perform firm classifications using your preferred method.
- Single firm classification is possible by searching for the company name and CIK using any of the methods.
- All methods save their output in pickle format for quick reloading and analysis.
- Detailed analysis and classifications are available in the
DataSummaries
folder.
Contributions are welcome! Please feel free to submit issues or pull requests.
This project is licensed under the MIT License.
I hope you find this project useful for your financial analysis needs. If you have any questions or feedback, please open an issue in this repository.
Happy Screening!