Big Tech Stock Prices

INFO 526 - Project 1

Data visualization
TidyTuesday
Author

Team Crimson - Arun, Varun, Jasdeep, Mohit, Pradnya

Abstract

This data visualization project aims to comprehend the patterns in the stock prices of major tech companies over a 10-year period. Given the inherent volatility of stock prices, various factors, including external disturbances, contribute to fluctuations. The project delves into comprehending the patterns in big tech company stock prices, particularly with respect to the impact of COVID-19. Our visualization techniques, including bar plots and line plots, play a crucial role in explaining the stock price phenomena.

In the second part of the project, we offer a more lucid understanding of stock price trends across financial quarters and weekdays. This insightful analysis empowers stakeholders with the information needed for informed decision-making and the formulation of proactive trading strategies.

Note: Given that we only have access to stock prices, establishing causality regarding the impact of stock prices in relation to COVID-19 may pose challenges. So, instead we will be observing trends and returns.

Introduction

The Big Tech Stock Prices dataset, sourced from the TidyTuesday project, provides a comprehensive overview of the daily stock prices and trading volumes of 14 prominent technology companies. The list of industry giants that are studied for data analysis are Apple, Adobe, Amazon.com, Salesforce, Cisco Systems, Alphabet, IBM, Intel, Meta, Microsoft, Netflix, NVIDIA, Oracle and TESLA.

Comprising two tables, namely big_tech_stock_prices.csv and big_tech_companies.csv, this dataset offers a ample amount of information for conducting in-depth analysis and exploring various aspects of the stock market. The big_tech_stock_prices.csv file contains detailed records of daily stock prices and trading volumes for each company, while the big_tech_companies.csv file provides additional information about the included companies, such as their names and stock symbols.

The data spans a period of 12 years, specifically from 2010 to 2022

Question 1 : Which companies have experienced the highest/lowest impact on their stock prices due to the pandemic?

Introduction

Comprehending the trends in overall stock prices is crucial for grasping the broader impact of stock fluctuations. In this section, we delve into the patterns observed in the adj_close stock prices over a 12-year period, spanning from 2010 to 2022, and examine how they fluctuate throughout this timeframe. The key variables under consideration are primarily adj_close, date, and stock_symbol.

Analyzing stock prices across different companies provides insights into trends over time. For instance, identifying an upward trend in a specific company during a particular period suggests the likelihood of high returns for that duration. Conversely, a downward trend indicates the potential for negative returns. If the trend appears sinusoidal, it signals a seasonal effect with anticipated modest returns over the period.

To delve deeper into these dynamics, we specifically zoom in on the pre and post-COVID times. This focused examination allows us to discern the effects of the pandemic on stock trends, offering a comprehensive understanding of how major tech companies were impacted during and after the COVID-19 era.

Approach

To comprehensively analyze the stock price patterns across various companies over the 12-year period, we will employ three types of plots: two line plots and one bar plot.

For all the plots, the company names will be cleaned and extracted for proper labeling.

In the first line plot, we will depict the overall trends of all companies from 2010 to 2022. The lines will be annotated with the COVID-19 time period, highlighting upward and downward trends. Most lines will be plotted in grey, except for a couple where the trends are particularly conspicuous. Comments will accompany these lines for quick comprehension.

The second line plot zooms into the period from 2018 to 2022. Instead of directly plotting stock prices, we plotted de-trending days plot for which we created 14 models across companies based on stock prices. Ratios are then calculated based on fitted and actual stock prices, offering insights into underlying patterns on a standardized scale. Facets are incorporated to distinguish between the plots, maintaining the color patterns from the first plot.

For the third plot, we consider the starting date of 2018, the year 2020, and the closing date of 2022 to extract two-year and five-year returns. Two-year returns showcase the initial impact of the tech boom before COVID-19, while five-year returns highlight a company’s intrinsic strength despite market fluctuations. The returns are averaged per year for easy comprehension. First, two-year returns for all companies are plotted using a bar plot with descending values. Similarly, five-year returns are plotted. These plots are combined using cowplot and presented side by side, illustrating how returns fluctuated across companies during these two critical time periods.

Analysis

Discussion

Plot1:

  • Most companies experienced a decline in stock prices in H1 2020 due to initial pandemic fears. However, these prices rebounded and increased sharply as technology adoption and importance increased.
  • After 2022, a general decline affected most companies, but notably, Netflix and Adobe experienced more pronounced decreases compared to the overall market trend. This decline was attributed to post-Covid-19 effects, such as a slowdown in sales, recession fears, and an increase in unemployment rates.

Plot2:

  • Plot2 depicts detrended stock price fluctuations spanning a 5-year period (2018-2022). The area above the blue line indicates higher returns during that period. Notably, most companies, excluding the relatively flatter trends of IBM and Cisco, appear to have modest returns, with significant deviations becoming more apparent, particularly from 2020 onwards.
  • Among the companies unaffected by the trend reversal in 2022 are Apple, Netflix, Microsoft, and IBM. Upon closer examination, it becomes evident that Apple, Netflix, and Microsoft stand out as long-term gainers.

Plot3:

  • Plot3 allows for a comparison of average returns over 2 years and 5 years for various stocks.
  • Microsoft recorded the highest returns over 2 years at 46.46%, which decreased to 39.55% over 5 years. In contrast, Tesla showed the highest 5-year returns of 94.02% (compared to 17.12% over 2 years).
  • Adobe and Netflix experienced the most significant negative impact, with returns dropping from 44% and 32% over 2 years to 17% and 9% over 5 years, respectively.
  • Conversely, Tesla had the most substantial positive impact, with returns increasing from 17% over 2 years to an impressive 94% over 5 years.

Conclusion:

Throughout the analysis, the impact of the pandemic on stock prices reveals distinctive winners and losers. Netflix and Adobe notably suffered substantial declines in 2022 due to post-Covid-19 effects, including a sales slowdown, recession fears, internal factors and rising unemployment rates. Conversely, Apple, Microsoft, and IBM demonstrated resilience, remaining relatively unaffected by the trend reversal in 2022. A closer look at long-term trends positions Apple, Telsa, and Microsoft as standout gainers, while Tesla emerges as a clear winner with the highest 5-year returns, surging from 17% to an impressive 94%. This comprehensive overview highlights the varying degrees of impact and success among the analyzed companies during this period.

Question 2 : What patterns do we see in the positive gain days over the given period?

Introduction

In the previous question, we observed variations in returns across different companies during the COVID-19 pandemic and the five-year period. In this question, our focus shifts to analyzing the number of gain days across the years to identify potential patterns for companies.

To compute the gain_days variable, we leverage the open and close variables on the same day. If the closing price is higher than the opening price, we designate it as a gain (1), otherwise, it is categorized as no gain (0). The other key variables under consideration include date and stock_symbol.

Analyzing gain_days across different companies offers valuable insights for trading strategies, specifically in determining optimal entry and exit points. This analysis gains further depth when overlapped with weekdays. For instance, if the average gain day is lower on Monday and higher on Friday for a particular company, it suggests that buying on Monday and selling on Friday could be a more favorable strategy.

This information is particularly beneficial in short-term trading scenarios compared to long-term trading. Moreover, it proves useful in uncertain market conditions, providing traders with actionable insights for decision-making.

Approach

To comprehensively analyze gain-day patterns across various companies over the 12-year period, we will employ two distinct types of plots: a column plot and a ridge plot.

For all the plots, meticulous attention will be given to cleaning and extracting company names to ensure accurate labeling.

In the first column plot, our objective is to illustrate the overall gain-days of all companies from 2010 to 2022 on a yearly basis. For this purpose, the gain_days data will be aggregated yearly, generating an animated series of 12 column charts representing different companies. This dynamic presentation provides insights into specific peaks and troughs for gain days across these years for various companies. Additionally, the number of gain days will be annotated using geom_text for a swift comprehension of the numerical values within the animated plot.

The second plot delves into weekday analysis, offering a deeper understanding of trading dynamics. Gain-days will be grouped by quarter and weekday, ensuring an average of approximately 12 weekdays per quarter. Ridge density plots across weekdays will visually articulate the spread and peaks of gains, facilitating the identification of which specific day is more favorable for trading in the context of individual tech companies.

These visualizations collectively provide a nuanced understanding of gain-day patterns, empowering traders with valuable insights for informed decision-making. The integration of both yearly trends and weekday analyses offers a holistic perspective on trading dynamics over the analyzed 12-year period.

Analysis

Discussion

Plot1:

  • Most companies share a consistent number of positive gain days, averaging around 130 each year.
  • An exception is 2022, where the number drops to 115 positive gain days.
  • Suggests a substantial market impact on all companies, as seen in previous analyses.
  • However, as the positive gain days are nearly the same across companies, it’s challenging to draw direct conclusions about the specific slots for traders’ decision-making from this plot.

Plot2:

  • Clear distribution of positive gain days across weekdays for all companies.
  • Example: Adobe presents opportunities to buy on Monday and sell on Thursday.
  • Intel generally has higher positive gain days, except on Tuesday.
  • Highlights the distinct buying and selling strategies for each company.

Conclusion:

In our earlier analysis, we identified companies with higher returns. Now, considering different positive gain days across weekdays, short-term investors can strategically align with historical performance. For instance, Tesla, with higher returns, may be a target for buying on Monday and Tuesday, selling on Tuesday. In contrast, IBM, with lower returns, could be bought on Thursday and sold on Wednesday. This approach optimizes trading strategies by incorporating both return patterns and positive gain day distributions. Empowering traders with these insights, along with considering the potential volatility, these graphs serve as valuable tools for day and weekly trading strategies, facilitating quick gains in the dynamic stock market landscape.

References

  • https://stackoverflow.com/questions/10576095/formatting-dates-with-scale-x-date-in-ggplot2
  • https://viz-ggplot2.rsquaredacademy.com/ggplot2-text-annotations