Disclaimer: The code is provided as-is and the author takes no responsibility for any issues or damages arising from its use.
This repository contains R code to perform fundamental analysis for value investors. It leverages the dplyr
and tidyverse
libraries along with fmpcloudr
to retrieve and analyze financial data from Financialmodelingprep API (fmp). Also, the code retrieves data from Greenblatt's magic formula website which is used for further analysis.
- Analysis: Analyze key financials of a company.
- Benchmarking: Compare a company’s financial metrics with other companies
- Visualization: Produce graphs and charts to perform analysis.
- R (version >= 4.0.0)
- RStudio (optional, but recommended)
- Packages:
dplyr
,tidyverse
,fmpcloudr
,ggplot2
,shiny
(for interactive visualizations)
-
Set up your API Token on : https://www.financialmodelingprep.com
-
Clone the repository:
bash git clone https://github.com/gp1981/fmp_analysis.git cd fmp_analysis
-
Run the script on run_analysis.R:
-
Run the Analysis:
R source('scripts/main.R')
-
Select the companies: Modify the
main.R
script to include the ticker of the company and its competitors.
The folder scripts/
includes the following files:
-
main.R: the main script to perform the analysis
-
utils.R: script of utility functions
-
data_retrieval.R: script to retrieve data from fmp
An up-to-date description of the functions in each file is reported in the project https://github.com/users/gp1981/projects/14/views/1.
Contributions are welcome! Please create a pull request with a detailed description of your changes.
This project is licensed under the MIT License.