Money Machine

Equations

The maths we measure with

These are the most important equations in trading.

  1. Modern Portfolio Theory (Markowitz)

    Expected risk is the portfolio variance

    σR2=∑wi2σi2+∑∑wiwjCij
    • σ is the standard deviation (risk).
    • Cij are the cross-correlations.
    • wi are the weighting factors.
  2. Trade Expectancy

    E=(PW×W‾)−(PL×L‾)
    • 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.
  3. Win Rate

    Win Rate=Winning TradesTotal Trades
    • Measures the frequency of profitable trades.
  4. Net Profit-to-Drawdown Ratio

    Net Profit-to-Drawdown=Net ProfitMaximum Drawdown
    • 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.
  5. Risk-Reward Ratio

    Risk-Reward=RiskReward
    • Measures the amount risked relative to the potential reward.
  6. R-Multiple

    R-Multiple=Trade Profit or LossInitial Risk
    • Standardises trade results relative to the initial risk taken.
  7. Sharpe Ratio

    S=Rp−Rfσp
    • Risk-adjusted return: excess return compared with the standard deviation of returns.
  8. Sortino Ratio

    Sortino=Rp−RTσd
    • 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.
  9. Compound Annual Growth Rate (CAGR)

    CAGR=(VfVi)1/n−1
    • The annualised rate at which an investment would have grown from its initial value to its final value.
  10. Net Profit-to-Average-Drawdown Ratio

    Net Profit-to-Average Drawdown=Net ProfitAverage Drawdown
    Average Drawdown=∑i=1NDDiN
    • 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.
  11. Profit Factor

    Profit Factor=Gross ProfitGross Loss
    • 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.
  12. Position Sizing

    Stocks

    Position Size=Account Size×Risk %|Entry Price−Stop Loss Price|

    Futures

    Position Size=Account Size×Risk %|Entry−Stop|×Dollar Value per Point
  13. Risk of Ruin

    ROR=(1−A1+A)C/R
    • 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.
  14. Kaufman Efficiency Ratio

    ER=|Pt−Pt−n|∑i=1n|Pt−i+1−Pt−i|
    • 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.
  15. Information Coefficient

    For diversification

    IC=Corr(St,Rt+1)
    • 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.
  16. Raw Stochastic

    %K=C−LnHn−Ln×100
    • 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.
  17. Hurst Exponent

    For fractal analysis

    R(n)S(n)∝nH
    • H < 0.5: anti-persistent, a mean-reverting tendency.
    • H ≈ 0.5: approximately random-walk behaviour.
    • H > 0.5: persistent, a trending tendency.
  18. Spectral Analysis

    John Ehlers

    X(f)=∑t=0N−1xte−i2πft/N
    P(f)=|X(f)|2Dominant Cycle Period=1fdominant
    • 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.
  19. Fundamental Law of Active Management

    IR≈ICBR
    Performance≈Skill×Diversification
    • IR = information ratio, IC = information coefficient (skill), BR = breadth, the number of independent opportunities.
  20. Volatility Scaling

    σshort=σlongT
    σdaily=σannual252σannual=σdaily252
    • The square-root-of-time rule, using about 252 trading days a year.
  21. Particle Swarm Optimization

    Velocity update, then position update

    vi(t+1)=ωvi(t)+c1r1[pi−xi(t)]+c2r2[g−xi(t)]
    xi(t+1)=xi(t)+vi(t+1)
    • 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.
  22. Z-Score

    Z=x−μσ
    • 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.
  23. Linear Regression

    y^=β0+β1x
    et=yt−y^t
    • β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.
  24. The MAR Ratio

    MAR=CAGRMaximum Drawdown
    • 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

∂V∂t+12σ2S2∂2V∂S2+rS∂V∂S−rV=0

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:

dSt=μStdt+vtStdWtSdvt=κ(θ−vt)dt+ξvtdWtvdWtSdWtv=ρdt

Now volatility itself is random, so you’re simultaneously modeling price and volatility.