-
Stocks Portfolio Analysis Tool. You may add a custom portfolio that you'd like to analyze against the others.
-
Source Code:
whale_analysis.ipynb
Historical daily returns of several portfolios. The .csv
files will require the following column data:
| Symbol | Date | Closing Price |
Analyze the data to see if any of the portfolios outperform the stock market (i.e., the S&P 500).
-
Calculate and plot daily returns of all sample portfolios.
-
Calculate and plot cumulative returns for all sample portfolios. Does any portfolio outperform the S&P 500?
-
Create a box plot for each of the returns.
-
Calculate the standard deviation for each portfolio.
BERKSHIRE HATHAWAY INC 0.012919 TIGER GLOBAL MANAGEMENT LLC 0.010894 S&P 500 0.008554 Algo 2 0.008342 SOROS FUND MANAGEMENT LLC 0.007895 Algo 1 0.007620 PAULSON & CO.INC. 0.007023
-
Determine which portfolios are riskier than the S&P 500.
SOROS FUND MANAGEMENT LLC is less risky than the S&P 500 PAULSON & CO.INC. is less risky than the S&P 500 TIGER GLOBAL MANAGEMENT LLC is riskier than the S&P 500 BERKSHIRE HATHAWAY INC is riskier than the S&P 500 Algo 1 is less risky than the S&P 500 Algo 2 is less risky than the S&P 500
-
Calculate the Annualized Standard Deviation.
SOROS FUND MANAGEMENT LLC 0.125335 PAULSON & CO.INC. 0.111488 TIGER GLOBAL MANAGEMENT LLC 0.172936 BERKSHIRE HATHAWAY INC 0.205077 Algo 1 0.120967 Algo 2 0.132430 S&P 500 0.135786
-
Calculate and plot the rolling standard deviation for all portfolios using a 21-day window.
-
Calculate and plot the correlation between each stock to determine which portfolios may mimick the S&P 500.
-
Choose one portfolio, then calculate and plot the 60-day rolling beta between it and the S&P 500.
An alternative method to calculate a rolling window is to take the exponentially weighted moving average. This is like a moving window average, but it assigns greater importance to more recent observations. Try calculating the ewm
with a 21-day half-life.
-
Determine whether the algorithmic strategies outperform both the market (S&P 500) and the whale portfolios.
Based on risk to reward, - Algo 1 outperforms the S&P 500 and the whales portfolios. - Algo 2 outperforms most whales portfolios, except for the Berkshire Hathaway INC and the S&P500.
-
Visit Google Sheets and use the built-in Google Finance function to choose 3-5 stocks for your portfolio.
-
Download the data as CSV files and save in the
Resources
directory. -
Run the Custom Portfolio Analysis Section.