What a quant analyst does daily with Python and real data

August 22, 2026
Facebook logo.
Twitter logo.
LinkedIn logo.
Newsletter issue count indicatorNewsletter total issues indicator
What a quant analyst does daily with Python and real data

What a quant analyst does daily with Python and real data

A quant analyst uses statistics and code to answer questions that affect money. They might figure out whether a stock's market price looks too high or too low relative to the underlying business. They might measure how much risk a collection of investments carries, or whether a trading strategy actually works on real data. If you're getting started with quant finance, understanding what a quant analyst does day to day, and how to replicate that work in Python, is the fastest way to figure out whether this career fits you. For a broader view of the quantitative finance techniques that quant analysts use daily, that article pairs well with what we'll cover here.

Most guides to becoming a quant analyst hand you a reading list of math textbooks and tell you to spend two years on stochastic calculus. That's fine if you want to price exotic derivatives at an investment bank. But the field has changed.

Today, Python is the most common research language across many quant teams. A huge share of quant analyst work involves real market data and looks more like applied statistics than pure mathematics. This article shows you what that work actually looks like, with a complete worked example you can run yourself.

What a Quant Analyst Actually Does

The job title "quant analyst" covers a wide range of roles, but they share a common thread. A quant analyst takes financial questions and turns them into problems that data and math can solve. The output is usually a number or a model that someone else uses to make a decision about money.

The most common paths fall into three broad categories. Research quant analysts test whether patterns in stock prices actually predict future returns. Risk quant analysts build models that estimate how much a collection of investments could lose in a bad week. Pricing quant analysts calculate the fair value of financial contracts like options (contracts that give you the right to buy or sell something at a set price).

The common skill across all these roles is the ability to pull data, clean it, and run statistical analysis. Ten years ago, much of this happened in Excel or MATLAB. Today, Python is the default choice on most teams.

The daily workflow

A typical day for a quant analyst starts with pulling market data from a database or API. Then comes cleaning and aligning that data, which is where most of the time actually goes. After that, they run calculations. They might compute rolling averages, measure how much a stock's price swings around, or test whether two assets tend to move together. Then they write up what they found.

The Python ecosystem makes all of this straightforward. pandas handles data manipulation, NumPy does the math, and matplotlib produces charts. If you already have Python foundations, you have the building blocks for quant analyst work.

Core Quant Analyst Skills

You don't need a PhD to start doing quant analyst work. You need comfort with Python. You also need a working grasp of basic statistics and the habit of questioning your own results.

Statistics that matter in practice

Quant analysts use statistics constantly, but not the kind you might expect. The most useful concepts are surprisingly basic.

You need to understand mean and standard deviation. The mean is the average value. Standard deviation measures how spread out the data is around that average. You also need to understand correlation, which tells you whether two things tend to move in the same direction. You also need to know what a return is, which means the percentage change in price from one period to the next.

More advanced work involves regression (fitting a line through data to find relationships) and hypothesis testing (checking whether a pattern is statistically meaningful or just random). But you can do real quant analysis with just the basics.

Why Python won

Python became the default language for quant analysts because it's fast enough for research and readable enough to share with colleagues. A quant analyst who writes a model in Python can hand that code to a developer who turns it into a live system. That handoff is much harder with Excel or R.

The pandas library is especially important. Wes McKinney built it while working at AQR Capital Management, specifically to handle the kind of time-series data (sequences of prices or values recorded over time) that quant work requires. When you see quant analysts working with daily stock prices or aligning data from different sources, they almost always use pandas.

A Complete Quant Analyst Workflow in Python

Let's walk through a realistic quant analyst task from start to finish. We'll measure how a stock behaved over time. Then we'll calculate a few common summary numbers and build a simple trading rule based on recent performance.

This is the kind of task a new quant analyst might get on day one. Pull the data, clean it, compute the numbers, and present what you found.

Setting up and loading data

We'll use yfinance to pull historical price data. In a professional setting, you'd use a Bloomberg terminal or a proprietary database. The steps are similar, but professional data sources handle corporate actions, missing values, and intraday coverage more carefully than free Yahoo Finance data.

One note before running this code. Newer versions of yfinance sometimes change how columns are named. If you get an error about Adj Close not existing, run print(data.columns) to see what's available, or pass auto_adjust=False to the download call.

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

# Pull 5 years of daily price data for Apple
ticker = "AAPL"
data = yf.download(ticker, start="2019-01-01", end="2024-01-01")

# Calculate daily returns (percentage change from one day to the next)
data["daily_return"] = data["Adj Close"].pct_change()

# Drop the first row, which has no return (there's no previous day to compare to)
data = data.dropna(subset=["daily_return"])

print(f"Loaded {len(data)} trading days for {ticker}")
print(data[["Adj Close", "daily_return"]].tail())

This gives us a DataFrame with adjusted closing prices and daily returns. The adjusted close accounts for stock splits and dividends, so the returns reflect what an investor actually experienced.

Computing risk and return numbers

A quant analyst usually starts by checking two things about any asset. How much did it gain or lose, and how sharply did it swing along the way?

# Estimate the yearly return by taking the average daily return
# and scaling it to 252 trading days
annualized_return = data["daily_return"].mean() * 252

# Estimate the typical size of price moves over a year
# from the day-to-day spread in returns
annualized_vol = data["daily_return"].std() * np.sqrt(252)

# Compare return with how unstable the returns were
# We skip the risk-free rate here for simplicity
sharpe_ratio = annualized_return / annualized_vol

# Find the worst drop from a previous high point
cumulative = (1 + data["daily_return"]).cumprod()
rolling_max = cumulative.cummax()
drawdown = (cumulative - rolling_max) / rolling_max
max_drawdown = drawdown.min()

print(f"Annualized Return: {annualized_return:.2%}")
print(f"Annualized Volatility: {annualized_vol:.2%}")
print(f"Sharpe Ratio: {sharpe_ratio:.2f}")
print(f"Maximum Drawdown: {max_drawdown:.2%}")

Let's break down what each number tells you.

The annualized return is a rough estimate of yearly performance. We take the average daily gain and multiply by 252 (the approximate number of trading days in a year). This is a simplification, not a true compounded growth rate. For a more accurate figure, you'd calculate it from the total cumulative return over the full time period. But this quick estimate is how most quant analysts start.

Volatility (how much the price swings around) works similarly. We take the standard deviation of daily returns and scale it by the square root of 252. This scaling comes from a mathematical property of independent random variables. Higher volatility means the stock's price bounced around more wildly.

The Sharpe ratio divides return by volatility. In plain terms, it tells you how much return you earned for each unit of price instability you endured. Higher is better, but the number only means something when you compare similar strategies or assets. A Sharpe of 1.5 on a stock portfolio and a Sharpe of 1.5 on a bond portfolio don't mean the same thing in practice.

Maximum drawdown measures the worst drop from a previous peak to a later low point. If the number is -33%, that means the stock fell 33% from its high at some point during the period. Many investors pay close attention to this because it shows how painful the ride could get.

Testing a momentum trading rule

Now let's test a common idea that quant analysts often check. The idea, called momentum, is that stocks which rose recently may keep rising for a while.

We'll build a simple rule. If the stock's return over the past 60 trading days (roughly 3 months) is positive, we hold the stock. If it's negative, we sit in cash. For more background on how analysts build and test rules like this, see this guide to trading strategies and backtesting.

# Calculate the rolling 60-day return
data["momentum"] = data["Adj Close"].pct_change(periods=60)

# Create a trading rule
# A value of 1 means we hold the stock, and 0 means we sit in cash
# We shift by 1 day so we use yesterday's information to trade today
data["signal"] = (data["momentum"] > 0).astype(int).shift(1)

# The strategy earns the stock's daily return only on days when the rule says to hold it
data["strategy_return"] = data["daily_return"] * data["signal"]

# Drop rows where we don't have enough data for the momentum calculation
strategy_data = data.dropna(subset=["strategy_return"])

The .shift(1) on the trading rule is critical. Without it, we'd use information from today to make a decision about today, which is impossible in real life. This mistake is called look-ahead bias, which means you let future information affect an earlier decision. It's one of the most common errors in this kind of strategy test.

Evaluating the strategy

Now we compare the momentum strategy to simply holding the stock the entire time, an approach called buy-and-hold (you buy once and never sell).

Keep in mind that this toy example ignores trading costs, bid-ask spreads, and taxes. The reported performance is only a rough first pass, not something you'd trade on directly.

# Calculate cumulative returns for both approaches
strategy_data = strategy_data.copy()
strategy_data["cumulative_buyhold"] = (1 + strategy_data["daily_return"]).cumprod()
strategy_data["cumulative_strategy"] = (1 + strategy_data["strategy_return"]).cumprod()

# Strategy summary numbers
strat_annual_return = strategy_data["strategy_return"].mean() * 252
strat_annual_vol = strategy_data["strategy_return"].std() * np.sqrt(252)
strat_sharpe = strat_annual_return / strat_annual_vol

# Maximum drawdown for the momentum strategy
strat_cumulative = (1 + strategy_data["strategy_return"]).cumprod()
strat_rolling_max = strat_cumulative.cummax()
strat_drawdown = (strat_cumulative - strat_rolling_max) / strat_rolling_max
strat_max_drawdown = strat_drawdown.min()

print(f"\n{'Metric':<25} {'Buy & Hold':>12} {'Momentum':>12}")
print("-" * 50)
print(f"{'Annualized Return':<25} {annualized_return:>11.2%} {strat_annual_return:>11.2%}")
print(f"{'Annualized Volatility':<25} {annualized_vol:>11.2%} {strat_annual_vol:>11.2%}")
print(f"{'Sharpe Ratio':<25} {sharpe_ratio:>12.2f} {strat_sharpe:>12.2f}")
print(f"{'Max Drawdown':<25} {max_drawdown:>11.2%} {strat_max_drawdown:>11.2%}")

# Plot both equity curves
fig, ax = plt.subplots(figsize=(12, 6))
ax.plot(strategy_data.index, strategy_data["cumulative_buyhold"], label="Buy & Hold")
ax.plot(strategy_data.index, strategy_data["cumulative_strategy"], label="Momentum Strategy")
ax.set_title(f"{ticker}: Buy & Hold vs. 60-Day Momentum Strategy")
ax.set_ylabel("Growth of $1")
ax.legend()
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.show()

The numbers show whether the momentum rule earned more than buy-and-hold and whether the ride was smoother. The chart shows you when the rule helped and when it hurt.

But one stock over one five-year window is not enough evidence to trust a trading idea. A careful quant analyst would rerun the test on other stocks and older time periods. They would also try nearby settings, like 30 or 120 days instead of 60, to see whether the result depends on one lucky choice. If the pattern only works on Apple from 2019 to 2024 with exactly a 60-day window, it's probably a coincidence.

What matters is not only writing the code. It's checking whether the result holds up when you change the stock, the dates, or the rule settings. That habit of questioning your own output is what separates useful analysis from a misleading notebook.

What this example does not cover

Real quant analyst work usually involves multiple assets at once, not just a single stock. It includes checks for missing data and date alignment issues. It compares results against a benchmark (a reference point like the S&P 500). It accounts for transaction costs and slippage (the difference between the price you expected and the price you actually got). It also repeats the test across many time periods to see whether the result is stable.

This example gives you the skeleton. The production version has more error handling, more assets, and more skepticism built in.

How This Maps to a Quant Analyst Career

The workflow above reflects the basic job. You gather data, measure what happened, test a trading idea, and check whether the result is useful. Junior quant analysts do exactly this kind of analysis. Senior analysts do the same thing with more sophisticated models and larger datasets.

If you want to go deeper into algorithmic trading with Python, the next step is learning to test strategies on data the rule hasn't seen before. You build the rule on one chunk of historical data, then check whether it still works on later data that the rule did not get to see while you designed it. This check helps you figure out whether the rule actually captures something real, instead of only fitting the data you already looked at.

The math gets harder as you advance. Pricing options requires understanding probability distributions. Building risk models for large collections of investments requires linear algebra. Machine learning applications require optimization theory. But none of that matters if you can't do the basic workflow cleanly. Start with data, returns, and simple statistics. Build from there.

The quant analyst role rewards people who are both rigorous and practical. You need to care about getting the math right, but you also need to produce results that someone can act on. Python helps with both parts because you can test ideas quickly and share the code with other people on the team.

Start Building Quant Analyst Skills

The worked example in this article covers the core loop of quant analyst work. You pulled data, computed summary numbers, tested a trading rule, and evaluated the results against a simple alternative. If you want to build on this, Getting Started With Python for Quant Finance covers this from start to finish, with code templates you can run yourself.