What to Log for Clean Cost Metrics: Trade Journal Template
Why logging matters
Most cost analysis errors come from missing fields, mismatched timestamps, or incomplete fill data.
If you want reliable metrics like effective spread, you must log trades and quotes in a structured way.
The minimum viable logging set
For every order, log:
• trade_id (unique)
• market_id
• side (buy or sell)
• order_type (market or limit)
• limit_price (null for market)
• timestamp_submit (milliseconds preferred)
Quote snapshot: required for midquote
To compute midquote cleanly, you need bid and ask from the same snapshot:
• best_bid
• best_ask
• timestamp_quote_snapshot (single timestamp for both)
If you store bid and ask separately without a shared snapshot timestamp, you will create fake midquotes and break your metrics.
Fill data: required for VWAP
If you have multiple fills, you must compute execution price using VWAP. That requires per fill records:
• fill_id
• fill_price
• fill_qty
• timestamp_fill
Also store:
• total_qty
• execution_price_vwap (optional derived field)
Fees and maker taker
Costs are not only execution. Store fees per fill:
• fee_amount
• fee_currency or units
• maker_taker_flag (if the venue provides it)
This lets you compute all in cost and compare maker vs taker behavior.
Optional but highly useful fields
• visible_depth_bid_top and visible_depth_ask_top
• depth_band metrics (size available within X cents)
• session_id or strategy_id
• notes field (why you took the trade)
A simple trade journal record format
You can store trades as one parent record plus a list of fills. The key is that fills and quote snapshot must be linkable.
Sanity checks to catch broken logs
• best_bid should be less than or equal to best_ask
• midquote should fall between bid and ask
• total_qty should equal sum of fill_qty
• timestamps should be monotonic (fill after submit)
• no negative spreads
Takeaway
Clean cost metrics are a data problem first. Log a single quote snapshot timestamp, store per fill data, and record fees per fill. With that you can compute VWAP, effective spread, and all in cost reliably.
Related
• Midquote Done Right: Snapshot Timing and Data Quality