Skip to content

Trading Formulas Reference

Difficulty beginner

Returns and Price

Simple Return

R_t = (P_t - P_{t-1}) / P_{t-1} = P_t / P_{t-1} - 1

where: R_t simple return at time t · P_t price at time t · P_{t-1} price at the previous period. does: percent change in price between two consecutive observations · the most common return measure for retail use.

Log Return

r_t = ln(P_t / P_{t-1}) = ln(P_t) - ln(P_{t-1})

where: r_t continuously-compounded (log) return · ln natural logarithm. does: time-additive return — log returns over multiple periods sum directly (unlike simple returns). Preferred for statistical modelling.

Multi-Period Return

R_{t,t+n} = (P_{t+n} / P_t) - 1
r_{t,t+n} = Σ_{i=1}^{n} r_{t+i-1, t+i}

where: R_{t,t+n} simple return over n periods · r_{t,t+n} log return over n periods · Σ sum. does: aggregates n single-period returns into one. Log returns chain by addition; simple returns chain by multiplication of (1+R).

Annualized Return

R_annual = (1 + R_total)^(252/n) - 1
r_annual = r_daily × 252

where: R_total cumulative simple return over n trading days · 252 standard count of US equity trading days per year · r_daily daily log return. does: scales any-horizon return to an annual equivalent — required for cross-strategy comparison.

Total Return (with dividends)

TR_t = (P_t + D_t - P_{t-1}) / P_{t-1}

where: TR_t total return · P_t price at time t · D_t dividend paid in period t · P_{t-1} price at previous period. does: captures both price appreciation and income — the only "honest" return measure for dividend-paying assets.

Risk and Volatility

Variance

σ² = Σ(R_i - R̄)² / (n-1)

where: σ² sample variance · R_i individual return observation · mean return · n-1 Bessel-corrected denominator for unbiased sample estimate. does: average squared deviation from the mean — the foundational dispersion measure. Square root = standard deviation.

Standard Deviation (Volatility)

σ = √σ²
σ_annual = σ_daily × √252

where: σ standard deviation (volatility) · σ_daily daily volatility · √252 scaling factor under the square-root-of-time rule (assumes i.i.d. returns). does: dispersion in the same units as returns. The annualization step assumes returns are independent across days — a simplifying assumption.

Average True Range (ATR)

TR = max(H-L, |H-C_{prev}|, |L-C_{prev}|)
ATR = MA(TR, n)

where: H period high · L period low · C_{prev} previous close · MA(·, n) n-period moving average (typically Wilder smoothing with n=14). does: volatility measure that captures intraday range AND gap risk — used heavily for stop placement and position sizing across asset classes.

Downside Deviation

σ_down = √[Σ min(0, R_i - MAR)² / n]
MAR = Minimum Acceptable Return

where: σ_down downside deviation · R_i return observation · MAR minimum acceptable return (often 0 or risk-free rate) · min(0, ·) clips positive deviations to zero. does: measures only "bad" volatility (returns below MAR). Used in Sortino ratio. Captures the asymmetric pain of losses vs. gains.

Semi-Variance

σ²_semi = Σ_{R_i < R̄} (R_i - R̄)² / n

where: σ²_semi semi-variance (downside variance only) · summation is restricted to observations below the mean. does: like variance but only counts below-mean returns. A purer "downside risk" view than total variance.

Risk-Adjusted Returns

Sharpe Ratio

Sharpe = (R_p - R_f) / σ_p

where: R_p portfolio return · R_f risk-free rate · σ_p portfolio standard deviation. does: excess return per unit of total volatility. Industry-standard headline ratio. Penalizes upside volatility too — see Sortino for asymmetric alternative.

Sortino Ratio

Sortino = (R_p - R_f) / σ_down

where: R_p portfolio return · R_f risk-free rate · σ_down downside deviation. does: like Sharpe but uses only downside deviation. Better for asymmetric-return strategies (options-selling, tail-hedges).

Calmar Ratio

Calmar = CAGR / |Max Drawdown|

where: CAGR compound annual growth rate · Max Drawdown largest peak-to-trough decline (negative number, taken in absolute value). does: return-per-unit-of-pain. Favored by CTAs and trend-followers because it directly reflects worst historical experience.

Information Ratio

IR = (R_p - R_b) / σ_(p-b)
Tracking Error = σ_(p-b)

where: R_p portfolio return · R_b benchmark return · σ_(p-b) standard deviation of (R_p − R_b), i.e. tracking error. does: active manager's Sharpe ratio — measures excess return per unit of tracking risk vs. benchmark.

Treynor Ratio

Treynor = (R_p - R_f) / β_p

where: R_p portfolio return · R_f risk-free rate · β_p portfolio beta to the market. does: excess return per unit of systematic (non-diversifiable) risk. Useful when the portfolio is one slice of a larger diversified holding.

Omega Ratio

Omega = ∫_r^∞ (1-F(x))dx / ∫_{-∞}^r F(x)dx

where: r threshold return · F(x) cumulative distribution function of returns · the numerator integrates upside above r, the denominator integrates downside below r. does: ratio of probability-weighted gains to losses above/below a threshold. Captures the full return distribution shape, not just mean/variance.

Sterling Ratio

Sterling = CAGR / Average Drawdown

where: CAGR compound annual growth rate · Average Drawdown mean of the n largest historical drawdowns (typically 3 or 5). does: like Calmar but uses average rather than maximum drawdown — less sensitive to one extreme historical event.

Burke Ratio

Burke = (R_p - R_f) / √[Σ DD_i² / n]

where: R_p portfolio return · R_f risk-free rate · DD_i individual drawdown · denominator = RMS of all drawdowns. does: weights all drawdowns (not just the worst) by their squared magnitude. Sensitive to repeated medium drawdowns.

Drawdown

Drawdown

DD_t = (V_t - Peak_t) / Peak_t
Peak_t = max(V_0, V_1, ..., V_t)

where: DD_t drawdown at time t (≤ 0) · V_t portfolio value at time t · Peak_t running maximum of value through time t. does: percentage decline from the running peak. Zero when at a new high; negative otherwise.

Maximum Drawdown

MDD = min(DD_t) for all t

where: MDD maximum drawdown (most negative DD over the sample) · t time index over the full observation window. does: the worst peak-to-trough loss experienced. The single most-cited risk metric beyond volatility.

Recovery Time

T_recovery = first t where V_t = Peak after MDD

where: T_recovery time taken for value to return to the previous peak after the maximum drawdown. does: measures how long underwater the strategy stayed. Critical for assessing whether the strategy is psychologically tradeable.

Ulcer Index

UI = √[Σ DD_i² / n]

where: DD_i individual drawdown observation · n number of observations · denominator inside the root = mean squared drawdown. does: RMS of drawdowns — penalizes both depth and duration. Lower = smoother equity curve.

Value at Risk (VaR)

Parametric VaR

VaR_α = V_p × (μ - z_α × σ) × √t

where: α confidence level (e.g. 0.95) · V_p portfolio value · μ expected return · z_α standard normal quantile (1.645 for 95%, 2.326 for 99%) · σ volatility · t time horizon in years. does: quantile of the assumed-normal P&L distribution. Fast to compute but underestimates tail risk because real returns are not normal.

Historical VaR

VaR_α = α-percentile of historical returns × V_p

where: α-percentile empirical quantile of past return observations · V_p portfolio value. does: non-parametric VaR using only past data — captures empirical shape including skew/kurtosis but limited to events that actually occurred in-sample.

Cornish-Fisher VaR (adjusted for skewness/kurtosis)

z_cf = z + (z²-1)S/6 + (z³-3z)K/24 - (2z³-5z)S²/36
VaR_cf = V_p × (μ - z_cf × σ) × √t

where: z standard normal quantile · S sample skewness · K sample excess kurtosis · V_p portfolio value · μ mean · σ volatility · t horizon. does: adjusts the normal-distribution quantile for the observed skew and kurtosis — closer to empirical tails than parametric VaR.

Conditional VaR (Expected Shortfall)

CVaR_α = E[L | L > VaR_α]

where: L loss · VaR_α value-at-risk at confidence α · E[· | ·] conditional expectation. does: average loss given the loss exceeds VaR — captures the magnitude of tail events, not just their threshold. Coherent risk measure (unlike VaR).

Position Sizing

Fixed Fractional

Position Size = Account Risk $ / (Entry - Stop)
Account Risk $ = Account Value × Risk %

where: Entry - Stop per-share dollar risk · Risk % fraction of equity risked per trade (typically 1–2%) · Account Value current equity. does: sizes positions so that hitting the stop loses exactly the predefined % of equity — keeps risk constant regardless of price level.

Kelly Criterion

f* = (bp - q) / b
where:
b = odds (avg win / avg loss)
p = win probability
q = 1 - p

For continuous returns:
f* = μ / σ²

where (continuous): f* optimal fraction of capital to bet · μ expected return · σ² variance of returns. does: maximizes the expected logarithm of wealth (geometric growth). Full Kelly is aggressive — most traders use half- or quarter-Kelly.

f = f* / 2

where: f* full Kelly fraction · f practical sizing fraction. does: captures ~75% of full Kelly's expected growth with roughly 1/4 the variance — far more robust to parameter estimation noise.

Volatility-Based Sizing

Position Size = (Account × Risk %) / (ATR × Multiplier)

where: ATR average true range · Multiplier how many ATR you allow before stopping out (e.g. 2-3) · Risk % equity risked per trade. does: normalizes position size by realized volatility — high-vol assets get smaller positions automatically.

Risk Parity

w_i = (1/σ_i) / Σ(1/σ_j)

where: w_i weight on asset i · σ_i volatility of asset i · denominator sums inverse-volatility across all assets. does: weights assets so that each contributes equal risk to the portfolio. Highly diversifying across asset classes.

Portfolio Theory

Portfolio Return

R_p = Σ w_i R_i

where: R_p portfolio return · w_i weight on asset i · R_i return on asset i · Σ sum over all assets. does: the portfolio return is a weighted average of constituent returns — linear regardless of correlation.

Portfolio Variance (2 assets)

σ²_p = w₁²σ₁² + w₂²σ₂² + 2w₁w₂ρ₁₂σ₁σ₂

where: w_i weight · σ_i standard deviation · ρ₁₂ correlation between asset 1 and asset 2. does: variance is not a weighted average — the cross term reveals that correlation reduces (or amplifies) portfolio risk vs. the sum of individual risks.

Portfolio Variance (n assets)

σ²_p = w'Σw

where: w column vector of portfolio weights (n×1) · Σ covariance matrix of asset returns (n×n) · w' transpose of w (1×n). does: matrix form generalizing the 2-asset case to n assets — the basis of mean-variance optimization.

Optimal Weights (Markowitz)

Minimize: w'Σw
Subject to: w'μ = target return, Σw_i = 1

Solution:
w = λΣ⁻¹μ + γΣ⁻¹1

where: w weights vector · Σ covariance matrix · μ expected return vector · 1 vector of ones · λ, γ Lagrange multipliers solving the constrained optimization. does: finds the minimum-variance weights for a target return. Each (return, variance) pair traces out the efficient frontier.

Capital Asset Pricing Model (CAPM)

E(R_i) = R_f + β_i(E(R_m) - R_f)
β_i = Cov(R_i, R_m) / Var(R_m)
α_i = R_i - [R_f + β_i(R_m - R_f)]

where: E(R_i) expected return on asset i · R_f risk-free rate · β_i asset's sensitivity to market · E(R_m) expected market return · α_i Jensen's alpha (excess return unexplained by beta). does: decomposes asset return into risk-free rate + compensation for systematic risk + idiosyncratic alpha. Bedrock asset-pricing model.

Arbitrage Pricing Theory (APT)

E(R_i) = R_f + β_i1F₁ + β_i2F₂ + ... + β_inF_n

where: E(R_i) expected return on asset i · R_f risk-free rate · β_ij factor loading of asset i on factor j · F_j premium associated with factor j. does: multi-factor generalization of CAPM. Equity factors typically include market, size, value, momentum, quality, low-vol.

Technical Indicators

Moving Averages

SMA = Σ P_i / n
EMA_t = P_t × k + EMA_{t-1} × (1-k)
where k = 2/(n+1)
WMA = Σ (w_i × P_i) / Σ w_i

where: SMA simple moving average · EMA exponential moving average · k smoothing factor (higher k = more weight on recent prices) · WMA weighted MA with explicit weights w_i. does: smooths price to reveal trend. EMA reacts faster to new data than SMA at the same period; WMA lets you customize the weighting profile.

Relative Strength Index (RSI)

RS = Avg Gain / Avg Loss
RSI = 100 - 100/(1 + RS)

where: Avg Gain rolling average of positive price changes over n periods (typically 14) · Avg Loss rolling average of absolute negative changes · RS relative strength. does: bounded 0–100 momentum oscillator. >70 conventionally "overbought", <30 "oversold" — but use as a context signal, not a standalone trigger.

MACD

MACD = EMA(12) - EMA(26)
Signal = EMA(MACD, 9)
Histogram = MACD - Signal

where: EMA periods (12, 26, 9) are convention from Appel · Signal is the EMA of the MACD line itself · Histogram is the divergence between MACD and its signal. does: combines a faster and slower EMA to flag trend changes (crossovers) and momentum shifts (histogram).

Bollinger Bands

Middle = SMA(n)
Upper = SMA(n) + k × σ(n)
Lower = SMA(n) - k × σ(n)
%b = (P - Lower) / (Upper - Lower)
Bandwidth = (Upper - Lower) / Middle

where: n lookback (typically 20) · k standard-deviation multiplier (typically 2) · σ(n) n-period rolling standard deviation · %b price's position within the bands (0=lower, 1=upper) · Bandwidth band width as fraction of midline. does: dynamic volatility bands. Squeeze (low bandwidth) often precedes breakouts; touches of the bands signal stretched conditions.

Average Directional Index (ADX)

+DM = max(High - PrevHigh, 0)
-DM = max(PrevLow - Low, 0)
+DI = 100 × EMA(+DM, n) / ATR(n)
-DI = 100 × EMA(-DM, n) / ATR(n)
DX = 100 × |+DI - -DI| / (|+DI| + |-DI|)
ADX = EMA(DX, n)

where: +DM/-DM directional movement (up/down) · ATR average true range · +DI/-DI directional indicators · DX raw directional index · ADX smoothed DX. does: measures trend strength irrespective of direction. ADX > 25 conventionally indicates a tradeable trend.

Options Pricing

Black-Scholes

d1 = [ln(S/K) + (r + σ²/2)T] / (σ√T)
d2 = d1 - σ√T

Call = S × N(d1) - K × e^{-rT} × N(d2)
Put = K × e^{-rT} × N(-d2) - S × N(-d1)

where: S current spot price · K strike price · r risk-free rate (annualized) · T time to expiration in years · σ annualized volatility · N(·) standard normal cumulative distribution function · e^{-rT} discount factor. does: closed-form price for European calls and puts under log-normal price dynamics. The foundation of modern options pricing.

Put-Call Parity

C - P = S - K × e^{-rT}

where: C European call price · P European put price · S spot · K strike · r risk-free rate · T time to expiry. does: model-free arbitrage relationship. Lets you synthesize one option from the other plus underlying — any deviation is risk-free profit (ignoring frictions).

Greeks

Delta (call) = N(d1)
Delta (put) = N(d1) - 1
Gamma = N'(d1) / (S × σ√T)
Theta (call) = -[S × N'(d1) × σ] / (2√T) - rK × e^{-rT} × N(d2)
Vega = S × N'(d1) × √T
Rho (call) = K × T × e^{-rT} × N(d2)

where: N'(·) standard normal density (PDF, not CDF) · all other symbols as in Black-Scholes above · Greek = partial derivative of option price w.r.t. one input. does: Delta (price sensitivity to S), Gamma (delta sensitivity to S), Theta (time decay per day), Vega (vol sensitivity), Rho (rate sensitivity). The hedge-and-risk vocabulary of options trading.

Implied Volatility

Find σ such that: BS(S, K, r, T, σ) = Market Price

where: BS(·) Black-Scholes price as a function of the inputs · the equation is solved numerically (Newton-Raphson or bisection) for σ. does: the σ the market is implicitly pricing in. Reverses Black-Scholes — given the market price, what volatility makes the model agree?

Performance Measurement

Compound Annual Growth Rate (CAGR)

CAGR = (V_end / V_start)^(1/n) - 1

where: V_end ending portfolio value · V_start starting value · n number of years. does: the constant annual rate that would produce the observed total return — the most-cited long-horizon return measure.

Profit Factor

PF = Gross Profit / Gross Loss

where: Gross Profit sum of all winning-trade P&Ls · Gross Loss absolute value of sum of all losing-trade P&Ls. does: ratio of dollars made to dollars lost. PF > 1 = strategy makes money before costs. Common rule of thumb: PF > 1.5 to be trade-worthy.

Expectancy

E = WR × AvgWin - (1-WR) × AvgLoss

where: WR win rate (0–1) · AvgWin average dollar amount won per winning trade · AvgLoss average dollar lost per losing trade. does: expected P&L per trade. The single most important number in evaluating a trading rule — negative expectancy means the strategy loses on average.

Win Rate

WR = Winning Trades / Total Trades

where: Winning Trades count of trades with P&L > 0 · Total Trades count of all closed trades. does: fraction of trades that are profitable. A high win rate with poor reward:risk can still be a losing strategy — see Expectancy.

Payoff Ratio

PR = AvgWin / AvgLoss

where: AvgWin average winning trade · AvgLoss average losing trade (absolute value). does: reward-to-risk on realized trades. PR < 1 needs high win rate to be profitable; PR > 2 can be profitable even at low win rates.

Maximum Consecutive Wins/Losses

MCW = max consecutive winning trades
MCL = max consecutive losing trades

where: counted as the longest unbroken streak across the full trade history. does: psychological stress indicators. Even a positive-expectancy strategy can have brutal losing streaks — knowing the historical worst helps you stay disciplined.

Recovery Factor

RF = Net Profit / |Max Drawdown|

where: Net Profit total cumulative profit · Max Drawdown largest peak-to-trough decline (absolute value). does: how many drawdowns' worth of profit you accumulated. RF > 3 over a multi-year window suggests robust expectancy relative to risk.

Squared Correlation (R²)

R² = 1 - SS_res / SS_tot

where: SS_res sum of squared residuals (Σ(y - ŷ)²) · SS_tot total sum of squares (Σ(y - ȳ)²) · ranges from 0 (no fit) to 1 (perfect fit). does: fraction of variance in the dependent variable explained by the model — the basic goodness-of-fit metric for regression.

Statistical Tests

t-Statistic

t = (x̄ - μ₀) / (s/√n)

where: sample mean · μ₀ hypothesized population mean (often 0) · s sample standard deviation · n sample size · denominator = standard error of the mean. does: tests how many standard errors the sample mean sits from a hypothesized value — basis for hypothesis testing on a single sample.

Z-Score

z = (x - μ) / σ

where: x raw observation · μ mean · σ standard deviation. does: standardizes a value to units of standard deviation from the mean. |z| > 2 conventionally marks an outlier.

Confidence Interval

CI = x̄ ± z × (σ/√n)

where: sample mean · z quantile of the standard normal (1.96 for 95%, 2.576 for 99%) · σ/√n standard error of the mean. does: range of plausible values for the true population mean at the chosen confidence level.

Correlation

ρ = Cov(X,Y) / (σₓ × σᵧ)

where: Cov(X,Y) covariance · σₓ, σᵧ standard deviations of X and Y · ρ Pearson correlation, range −1 to +1. does: standardized covariance — measures the strength of linear association. Beware: zero correlation does not imply independence.

Coefficient of Determination

R² = ρ²

where: for simple regression of Y on a single X, the coefficient of determination equals the squared Pearson correlation. does: quick way to get R² from a correlation when only one predictor is involved.

Market Microstructure

Effective Spread

Effective Spread = 2 × |Trade Price - Midpoint|

where: Trade Price price at which the trade executed · Midpoint (best bid + best ask) / 2 at the trade time. does: actual round-trip cost paid — usually narrower than the quoted spread because many trades execute inside the quoted bid-ask.

Implementation Shortfall

IS = (Decision Price - Execution Price) × Qty + Commissions

where: Decision Price mid (or last) at the moment the trade decision was made · Execution Price average fill price · Qty signed share count. does: measures total execution cost vs. the "paper" benchmark of trading instantly at the decision price. The honest scorecard for execution algorithms.

Market Impact (Square Root Model)

Impact = σ × Y × √(Qty / ADV)
where Y ≈ 0.5 to 1.0

where: σ daily volatility of the asset · Qty quantity to trade · ADV average daily volume · Y empirical scaling constant (0.5–1.0 across markets). does: expected adverse price move from executing a large order. The √-law is empirically robust across asset classes and venues.

VWAP

VWAP = Σ (P_i × V_i) / Σ V_i

where: P_i trade price · V_i trade volume · sum runs across all trades in the chosen window (intraday, session, etc.). does: the volume-weighted average price. Used as both a benchmark for execution and a target for participation-based algorithms.

Miscellaneous

Rule of 72

Years to double = 72 / Annual Return %

where: Annual Return % expressed as a whole number (e.g. 8, not 0.08). does: quick approximation for compounding time. Exact for returns near 8%; gets less accurate at very high or negative rates.

Continuously Compounded Return

r_continuous = ln(1 + R_discrete)

where: R_discrete periodic simple return (e.g. 0.01 = 1%) · ln natural log. does: converts a simple return into its continuously-compounded equivalent. Required when chaining periods additively.

Forward Price

F = S × e^{(r-q)T}
where q = dividend yield

where: F forward price · S spot price · r risk-free rate · q continuous dividend yield · T time to delivery in years. does: the no-arbitrage forward price for an asset paying continuous yield. For non-dividend assets q = 0 and F = S·e^{rT}.

Futures Basis

Basis = Spot Price - Futures Price

where: Spot Price cash market price · Futures Price futures contract price for a given delivery month. does: the difference between cash and futures prices. Converges to zero at expiry; non-zero values reflect carry costs, supply tightness, or financing pressure.

Cost of Carry

F = S × e^{(r + storage - convenience)T}

where: F futures price · S spot price · r risk-free financing rate · storage cost of physically holding the asset · convenience convenience yield (benefit of holding the physical) · T time to delivery. does: general no-arbitrage relation for commodity futures. Storage > convenience implies contango; storage < convenience implies backwardation.

Quick Reference Table

Metric Good Acceptable Poor
Sharpe > 1.5 0.5-1.5 < 0.5
Sortino > 2.0 0.7-2.0 < 0.7
Max DD < 10% 10-25% > 25%
Win Rate > 60% 45-60% < 45%
Profit Factor > 1.5 1.1-1.5 < 1.1
Calmar > 1.0 0.3-1.0 < 0.3