Adam KimMECHANICAL ENGINEERING
Menu
← BACK TO PROJECTS

Engineering case study

SPY and QQQ ETF analysis

How much did each fund gain, and how far did it fall along the way? This Python project compares six years of daily returns, volatility, correlation, and drawdowns.

Personal project · 1,508 trading sessions · January 2020–December 2025

Project status
Completed
Disciplines
Python / Data analysis
My role
Historical price analysis and reporting
Growth of $100 from January 2020 through December 2025. SPY ended at $229.06 and QQQ at $294.52.
Both series start at $100 at the January 2, 2020 close and use prices adjusted for splits and distributions.

01

Returns and risk

January 2, 2020 through December 31, 2025
MetricSPYQQQ
Cumulative return+129.06%+194.52%
Maximum drawdown−33.72%−35.12%
Drawdown troughMar 23, 2020Nov 3, 2022
Annualized volatility, final 21 sessions8.72%13.21%

Daily returns had a correlation of 0.9365 across the sample. The funds often moved together, but their deepest losses came at different times. SPY reached its drawdown trough in March 2020 and QQQ in November 2022.

02

Calculations

The script calculates daily percentage changes and tracks each fund’s decline from its highest adjusted close to date. A trailing window of 21 daily returns gives the rolling compounded return, sample volatility annualized using 252 trading sessions, and Pearson correlation between funds.

03

Run the analysis

Extract the ZIP and run python analyze.py with Python 3.10 or later. The archive includes the script, adjusted prices, daily metrics, and instructions for changing the rolling window.

Download the Python project (.zip)

Download daily results (.csv)

Historical price source on GitHub

← All projects