The Awesome Retirement Portfolio Projector is a scalable, user friendly application that allows retail investors to do sophisticated predictive modeling for their retirement portfolio.
After answering a series of profile questions, retail investors are able to receive a recommended portfolio and to run statistical simulation on the positions allocated as this recommendation; and get an estimate of their portfolios likely outcome over a specified time horizon. Simulations use historical pricing data from the Alpaca API. Simulations can be run for three different risk profiles - Low, Moderate, and High. Lower risk profiles have their portfolio rebalanced to include higher allocation on fixed income.
The application is a foundation that can be scaled to use a variety of input data sources, customizable expected returns, and limits on the allocation of individual assets. Profile questions can be modified to make a more detailed financial profile around common life scenarios such as debt, dependents, long term care, divorce, and multiple retirement income sources.
Built on Python, this application makes use of the following libraries:
Fire
Questionary
Numpy
Pandas
Voila
SciPy
alpaca_trade_api
sqlalchemy
dotenv
hvPlot
matplotlib
The Alpaca Trade api provides a variety of updated securities and financial information.
All python packages can be installed via PIP in the command line. For the Alpaca API, you will need to create and account and set up an API key at Alpaca
Here is a walk through example of a user who runs a portfolio simulation with a high risk tolerance.
Simply tell the app what stocks you have in your portfolio.
To run the application, install the libraries listed above and run python awesome_tool.py
from the command line.
The application will provide a recommended portfolio based on risk profile. The key elements for the recommendation are:
-
Assure diversification by using multiassets, including a set of diversified ETFs and Funds, that is easily customizable in the Jupyter Notebook.
-
Risk level will be controlled by managing the equity allocation:
- High Risk : 75 - 90%
- Moderate Risk: 40 - 60%
- Low Risk : 5 - 20%
- Weights are optimized for a maximum Sharpe ratio.
The application then runs a Montecarlo simulation based on the historical pricing data of your portfolio:
The number of runs of the Montecarlo Simulation it has been set to 100 for a faster speed in the running of the program. This is easible customizable in Jupyter lab for higher amounts, like 500 or 1000.
Written by fintech team:
- Paola A. Carvajal Almeida Linked In
- Jonathan Woolsey GitHub
- Abiy Mekuria GitHub
- Charles Twitchell Linked In
GPU License