Skip to content

Python code to select a portfolio of stock (data directly grab from Yahoo Finance) and find the composition who optimizes both expected return and volatility

Notifications You must be signed in to change notification settings

neilmruben/Portfolio-optimization-with-Python-and-Interactive-Visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Portfolio-optimization-with-Python-and-Interactive-Visualization

Python code to select a portfolio of stock (data directly grab from Yahoo Finance) and find the composition who optimizes both expected return and volatility Library to use :

-numpy -pandas -matplotlib.pyplot -pandas_datareader -scipy.stats -yfinance

For this code we will use the Modern Portfolio Theory based on H.Markowitz hypothesis (1952). For simplify the calculation we will use this formula of the Sharpe ratio : where we supposed that risk free rate equal to 0 : image

Interactive visualization : image

Correlation Matrix : image

At the end we will have a plot of the x combinaisons calculated by Python with the optimal portfolio :

image

image

image

About

Python code to select a portfolio of stock (data directly grab from Yahoo Finance) and find the composition who optimizes both expected return and volatility

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published