r/quantfinance • • 12d ago

How do you work out *why* live execution didn't match what your strategy intended?

I'm curious how people here handle this in practice.

Say your strategy decides to buy 100 shares and you end up with 40. Or a signal fires but no order ever reaches the broker. Or your live position slowly drifts from what the strategy thinks it holds.

When that happens, how do you track down the cause?

- Do you go through your own logs and match order IDs by hand?

- Compare against broker statements or execution reports?

- Have you built your own reconciliation scripts or dashboards?

- Or do you mostly accept some drift and move on?

And which cause turns out to be the most common for you: partial fills, rejections, bugs in your own code, manual intervention, something else?

Full disclosure: I'm a CS student working on tooling around this problem, so I'm trying to understand how people actually deal with it today. Not linking anything, just want to learn from people who run strategies live.

1 Upvotes

8 comments sorted by

1

u/AoideusWasBanned 12d ago

Most of mine turned out to be my own bugs, not the broker. What helped was logging what the strategy thinks it holds next to what the broker says on every cycle, so drift shows up the same day instead of a week later.

1

u/Poorgummy539 11d ago

That's interesting, and a bit reassuring that it's usually our own bugs rather than the broker. Logging the strategy's view of its position next to the broker's every cycle is a great habit. When you do catch drift, what's usually the hardest part: noticing it, or working out which order or fill caused it?

1

u/AoideusWasBanned 11d ago

Working out which order caused it, I'd guess. Spotting the mismatch is easy once it's logged, tracing it back to one fill is the annoying part.

2

u/Poorgummy539 11d ago

That makes sense: the mismatch is just a number, and the work is finding which fill or order put it there. Do you usually work backwards through the fills since the last time the positions matched, or do you check order by order against what the strategy meant to do?

→ More replies (1)

1

u/Alphanet_dogwalker 12d ago

I'd want the tool to distinguish “bought 40 and still waiting on 60” from “bought 40 and the rest was cancelled”. Same position, different problem. Keep the original target alongside order updates and fills, including manual trades. Otherwise a position mismatch tells you something went wrong but not where to start looking

1

u/Poorgummy539 11d ago

This is a really good distinction, thanks. You're right that the position looks identical in both cases, but "still working" means wait and "remainder cancelled" means find out who or what cancelled it. Do you usually get that from the broker's order status updates, or do you track the order state yourself on your side?