Kifah Owda
Data & Analytics

InvestInsight: A Python Tool for Watching Tech Stocks Against the Market

A startup investing in tech stocks wanted one place to check how its holdings were moving against the market. I built the data pipeline and the analysis behind it.

Desk with a laptop and monitor showing stock price charts, and a phone calculator resting on printed financial reports

1.34

MSFT's beta vs the S&P 500 — it moved 34% more than the market over the period

1.16

AAPL's beta — 16% more volatile than the market

Friday

The day AAPL most often hit its monthly high; lows clustered on Thursdays

6

Analyses per query: moving average, monthly overview, daily ROI, monthly ROI, risk, frequency trends

What the tool shows

Four of the six views, from trend to timing.

Line chart of AAPL, MSFT and SPY closing prices with 30-day moving averages, with buy and sell crossover points marked

Price vs 30-day moving average

Closing price against its 30-day moving average for AAPL, MSFT and SPY. Where price crosses the average is the signal the tool highlights.

Line chart of monthly return on investment for AAPL and SPY from January 2023 to July 2024

Monthly return on investment

Monthly ROI for each ticker, calculated from the first open and last close of the month. All three dropped in Sept 2023 and recovered by November.

Line chart comparing 30-day rolling volatility of AAPL and SPY, with AAPL spiking sharply in mid-2024

Rolling volatility

30-day rolling volatility, annualized. AAPL stayed above SPY the whole period and spiked sharply in mid-2024.

Two tables listing AAPL's monthly highest and lowest prices with the weekday each occurred

Frequency trends

Monthly highs and lows with the weekday each one landed on. For AAPL, highs most often fell on Fridays and lows on Thursdays.

The Business Question

A startup holding a handful of tech stocks wanted to answer four things quickly: Is the price trending up or down? What did we earn this month? How risky is this stock compared to the market? And is there a pattern in when it peaks and dips? They wanted this from live data, not a spreadsheet someone updates by hand.

The Approach

I wrote the technical design document first, then built the pipeline it described. Data comes from Alpha Vantage's daily time series, gets cleaned (column names normalized, duplicates and empty rows removed, date range filtered) and lands in one DataFrame per ticker. From there, six functions produce the analyses: 30-day moving average, monthly average close and volume, daily and monthly ROI, beta against SPY, annualized 30-day rolling volatility, and monthly high/low frequency by weekday. Each function returns a chart or table the UI can drop straight into the window.

Architecture diagram: user interface, Alpha Vantage API gateway, clean and process data, data manipulation and visualization, stock data dashboard output
User input → API → clean → analyze → visualize. Each stage has one input and one output, which made it easy to split the work between two people.
Role
Technical design, data pipeline, cleaning and all analysis functions
Team
Pitchaporn Keenaphan (UI/UX)
Timeline
Jul–Aug 2024

What Each Number Tells an Investor

Six analyses, one pipeline

Every analysis in the tool answers a specific question an investor would ask. The moving average shows direction. ROI shows what a position actually returned. Beta and rolling volatility show risk relative to the market. Frequency trends show whether there's any pattern in timing.

None of these are trading signals on their own. The tool's job is to put them side by side so a person can make the call with the full picture.

The Numbers Behind the Analysis

Moving average and rolling volatility window
30 daysMoving average and rolling volatility window
Annualization factor — trading days in a year
√252Annualization factor — trading days in a year
Data window analysed: Jan 2023 – Jul 2024
19 monthsData window analysed: Jan 2023 – Jul 2024
Tickers per query — any two stocks plus SPY as the market benchmark
3Tickers per query — any two stocks plus SPY as the market benchmark

Technical Foundation

  • Python

    pandas and NumPy for the pipeline and all calculations; Matplotlib for charts.

  • Alpha Vantage API

    Daily time-series data pulled fresh per ticker on every run and held in memory — no database.

  • Data cleaning

    Normalized column names, removed duplicates and empty rows, filtered to the requested date range, aligned series before any cross-ticker calculation.

  • Financial analysis

    Moving average, ROI, beta, annualized rolling volatility, monthly high/low frequency.

  • Technical design

    Wrote the TDD: architecture, data flow, and the input/output contract for each stage.

View the code on GitHub

See it for yourself.

Explore the live work behind this case study.