Trading Formulas Reference¶
Difficulty beginner
Returns and Price¶
Simple Return¶
where:
R_tsimple return at time t ·P_tprice 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¶
where:
r_tcontinuously-compounded (log) return ·lnnatural logarithm. does: time-additive return — log returns over multiple periods sum directly (unlike simple returns). Preferred for statistical modelling.
Multi-Period Return¶
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¶
where:
R_totalcumulative simple return over n trading days ·252standard count of US equity trading days per year ·r_dailydaily log return. does: scales any-horizon return to an annual equivalent — required for cross-strategy comparison.
Total Return (with dividends)¶
where:
TR_ttotal return ·P_tprice at time t ·D_tdividend 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¶
where:
σ²sample variance ·R_iindividual return observation ·R̄mean return ·n-1Bessel-corrected denominator for unbiased sample estimate. does: average squared deviation from the mean — the foundational dispersion measure. Square root = standard deviation.
Standard Deviation (Volatility)¶
where:
σstandard deviation (volatility) ·σ_dailydaily volatility ·√252scaling 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)¶
where:
Hperiod high ·Lperiod 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¶
where:
σ_downdownside deviation ·R_ireturn observation ·MARminimum 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¶
where:
σ²_semisemi-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¶
where:
R_pportfolio return ·R_frisk-free rate ·σ_pportfolio 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¶
where:
R_pportfolio return ·R_frisk-free rate ·σ_downdownside deviation. does: like Sharpe but uses only downside deviation. Better for asymmetric-return strategies (options-selling, tail-hedges).
Calmar Ratio¶
where:
CAGRcompound annual growth rate ·Max Drawdownlargest 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¶
where:
R_pportfolio return ·R_bbenchmark 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¶
where:
R_pportfolio return ·R_frisk-free rate ·β_pportfolio 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¶
where:
rthreshold 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¶
where:
CAGRcompound annual growth rate ·Average Drawdownmean 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¶
where:
R_pportfolio return ·R_frisk-free rate ·DD_iindividual 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¶
where:
DD_tdrawdown at time t (≤ 0) ·V_tportfolio value at time t ·Peak_trunning maximum of value through time t. does: percentage decline from the running peak. Zero when at a new high; negative otherwise.
Maximum Drawdown¶
where:
MDDmaximum drawdown (most negative DD over the sample) ·ttime index over the full observation window. does: the worst peak-to-trough loss experienced. The single most-cited risk metric beyond volatility.
Recovery Time¶
where:
T_recoverytime 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¶
where:
DD_iindividual drawdown observation ·nnumber 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¶
where:
αconfidence level (e.g. 0.95) ·V_pportfolio value ·μexpected return ·z_αstandard normal quantile (1.645 for 95%, 2.326 for 99%) ·σvolatility ·ttime 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¶
where:
α-percentileempirical quantile of past return observations ·V_pportfolio 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)¶
where:
zstandard normal quantile ·Ssample skewness ·Ksample excess kurtosis ·V_pportfolio value ·μmean ·σvolatility ·thorizon. does: adjusts the normal-distribution quantile for the observed skew and kurtosis — closer to empirical tails than parametric VaR.
Conditional VaR (Expected Shortfall)¶
where:
Lloss ·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¶
where:
Entry - Stopper-share dollar risk ·Risk %fraction of equity risked per trade (typically 1–2%) ·Account Valuecurrent 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.
Half-Kelly (recommended)¶
where:
f*full Kelly fraction ·fpractical 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¶
where:
ATRaverage true range ·Multiplierhow 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¶
where:
w_iweight on asset i ·σ_ivolatility 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¶
where:
R_pportfolio return ·w_iweight on asset i ·R_ireturn 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)¶
where:
w_iweight ·σ_istandard 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)¶
where:
wcolumn 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)¶
where:
wweights vector ·Σcovariance matrix ·μexpected return vector ·1vector 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)¶
where:
E(R_i)expected return on asset i ·R_frisk-free rate ·β_iasset's sensitivity to market ·E(R_m)expected market return ·α_iJensen'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)¶
where:
E(R_i)expected return on asset i ·R_frisk-free rate ·β_ijfactor loading of asset i on factor j ·F_jpremium 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¶
where:
SMAsimple moving average ·EMAexponential moving average ·ksmoothing factor (higher k = more weight on recent prices) ·WMAweighted MA with explicit weightsw_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)¶
where:
Avg Gainrolling average of positive price changes over n periods (typically 14) ·Avg Lossrolling average of absolute negative changes ·RSrelative strength. does: bounded 0–100 momentum oscillator. >70 conventionally "overbought", <30 "oversold" — but use as a context signal, not a standalone trigger.
MACD¶
where: EMA periods (12, 26, 9) are convention from Appel ·
Signalis the EMA of the MACD line itself ·Histogramis 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:
nlookback (typically 20) ·kstandard-deviation multiplier (typically 2) ·σ(n)n-period rolling standard deviation ·%bprice's position within the bands (0=lower, 1=upper) ·Bandwidthband 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/-DMdirectional movement (up/down) ·ATRaverage true range ·+DI/-DIdirectional indicators ·DXraw directional index ·ADXsmoothed 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:
Scurrent spot price ·Kstrike price ·rrisk-free rate (annualized) ·Ttime 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¶
where:
CEuropean call price ·PEuropean put price ·Sspot ·Kstrike ·rrisk-free rate ·Ttime 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¶
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)¶
where:
V_endending portfolio value ·V_startstarting value ·nnumber of years. does: the constant annual rate that would produce the observed total return — the most-cited long-horizon return measure.
Profit Factor¶
where:
Gross Profitsum of all winning-trade P&Ls ·Gross Lossabsolute 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¶
where:
WRwin rate (0–1) ·AvgWinaverage dollar amount won per winning trade ·AvgLossaverage 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¶
where:
Winning Tradescount of trades with P&L > 0 ·Total Tradescount 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¶
where:
AvgWinaverage winning trade ·AvgLossaverage 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¶
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¶
where:
Net Profittotal cumulative profit ·Max Drawdownlargest 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²)¶
where:
SS_ressum of squared residuals (Σ(y - ŷ)²) ·SS_tottotal 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¶
where:
x̄sample mean ·μ₀hypothesized population mean (often 0) ·ssample standard deviation ·nsample 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¶
where:
xraw observation ·μmean ·σstandard deviation. does: standardizes a value to units of standard deviation from the mean. |z| > 2 conventionally marks an outlier.
Confidence Interval¶
where:
x̄sample mean ·zquantile of the standard normal (1.96 for 95%, 2.576 for 99%) ·σ/√nstandard error of the mean. does: range of plausible values for the true population mean at the chosen confidence level.
Correlation¶
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¶
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¶
where:
Trade Priceprice 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¶
where:
Decision Pricemid (or last) at the moment the trade decision was made ·Execution Priceaverage fill price ·Qtysigned 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)¶
where:
σdaily volatility of the asset ·Qtyquantity to trade ·ADVaverage daily volume ·Yempirical 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¶
where:
P_itrade price ·V_itrade 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¶
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¶
where:
R_discreteperiodic simple return (e.g. 0.01 = 1%) ·lnnatural log. does: converts a simple return into its continuously-compounded equivalent. Required when chaining periods additively.
Forward Price¶
where:
Fforward price ·Sspot price ·rrisk-free rate ·qcontinuous dividend yield ·Ttime 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¶
where:
Spot Pricecash market price ·Futures Pricefutures 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¶
where:
Ffutures price ·Sspot price ·rrisk-free financing rate ·storagecost of physically holding the asset ·convenienceconvenience yield (benefit of holding the physical) ·Ttime 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 |