Goshawk Trades (@GoshawkTrades)

2026-01-20 | ❤️ 3477 | 🔁 458


The Math Needed for Trading (Complete Roadmap)

I’m going to break down the essential math you need for trading. I’ll also share the exact roadmap and resources that helped me personally.

Let’s get straight to it.

This roadmap is for traders who want to use data.

Whether that’s backtesting strategies, building algorithms, or running systematic approaches.

If you want to trade based on evidence, patterns, and probability—this is your foundation.

I – Statistics and Probability

The foundation of extracting signal from noise

Every price move is a combination of signal and randomness.

Statistics gives you the tools to separate the two.

1.1 Sample Size and the Law of Large Numbers

Sample size is crucial because it leads to the Law of Large Numbers.

The bigger your sample, the closer your results get to the true expectation.

In trading: more trades = more accurate backtest.

A strategy that’s 10-0 in backtesting isn’t impressive. It’s insufficient data.

A strategy that has hundreds or thousands tells you something real about edge.

This is why you need years of data and hundreds of trades before trusting a backtest.

Plus it needs to be out of sample.

1.2 Central Tendency: Finding the Middle

Mean: Add all values and divide by count

Moving averages are just rolling means.

Median: The middle value when sorted

Better than mean when outliers exist (and they always exist in trading).

If you have 9 small losses and 1 massive Black Swan event, median shows the typical outcome better than mean.

Mode: Most frequent value

Almost useless in continuous data like prices. Occasionally useful for analyzing price clustering at round numbers.

Expected Value: Weighted average of all possible outcomes

This is what you’re actually trying to maximize in trading: (Win% × Avg Win) - (Loss% × Avg Loss)

1.3 Spread: How Much Things Vary

Variance: Average of squared differences from the mean

Mathematical foundation of risk.

Standard Deviation: Square root of variance

Same information as variance, but in the same units as your data (dollars, percent, etc.)

This becomes volatility when applied to returns.

Every position sizing formula uses volatility. Every risk metric uses standard deviation.

If you don’t understand this, you can’t size positions intelligently.

1.4 Correlation: Do Things Move Together?

Covariance: Raw measure of how two variables co-move

Positive = tend to move together Negative = tend to move opposite Zero = no relationship

Correlation: Standardized covariance from -1 to +1

This tells you if your strategies are actually independent.

Running 3 momentum strategies on correlated assets gives you 3x the size but not 3x the diversification.

Correlation = 0.9? You basically have one strategy. Correlation = 0.2? Now you have real diversification.

1.5 Probability Distributions

Different types of randomness follow different patterns.

Normal (Gaussian): The bell curve

Many models assume normality; real returns are heavy‑tailed, so Gaussian approximations can understate crashes

Binomial: Binary outcomes

Win or lose. Up day or down day. Used for modeling discrete events.

Uniform: Everything equally likely

Useful as a baseline assumption when you have no information.

Understanding which distribution fits your data determines which statistical tools work.

1.6 Central Limit Theorem

Why normal distributions show up everywhere:

The average of many random variables approaches a normal distribution, regardless of the underlying distribution.

This means:

  • Portfolio returns are more normal than individual stock returns

  • Average of 100 trades is more predictable than any single trade

  • Even if individual outcomes are messy, aggregates become clean

This justifies using normal-based statistics even when individual data points aren’t normal.

1.7 Conditional Probability

The probability of X given Y.

Markets have regimes. Your strategy performs differently in different conditions.

Example:

  • P(strategy wins) might be 55%

  • P(strategy wins | VIX > 30) might be 35%

  • P(strategy wins | VIX < 15) might be 70%

Understanding conditional probabilities lets you filter for favorable conditions.

1.8 Bayes’ Theorem

How to update your beliefs when new evidence arrives.

Prior belief + New evidence = Updated belief

Example:

  • You think a stock has 60% chance of going up tomorrow

  • Earnings come out and beat expectations

  • What’s the new probability?

Bayes’ Theorem gives you a systematic way to update probabilities based on new information.

Critical for adaptive strategies and regime-based trading.

1.9 Maximum Likelihood Estimation

How do you find the best parameters for a model?

MLE says: pick the parameters that make your observed data most likely.

This is why we minimize squared error in regression—it’s the maximum likelihood solution under Gaussian noise.

Understanding MLE explains why loss functions are designed the way they are.

1.10 Regression Models

Linear Regression: Fit a line to data

Used for:

  • Mean reversion (price deviates from trend line, reverts back)

  • Predicting continuous values

  • Understanding relationships between variables

Logistic Regression: Predict binary outcomes

Used for:

  • Up/down day prediction

  • Win/loss probability

  • Binary classification

Both are building blocks for more complex models.

II – Linear Algebra

The math of portfolios

Once you’re trading multiple positions or running multiple strategies, you’re doing linear algebra.

2.1 Scalars, Vectors, Matrices

Scalar: Single number

Example: One day’s return for one stock

Vector: Column of numbers

Example: Returns for 10 different stocks on the same day

Matrix: Grid of numbers

Example: 252 days of returns for 10 stocks (252×10 matrix)

Your portfolio is a weighted sum of vectors. Risk calculation is matrix multiplication.

2.2 Matrix Operations

Addition: Combine signals or returns

Multiplication: Apply weights to positions

Transpose: Flip rows and columns (needed for many calculations)

Example: Portfolio return = (weight vector) × (return vector)

2.3 Eigenvalues and Eigenvectors

These reveal the “principal directions” of your data.

In trading:

  • Which factors actually drive your portfolio?

  • How many independent sources of return do you have?

  • What’s your true diversification?

Used in:

  • Risk modeling

  • Portfolio optimization

2.4 Decomposition Methods

Singular Value Decomposition (SVD): Break a matrix into simpler components

Principal Component Analysis (PCA): Find the most important patterns in data

Real application:

You have 50 technical indicators. Most are correlated.

PCA finds the 5 underlying “factors” that explain 90% of the variation.

Now you can trade on 5 independent signals instead of 50 noisy ones.

III – Time Series Analysis

Markets have memory and structure

Today’s price depends on yesterday’s. Volatility clusters. Trends persist.

Time series analysis models these dependencies.

4.1 Stationarity

A time series is stationary if its statistical properties stay constant over time.

Most statistical tests assume stationarity.

Problem: Markets aren’t stationary.

Volatility changes. Correlations shift. Market structure evolves.

A strategy that works on stationary data might fail when the underlying process changes.

This is why strategies decay, and the market regime shift,s and your model assumes it hasn’t.

4.2 Autocorrelation

How much does today’s value depend on yesterday’s?

Positive autocorrelation: Yesterday up → today likely up (momentum)

Negative autocorrelation: Yesterday up → today likely down (mean reversion)

Zero autocorrelation: No pattern (random walk)

4.3 ARIMA Models

AutoRegressive Integrated Moving Average

Framework for forecasting time series.

AR (AutoRegressive): Today depends on previous days

I (Integrated): Account for trends

MA (Moving Average): Today depends on previous errors

Used for predicting returns, volatility, or any variable that evolves over time.

4.4 GARCH Models

Generalized AutoRegressive Conditional Heteroskedasticity

Fancy name for: “Volatility clusters and changes over time.”

After a big move, expect more volatility.

After calm periods, expect continued calm.

If you’re sizing positions based on recent volatility (which you should), GARCH formalizes this.

4.5 Cointegration

Two assets can both be non-stationary (trending), but their difference is stationary.

Example:

Stock A: trends from 150 over time

Stock B: trends from 135 over time

Spread (A - B): oscillates around $5

The spread is stationary even though both stocks trend.

This is the foundation of pairs trading.

You’re not betting on direction. You’re betting the spread returns to normal.

IV – Risk Management Math

How to not blow up

Edge doesn’t matter if you size wrong.

5.1 Value at Risk (VaR)

Maximum expected loss at a given confidence level.

95% VaR = $5,000 means:

95% of the time, you won’t lose more than $5,000.

But 5% of the time, you might lose more (possibly much more).

5.2 Sharpe Ratio

Risk-adjusted return

Sharpe = (Return - Risk-Free Rate) / Volatility

Measures how much return you get per unit of risk.

Two strategies with same return but different volatility have different Sharpe ratios.

Lower volatility = higher Sharpe = better risk-adjusted performance.

5.3 Maximum Drawdown

Biggest peak-to-trough loss.

More intuitive than volatility for most people.

Critical question: Can you psychologically handle that?

Can your account survive it without hitting margin calls?

5.5 Monte Carlo Simulation

Your backtest shows one sequence of trades.

Monte Carlo randomizes the order and runs thousands of simulations.

Why this matters:

Maybe your backtest got lucky with trade sequencing.

Maybe the worst drawdown hasn’t happened yet.

Monte Carlo shows the range of possible outcomes, not just the one path you observed.

VVI – How I Actually Learned This

Here’s some great books on the topics and even further knowledge.

Quantitative Trading by Ernie Chan

How to build your own algorithmic trading business.

Algorithmic Trading by Ernie Chan

Winning strategies and their rationale.

Time Series Analysis by Hamilton

The definitive reference. Dense but comprehensive.

Analysis of Financial Time Series by Tsay

Focused specifically on financial applications.

The Mathematics of Money Management by Ralph Vince

Classic text on position sizing.

Testing and Tuning Market Trading Systems by Timothy Masters

How to test strategies without overfitting.

VI – What You Actually Need

You don’t need all of this to start.

But you need to know what you don’t know.

Minimum for backtesting strategies:

  • Mean, median, standard deviation

  • Correlation

  • Basic probability

  • Sharpe ratio, max drawdown

Start with statistics.

That alone separates you from most newcomers.

Thanks for reading.

– Mounir


Tags

기타