99.80 yuan
A buyer is willing to pay this price.
An immediate sell starts on this side.
← Lesson 2 · What Do You Own After You Buy?
Your screen shows 100 yuan. You click Buy and the order fills at 100.20 yuan. Both prices can be accurate. The last trade and the price someone is currently willing to sell at answer different questions.
Lesson 1 separated observation from execution. Lesson 2 explained what you own once you buy. Now ask what happens between wanting to buy and getting a fill?
This fictional market simulator has no connection to a trading account. Its prices, quantities, and fees are teaching assumptions. The time estimate has yet to be tested with learners.
Read both sides of a quote ↓Imagine a market for fictional Asset A. Buyers quote what they will pay and sellers quote what they will accept. The highest bid right now is 99.80 yuan and the lowest ask is 100.20 yuan.
A buyer is willing to pay this price.
An immediate sell starts on this side.
A seller is willing to accept this price.
An immediate buy starts on this side.
Bid–ask spread100.20 − 99.80 = 0.40 yuanThe best ask minus the best bid.
Midpoint(99.80 + 100.20) ÷ 2 = 100 yuanThe average of the best bid and ask. An order may never trade at this price.
The last trade price shows where the previous trade took place. Quotes show the prices and quantities buyers and sellers are offering now. SEC order guidance explains why a market order’s execution price can differ from the last trade price.
If the quotes and sizes stay the same, buying one unit at 100.20 and selling it at 99.80 loses 0.40 yuan. That comes from crossing the spread, before fees.
Each quote covers a limited quantity. If only 2 units are available at the best ask and you want 4, check the next price level and its available quantity. Liquidity describes how much you can trade when you need to and what it costs to do so.
A market order tries to trade against available quotes without you specifying a fixed fill price. Large orders may fill at several prices. Check the market’s rules for price protection, unfilled quantities, and trading halts.
A buy limit sets the highest price you’ll accept. A sell limit sets the lowest. You may have to wait for an eligible quote.
Suppose you’re willing to pay up to 101 yuan and someone offers to sell at 100.20 yuan. The order fills at 100.20 first under this lesson’s matching rules. A limit of 101 yuan leaves room for a better price.CME explains limit orders, price improvement, price protection, and time in force for different order types.
A limit order also needs a time in force. Specify whether any unfilled quantity stays open, is canceled immediately, or expires at a scheduled time. Even if the market touches your limit price, your order may fill only partially or remain open. The fill depends on available quantity and your place in the queue.
The order book below lists the current bids and asks and their quantities. Each side starts with the best price for you. Run the default market buy for 4 units, then buy the same quantity with a 100.20 yuan limit and compare the results.
| Price (yuan) | Units |
|---|---|
| 99.80 | 3 |
| 99.60 | 4 |
| 99.40 | 5 |
| Price (yuan) | Units |
|---|---|
| 100.20 | 2 |
| 100.40 | 3 |
| 100.60 | 5 |
Each run starts with the same snapshot and the positions do not carry over. Assume sufficient cash and holdings, unchanged quotes, no competing orders, and no fees.
The simulation uses only the three displayed price levels. It fills the eligible portion of a limit order and leaves the rest open until you click “Cancel unfilled units.” No new quotes appear. If a market order exceeds the available quantity, the simulation immediately cancels what remains.These rules are specific to the demo. Markets may differ in price protection, time in force, and matching.
Filled
Open
Canceled
| Price (yuan) | Units | Trade value (yuan) |
|---|
An average fill price requires at least one fill.
A worse fill than the reference is positive here. For a buy, subtract the reference from the average fill price. For a sell, subtract the average fill price from the reference. This is a price comparison. The fill price already includes the difference. Average prices and differences per unit display four decimal places. Trade values display two.
The real order book can change between seeing a quote and getting your order to the market. Someone else can trade first or cancel a quote. This simulator shows what would happen under a fixed set of assumptions.SEC execution guidance explains that trades take time to execute and quotes apply only to limited quantities.
The default market buy for 4 units fills 2 at 100.20 and 2 at 100.40.
Purchase cost = 2 × 100.20 + 2 × 100.40 = 401.20 yuan
Average fill price = 401.20 ÷ 4 = 100.30 yuan
The average fill price is weighted by quantity. This time the two fills each contain 2 units. With unequal quantities, averaging the two prices directly gives the wrong result.
Slippage depends on your reference price. Compared with the midpoint of 100.00 at submission, the buy cost 0.30 yuan more per unit. Compared with the best ask of 100.20, it cost 0.10 yuan more. Record the reference time and price, the side, and the number of units filled.
Suppose you later sell all 4 units at 101 yuan with a 1 yuan fee on each side. Sale proceeds of 404 yuan − purchase cost of 401.20 yuan − total fees of 2 yuan = 0.80 yuan net profit.
The 401.20 yuan cost already uses the actual fill prices. Deducting slippage or the spread again would count the same execution difference twice.
This calculation gives the net profit on one round trip. Account returns also take idle cash, other positions, deposits, withdrawals, and fees into account. Later lessons bring these into a single ledger.
Buy 40 units. Assume quotes stay in place and there are no competing orders. Use these inputs regardless of the simulator settings above.
Place a limit order to buy 4 units at 100.20 yuan. Sellers offer only 2 units at 100.20, and all other asks are higher. The first 2 units fill. Cancellation of the remainder is then confirmed, with no more fills. Ignore fees.
Complete the questions below before trying the optional writing exercise. Use the fixed inputs here, even if you changed the experiment above. Enter numbers in the units shown and keep at least two decimal places where needed. Follow the specified precision for tables. You can check one answer at a time or all answers together.
Save your homework to export these results. Check again after changing an answer. Optional writing and self-assessment are ungraded. Save your work before refreshing.
Planned buy 4. Filled 2 at an average price of 100.20, for a trade value of 200.40. The other 2 units were canceled, leaving 0 open. The two filled units still count as holdings after the cancellation. This exercise excludes fees. This response is for self-review.
An order record should include side, planned quantity, order terms, time of submission, status, fill prices and quantities, fees, and any unfilled quantity.If the plan was to buy 40 units and only 20 filled, use the 20 actual fills in your research.
Submission, acceptance, fills, and cancellation confirmation are separate events. In a real system, after requesting cancellation, check for confirmation and any fills that happened in the meantime. This simulator cancels the remainder immediately.
Lesson 4 covers direction, leverage, and margin. Once you can record the actual fill quantity and price, you can distinguish position notional from account equity and evaluate how much loss the account can bear.
Lesson 4 · Direction, Leverage, and Margin →
Course home →