You need to understand the working methodology behind an ELOB (Electronic Limit Order Book)
You can assume ELOB as a ledger where all the orders are collected, prioritized and sorted in electronic format.
Assume a scrip is pooled with orders
[email protected]
ELOB: 9:40:05.340 time (Note: 5 seconds and 340 milliseconds), the order book contains these orders
Price Ask Qty
265.85 150
265.05 50
265.00 550
300 264.95
200 264.75
100 264.50
Bid Qty
In order to execute trade, a willing buyer and willing seller should both agree on same price.
If you see above condition, there is no match.
Best Buy Price is 264.95 (he is willing to buy to that extent, higher), This is Bid rate
Best Sell Price is 265.00 (he is willing to sell to that extent, lower), This is Ask rate.
Now assume, after seeing the Ask and Bid rates, someone sends an order Buy 620 shares at the price of 265. (Say at time 9:40:05.375 (Note 35 milliseconds later)
Now the situation in ELOB changes.
Price Ask Qty
265.85 150
265.05 50
(((620 265.00 550)))
300 264.95
200 264.75
100 264.50
Bid Qty
Now the ELOB has found a matching trade (but only matching for 550 shares) and will execute it immediately.
So 550 shares will be bought and sold by respective parties and your trading terminal will show the ticker price of 265.00 (which is nothing but last executed trade price LTP)
ELOB will now immediately change into
Price Ask Qty
265.85 150
265.05 50
70 265.00
300 264.95
200 264.75
100 264.50
Bid Qty
Note Ask rate changed from 264.95 to 265.00 now. Bid rate changed from 265.00 to 265.05
Now if a market order for buy is sent for 120 shares, then ELOB will change into
Price Ask Qty
265.85 80
70 265.00
300 264.95
200 264.75
100 264.50
Bid Qty
Now ticker moves to 265.85 from 265.00
Also note that Bid rate remains same at 265.00 while Ask rate has gone up from 265.05 to 265.85
Also, if you want to know Ask and Bid quantity, it is the sum of all shares from orders placed on that price.
Example Bid Qty 100 at 264.50 could have been made up of orders from so many people like (27+4+35+24) etc.,
These orders are prioritized based on their time of order placing (timestamp), whoever places first will get executed first (whoever placed orders in the same price range).
Its a bit lengthy but very insightful!
But I Hope you will understand now!
Cheers!