Shirley K Data
Project Two: Finance Project
This python project analyzes stock data of Bank of America, Citigroup, Goldman Sachs, JP Morgan Chase, Morgan Stanley, and Wells Fargo from January 3, 2006 to March 27, 2018. I used Quandl’s API for Stock Data in this project.
The Jupyter notebook containing the code for this project can be found here.
These are the maximum closing prices for each bank in the given date range.
Bank Ticker | |
---|---|
BAC | 54.90 |
C | 80.08 |
GS | 273.38 |
JPM | 118.77 |
MS | 89.30 |
WFC | 73.00 |
We can see from the following plot that the returns of each bank are generally directly proportional to the other banks in some fashion, except for Citigroup. The returns for Citigroup are very slow growing compared to the other banks.
The following are the dates of lowest returns and highest returns for each bank, as well as the standard deviations on returns of each bank.
|
|
|
Some interesting things we can take away from these tables:
Bank of America, Goldman Sachs, and JP Morgan Chase all had their lowest returns in this date range on President Obama’s Inauguration Day.
Citigroup had it's lowest return on February 27, 2009 when its preferred shares were converted to common stock.
Morgan Stanley had its lowest return when bans on short selling stocks ended.
Well’s Fargo reported its lowest return on the day of their last 2 to 1 stock split for shareholders.
Citigroup’s standard deviation is noticeably larger than other banks, indicating its stocks may be a riskier investment.
|
|
BAC Return | 0.013580 |
---|---|
C Return | 0.011148 |
GS Return | 0.012444 |
JPM Return | 0.010196 |
MS Return | 0.013217 |
WFC Return | 0.011223 |
2017 was the last fully ear of data in our set. The standard deviations are fairly consistent with one another during this year, but we can examine the two banks with the highest standard deviations to evaluate how risky these investments may be.
The two banks with the highest standard deviations for 2017 are Bank of America and Morgan Stanley.
The distributions of both Bank of America and Morgan Stanley are similarly clustered with similar outliers. We can see Morgan Stanley has one greater outlier than the Bank of America distribution, but Bank of America’s standard deviation is still a higher value than Morgan Stanley’s.
The plot shows that a majority of Morgan Stanley’s returns mostly stay between -0.02 and +0.02, whereas Bank of America’s returns range is a bit more spread out between -0.02 and +0.03.
This may indicate that Bank of America’s returns fluctuate more than Morgan Stanley’s.
Above is the plot for JP Morgan Chase, which had the lowest standard deviation in 2017. JP Morgan’s distribution is a bit more compact, with most of the distribution being between -0.015 and +0.015 roughly.
We can say that BAC and MS were slightly more risky and JPM was the least risky in 2017, but their standard deviations were not significantly varied across banks.
These are the closing prices for each bank’s stocks over the specified date range.
The plot shows that Goldman Sachs’s closing price behavior vary differently than the other banks over the same period. We can see the behaviors of the other banks better in the following plot:
The following is Goldman Sachs’s closing prices and their 30 day averages over 2017.
The following figures show whether there are any correlations between banks and their stock closing price trends.
JP Morgan Chase and Bank of America seem to have the least correlation during this time period; Bank of America and Morgan Stanley seem to have the most correlation.
sns.clustermap(bank_stocks.xs(key='Close',axis=1,level='Stock
Info').corr(),cmap='GnBu',annot=True)
The following candlestick plot is a better visualization of the daily status of stocks for Goldman Sachs in 2017.
The green bars indicate where GS has share price gains and the red indicates where they had share price declines.
Next, we see a plot of Goldman Sachs’s closing prices and simple moving averages for periods of 13, 21, and 55 days.
In this final Bollinger band plot, we can see closing prices for Goldman Sachs in 2017 with a 14-day simple moving average period.
The closing prices are well contained by the upper and lower bounds, indicating that there are not many instances of being oversold or overbought.