{adamcoding}
Part II
10
Chapter 10

Position Sizing and Risk

Your edge determines whether the equity curve points upward. Your position sizing determines whether you're still there to see it. These are separate problems and people conflate them constantly.

Fixed fractional risk

The baseline, and adequate for most purposes: risk a constant fraction of equity per trade.

python
def position_size(equity, risk_pct, entry_price, stop_price, contract_size=1):
    risk_amount = equity * (risk_pct / 100)
    risk_per_unit = abs(entry_price - stop_price) * contract_size
    if risk_per_unit <= 0:
        return 0
    return risk_amount / risk_per_unit

Properties worth understanding: position size shrinks automatically in drawdown (protective) and grows in profit (compounding). Every trade contributes the same risk in R terms, which is what makes expectancy measurable in the first place.

Typical values are 0.5% to 2% per trade. If that sounds timid, revisit the drawdown simulation in Chapter 4 - a 15R drawdown is routine for a working system, and at 2% risk that's a 30% account decline.

Volatility targeting

Fixed fractional risk already adapts to volatility if your stop is ATR-based, since a wider stop yields a smaller position. Volatility targeting generalises this to the portfolio: scale exposure so that predicted portfolio volatility stays constant.

The rationale is that market volatility varies by a factor of five or more between calm and stressed regimes. Constant notional exposure means your actual risk swings wildly. Constant volatility exposure means your risk is stable and your worst periods are less catastrophic.

The caveat: volatility is predictable in the short run (it clusters) but the relationship between volatility and return is not stable. Vol targeting is a risk-management tool, not an alpha source.

Correlation, and the error that ends accounts

This is the single most expensive mistake in the chapter.

You have five positions, each risking 2%. You believe you're risking 10% in the worst case. That is true only if the positions are independent.

If all five are long tech stocks, you do not have five positions. You have one position at 10% risk, with extra commission. If all five are long anything during a liquidity crisis, the same is true - correlations converge toward 1 exactly when you need them not to. The diversification you measured in calm periods evaporates in the periods that determine your survival.

Two practical defences:

Portfolio heat - total risk across all open positions, with a hard cap:

python
def can_open_position(open_positions, new_risk_pct, max_heat_pct=6.0):
    current_heat = sum(p.risk_pct for p in open_positions)
    return (current_heat + new_risk_pct) <= max_heat_pct

Correlation-adjusted heat - group positions into correlation clusters and cap risk per cluster, not per position. Two highly correlated positions count as roughly one.

And when estimating correlations, use crisis-period data, not full-sample. The full-sample correlation is an average that includes the calm periods. The number you need is the one that applies when things break.

Deriving risk from a drawdown budget

Rather than picking 1% because it sounds sensible, derive it.

  1. Decide the maximum drawdown you would tolerate without abandoning the system. Be honest - this is a psychological limit, not a mathematical one. Say 25%.
  2. Simulate your strategy's drawdown distribution in R (Chapter 4's code).
  3. Take a pessimistic percentile - say the 95th - of maximum drawdown in R. Say it's 18R.
  4. Risk per trade = 25% / 18R ≈ 1.4% per trade.

This is a defensible number with a derivation behind it, and it will usually be smaller than the one you'd have picked by feel.

Risk limits as circuit breakers

You already know how to build these - they're rate limiters and circuit breakers, and the failure they guard against is the same: a component behaving badly at speed.

  • Max concurrent positions - bounds complexity and correlated exposure.
  • Max portfolio heat - as above.
  • Daily loss limit - stop trading for the day beyond a threshold. Guards against both cascading market conditions and your own tilt.
  • Max consecutive losses - pause and inspect. Not because the losses mean the edge is gone (Chapter 4 says they're expected), but because they might mean something broke, and you want a forced checkpoint to distinguish the two.
  • Kill switch - a single mechanism that flattens everything and halts trading. Test it. An untested kill switch is not a kill switch.

Implement these in the system rather than in your intentions. The entire reason for building a systematic strategy is that your intentions are unreliable under stress.

The compounding trap

A last piece of arithmetic that people get wrong emotionally.

A 50% loss requires a 100% gain to recover. A 20% loss requires 25%. The relationship is asymmetric and it gets brutal fast:

DrawdownGain needed to recover
10%11%
20%25%
33%50%
50%100%
75%300%
90%900%

This is why avoiding large losses matters more than capturing large gains, and why leverage - which converts drawdowns into outages, as Chapter 3 put it - is so much more dangerous than its symmetric appearance suggests.

Survival is not a constraint on the strategy. It is the strategy.