Three consecutive losses. That's the number most trading bots use to trigger a circuit breaker. I looked at where that number came from. Nobody had a good answer.

The problem with arbitrary thresholds is that they conflate two different things: bad luck and a broken strategy. At a 60% win rate, three consecutive losses happens roughly once every 15 trade sequences. Your circuit breaker fires. Your bot stops. Nothing was wrong.

The calculation

The right question isn't "how many losses in a row?" It's "at what point is this sequence statistically unlikely enough that something probably broke?"

For independent trials, the probability of N consecutive losses is (1 - win_rate)^N. You find the smallest N where that probability drops below your significance threshold. At 66.7% win rate, the math works out like this: one loss has a 33% chance, two losses 11%, three losses 3.7% — but 3.7% is still above 5%. The circuit breaker should trigger at four consecutive losses, not three.

At a 50% win rate, the threshold moves to five losses. At 40%, seven. The threshold is dynamic, not fixed.

What this changes

Running it against historical data, the arbitrary three-loss breaker would have halted my best-performing strategy 23 times in a six-month window. The statistical version would have halted it four times — and three of those four were genuine regime breaks where stopping was right.

The system also handles zero-win-rate gracefully. If the measured win rate is 0%, the threshold defaults to four (you want at least some signal before halting). If the win rate is very high, the threshold rises — a strategy winning 80% of the time can absorb five losses before the sequence becomes statistically improbable.

I spent three versions on this before getting it right. The first was too sensitive. The second was too permissive. The third uses actual maths.