Market Structure Tools
Opening & Closing Auction Simulator
See how price gets set at the open and close.
Enter a hypothetical order book of limit and market orders. The simulator finds the clearing price that maximizes matched volume, the same mechanism real exchanges use, and shows you the result, any order imbalance, and a supply-demand chart.
Direct Answer
The opening and closing auction simulator finds the clearing price that maximizes matched volume for a hypothetical order book of limit and market orders, the same mechanism NYSE and Nasdaq use to set official opening and closing prices. It reports the clearing price, matched volume, and any order imbalance.
Educational tool only. This simulator models auction mechanics with user-entered assumptions. Output is not investment advice, not a price prediction, and not a broker order instruction. Do not enter real account numbers, passwords, or brokerage credentials.
Auction Simulator
Pick a scenario to pre-load an order book, or build your own by adding buy and sell orders below. Then click Run Auction to see the clearing price.
| Side | Type | Qty (shares) | Limit price ($) | Remove |
|---|
Auction Result
Volume at each price level
| Price ($) | Buyable (shares) | Sellable (shares) | Matched (shares) | Imbalance |
|---|
matched = min(buyable, sellable) is greatest. Any unmatched shares at the clearing price constitute the auction imbalance, which is published by exchanges and may attract offsetting orders before the auction completes. How the Simulator Works
This simulator applies the standard call auction price-maximization algorithm used by NYSE, Nasdaq, and most major exchanges at the open and close of each session.
Algorithm steps
- Collect orders. Market orders will execute at any price. Limit buy orders execute at or below their limit price; limit sell orders execute at or above theirs.
- Identify candidate prices. Any limit price in the order book is a candidate clearing price. (If only market orders are present and no limit prices exist, a reference price is required.)
- Compute cumulative interest at each price. At candidate price
P: Buyable(P) = all market buy shares + all limit buy shares with limit ≥ P. Sellable(P) = all market sell shares + all limit sell shares with limit ≤ P. - Calculate matched volume. Matched(P) =
min(Buyable(P), Sellable(P)). - Choose the clearing price. Select the price P* that maximizes Matched(P). If two prices produce equal matched volume, the exchange tie-breaks by choosing the highest price when buy interest exceeds sell interest, the lowest price when sell exceeds buy, and the price closest to the previous close otherwise.
- Compute imbalance. Any shares on the larger side at P* that were not matched form the auction imbalance.
Worked example (pre-loaded "Typical Open" scenario)
- Orders: 200 market buy; limit buys at $101×300, $100×500, $99×200; 100 market sell; limit sells at $99×200, $100×400, $101×300.
- Candidate prices: $99, $100, $101.
- At $99: Buyable = 200+300+500+200 = 1,200 | Sellable = 100+200 = 300 → Matched = 300.
- At $100: Buyable = 200+300+500 = 1,000 | Sellable = 100+200+400 = 700 → Matched = 700.
- At $101: Buyable = 200+300 = 500 | Sellable = 100+200+400+300 = 1,000 → Matched = 500.
- Clearing price = $100.00 (maximizes matched). Imbalance = 1,000 − 700 = 300 shares buy-side.
Data and limitations
- User-entered data only. No live market data or brokerage connection. Outputs reflect the hypothetical order book you construct.
- Price priority assumed. Within a limit price, the simulator does not model time priority (FIFO queue position) because that detail is immaterial for determining the clearing price itself.
- One tick size. The simulator accepts any decimal price. Real exchanges enforce minimum tick sizes ($0.01 for most U.S. equities).
- No D-Quotes or I-Orders. NYSE and Nasdaq have proprietary order types in their closing auction (D-Quotes, Imbalance-Only orders) that this educational model does not replicate.
- No collar enforcement. Exchanges apply price collars during re-opening auctions after halts. These guardrails are not modeled here.
Frequently Asked Questions
In continuous trading (the bulk of the regular session), orders match immediately against resting orders in the order book at the best available price. A buyer and seller meet whenever both conditions are satisfied simultaneously.
A call auction (also called a batch auction) collects all eligible orders over a defined window, before 9:30 AM for the opening, and around 3:45-4:00 PM for the closing, then matches them all at a single price at the same moment. Because all orders clear at one price, the auction produces a more orderly, less volatile opening or closing print compared to what a continuous match on a fragmented, pre-market order flow would generate.
The simulator tests every limit price in the order book as a candidate clearing price. At each price, it sums all orders willing to buy (limit price at or above the candidate) and all orders willing to sell (limit price at or below). Matched volume equals the minimum of the two. The price where this minimum is highest is the clearing price.
If two prices tie for maximum matched volume, the simulator applies the standard tie-break rule: choose the higher price when there is a buy-side surplus, the lower price when there is a sell-side surplus, and the price closest to the midpoint otherwise. This matches the general logic used by NYSE and Nasdaq, though each exchange publishes additional proprietary rules.
An imbalance occurs when buy interest and sell interest at the clearing price are not equal. The side with more shares has unmatched volume, those orders execute at the clearing price but only the matched portion is filled. The unmatched portion is the imbalance quantity.
Common causes: a news event overnight creates a surge of market-on-open buy orders; index rebalancing pushes concentrated sell interest into the closing auction; or retail orders accumulated over the prior evening are disproportionately on one side. Exchanges publish indicative imbalance data (size and direction) roughly 10-15 minutes before the auction to attract offsetting liquidity. Large imbalances widen the spread between the indicative auction price and the prior close.
MOO (Market on Open) orders execute at the opening auction price, whatever it is. They contribute to the market-order buy or sell pool modeled here as "Market" type orders in the opening auction.
MOC (Market on Close) orders execute at the closing auction price. They are the most common driver of closing auction imbalances on high-volume index days, because funds tracking an index must buy or sell exact weights at the official closing price.
LOO (Limit on Open) and LOC (Limit on Close) orders set a price limit but still participate only in the respective auction, not continuous trading. In this simulator these appear as limit orders. An LOC buy at $150 will execute in the closing auction only if the clearing price is $150 or lower.
An auction requires at least one willing buyer and one willing seller to overlap at some price. If every buy limit price is below every sell limit price, and there are no market orders, no single price satisfies both sides simultaneously. The order book is "uncrossed," and no execution occurs.
In practice this rarely happens in the opening auction of a liquid stock, because market orders (MOO/MOC) guarantee volume on both sides and will match against each other at the equilibrium price. It can occur in thinly traded securities or in a re-opening auction after a halt, where limit orders accumulate with a wide spread. Try the "No overlap" scenario in the simulator to see this case.
The mechanics, price-maximization matching, are the same. The key differences are in timing, order types, and participants:
Closing auction: NYSE runs its closing auction from approximately 3:50-4:00 PM ET and accepts D-Quotes (Closing D-Quotes allow floor brokers to offset imbalances). Nasdaq runs its closing cross starting around 3:50 PM ET and accepts Imbalance-Only (IO) orders that may only trade against the imbalance. The official closing print from these auctions sets NAV calculation prices for ETFs and mutual funds, drives index rebalancing trades, and is the benchmark for options settlement on expiration days. Closing auctions typically have far larger volume than opening auctions on index-heavy stocks.
Opening auction: Builds on orders accumulated overnight plus the last few minutes of pre-market. Volume is usually smaller and more driven by news-sensitive retail and institutional orders. Both Nasdaq and NYSE run opening auctions; for Nasdaq this is called the "Opening Cross."
This tool is built for education, not execution. It never requests broker credentials, API keys, account numbers, or any personally identifying information. Entering that information into a third-party website would create security and privacy risks. All inputs stay in your browser, nothing is sent to a server.
If you want to see your actual open-session order status, use your broker's platform directly. This simulator is for understanding how the auction mechanism works conceptually, not for routing or managing real trades.
It applies the core principle, clearing accumulated buy and sell interest at the single price that maximizes executed quantity, which is what real auctions do. Actual venue procedures add tie-breaking rules, constraints from price bands, treatment of order types with special eligibility, and reference-price rules that differ between exchanges. The simulator shows why a clearing price lands where it does rather than reproducing any specific venue's rulebook.
Timing rules are absent: real auctions have cut-off points after which certain order types cannot be entered, amended or cancelled, and interest arriving after those points is treated differently. Imbalance information published in the run-up also changes behaviour, since participants respond to it. The simulator treats the order set as fixed, which removes the feedback loop that operates in the minutes before a real auction clears.