This question is disturbing me.... regarding order matching

#1
I have a doubt which is haunting me since several days. I hope somebody with clear basics can help me out.

This is regarding limit orders and order matching. As I see, limit order is defined online from several sources as "An order to buy or sell stock at a specified price. The order can be executed only at the specified price or better."

I will ask this question with an example
Lets consider the following limit order book


----BID ---------- ASK----
(buyer 1)105.0 (seller 1)103.5
(buyer 2)104.0 (seller 2)105.0
(buyer 3)103.0 (seller 3)106.0
(buyer 4)102.0 (seller 4)107.0
(buyer 5)101.0 (seller 5)108.0
(for simplicity sake assume order quantity is same for all buyers & sellers)


Now here goes my questions. Please try to answer all 3 of them since they all are very closely related and each answer affects the answer to another question


1. How will the order matching happen. Will it be (buyer 1 with seller 2) or (buyer 1 with seller 1)

2. If you say matching will be (buyer 1 with seller 2) then why does a limit order definition says order can be executed at your limit price or better? In what scenario can this execution at better price exactly happen?

3. if you say matching will be (buyer 1 with seller 1) then at what price will the trade be executed- 105 or 103.5. if you are saying 103.5, then wouldn't it eventually imply that any limit sell order practically can never be executed at higher prices even though its definition says so?
 
Last edited:

Riskyman

Well-Known Member
#2
I have a doubt which is haunting me since several days. I hope somebody with clear basics can help me out.

This is regarding limit orders and order matching. As I see, limit order is defined online from several sources as "An order to buy or sell stock at a specified price. The order can be executed only at the specified price or better." Limit order means the MAX one is willing to pay but it can be less.

I will ask this question with an example
Lets consider the following limit order book


----BID ---------- ASK----
(buyer 1)105 (seller 1)103
(buyer 2)104 (seller 2)105
(buyer 3)103 (seller 3)106
(buyer 4)102 (seller 4)107
(buyer 5)101 (seller 5)108
(for simplicity sake assume order quantity is same for all buyers & sellers)


Now here goes my questions. Please try to answer all 3 of them since they all are very closely related and each answer affects the answer to another question


1. How will the order matching happen. Will it be (buyer 1 with seller 2) or (buyer 1 with seller 1)

2. If you say matching will be (buyer 1 with seller 2) then why does a limit order definition says order can be executed at your limit price or better? In what scenario can this execution at better price exactly happen?

3. if you say matching will be (buyer 1 with seller 1) then at what price will the trade be executed- 105 or 103. if you are saying 103, then wouldn't it eventually imply that any limit sell order practically can never be executed at higher prices even though its definition says so?
You got it right about the limit order. But think you made a mistake with the spread.

This is how it should look like

----BID ---------- ASK----
(buyer 1)105 (seller 1)106
(buyer 2)104 (seller 2)107
(buyer 3)103 (seller 3)108
(buyer 4)102 (seller 4)109
(buyer 5)101 (seller 5)110

The bid/ask you quoted is wrong as buyer is willing to pay 105 and seller is at 103. Even supposing this were to be the case then the trade would get executed at 103 i.e at limit order or better.

In the spread i have quoted, the price has to match. Either the seller or the buyer has to blink. Note that its the highest bidder and the lowest seller will be matched.This should answers your questions.
 

Subhadip

Well-Known Member
#3
I have a doubt which is haunting me since several days. I hope somebody with clear basics can help me out.

This is regarding limit orders and order matching. As I see, limit order is defined online from several sources as "An order to buy or sell stock at a specified price. The order can be executed only at the specified price or better."

I will ask this question with an example
Lets consider the following limit order book


----BID ---------- ASK----
(buyer 1)105 (seller 1)103
(buyer 2)104 (seller 2)105
(buyer 3)103 (seller 3)106
(buyer 4)102 (seller 4)107
(buyer 5)101 (seller 5)108
(for simplicity sake assume order quantity is same for all buyers & sellers)


Now here goes my questions. Please try to answer all 3 of them since they all are very closely related and each answer affects the answer to another question


1. How will the order matching happen. Will it be (buyer 1 with seller 2) or (buyer 1 with seller 1)

2. If you say matching will be (buyer 1 with seller 2) then why does a limit order definition says order can be executed at your limit price or better? In what scenario can this execution at better price exactly happen?

3. if you say matching will be (buyer 1 with seller 1) then at what price will the trade be executed- 105 or 103. if you are saying 103, then wouldn't it eventually imply that any limit sell order practically can never be executed at higher prices even though its definition says so?
I know I am just posting, but just think of it, is it really helpful by knowing this , you will earn more?

Think of profitability- in each question you ask.

BTW, sorry, do not know the answer though.

Just my one cent, do not want controversies.
 
#4
But think you made a mistake with the spread.

This is how it should look like

----BID ---------- ASK----
(buyer 1)105 (seller 1)106
(buyer 2)104 (seller 2)107
(buyer 3)103 (seller 3)108
(buyer 4)102 (seller 4)109
(buyer 5)101 (seller 5)110

The bid/ask you quoted is wrong as buyer is willing to pay 105 and seller is at 103. Even supposing this were to be the case then the trade would get executed at 103 i.e at limit order or better.
I deliberately made-up that order book so that live matching within this example was possible.
And secondly I don't think retail traders order by watching order book precisely. So random chances of buyer-105 and seller-103 is theoretically possible.

2. considering trade occurs at 103 and that buyer is always prioritized, then then wouldn't it eventually imply that any limit sell order practically can never be executed at higher prices even though its definition says so?

Finally thanks for taking the time to reply.
 
#5
I know I am just posting, but just think of it, is it really helpful by knowing this , you will earn more?

Think of profitability- in each question you ask.

BTW, sorry, do not know the answer though.

Just my one cent, do not want controversies.
I know what you mean to say, but its just my nature. Unless I understand the basics satisfactorily I always feel under-confident. Also once I get the basics, I am very good in improvising and mastering it. Thats how my brain works ;-)
 

Subhadip

Well-Known Member
#6
:thumb::clapping::clap:
I know what you mean to say, but its just my nature. Unless I understand the basics satisfactorily I always feel under-confident. Also once I get the basics, I am very good in improvising and mastering it. Thats how my brain works ;-)
 
#7
Let me see how others answer this question and whether order matching concepts are clear. I will post my views tomorrow.It is easy if the concepts of order matching are clear.

Smart_trade
 
#8
1. How will the order matching happen. Will it be (buyer 1 with seller 2) or (buyer 1 with seller 1)
A: first (buyer 1 with seller 1) and then pending quantity (if any) of buyer 1 with seller 2

3. if you say matching will be (buyer 1 with seller 1) then at what price will the trade be executed- 105 or 103. if you are saying 103, then wouldn't it eventually imply that any limit sell order practically can never be executed at higher prices even though its definition says so?

A: depends who putted first 105 or 103, will execute first
 
#9
1. How will the order matching happen. Will it be (buyer 1 with seller 2) or (buyer 1 with seller 1)
A: first (buyer 1 with seller 1) and then pending quantity (if any) of buyer 1 with seller 2

3. if you say matching will be (buyer 1 with seller 1) then at what price will the trade be executed- 105 or 103. if you are saying 103, then wouldn't it eventually imply that any limit sell order practically can never be executed at higher prices even though its definition says so?

A: depends who putted first 105 or 103, will execute first
Thanks, and your explanation sounds quite logical. Could you plz point me to some resource where this order matching is explained in detail? I have literally googled for several hours stretch but still couldn't get a meaningful detailed reference on order matching.
 
#10
Some links to read in to understand the questions a bit better:

Day Trading Basics: The Bid Ask Spread Explained: http://vantagepointtrading.com/archives/13382

A Crash Course in Commodities: http://www.ftpress.com/articles/article.aspx?p=1436919&seqNum=6

What You Can Learn From the Bid-Ask Spread: http://michaelsincere.com/what-you-can-learn-from-the-bid-ask-spread/

The bid and the ask price in options trading explained: http://www.options-trading.com/bid-price-options-trading-explained/

Order (Price Type) Explained – Market, Limit Orders and the Like: http://investing-school.com/definition/order-price-type-explained-market-limit-orders-and-the-like/

Matching Orders: http://www.investopedia.com/terms/m/matchingorders.asp

Which are the order matching algorithms most commonly used by electronic financial exchanges?: https://stackoverflow.com/questions...thms-most-commonly-used-by-electronic-financi

Hope it helps, all the best and take care / Dan :)
 

Similar threads