Logging, Audit Trails and Incident Response
An audit trail records every signal, order, change and fill so trading can be reconstructed later. Learn what to log, the regulatory rules and how it helps traders.
An audit trail is a complete, time ordered record of everything a trading system or trader did: every market data input that mattered, every signal, every order sent, modified or cancelled, every fill and every manual intervention. It lets anyone reconstruct exactly what happened and why. For firms, audit trails are a regulatory requirement. For individual algo traders, they are the best debugging tool available and the foundation of honest performance review.
What to record#
| Event | Key fields |
|---|---|
| Signal generated | Time, strategy, symbol, signal value, inputs used |
| Order sent | Time, client order ID, symbol, side, quantity, price, order type |
| Order acknowledged | Broker or exchange order ID, time |
| Order modified or cancelled | Old and new values, reason, who or what initiated it |
| Fill | Time, price, quantity, venue, fees |
| Risk check result | Which check, pass or fail, values |
| Manual action | User, action, time, reason |
| Configuration change | Parameter, old and new value, who changed it |
| System events | Starts, stops, disconnects, errors |
Properties of a good audit trail#
| Property | Why |
|---|---|
| Complete | Gaps make reconstruction impossible |
| Time accurate | Synchronised clocks with precise timestamps. See Clock Synchronization and PTP |
| Tamper resistant | Append only storage; records are never edited, only corrected with new entries |
| Linked | IDs connect signals to orders to fills |
| Retained | Kept for the required period |
| Searchable | Easy to query when needed |
Regulatory requirements#
- United States: the Consolidated Audit Trail (CAT) collects order and trade events across US equity and options markets from broker dealers. SEC and FINRA rules also require broker dealers to keep books and records, typically for several years.
- European Union: MiFID II requires firms to keep detailed order records and synchronise clocks to set precision levels, with stricter requirements for high frequency trading.
- Algorithmic trading firms in many jurisdictions must be able to explain and reconstruct algorithm behaviour on request.
See Trading Regulators: SEC, CFTC, FINRA and NFA.
Audit trails for individual traders#
Even without regulatory requirements, individual algo traders benefit from:
- Debugging: finding exactly where code behaved unexpectedly.
- Performance analysis: comparing intended and actual prices. See Slippage Analysis.
- Taxes and disputes: proving trades and costs. See Record Keeping for Traders.
- Honest review: seeing every trade, not just the memorable ones. See Trading Journal.
Practical implementation#
- Write structured logs (such as JSON lines) with consistent fields.
- Assign IDs that link each signal to its orders and fills.
- Use UTC timestamps with millisecond or finer precision. See Timestamps, Time Zones and Daylight Saving.
- Store logs append only and back them up. See Failover, Backups and Disaster Recovery.
- Reconcile daily against broker statements. See Trade Accounting and Reconciliation.
Frequently asked questions#
What is an audit trail in trading?#
A complete, time ordered record of signals, orders, modifications, fills and manual actions that allows trading activity to be reconstructed.
What is the Consolidated Audit Trail?#
A US regulatory database that tracks orders and trades across equity and options markets, used by regulators for surveillance and investigations.
Should retail algo traders keep audit trails?#
Yes. Detailed logs make debugging, performance review and record keeping much easier, even when not legally required.
You have finished the Algo Trading track. Continue with the programming skills behind it in Python for Trading.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- Algorithmic Trading ExplainedAlgorithmic Trading
- Automated vs Semi-Automated TradingAlgorithmic Trading
- Risk Controls and Kill SwitchesAlgorithmic Trading
- Monitoring Positions, P&L and RiskAlgorithmic Trading
- Alerts, Error Handling and ReconnectionAlgorithmic Trading
- Failover, Backups and Disaster RecoveryAlgorithmic Trading