How a Stock Exchange Really Works
What actually happens in the microseconds after you tap 'Buy' — order books, price-time priority, order types, and how a trade is cleared and settled into your demat account.
A stock exchange is an electronic marketplace that matches buyers and sellers in real time. Once you understand the order book, how orders are matched, and how a trade is settled, the market stops feeling mysterious — and you start placing orders with intent instead of guesswork.
You open your broker app, type a stock name, and tap 'Buy'. A second later it says 'Executed'. It feels like magic — but it is actually a precise, regulated process happening at incredible speed.
Behind that single tap, your order travels to an exchange, joins a queue of thousands of other orders, gets matched against a willing seller by strict rules, and is then cleared and settled into your demat account a day later.
Understanding this journey makes you a better trader. You learn why some orders fill instantly and others do not, why prices 'jump', and how to avoid paying more than you should.
What an Exchange Actually Does
The electronic marketplace
A stock exchange is a regulated, electronic platform whose single job is to match buy orders with sell orders, fairly and fast. In India, the two main exchanges are the NSE (National Stock Exchange) and the BSE (Bombay Stock Exchange).
The exchange itself does not decide a stock's price and does not take a side. It simply maintains an orderly marketplace where the forces of demand (buyers) and supply (sellers) meet. The price you see is the result of those forces, not a number the exchange sets.
Everything runs through a central system called the order matching engine, which processes an enormous volume of orders — lakhs per second at peak — using fixed, transparent rules so that no participant gets unfair priority.
- An exchange is a regulated electronic platform that matches buyers and sellers
- NSE and BSE are India's two primary equity exchanges
- The exchange never sets prices or takes sides — demand and supply do
- A matching engine applies fixed, transparent rules at very high speed
The Order Book: Bids, Asks & the Spread
The market's live queue
At the heart of every stock is its order book — a live list of all pending buy orders (bids) and sell orders (asks/offers) at different price levels.
The highest price a buyer is currently willing to pay is the Best Bid. The lowest price a seller is currently willing to accept is the Best Ask. The gap between them is called the spread.
The spread is a quiet but important cost. A tight spread means the stock is liquid (lots of buyers and sellers close together). A wide spread means the stock is illiquid — and you can lose money just crossing it.
- The order book lists all pending bids and asks at each price level
- Best Bid = highest buy price waiting; Best Ask = lowest sell price waiting
- Spread = Best Ask − Best Bid; tighter spread means more liquidity
- Crossing a wide spread is a hidden cost, especially in small stocks
How Orders Get Matched: Price-Time Priority
The rule that keeps it fair
The matching engine follows one core rule: price-time priority. Price comes first — the best price always gets matched ahead of worse prices. If two orders share the same price, time decides — whoever placed their order earlier gets filled first.
This is why a large, patient queue can form at a popular price level, and why being early matters when many people want the same price. It also explains why your limit order at a certain price may sit unfilled while the price trades around it — there were orders ahead of you in the queue.
The rule is completely mechanical and blind to who you are. A retail order and an institutional order at the same price are treated by the same priority logic.
- Best price is matched first (price priority)
- At the same price, the earliest order is matched first (time priority)
- The engine is blind to participant identity — the rule is the same for all
- Your limit order can sit unfilled if others are ahead in the queue
Order Types Every Beginner Must Know
Market, Limit, Stop-Loss
How your order behaves depends on the order type you choose. Getting this right is one of the fastest ways to stop losing money to careless execution.
- Market order = speed and certainty of execution, but not of price
- Limit order = control of price, but not certainty of execution
- Stop-loss orders activate only after a trigger price is touched
- SL becomes a limit order; SL-M becomes a market order once triggered
| Order type | What it does | Best used when |
|---|---|---|
| Market | Executes immediately at the best available price | You need certainty of execution in a liquid stock |
| Limit | Executes only at your chosen price or better | You want price control and can wait |
| Stop-Loss (SL) | Triggers a limit order once a trigger price is hit | Protecting a position with a defined exit |
| Stop-Loss Market (SL-M) | Triggers a market order once the trigger is hit | You need the exit to fill for sure once triggered |
From Click to Confirmation
The journey of a single order
When you tap 'Buy', your order does not go straight to the exchange — it travels through a chain, each part regulated and accountable.
- Orders pass through your broker before reaching the exchange
- The broker performs margin and risk checks first
- Matching happens at the exchange by price-time priority
- Confirmation returns to you almost instantly
Clearing & Settlement: T+1
How shares actually reach your demat
A matched trade is only the beginning. The shares and money must still change hands safely — this is clearing and settlement, handled by clearing corporations that guarantee both sides of the deal.
India runs on a T+1 settlement cycle: if you buy today (T), the shares are credited to your demat account the next business day (T+1), and the money moves from your account in the same cycle. T+1 is among the fastest standard cycles in the world.
This is why you hold three linked accounts: a bank account (money), a demat account (holds your shares in electronic form), and a trading account (places orders). Clearing corporations sit in the middle and remove the risk of the other party defaulting.
- Clearing corporations guarantee both sides of every trade
- India settles equity trades on a T+1 cycle — shares credited the next business day
- You need three linked accounts: bank, demat, and trading
- Settlement removes counterparty default risk for you
Liquidity & Circuit Limits
Why some stocks are safer to trade
Liquidity is how easily you can buy or sell without moving the price. High-volume stocks are liquid — tight spreads, easy fills. Low-volume stocks are illiquid — wide spreads, hard fills, and nasty surprises.
To keep markets orderly, exchanges also apply circuit limits — daily caps on how far a stock or index can move. An Upper Circuit means it cannot rise further that day; a Lower Circuit means it cannot fall further. Circuits prevent panic-driven free-falls and runaway spikes.
As a beginner, favour liquid stocks. They are easier to enter and exit, cost less in spread, and are far less prone to manipulation than thin, low-volume counters.
- Liquidity = how easily you trade without moving the price
- Liquid stocks: tight spreads, easy fills; illiquid: wide spreads, hard fills
- Circuit limits cap daily price moves to keep markets orderly
- Beginners should favour liquid, high-volume stocks
Frequently Asked Questions
Does the stock exchange decide the price of a stock?
No. The exchange only matches buyers and sellers. The price is set by demand and supply — the highest price a buyer will pay meeting the lowest price a seller will accept. The exchange is a neutral referee, not a price-setter.
What is the difference between a market order and a limit order?
A market order executes immediately at the best available price — you get certainty of execution but not of price. A limit order executes only at your specified price or better — you get price control but the order may not fill. Use limit orders in illiquid stocks to avoid slippage.
What does T+1 settlement mean?
T+1 means a trade settles one business day after it is executed. If you buy on Monday (T), the shares are credited to your demat account on Tuesday (T+1). India's T+1 cycle is among the fastest standard settlement cycles globally.
Why didn't my limit order get filled even though the price reached it?
Because of price-time priority. Other orders at the same price were placed before yours and sit ahead in the queue. If the available quantity at that price gets used up before reaching your order, the price can move away without filling you.
What is the bid-ask spread and why does it matter?
The spread is the gap between the best buy price (bid) and the best sell price (ask). It is a hidden cost: in a wide-spread (illiquid) stock, you can lose several percent the moment you buy at market. Tight spreads in liquid stocks keep this cost tiny.
What happens if the person on the other side of my trade defaults?
You are protected. Clearing corporations sit between buyers and sellers and guarantee settlement of every trade. This removes counterparty risk, so you don't need to worry about who is on the other side.
Founder of Mr. Chartist. Helping Indian retail traders learn the markets the right way — price action, risk, and real businesses over hype.