[MUSIC] In this video, we will see Limit Orders, enter the Order Group and await execution. We will define what the best ask and bid prices are and what the bid ask spread is. We will also define what depth is. Further, we will see how market order and some of limit orders interact with the outer book leading to trades. We will distinguish between marketable and standing limit orders. Let's revisit the idea of an order book using an example. Consider the limit order book for some stock XYZ Incorporated. The order book currently is empty. A trader then sends in an order to sell 150 shares of XYZ Incorporated with a limit price of $40. For ease of reference, let's call this sell order S1. This order sits on the sell side of the book. The lowest price at which someone is willing to sell shares in a stock is referred to as the best ask price. This means that the current ask price is $40. A few seconds later, a buy order for 225 shares at the price of $39.95 enters the market. Let's call this buy order B1. The S1 is not willing to sell at a price lower then $40 while B1 is not willing to pay more then $39.95 to buy shares of XYZ. So the two orders cannot bid against each other. This new buy order sits on buy side of the book. The highest price at which someone is willing to buy shares in a stock is referred to as the best bid price. The current best bid price after this limit buy order arrives is $39.95. Prior to that, there was no best bid price, as there were no buy orders in the order book. The difference between the best ask price and the best bid price is called the bid-ask spread. In our example, this is 40 minus 39.5, which means that the bid-ask spread is $0.05. Since both these orders did not execute immediately and instead entered the limit of the book and await execution, they are sometimes referred to as standing or passive limit orders. These orders provide liquidity against which other creators would demand liquidity will trade. You can also see that if no other order arrives, these two orders will not execute. This is the execution uncertainty that we talked about last time. There is no guarantee that they will be executed on. Moving on, a few seconds later, another buy order, B2 arrives at the market. This order is for 500 shares at a price of $39.7. You can verify that B2 will also not execute against S1 because the prices at which they're willing to trade do not match. However, B2 is at a higher price than B1 and so it improves on the best bid price. The new best bid price is $39.97 and the new bid-ask spread is 40 minus 39.97, which is $0.03. To quickly summarize the order book at this point, there is one sell order at $40 for 150 shares. There's one buy order at $39.97 for 500 shares and another one at $39.95 for 225 shares. The number of shares available for trading at each price is referred to as the depth. The debt at the best ask price of $40 is 150 shares, and the debt at the best bid price of $39.97 is 500 shares. Next, we see a market order S2, who sell 300 shares, arrived. Remember, market orders do not have any price restrictions, and they will trade at the current market prices. Since this is an order to sell, it will interact with the buy orders in the order book. Specifically, it will start at B2 which is at the best bid price of $39.97 for 500 shares. S2 is only for 300 shares so it will get executed or filled completely at $39.97. We will see a trade at 37.97 for 300 shares. In the case of S2, we can see that execution was instantaneous and this goes back to our discussion of market orders having no execution uncertainty. After this state, the best bid price stays at 39.97 but the debt at this price has gone down to 200 shares. The next order S3 to arrive is a sell order for 250 shares with a limit price of $39.95. The question now is, what will happen to this order? Will it sit in the order book awaiting execution like the earlier limit orders, S1, B1, and B2? The answer is no. It will behave like a market order and execute immediately. How does this happen? Remember, B2 is willing to pay a maximum price of 39.97 and B1 a maximum price of 39.95. S3 however is willing to sell at a price as low as 39.95 but higher prices are acceptable. This means that the prices at which B1 and B2 are willing to buy shares are prices at which S3 is willing to sell. Since the best bid is 39.97, S3 will execute at that price first. But that 39.97 is only 200 shares where as S3 is a sell order for 250 shares. This means 200 of S3's 250 shares will be filled at 39.97. We will see a trade for 200 shares at 39.97. This results in B2 completely being filled. S3 still needs 50 shares and B1 is at a price of 39.95. This price is also acceptable to S3 as its limit price is 39.95. The remaining 50 shares of S3 will execute at $39.95 which is what we will observe as a trade. Orders such as S3 which are limit orders but executed instantaneously are usually referred to as marketable limit orders or active orders. Like market orders, their execution is not uncertain but the prices are uncertain. In the case of S3, even though its limit price was 39.95, it was executed at two different prices, namely 39.97 and 39.95. But none of the prices were lower than its acceptable price of 39.95. After S3's execution, the best bid price has dropped back to 39.95 and the bid ask spread is back to $0.05. S1 and the balance of B1 which is now 175 shares continue to sit in the order book awaiting execution. Next time, we will continue to see some other order book dynamics which will further your understanding of how the limit order book market works. [MUSIC]