Analyzing Gas Stocks with Tidyquant

Josh Siatkowski

My Internship: Investor Relations at Expand Energy

Question of my summer: How is $EXE performing compared to peers?

Types of Financial Analysis and Market Efficiency

Technical Analysis 📉📈:

Using past stock data to analyze a stock

Fundamental Analysis 🔎📊:

Using company information to find real value of stock

Weak-Form Efficiency 🎲↕️:

Past stock price data reflected in current stock prices – no technical analysis to predict stock prices

Semi-Strong-Form Efficiency 🗞️⚡️:

All public information reflected in current stock prices – no fundamental analysis to predict stock prices

Does Technical Analysis Actually Work?

Success is debated

But examining price data is useful when selecting stocks for:

  1. Viewing Historic Performance
  2. Assessing Risk and Volatility
  3. Comparing with Peer Companies

Bridging Finance and Tidyverse with Tidyquant

Tidyquant:
  • Aggregates financial data from different software and returns in tidy format

  • Expands on ggplot infrastructure for improved visualization

  • Simplifies performance analysis functions from existing packages

How can we use Tidyquant to analyze $EXE?

Example 1: Simple Stock Price Graph

Using the tq_get() function, we can easily extract price data for EXE and display with ggplot. But we are missing some key insights…

  • Intraday movements

  • Returns relative to peers

  • Risk measurements

Example 2: Show Intraday Movement with geom_candlestick add-on

Tidyquant adds geom_candlestick to ggplot, which has parameters for open, close, high, and low prices throughout a day. This allows us to better see how the stock actively trades.

Example 3: Compare Cumulative Returns across Peers

We can compare prices, but this isn’t very useful – we need returns

It looks like EXE is mediocre compared to others – but what if the stocks were going down?

Example 4: Using Performance Analysis Functions to Compare Systematic Risk

The CAPM regression results of the five major gas companies – EXE generates returns with low systematic risk

Conclusion: Is $EXE Doing Well? Worth Buying?

  • Technical Analysis doesn’t offer long-term outlook

  • But Tidyquant can visualize risk, peer relationships, and historic returns to supplement other information in investment decision

References