Matching Engine
Also known as: order matching engine, exchange matching engine, central limit order book, trading engine
What is it?
A matching engine is the software at the centre of an exchange or trading venue that holds every resting order and pairs buyers with sellers according to one fixed, published rule, normally best price first and, among equal prices, whoever arrived first. Price-time priority is the part you actually trade against. Suppose three traders are bidding 1.0842 for EUR/USD in sizes of 2, 5 and 1 lots, and they arrived in that order.
A market sell of 6 lots fills the 2-lot order completely, then 4 lots of the 5-lot order, and never reaches the third trader at all. The 1 lot left over from the second order stays in the book, still standing ahead of the trader who arrived last. For an automated trader the consequence is that queue position is an asset.
A resting limit order holds its place until you touch it, and changing the price sends it to the back of the queue at the new level. Retail forex complicates this, because there is no single central book: your broker either matches you internally or routes out to liquidity providers, so the engine you interact with is the broker's own aggregator and its rules are not published the way an exchange's are.
Why it matters: A matching engine fills orders by price and then by arrival time, so amending a resting limit order sends it to the back of the queue and can cost you the fill.
Queue position decides whether a resting limit order is filled at all, so how often your bot amends orders changes its fill rate directly.
Real-world example
A bot resting a 1.0842 bid moved it to 1.0843 and back again to chase a better price, surrendering its queue position twice; the level then traded and filled the orders that had simply stayed put.
How SignalBots handles it
SignalBots signals give a defined entry level rather than a chase instruction, so your bot can rest an order and keep its place instead of repricing itself to the back of the queue. See /risk-warning.
Pro tip
Amend a resting limit order only when the trade thesis has genuinely changed. Every reprice puts it behind every order already waiting at the new level.
Common pitfalls
Cancelling and replacing a limit order repeatedly to stay at the front, which achieves the exact opposite and pushes it to the back of the queue each time.
Frequently asked questions
What rule do most matching engines use?
Price-time priority: the best price fills first, and among orders resting at the same price the earliest arrival fills first. Some venues use pro-rata allocation instead, splitting fills in proportion to order size.
Does retail forex have a matching engine?
Not a single central one. Each broker runs its own internal matching or aggregation layer and routes what it does not match to liquidity providers, so there is no shared public queue to join.
Does amending an order always lose queue position?
Changing the price always does. Reducing size usually preserves your place, while increasing it normally sends the added quantity to the back. The precise rule varies by venue, so check the one you trade.
How fast is a modern matching engine?
Major venues process an order in single-digit microseconds. That speed is precisely why network distance, not engine processing, dominates latency for any trader outside the data centre.
Can I see my position in the queue?
Rarely in a direct way. Depth-of-market data shows the total size resting at each price but not the order of arrival, so queue position is usually estimated from how much size was already there when you joined.
Trading involves substantial risk of loss. Historical and backtested results do not guarantee future performance. Read the full risk warning.