Simulating Pro-Rata Matching
How to reproduce, in a backtest, the exchange matching rule that splits an incoming order across resting orders in proportion to their size rather than filling the oldest order first.
Prerequisites: Self-Trade Prevention in Simulation
Most equity exchanges fill resting orders price-then-time: at the best price, whoever arrived first gets filled first. Some markets — many futures and options exchanges in particular — instead use pro-rata matching at the best price: an incoming order is split across all resting orders at that price in proportion to their size, regardless of who arrived first. A backtest that assumes time priority everywhere will badly misjudge fill rates and adverse selection on a pro-rata venue, so the simulator needs a matching rule that mirrors the real one.
Simulating this means, for every incoming order, identifying all resting orders at the matched price, computing each one's share of the fill as its size divided by the total resting size at that price (subject to the exchange's own rounding and minimum-fill rules), and allocating fills accordingly rather than walking the queue in arrival order.
Worked example
Three resting buy orders sit at the best bid: 100, 300, and 600 contracts, a total of 1,000. A sell order for 200 contracts arrives. Pro-rata allocates each resting order its proportional share: , , and contracts respectively. A simulator using time priority instead would have filled the first order for its full 100 and moved on — a completely different, and wrong, outcome for a pro-rata venue.
Pro-rata matching splits a fill across all resting orders at a price proportionally to their size, not by arrival order, so a backtest simulating a pro-rata market must replicate that proportional allocation explicitly — reusing a time-priority fill model will misstate both fill quantities and the resulting adverse-selection profile.
Further reading
- Harris, Trading and Exchanges, ch. 4