The program between buyer and seller
Your broker sends the order to the exchange. Its checks eligible orders and pairs buyers with sellers. The holds orders still waiting to trade.
In the ordinary continuous market, eligible resting orders follow price-time priority: better prices first, then earlier arrival at the same price. This lesson uses ordinary, fully displayed limit orders; auctions and special order conditions need their own rules.
For buyers, higher is better: ₹501 comes before ₹500. For sellers, lower is better: an offer at ₹499 comes before ₹500. Each side competes with orders on its own side.
Four buy orders, and an arriving seller
The historical snapshot behind your purchase. Change the incoming market seller's quantity to inspect possible fills; the original ten-share purchase did complete.
The ₹499 buyer arrived earliest and is still last. At ₹500, the HNI's order is six seconds older than yours. The names explain the example; they do not buy queue priority.
Count what stands ahead of you
The first 200 shares sold meet the ₹501 bid. The next 500 meet the earlier ₹500 bid. Only after 700 shares have been sold into this unchanged snapshot does the seller reach your order.
At a seller quantity of 705, five of your ten shares fill. At 710, all ten fill. With 250 sold, 200 trade at ₹501 and 50 at ₹500; you receive nothing. A single incoming order can produce several trades.
Trades in this continuous-market example execute at the resting order's price. The seller does not receive one average price from the engine, although the broker may display an average across the separate fills.
Set the incoming seller's quantity to 705. How many of your ten shares fill?
A limit can trade immediately too
A names your worst acceptable price: the most you will pay to buy, or the least you will accept to sell. It need not wait. If eligible sell orders already exist at or below a new buy limit, that order can execute immediately against them.
A seeks the best available opposite orders without your own limit price. It can cross several price levels. Available quantity, exchange protections and order rules still constrain execution; a market order is not a promise of unlimited liquidity.
Our four-row book is a frozen teaching snapshot. In a live book, orders arrive, cancel and change. Some modifications can change queue priority. Your position is not a permanent ticket.
The exchange has participant information and applies controls, including self-trade prevention. Price-time priority means ordinary eligible orders do not jump the queue because the trader is rich or famous. It does not mean the exchange knows only two fields or ignores every other rule.