# How is the actual trade on exchanges processed for simple stock orders?

I have been googling around for a clear answer to this for a long time and still are unsure how it works. Please do not dismiss this as a "who decides stock prices" etc. kind of question.

In my question I'm talking about the most common large exchanges like NASDAQ, XETRA, TSX, etc.

For a specific stock, let's assume the bid ask offer situation is as follows:

```| BUY Amount | BUY Price | SELL Amount | SELL Price |
| 103        | 8,00€     | 1501        | 8,05€      |
| 510        | 7,90€     | 3214        | 8,10€      |
| 2005       | 7,85€     | 1000        | 8,20€      |
| 1000       | 7,70€     | 300         | 8,25€      |
| 3200       | 7,65€     | 9628        | 8,35€      |
```

This is a real world stock, and at the time I took the screen capture the values were as follows:

Price: 8,00€
Last transaction: 400 @ 8,00€

So, now we get to my questions:

a) So, in this situation, a market order for buying 2000 shares would first buy the 1501 available at 8,05€ and the rest 499 available at 8,10€. Have i understood correctly?

b) With a limit order of 2000 @ for example 7,80€, I would simply have to wait until ANY stock is offered at prices equal or below 7,80€ and I would just be able to purchase the amount that is available?

c) Are all the orders put on the same process list in FIFO? I.e. after each transaction when the stock price might change, the list is evaluated in FIFO order? This puzzles me, because it would mean that there might be this situation:

1st in queue: Market order
2nd in queue: Limit order
3rd in queue: Another limit order

So, if the market order changes the price in such way that the 2nd limit order cannot be filled anymore, what happens to it? Where in the queue will it go? Will it still have precedence over other limit orders that have been placed AFTER it?

If the system is fair, one would assume that your limit order stays ahead of the other limit order, so that you can benefit from placing your order visible earlier.

Thank you very much!

• -2? Oh come on. I don't think my question was that bad. – Remolod Domelor Sep 22 '16 at 14:00
• This has been asked and answered before, hence the downvotes -- though what folks should be doing is voting to close as duplicate. – keshlam Sep 22 '16 at 14:35
• I'm not sure how specific order filling practices of a security exchange has anything to do with personal finance. – quid Sep 22 '16 at 16:18
• – praveent Sep 23 '16 at 15:07
• Thank you praveent! And sorry for the messiness in my question, with your link I found the right terms to look for! – Remolod Domelor Sep 23 '16 at 20:50