← Back to Financial Concepts
Risk Metrics

Maximum Drawdown

Max drawdown measures largest peak-to-trough decline. Critical for tail risk—it captures worst-case, unlike symmetric volatility.

Max Drawdown
0%
Max Peak
$0
Final Value
$0

The Formula

MaxDrawdown = (Trough - Peak) / Peak

How It Works

// Calculate maximum drawdown from price series
function maxDrawdown(prices) {
    let maxDD = 0;
    let peak = prices[0];
    
    for (const price of prices) {
        if (price > peak) {
            peak = price;  // New high found
        }
        const dd = (peak - price) / peak;
        if (dd > maxDD) {
            maxDD = dd;  // New max drawdown
        }
    }
    return maxDD;
}

// GBM simulation for price path
function simulateGBM(S0, mu, sigma, T) {
    const dt = T / 60;  // monthly steps
    const prices = [S0];
    let S = S0;
    
    for (let i = 0; i < 60; i++) {
        const drift = (mu - 0.5 * sigma * sigma) * dt;
        const shock = sigma * Math.sqrt(dt) * randn();
        S = S * Math.exp(drift + shock);
        prices.push(S);
    }
    return prices;
}