The edge cases that separate a demo from a live trading system
Anyone can make a trading bot look good on a clean afternoon. What decides whether a system survives a live market is everything that happens on the bad days: the dropped connection, the half-filled order, the frozen data feed. These are the edge cases, they are unglamorous, and handling them is most of the real work. It is also the difference we are paid for.
The things that only break in a live market
None of the following show up in a quiet test. All of them show up eventually in live trading, and a system has to expect every one:
- Dropped connections. The link to the broker will fail mid-session. When it comes back, the system has to work out what actually happened while it was gone, and carry on without re-sending an order it already sent.
- Partial fills. You ask for five contracts and get two. The system has to decide what to do with the rest, and do it in seconds, not sulk in a state nobody planned for.
- Rejections. The broker says no, for a dozen possible reasons. The system has to understand why and respond, not assume the order went through.
- Stale data. A feed can stop updating without any error at all. The system has to notice it has gone quiet and refuse to trade on a price that is no longer real.
- Rate limits. Send too many requests too fast and the broker throttles you, often at the worst possible moment. The system has to stay under the limit by design.
- Time and the calendar. Time zones, holidays, half-days and contract rollovers all quietly break naive code that assumes every day is a normal trading day.
Knowing the truth: reconciliation
Above all of these sits one question the system must always be able to answer: what do I actually hold right now? The system's own idea of its positions can drift from what the broker really shows, and once those two disagree, every decision after that is built on a lie. Reconciling the two continuously, and trusting the broker as the source of truth, is what keeps the whole thing honest.
The most important feature is the one that stops it
A live trading system needs a kill switch: a hard limit that halts everything if the day runs past a set loss, or if something is clearly wrong. It is the least exciting feature to build and the most important one to have, because the worst outcome is not a missed trade. It is a system that keeps trading when it should have stopped.
You find these by forcing them
You do not wait for these events to test them. You cause them on purpose: force a rejection, a cancellation, a dropped connection, and prove the system does the right thing when the broker refuses to cooperate. Then you move from paper trading to small live orders, because a few of these situations only ever appear in a real market. Every change gets checked against everything that already worked, so adding one feature never quietly breaks ten that were already right.
This is where the engineering lives
The strategy might be simple. Keeping it running correctly against a real broker, with real money, through connection drops and partial fills and everything else the market throws at it, is not. That is most of what goes into our custom trading software and our execution engines, and you can see it in practice in our case studies. We build the software to your specification. We do not supply strategies or trading calls, and we make no claim about returns.
Common questions
- Why does a trading bot that works in testing fail in live trading?
- Because testing happens on a calm, cooperative connection, and the live market is neither. Connections drop, orders get partially filled or rejected, data feeds freeze without warning, and the broker imposes limits you never hit in a quiet test. A bot that has not been built for those events does the wrong thing the first time one happens.
- What are the most important edge cases in an automated trading system?
- Reconnecting after a dropped connection without re-sending an order, handling partial fills and rejections, noticing when a data feed has gone stale, reconciling the system view of positions against the broker, and a kill switch that halts everything if something goes wrong. These are unglamorous, and they are where most of the real engineering effort goes.
- How do you test for these edge cases?
- By forcing them on purpose rather than waiting for them. We trigger rejections, cancellations and dropped connections deliberately, and check the system does the right thing when the broker does not cooperate. Then we progress from paper trading to small live orders, because some situations only appear in a real market.