Why Backtests Can Fill the Legs of a Spread Trade at Different Times
Summary
This forum discussion concerns a spread reversal strategy whose two legs sometimes fill together in backtests and sometimes fill days apart. One reply points to a spread-strategy module as a way to address legging. A longer response suggests possible causes: separate orders with different price opportunities or liquidity, limit prices that are not reached in the next bar, and backtest engines that process instruments or orders sequentially. It also recommends inspecting order prices, quantities, fill times, and execution prices to identify where the delay arises.
These explanations are general troubleshooting hypotheses, not a verified diagnosis of the original user’s VeighNa setup. The thread supplies no code, data, engine configuration, or reproduction of the behavior, and the suggested alternatives—such as market orders or simulated combination execution—are not evaluated. The main practical lesson is to distinguish strategy logic from fill-model behavior and inspect each leg’s orders and fills. Separate-leg execution can leave a spread temporarily exposed, while a backtest with simplified matching may not represent live execution accurately.
Key ideas
- Separate orders can fill at different times when the two instruments have different liquidity or price paths.
- Limit orders may remain unfilled if the backtest bars do not reach their prices.
- Sequential data updates or matching rules can affect when multi-leg orders are executed.
- Order logs can help identify which leg fills late and under what conditions.
- The discussion offers possible causes but does not establish the cause in the reported setup.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.