On this example we will apply the Efficient Frontier implementation using MonteCarlo Simulations from the Modern Portfolio Theory (MPT) to define and optimize 2 portfolio examples. One by reducing volatility and other by getting optimal Sharpe Ratio.
Try it here.
- Define a portfolio of 4 assets on the sidebar and select the start date for the data retreival.
- Implement a MonteCarlo Simulation (limited to 10000 due computational efficiency for the example) to get the Efficient Frontier.
- We will get the metrics and weights for an Optimal Sharpe Portfolio and a Minimum Variance Portfolio (less volatility).
- Notice the optimal portfolios might have less than the inital assets introduced!
- For the example data is gathered using Yahoo! Finance. Use that ticker format. Ex: S&P500 = ^GSPC or YPFD.BA, BBVA.MC for local markets.
- Note this is a public example, some capabilities are limited to simplify the app. If you have a doubt or you wish any other usage, get in touch.
- Limitations: Number of iteration for MCS, number of assets, dates, data source, metrics to get specific porftolios other than Sharpe and Volatility, etc.
- If you've got any feedback or comment, I'll be happy to read it ;).
- For this examples, ideas and more contact here.
- Cf. Markowitz, Harry (1952): “Portfolio Selection.” Journal of Finance, Vol. 7, 77-91.
- Hilpisch, Yves (2015): “Python For Finance. Analyze Big Financial Data”.
- Rothwell, Kevin (2020): “Applied Financial Advice and Wealth Management”
- Streamlit documentation