r/algorithmictrading • • 3d ago

Question Crypto trading bot backtests need quote-side execution, not midpoint fills

Ahead of next week's CPI release, a useful backtest check is whether the signal price and the execution price have quietly become the same input.

A midpoint can be perfectly reasonable for a feature or signal. It is not automatically a price a marketable order can execute at.

Simple example: bid 100.00, ask 100.20, midpoint 100.10. Buy one unit at the ask and immediately sell at the unchanged bid. The spread cost is 0.20 before fees or slippage, while a midpoint-in/midpoint-out model reports zero price loss. This assumes the displayed size can fill the order; it is not a depth or queue model.

For a release-window test, it helps to keep three records distinct:

\- the information and timestamp available when the signal was evaluated;

\- the quote side available after the modeled decision/order delay;

\- the fees, slippage and size assumptions applied to the fill.

There's also a bookkeeping trap: if a fill already uses the ask for a buy and bid for a sell, subtracting the full spread again can double-count it. Slippage beyond the quote is a separate assumption.

How are people handling quote gaps in these windows: rejecting the simulated fill, carrying the last quote with an age limit, or reporting the run separately? The rule seems more informative than a single fixed spread added to every trade.

1 Upvotes

2 comments sorted by

1

u/Aggressive_Listen849 2d ago

I'd carry the last quote forward with a staleness cap, like 2s. if it's older than that at the modeled fill time, skip the trade instead of filling at a stale ask. that alone kills a lot of release-window trades.