How Orders Execute and Prices Are Recorded
A Very Small Apple Market
This tutorial builds a toy “Apple Market” that, for execution purposes, is mechanically equivalent to markets for stocks, futures, or other traded assets.
It does so from the ground up, using the simplest setting: people buying and selling apples in specific quantities. We will keep a literal ledger recording offers to sell, offers to buy, and what happens when their prices meet. As the market evolves, we will introduce only the minimum structure needed to keep the record honest. By the end, price changes will no longer appear abstract or metaphorical; they will follow directly from the bookkeeping.
Although the setting is simplified, the tutorial uses standard market terminology throughout— bid, ask, execution, trade tape — to preserve a direct mapping to actual markets. These terms mean the same things here as they do in real trading systems.
The objective is to depict price formation as far as mechanics alone can explain it, starting with only the simplest transactions.
There are no charts, indicators, or strategies here. There is no prediction, psychology, or intent.
This is deliberate: the goal is to understand execution mechanics in isolation, before any additional layers are introduced.
There is only bookkeeping.
We will use apples instead of shares, contracts, or currency. Buy orders request apples. Sell orders offer apples. Prices are numbers attached to offers to buy or sell a set amount of apples. Apples are used only to remove financial context; the mechanics shown here apply unchanged to real markets.
At the start, there is no “market.” There are only empty ledgers.
We will introduce three records and nothing else:
- a list of sell offers (asks)
- a list of buy offers (bids)
- a record of completed exchanges (the trade tape)
Prices will change only when an exchange occurs. If no exchange happens, nothing has happened, no matter what offers exist.
Each new piece of structure appears only when the previous one becomes insufficient. When something feels confusing, the bookkeeping will be fixed before moving on.
By the end, price movement is shown through execution, event by event.
Day One of the Apple Market Exchange
The Apple Market Exchange begins empty. On day one, there are no offers to sell, no offers to buy, and no reported price.
Only a record-keeping system exists.
From the start, three simple rules apply:
- All activity must be recorded.
- The method used for record-keeping does not affect the mechanics of execution.
- A minimal record is sufficient to demonstrate those mechanics.
No software or automation is required for the mechanics shown here.
Orders are entered into the system and written into the record. An exchange occurs only when recorded buy and sell prices overlap. When that condition is met, an execution occurs and is recorded.
Orders do not interact directly with one another. All interaction occurs through the record. Nothing happens unless it is written down. Nothing is executed unless it is recorded.
The market is built incrementally: one order, one execution at a time.
On Price Visibility
When an execution occurs and is recorded, a price value is written into the trade tape. That value is the reported market price.
How that information becomes visible outside the record—through charts, reports, or other displays—is outside the scope of this tutorial.
The mechanics shown here explain how prices are recorded through execution, not how they are distributed or observed.