Why Trading Systems Should Track Orders, Fills, and Positions In-House
Summary
The document discusses how an order and position management component should work in automated trading. Its central recommendation is to maintain an internal view of orders, fills, positions, and risk rather than relying entirely on a broker or exchange. External execution reports can be delayed or missing, and a connection can fail after an order has been acknowledged, leaving the strategy exposed unless it tracks that order itself.
The evidence is practical failure scenarios and the recommendation to reconcile internal records with counterparty reports, including drop copies. It distinguishes lower frequency systems, where positions may be stored for later retrieval, from high frequency systems that often use dedicated order, position, and risk processes. The discussion does not specify a database, messaging design, or detailed implementation pattern, so it motivates reliable tracking and reconciliation without serving as a complete architecture guide.
Key ideas
- Maintain internal records of submitted orders and fills instead of relying solely on broker or exchange reports.
- An acknowledged order remains an exposure even if the application disconnects before receiving later updates.
- Reconcile internal positions and fills against execution partner records to detect missing or inconsistent reports.
- Dedicated order, position, and risk components are common in higher frequency trading systems.
Tags
Full text
# Order and position management in (semi-)automated trading system # Order and position management in (semi-)automated trading system A simple and lazy approach to implementing an order and position management (OPM) component in a (semi-)automated trading system: leave most OPM to counter party (broker/exchange). Even then funds and positions need to be checked once orders are supposed to be dispatched. Else it is unkown whether one has funds or already the intended position in a symbol. - Certainly such requests/responses do not fit ultra high frequency trading (uhft), or are optimistic approaches with respect to order execution used? If not, what is the uhft OPM [software] design approach? - Is the lazy approach good enough for lower frequency trading? Or are other [software] design patterns favorable? Which and why? Although the title What approaches are there to order handling in automated trading? is promising, answers were geared towards a specific difficulty. The references for developing an automated trading system do not discuss OPM in detail. A refined OPM component should reflect almost all account details (funds, transmitted orders, fills) reliably. I believe software design patterns of banking/exchange platforms should apply. References for reliable messaging/databases accessible to the non-expert developer would be nice. ## Answer by chrisaycock (score 4, accepted) https://quant.stackexchange.com/a/4346 Regardless of frequency, every firm should track its own fills to ensure that the exchange's drop copy is accurate. Now it is true that the positions can be stored in a simple database for later retrieval if real-time execution isn't a goal. But it is extremely dangerous (and fiduciary irresponsible) to just "take the counter-party's word for it". ## Answer by Matt Wolf (score 1) https://quant.stackexchange.com/a/4369 1) The uhf/hf approach is to run dedicated order management modules, position managers, and risk checks in dedicated processes in-house and NEVER rely for any of this on outside applications. For uhf some or all of those processes may run on hardware chips, but most on the hf side and lower frequency side runs within software modules that are dedicated to only manage orders, only manage risk, only manage positions. 2) No, its not enough. Example: You submit an order, you get the acknowledgement of the receipt of the order and then your app or connection to the broker goes down. Fact is that you have submitted an order and fact is that your broker received the order and confirmed it. You must account for that submitted order yourself before your app reconnects or before you get any fill confirmation at a later point. Just one of the many tons of issues that may go wrong or occur and which may be completely outside of your control. Even if everything goes as planned its standard practice to run your own OMS and other components and to frequently sync it with what your execution partners show. If there is a misalignment then something is wrong and thats exactly what you want, the knowledge of something being wrong. Or would you like to continuously shoot orders into the market and get filled in size that you never anticipated just because your broker does not send you fills for whatever reason?
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.