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 Finnhub 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 Finnhub. The API key should be stored as an environment variable named API_KEY
.
File | Purpose |
---|---|
main.R |
Main script to run the analysis |
Functions/api.R |
Functions for interacting with the API |
Functions/utils.R |
Utility functions |
Functions/analysis.R |
Analysis functions for stock ranking |
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.