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.

p_p2_img2.png
 

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.

Dates of Lowest Return
BAC Return 2009-01-20
C Return 2009-02-27
GS Return 2009-01-20
JPM Return 2009-01-20
MS Return 2008-10-09
WFC Return 2006-08-14
Dates of Highest Return
BAC Return 2009-04-09
C Return 2011-05-09
GS Return 2008-11-24
JPM Return 2009-01-21
MS Return 2008-10-13
WFC Return 2008-07-16
Standard Deviations of Returns
BAC Return 0.033930
C Return 0.162066
GS Return 0.023839
JPM Return 0.025657
MS Return 0.035006
WFC Return 0.029398

Some interesting things we can take away from these tables:

Standard Deviations of Returns in 2017
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.

Unknown-6.png
Unknown-7.png

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.

 
Unknown-8.png

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.

Unknown-2.png

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:

Unknown.png

The following is Goldman Sachs’s closing prices and their 30 day averages over 2017.

Unknown-9.png

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.

p_p2_img8.png

sns.clustermap(bank_stocks.xs(key='Close',axis=1,level='Stock
Info').corr(),cmap='GnBu',annot=True)

p_p2_img9.png

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.

Unknown-3.png

Next, we see a plot of Goldman Sachs’s closing prices and simple moving averages for periods of 13, 21, and 55 days.

p_p2_img11.png

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.

Unknown-5.png
Previous
Previous

Project One: 911 Call Project

Next
Next

Project Three: Deep Learning Project