The Claude Quant PlaybookDownload ebookDownload ebook

Family 8 of 9 · 13 formulas · each in 3D

Risk and portfolio

Sharpe and Sortino, drawdown, value at risk, expected shortfall, beta, diversification and how much to bet. Returns get the headlines; risk decides whether you survive long enough to collect them.

Build a trading system with Claude.Download ebook

Showing all 13

  1. 01beginner

    Sharpe ratio

    The Sharpe ratio is the return a strategy earns above cash, divided by how much its returns bounce around. It answers one question: how much reward do you get for each unit of risk you take?

    Used by portfolio manager: Compares funds and strategies with very different risk levels on one scale, and reports it to investors.

    Full lesson
  2. 02intermediate

    Sortino ratio

    The Sortino ratio is a Sharpe ratio that only counts bad volatility. Returns above the target do not count as risk; only the shortfalls below it go into the denominator.

    Used by portfolio manager: Reports it for strategies with lopsided returns, such as option buying or trend following, where big up days would unfairly lower the Sharpe ratio.

    Full lesson
  3. 03beginner

    Maximum drawdown

    Maximum drawdown is the biggest fall from a peak to a later low, as a share of the peak. It is the worst loss you would have suffered if you had invested at the worst possible moment.

    Used by risk manager: Sets drawdown limits: if a desk or strategy falls a set percentage from its peak, it must cut risk or stop trading.

    Full lesson
  4. 04intermediate

    Value at risk (VaR)

    Value at risk is a loss threshold: with confidence c, you will not lose more than this over the horizon. This version assumes normal returns with zero mean, so VaR is a fixed number of standard deviations of the P&L.

    Used by risk manager: Reports the firm's daily VaR and sets VaR limits for each desk, so risk can be compared across very different products.

    Full lesson
  5. 05advanced

    Expected shortfall (CVaR)

    Expected shortfall is the average loss in the tail beyond VaR. VaR tells you where the bad days start; expected shortfall tells you how bad they are on average.

    Used by risk manager: Reports expected shortfall alongside VaR, because it reacts to how fat the tail is, not just where it begins.

    Full lesson
  6. 06intermediate

    Beta

    Beta is the slope of a stock's returns against the market's returns. A beta of 1.5 means the stock tends to move 1.5% for every 1% the market moves.

    Used by portfolio manager: Adds up the betas of all holdings to know how much the portfolio will move with the market, and hedges with index futures.

    Full lesson
  7. 07intermediate

    Capital asset pricing model (CAPM)

    CAPM says an asset's expected return is the risk-free rate plus its beta times the market's extra return. Only market risk is paid for; risk you could diversify away earns nothing.

    Used by portfolio manager: Uses it as the benchmark: any return above the CAPM line is alpha, the part that skill must explain.

    Full lesson
  8. 08intermediate

    Two-asset portfolio variance

    The risk of a mix of two assets is not the average of their risks. It depends on how they move together: the less correlated they are, the more their ups and downs cancel.

    Used by portfolio manager: Checks how adding a new holding changes total risk, which depends far more on its correlation than on its own volatility.

    Full lesson
  9. 09advanced

    Minimum-variance portfolio

    Of all the ways to split money between two assets, one mix has the least risk. This formula gives that weight, using only the volatilities and the correlation, not the expected returns.

    Used by portfolio manager: Runs minimum-variance portfolios as a low-risk product, because they need no return forecasts, which are the noisiest input.

    Full lesson
  10. 10intermediate

    Kelly criterion

    The Kelly criterion is the bet size that makes your bankroll grow fastest over many bets. Bet less and you grow slower; bet more and you grow slower too, and far enough past it you shrink.

    Used by portfolio manager: Uses Kelly as an upper limit on leverage for a strategy with a known edge, and usually runs at a fraction of it.

    Full lesson
  11. 11intermediate

    Risk of ruin

    If you bet one unit at a time on even-money bets with an edge, this is the chance you go broke before your bankroll runs away from zero. It falls exponentially with the number of units you start with.

    Used by retail trader: Checks whether a positive-edge system is safe at their trade size, or likely to wipe them out on a bad run first.

    Full lesson
  12. 12beginner

    Fixed-fractional position sizing

    Decide how much money you are willing to lose if the trade fails, then buy exactly enough shares that hitting your stop loses that amount. The stop sets the size, not the other way round.

    Used by retail trader: Risks a fixed 0.5% to 2% of the account per trade, so a losing streak dents the account instead of ending it.

    Full lesson
  13. 13beginner

    Diversification and the correlation floor

    Spreading money equally over more assets lowers risk, quickly at first and then more and more slowly. The risk never falls below a floor set by how correlated the assets are.

    Used by portfolio manager: Decides how many positions are enough: past a few dozen, extra names barely lower risk if they are correlated.

    Full lesson

Rather not code the maths yourself? Describe your trading idea and let AI build the bot.

Build a bot with AgenKit

Every model is drawn from the formula's own code, so what you see is the exact maths. Models simplify markets on purpose. This is education, not financial advice.