Skip to content

This project analyzes the performance of FAANG stocks (Meta, Apple, Amazon, Netflix, and Google) from 2019 to 2024, comparing their risk-return profiles and correlations. Using Python and financial data from Yahoo Finance (yfinance), I calculated key metrics, visualized cumulative growth, and identified diversification opportunities. This analysis demonstrates skills in financial data manipulation, statistical analysis, and visualization—critical. The data set is partially shown below.

import yfinance as yf
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns

tickers = ["META", "AAPL", "AMZN", "NFLX", "GOOGL"]
data = yf.download(tickers, start="2019-01-01", end="2024-12-31")["Close"]

print(data.head())
returns = data.pct_change().dropna()

(1 + returns).cumprod().plot(figsize=(12, 6))
plt.title("FAANG Stocks: Growth of $1 Investment (2019-2024)")
plt.ylabel("Cumulative Returns")
plt.grid(True)
plt.show()


This plot tracks the growth of a hypotheical $1 investment in each FAANG stock over the 5-year period. Netflix and Amazon show the highest volatility, while Apple and Google show stedier growth.

annual_returns = returns.mean() * 252
annual_volitility = returns.std() * np.sqrt(252)

pd.DataFrame({
    "Annualized Return": annual_returns,
    "Annualized Volatility": annual_volitility
}).plot.bar(subplots=True, figsize=(12, 8))
plt.suptitle("Risk vs. Return (FAANG Stocks)")
plt.show()

This bar chart compares two key financial metrics for each FAANG stock, annualized return and annualized volatility.

sns.heatmap(returns.corr(), annot=True, cmap="coolwarm")
plt.title("FAANG Stocks: Daily Returns Correlation")
plt.show()

This matrix reveals how FAANG stocks move together. Some stocks show high correlation, which would suggest similar market influences. Netflix shows weaker ties to other companys, which would indicate diversification benefits.

In conclusion, Netflix offered the highest returns, but its volatility makes it risky for conservative investors. Combining Apple/Google (stable) with Netflix (high-growth) could optimize risk-adjusted returns.

This analysis mirrors real-world portfolio management strategies. Balancing risk and return is essential for maximizing investor outcomes.