Project presented by


Analysis of Stock Market During Economic Events Apple (AAPL) Vs Microsoft (MSFT)

“One Team. One Fight”

                                    Executive Summary


Introduction: We chose to analyze the NASDAQ stocks AAPL and MSFT over the last ten years to see how world events affected each, how they perform relative to each other during those events, which stock is riskier, and which stock you should buy today if looking to invest.  Our team wrote code to test volume of sales, average growth, and volatility.  We also wrote code to pull data from the NASDAQ website based on any ticker symbol entered into the command terminal as a tool that a potential buyer can use to help make the best decision.  We built a website using HTML code for widespread and easy viewing of our presentation, code, and our decision model.  
 
Our choice – We chose to compare Apple and Microsoft because they are two of the most famous competitors, both have been tremendously successful, and both have different business models.  Apple uses integrated software with proprietary hardware, whereas Microsoft has its own platforms but also contracts their software out to other companies like Samsung, Dell, HP, etc.  Our theory is that Apple will be more susceptible to certain events in specific areas (i.e. a disaster in Taiwan where Foxconn is headquartered), but may also be more stable during economic fluctuations due to having greater control of their supply chain.  Microsoft, having a more diversified product, might be more secure against specific events, but might have more trouble keeping up with a fast paced, dynamic industry, and therefore might not be able to grow as fast as Apple.  Our goal is to answer the question of which stock you should buy depending on your needs, i.e. something stable and slow vs. something fast and risky historically, with external factors considered. 

Our approach – There are many data points available in the .CSV files that can be downloaded from the NASDAQ website.  You can get the volume, growth, open, close, daily high, daily low, current data, and more.  We used ‘Pandas’ in Python to create data frames with the desired data and to pull out the data we chose to analyze side by side for Apple and Microsoft.  While we looked at many comparisons listed in our tables, the three we chose to focus on for our 15-minute presentation were sales volume, daily growth, and stock volatility.

Sales Volume – For sales volume, first we created a table, day by day over 10 years, to compare the volume of stocks sold for both Apple and Microsoft.  We summed the data by year, and used the ‘.mean’ function to get average stock trades per year for each company, and then plotted the two to compare them.  The goal of assessing is simply to tell which company is more popular on average on the stock floor.  More trades over time means that the company is healthier and most likely growing, while stagnant trade numbers or lower numbers may be less of an indicator.

Daily Growth – The indicator most buyers care about when assessing a potential stock option is growth over a period of time.  To assess growth we used the ‘.sum()’ function with the daily stock closing prices, year by year.  We built graphs daily and monthly as well, but there was too much data to be easily viewable in any graph over the course of 10 years.

Volatility – To assess volatility, we compared the fluctuation of the two stocks over 10 years.  We again used the ‘.mean’ function, but this time the average up or down the growth of the entire year.  We used a box plot to compare the data between the two companies.  We looked at how often there was a large (or small) gap between opening price and closing price over the year.  The assumption is that a more volatile stock is riskier, with more chance for large gains over a short time, and a less volatile stock is safer for a long-term investment. 

External Factors – There are many external factors that can affect the economy and the stock market.  We chose to focus on a list of major world events over the last ten years that can have a major effect on the US economy.  The events we chose are; the housing crisis in 2007, the global banking system collapse in 2008, the stock market crash in 2008, the 2009 presidential election, Japan’s tsunami and nuclear disaster in 2011, Steve Jobs death in 2011, China emerging as the world’s largest economy in 2015, Hurricane Harvey in 2017, the 2017 presidential election, and the cost of the war on terror over the last ten years.

Additional Resources – We decided to use some of the tools we’ve learned more recently in Computational Method II to make our analysis more useful and easier to view.  Specifically, we built a website using HTML that consolidates Jupyter online, Python code viewing, PowerPoint presentation capability, information about group members, raw stock data in.CSV format, and convenient access for anyone who wishes to access it at http://www.itn.us/home.html.  We also built a Python tool for web-scraping data from the NASDAQ site.  The code is viewable on our website and sent via separate correspondence.  It can be run from the command terminal by using ‘python stockchecker.py AAPL’ or for any stock ticker chosen to give current daily information about the stock.
 
All of these resources together should be a useful tool to analyze and pick the best stock depending on your personal preferences and goals.