This project is a portfolio analysis of different sectors within Fintech to better understand the growth, correlations, and profitability of Fintech companies. Through analyzing different calculations such as finding the cumulative returns, 21-day rolling average and standard deviations, Sharpe ratios, and running Monte Carlo simulations, our analysis should provide insights into which sectors/stocks in Fintech would be good investments.
Through our analysis we hope to answer the following questions:
- How does each Fintech sector, and the individual stocks within them, perform over time?
- Which sectors and individual stocks are the best potential investments?
- What are the relationships or correlations between each sector?
- Based on what we learned about the sectors and stocks, if we were to come up with a Fintech portfolio what stocks would we choose?
We currently use yfinance to grab 5 years of closing price data (from the time that the notebook code is ran) for the following sectors if Fintech:
- Paytech
- PayPal
- Square
- MasterCard
- Lending
- LendingTree
- LendingClub
- Black Knight
- Banking
- Fiserv
- Jack Henry and Associates
- FIS (Fidelity National Information Services)
Our project begins by using yfinance to collect 5 years of closing price data from each stock within our chosen Fintech sectors. We then reformat the data to produce the daily returns needed to run the majority of our calculations.
Then we calculate metrics such as the cumulative returns, rolling 21-day averages and standard deviations, betas, and sharpe ratios. Each metric is visualized to better see how each stock or sector compares to each other.
Next we run 5-year and 1-year prediction Monte Carlo simulations where for each prediction length we run even and uneven weight distributed simulations for each sector. The uneven weight distributions are a 50%, 30%, 20% split where each stock within the sector is weighted based on its Sharpe ratio. With the results from the Monte Carlo simulation we describe the 95% confidence intervals assuming we start with a portfolio value of $10,000
Finally, with the insights we gained from the calculations, we create a custom portfolio made up of the highest Sharpe ratio stocks from all sectors. We then run similar calculations by averaging the daily returns of all stocks to get the portfolio's daily returns for 5 years. With the daily returns we calculate annualized metrics and run Monte Carlo simulations to give predictions of how the portfolio might do in 1 or 5 years, again by looking at the 95% confidence intervals for each prediction with different weight distribution.
This is a Python 3.7 project ran using a JupyterLab in a conda dev environment.
The following dependencies are used:
- Jupyter - Running code
- Conda (4.13.0) - Dev environment
- Pandas (1.3.5) - Data analysis
- Matplotlib (3.5.1) - Data visualization
- Numpy (1.21.5) - Data calculations + Pandas support
- hvPlot (0.8.1) - Interactive Pandas plots
- holoviews (1.15.2+) - REQUIRED VERSION Interactive Pandas plots; will cause error without proper version
- Alpaca Trade API (2.3.0) - Required for Monte Carlo simulations
- yfinance (0.1.87) - Data collection
- nbdime (3.1.1) - Fixing merge conflicts in Jupyter notebooks
If you would like to run the program in JupyterLab, install the Anaconda distribution and run jupyter lab
in a conda dev environment.
To ensure that your notebook runs properly you can use the requirements.txt file to create an exact copy of the conda dev environment used to create the notebook.
Create a copy of the conda dev environment with conda create --name myenv --file requirements.txt
Then install the requirements with conda install --name myenv --file requirements.txt
The Jupyter notebook fintech-sector-portfolio-analysis.ipynb will provide all steps of the data collection, preparation, and analysis. Data visualizations are shown inline and accompanying analysis responses are provided.
Note that the data collection and the Monte Carlo simulations change every time that the notebook is ran. The data collection gets data 5 years from the date ran and the Monte Carlo simulations use that data to produce randomized results to predict what the portfolio performance could look like based on that data.
The data collected and shown in the examples were from the time that this project was started - November 2022.
Our presentation slides for this project are in the Resources folder: Fintech-Sector_Analysis-Presentation
Ethan Silvas
Naomy Velasco
Karim Bouzina
Jeff Crabill
This project uses the GNU General Public License