<p>As in the answer <a href="https://economics.stackexchange.com/questions/24729/how-are-final-stock-prices-arrived-at">here</a> (which you referred to yourself), the price of a stock is the price the stock was last traded at (until that price is updated because a new trade happens). A trade occurs if a bid and ask are matched.</p>
<p>The matching relies on a double ordering. The principle to remember here is &quot;buy low, sell high&quot;. Also, remember that the ask is the <em>minimum</em> price a would-be seller is happy to sell, while the bid is the <em>maximum</em> price a would-be buyer is happy to buy. The buy and sell offers are ordered in the following way:</p>
<ul>
<li><strong>Asks</strong>: lowest first, highest last, then in the order they were submitted.</li>
<li><strong>Bids</strong>: highest first, lowest last, then in the order in which they were submitted.</li>
</ul>
<p>This is called <strong>price-time-priority matching</strong> (see <a href="https://www.investopedia.com/terms/m/matchingorders.asp#:%7E:text=Under%20a%20basic%20FIFO%20algorithm,order%20at%20a%20lower%20price." rel="nofollow noreferrer">here</a>). Many exchanges use a variant of that procedure with potentially some extensions. An important exception is the NYSE, which has a pro-rate system on top (see <a href="https://www.nyse.com/article/parity-priority-explainer" rel="nofollow noreferrer">here</a>), but this is not relevant for your cases.</p>
<blockquote>
<p>What happens when the bid is higher than the ask? For example, someone is ready to pay \$101 per share for 100 shares, and someone wants to sell 100 shares at \$100. What will be the new price?</p>
</blockquote>
<p>The matching in this case depends on the order in which instructions were submitted and on the <em>best price rule</em>, which says that whoever submits  last gets the best available price. One motivation for that rule is that agents shouldn't be punished for submitting limit orders. After all, if that principle were not in place, agents who act last could instead put in market orders (without a limit), where a buyer immidiately buys at the lowest ask, and a seller sells at the highest bid, which may result in a better deal for the agent last to act. If not in place, you wouldn't get many limit orders, if any at all. So this rule favors market liquidity.</p>
<p>Applying these rules, if the sell offer at \$100 was there first, the buyer, even though she is happy to pay \$101, will only pay 100. Conversely, if the buyer places the order first, the seller will sell for 101. So, depending on the order of submission, the resulting price will be either 100 or 101.</p>
<blockquote>
<p>What if there are multiple matches at an instance? Let's say we have someone wanting to buy 100 shares at \$100 and someone wanting to sell 100 shares at $100. We also have someone wanting to buy 500 shares at \$110 and someone wanting to sell 500 shares \$110. What is the new price?</p>
</blockquote>
<p>Again, the matching depends on the double ordering mentioned above and the best price principle. I won't go through all possible cases, but provide a few <strong>illustrations</strong>:</p>
<ul>
<li><p>Bid = 500@\$110. The seller comes in with 100@\$100. The trade is executed at the best price (for the seller) at \$110. (if they submit in the reverse order, the trade will happen at a price of \$100)</p>
</li>
<li><p>Bid = 100@\$100, Ask = 500@\$110. There is no match. Ask = 100@\$100 comes in, &quot;jumps the queue,&quot; and 100 shares are traded at \$100.</p>
</li>
<li><p>Bid = 100@\$100, Ask = 500@\$110. There is no match. A new bid comes in with 500@\$110. It jumps the bid queue and is matched with the ask, and the trade happens at a price of \$100.</p>
</li>
</ul>
<p>Note that time-stamping these days is very accurate, to within one millisecond  (see for example <a href="https://www.npl.co.uk/getattachment/5b94a9f8-bd79-478e-ba25-8fc56f51be33/NPLTime_Complete_Guide.pdf.aspx?lang=en-GB&amp;ext=.pdf" rel="nofollow noreferrer">here</a>). For any confusion to occur, orders would have the share the same time-stamp and precisely the same price.</p>

CC BY-SA 4.0
2022-08-11T07:15:00.843Z
Thanks, very good answer! Is there a name (and possibly a reason) for this principle that the price will be in favor of the last person to make an order?
timtam
CC BY-SA 4.0
2022-08-11T08:37:29.753Z
I edited the answer.
BrsG
CC BY-SA 4.0
2022-08-10T17:33:40.700Z
2022-08-11T08:37:15.960Z
2022-08-11T08:37:15.960Z
BrsG
<p>I looked at <a href="https://economics.stackexchange.com/questions/24729/how-are-final-stock-prices-arrived-at">this question</a> already. I know there is an order book with bid and ask and that the price is updated when a match occurs. But I have two questions:</p>
<ol>
<li><p>What happens when the bid is higher than the ask? For example someone is ready to pay \$101 per share for 100 shares and someone wants to sell 100 shares at \$100. What will be the new price?</p>
</li>
<li><p>What if there are multiple matches at an instance? Let's say we have someone wanting to buy 100 shares at \$100 and someone wanting to sell 100 shares at \$100. We also have someone wanting to buy 500 shares at $110 and someone wanting to sell 500 shares \$110. What is the new price?</p>
</li>
</ol>

CC BY-SA 4.0
2022-08-10T09:29:47.083Z
"*we have someone wanting to buy 100 shares at \$100 and someone wanting to sell 100 shares at \$100. We also have someone wanting to buy 500 shares at \$110 and someone wanting to sell 500 shares \$110.*" Who came first? Each of these offers should have a timestamp, and possible deals are - to my knowledge - resolved immediately.
Giskard
CC BY-SA 4.0
2022-08-10T09:59:30.083Z
What if they have the same timestamp? Given the amount of trades done each day and the low precision of computer clocks, this must have happened before
timtam
CC BY-SA 4.0
2022-08-10T10:34:35.180Z
@timtam: what do you mean by "when demand is higher than offer"? Asking because the two cases you refer to have the same amounts on both the sellers' and buyers' sides? Your actual questions seem to be different. Should we answer the question in the header or the two unrelated cases in the body?
BrsG
CC BY-SA 4.0
2022-08-10T11:26:58.120Z
You're right, high demand is being ready to pay a lot, while high offer would be being ready to sell at cheap. So maybe the question is actually what would happen when both demand and offer is high, but when there is a gap as in my first subquestion.
timtam
CC BY-SA 4.0
2022-08-10T11:27:43.207Z
I am basically just interested in an answer for my two subquestions, the title question is irrelevant
timtam
<finance><stock-market><markets><financial-markets>
How are stock prices determined in the following cases?
timtam
# How are stock prices determined in the following cases?

(Asked by: username_0 on 2022-08-10)

I looked at [this question](https://economics.stackexchange.com/questions/24729/how-are-final-stock-prices-arrived-at) already. I know there is an order book with bid and ask and that the price is updated when a match occurs. But I have two questions:

1. What happens when the bid is higher than the ask? For example someone is ready to pay \$101 per share for 100 shares and someone wants to sell 100 shares at \$100. What will be the new price?
2. What if there are multiple matches at an instance? Let's say we have someone wanting to buy 100 shares at \$100 and someone wanting to sell 100 shares at \$100. We also have someone wanting to buy 500 shares at $110 and someone wanting to sell 500 shares \$110. What is the new price?

**Tags:** finance, stock-market, markets, financial-markets
> **Comments:**
> **username_1**: "*we have someone wanting to buy 100 shares at \$100 and someone wanting to sell 100 shares at \$100. We also have someone wanting to buy 500 shares at \$110 and someone wanting to sell 500 shares \$110.*" Who came first? Each of these offers should have a timestamp, and possible deals are - to my knowledge - resolved immediately.  
> **username_0**: What if they have the same timestamp? Given the amount of trades done each day and the low precision of computer clocks, this must have happened before  
> **username_2**: @timtam: what do you mean by "when demand is higher than offer"? Asking because the two cases you refer to have the same amounts on both the sellers' and buyers' sides? Your actual questions seem to be different. Should we answer the question in the header or the two unrelated cases in the body?  
> **username_0**: You're right, high demand is being ready to pay a lot, while high offer would be being ready to sell at cheap. So maybe the question is actually what would happen when both demand and offer is high, but when there is a gap as in my first subquestion.  
> **username_0**: I am basically just interested in an answer for my two subquestions, the title question is irrelevant  

---

## 1 answers

### Answer by username_2 on 2022-08-10. Score: 3 | Accepted answer

As in the answer [here](https://economics.stackexchange.com/questions/24729/how-are-final-stock-prices-arrived-at) (which you referred to yourself), the price of a stock is the price the stock was last traded at (until that price is updated because a new trade happens). A trade occurs if a bid and ask are matched.

The matching relies on a double ordering. The principle to remember here is "buy low, sell high". Also, remember that the ask is the *minimum* price a would-be seller is happy to sell, while the bid is the *maximum* price a would-be buyer is happy to buy. The buy and sell offers are ordered in the following way:

* **Asks**: lowest first, highest last, then in the order they were submitted.
* **Bids**: highest first, lowest last, then in the order in which they were submitted.

This is called **price-time-priority matching** (see [here](https://www.investopedia.com/terms/m/matchingorders.asp#:%7E:text=Under%20a%20basic%20FIFO%20algorithm,order%20at%20a%20lower%20price.)). Many exchanges use a variant of that procedure with potentially some extensions. An important exception is the NYSE, which has a pro-rate system on top (see [here](https://www.nyse.com/article/parity-priority-explainer)), but this is not relevant for your cases.

> What happens when the bid is higher than the ask? For example, someone is ready to pay \$101 per share for 100 shares, and someone wants to sell 100 shares at \$100. What will be the new price?

The matching in this case depends on the order in which instructions were submitted and on the *best price rule*, which says that whoever submits last gets the best available price. One motivation for that rule is that agents shouldn't be punished for submitting limit orders. After all, if that principle were not in place, agents who act last could instead put in market orders (without a limit), where a buyer immidiately buys at the lowest ask, and a seller sells at the highest bid, which may result in a better deal for the agent last to act. If not in place, you wouldn't get many limit orders, if any at all. So this rule favors market liquidity.

Applying these rules, if the sell offer at \$100 was there first, the buyer, even though she is happy to pay \$101, will only pay 100. Conversely, if the buyer places the order first, the seller will sell for 101. So, depending on the order of submission, the resulting price will be either 100 or 101.

> What if there are multiple matches at an instance? Let's say we have someone wanting to buy 100 shares at \$100 and someone wanting to sell 100 shares at $100. We also have someone wanting to buy 500 shares at \$110 and someone wanting to sell 500 shares \$110. What is the new price?

Again, the matching depends on the double ordering mentioned above and the best price principle. I won't go through all possible cases, but provide a few **illustrations**:

* Bid = 500@\$110. The seller comes in with 100@\$100. The trade is executed at the best price (for the seller) at \$110. (if they submit in the reverse order, the trade will happen at a price of \$100)
* Bid = 100@\$100, Ask = 500@\$110. There is no match. Ask = 100@\$100 comes in, "jumps the queue," and 100 shares are traded at \$100.
* Bid = 100@\$100, Ask = 500@\$110. There is no match. A new bid comes in with 500@\$110. It jumps the bid queue and is matched with the ask, and the trade happens at a price of \$100.

Note that time-stamping these days is very accurate, to within one millisecond (see for example [here](https://www.npl.co.uk/getattachment/5b94a9f8-bd79-478e-ba25-8fc56f51be33/NPLTime_Complete_Guide.pdf.aspx?lang=en-GB&ext=.pdf)). For any confusion to occur, orders would have the share the same time-stamp and precisely the same price.

> **Comments:**
> **username_0**: Thanks, very good answer! Is there a name (and possibly a reason) for this principle that the price will be in favor of the last person to make an order?  
> **username_2**: I edited the answer.  

---

