The data are limited to ~5000 stocks in US only. Also the download of the data with SimFin libary does not include the most recent quarters
This library provides functionality to analyze financial data and rank companies based on the principles outlined in the book "The Little Book that Still Beats the Market" by Joel Greenblatt. Author: gp1981 with the contribution of ChatGPT4.0
This library provides functionality to analyze financial data and rank companies based on the principles outlined in the book "The Little Book that Still Beats the Market" by J. Greenblatt. The system utilizes data from the SimFin API to analyze and rank stocks based on specific criteria.
The purpose of this project is for educational purposes only. The code provided here is not intended as financial advice and should be used at your own risk.
In "The Little Book that Still Beats the Market," J. Greenblatt outlines a simple stock ranking system called the Magic Formula. The Magic Formula ranks stocks based on two key factors: earnings yield and return on capital. By selecting stocks with high earnings yield and return on capital, the system aims to identify potentially undervalued companies with strong profitability.
The code provided in this repository is for educational purposes only and should not be considered as financial advice. Use the code and any information obtained from it at your own risk. The author and contributors of this repository are not responsible for any investment decisions made based on the code or its output.
To use the code in this repository, you will need an API key from Simfin. The API key should be stored as an environment variable named API_KEY
.
File | Purpose |
---|---|
main.py |
Main script to run the analysis |
utils.py |
Utility functions |
analysis.py |
Analysis functions for stock ranking |
tutorial.py |
Tutorial based on SimFin GitHub Tutorial |
Tutorial_Jupyter.ipynb |
Same tutorial in Jupyter SimFin GitHub Tutorial |
Contributions to this project are welcome! Please follow the guidelines below when making contributions:
If you encounter any issues or have suggestions, please open an issue in the GitHub repository.
When making commits to the repository, please follow these guidelines for writing descriptive commit messages:
- Feat: Use this prefix for new features or enhancements to existing functionality.
- Fix: Use this prefix for bug fixes or resolving issues.
- Docs: Use this prefix for documentation updates or improvements.
- refactor : Use this prefix for code refactoring or restructuring without changing functionality.
- test : Use this prefix for adding or modifying test cases. Please provide a clear and concise description of the changes made in the commit message.
When creating branches, please use descriptive names that indicate the purpose or functionality of the branch. Some common branch naming conventions include:
- Feature-branch-name: Use this prefix for branches that add new features or enhancements.
- Bugfix-branch-name: Use this prefix for branches that fix bugs or resolve issues.
- Refactor-branch-name: Use this prefix for branches that involve code refactoring
- docs-branch-name: Use this prefix for branches that involve documentation updates or improvements. Choose a branch name that clearly represents the purpose of the branch and provides context to other contributors.
tbd