Periscøpe
// Field note

Why broker state is a first-class trading-system problem

Most trading-system bugs in live are really disagreements between your code's idea of the world and the broker's. Broker state deserves to be treated as a first-class concern.

June 19, 2026

In a backtest, there is exactly one version of the truth, and your code holds it. In live trading, there are two, your code’s idea of the world, and the broker’s, and they are not always the same. A surprising share of live trading bugs are, at bottom, the two disagreeing. Which is why broker state deserves to be treated as a first-class problem, not an afterthought.

Two sources of truth

Your strategy keeps a model: my position is X, my buying power is Y, that order is still working. The broker keeps its own books, and on questions of fills, positions, and buying power, the broker’s books win. The gap between them is small most of the time and occasionally large, a fill the broker processed before your system saw it, an order that was rejected while your code still thinks it’s live, a position changed out of band.

Treat your internal state as a hypothesis about the broker’s state. The moment you treat it as the truth, you’ve written a bug that will only show up in live.

Why this is easy to get wrong

Because nothing in research forces you to think about it. The backtest has no broker, so there’s no second source of truth, so there’s no reconciliation problem, so the whole category of bug is invisible until the first live run. Code written without broker state in mind will assume its own memory is reality, and that assumption holds right up until it doesn’t.

What “first-class” means in practice

Taking broker state seriously means:

  • Designing for disagreement. Your code should expect its model and the broker to drift, and behave sanely when they do, especially around rejections and partial fills.
  • Knowing which checks enforce and which advise. In simulation you can enforce buying-power rules; in live, the broker is authoritative and your own figure is advisory. Confusing the two is a classic trap.
  • Making state visible. You can’t manage a disagreement you can’t see. Orders, fills, positions, and an advisory buying-power view need to be in front of you, not buried.
  • Owning reconciliation. Surfacing broker-reported state is not the same as the broker’s books being yours. You’re still responsible for reconciling your account.

The takeaway

The strategies that survive live aren’t the ones that assume the world matches their model. They’re the ones written by someone who expected the broker to be the truth and built around it. Broker state isn’t a detail you handle at the end. It’s a design assumption you make at the beginning, or pay for later.

Related
// Access

Run one strategy through Periscøpe.

We onboard in focused cohorts. Tell us what you trade and how you work. Live access is rolled out to select users on request.

We only use your email to contact you about access.

Read the docs →