These are the most important equations in trading.
Modern Portfolio Theory (Markowitz)
Expected risk is the portfolio variance
- σ is the standard deviation (risk).
- Cij are the cross-correlations.
- wi are the weighting factors.
Trade Expectancy
- E = trade expectancy.
- PW = probability of a winning trade (win rate), W̄ = average winning trade.
- PL = probability of a losing trade (loss rate), L̄ = average losing trade.
Win Rate
- Measures the frequency of profitable trades.
Net Profit-to-Drawdown Ratio
- How much net profit a strategy generates for each dollar of drawdown risk.
- Example: $100,000 ÷ $20,000 = 5.0, so $5 of net profit for every $1 of maximum drawdown.
Risk-Reward Ratio
- Measures the amount risked relative to the potential reward.
R-Multiple
- Standardises trade results relative to the initial risk taken.
Sharpe Ratio
- Risk-adjusted return: excess return compared with the standard deviation of returns.
Sortino Ratio
- Rp = strategy or portfolio return, RT = target or minimum acceptable return.
- σd = downside deviation, the volatility of returns below the target.
- Sharpe penalises all volatility; Sortino penalises only downside volatility. Useful, because a large upside move is not a risk you want to be punished for.
Compound Annual Growth Rate (CAGR)
- The annualised rate at which an investment would have grown from its initial value to its final value.
Net Profit-to-Average-Drawdown Ratio
- DDi is the magnitude of each individual drawdown and N is the number of drawdown periods.
- A more formal risk-adjusted measure, the Sterling ratio, historically uses average drawdown, though definitions vary.
Profit Factor
- How many dollars of gross profit a strategy generates for every dollar it loses.
- Example: $120,000 ÷ $50,000 = 2.4, meaning $2.40 of gross winnings for every $1.00 lost.
- Profit factor is not a rate of return. A 2.4 profit factor does not mean a 240% return.
Position Sizing
Stocks
Futures
Risk of Ruin
- A = trading advantage (edge), C = trading capital, R = amount risked per trade.
- This is one simplified model. For real strategies with variable wins, losses and position sizing, Monte Carlo simulation is generally more useful for estimating the probability of hitting a given ruin or drawdown threshold.
Kaufman Efficiency Ratio
- Pt = current price, Pt−n = price n periods ago, n = lookback period.
- The ratio runs from 0 to 1. Near 1, price is moving efficiently in one direction, so the trend is stronger. Near 0, price is moving back and forth: noise and chop.
- For a mean-reversion strategy, a low efficiency ratio is useful for finding conditions where price movement is less directional.
Information Coefficient
For diversification
- St = strategy signal or forecast at time t, Rt+1 = the return that followed.
- Near +1, the signal strongly predicts returns in the right direction. Near 0, there is little or no predictive relationship. Near −1, it predicts them backwards.
Raw Stochastic
- C = current closing price, Ln = lowest low and Hn = highest high over the last n periods.
- Near 100, price is near the top of its recent range. Near 0, near the bottom.
Hurst Exponent
For fractal analysis
- H < 0.5: anti-persistent, a mean-reverting tendency.
- H ≈ 0.5: approximately random-walk behaviour.
- H > 0.5: persistent, a trending tendency.
Spectral Analysis
John Ehlers
- Spectral analysis decomposes price into frequency components; the frequency with the greatest meaningful power is read as the dominant cycle.
- Ehlers applies digital signal processing to prices: rather than assuming something like a 20-bar cycle, his methods estimate the market’s current dominant cycle and adapt indicators to it.
- Three different questions: the efficiency ratio asks how directionally price is moving, the Hurst exponent asks whether the series persists or reverts across scales, and spectral analysis asks which cycle lengths are prominent right now.
Fundamental Law of Active Management
- IR = information ratio, IC = information coefficient (skill), BR = breadth, the number of independent opportunities.
Volatility Scaling
- The square-root-of-time rule, using about 252 trading days a year.
Particle Swarm Optimization
Velocity update, then position update
- xi = a particle’s position, meaning one candidate set of strategy parameters; vi = its velocity; pi = its best solution so far; g = the swarm’s best.
- ω = inertia weight, c1 = cognitive coefficient, c2 = social coefficient, r1 and r2 = random values between 0 and 1.
- For strategy optimisation a particle might be (MA length, stop loss, entry threshold). The swarm searches for combinations that maximise a chosen objective: profit factor, Sharpe, or net profit over maximum drawdown.
Z-Score
- How many standard deviations the current observation sits above or below its mean.
- For mean reversion: Z > 2 is unusually high relative to its historical distribution, Z < −2 unusually low.
- A high or low Z-score does not itself mean price will revert. It only says how unusual the observation is within the chosen window, and markets can stay several standard deviations from their mean during strong trends.
Linear Regression
- β0 = intercept, β1 = slope, x = explanatory variable.
- In a price-against-time regression the slope gives the direction and rate of the fitted trend: β1 > 0 is an upward trend, β1 < 0 downward.
- The residual says how far the observed value sits from what the regression predicts. Z-scoring that residual is a common building block in statistical mean-reversion and pairs trading.
The MAR Ratio
- Example: CAGR 30% with a maximum drawdown of 15% gives MAR = 2.0.
- A higher MAR means more compound annual growth relative to the worst historical drawdown.
Not mentioned: Monte Carlo and Genetic Algorithms, because not standardized.
Equations you don’t need
The Black-Scholes Partial Differential Equation
It describes how the theoretical value V of a derivative evolves with the underlying asset price and time under the model’s assumptions.
A more sophisticated modern derivative-pricing setup might involve a stochastic-volatility model, such as Heston:
Now volatility itself is random, so you’re simultaneously modeling price and volatility.