Trading is buying or selling a financial instrument. An executed trade changes a position and creates contractual cash flows; a forecast, quote or submitted order does not by itself do so. For a quant, that distinction separates a promising signal from a strategy that can actually be implemented.
Trades can seek a return, hedge an existing risk, rebalance a portfolio or manage a dealer's inventory. A profitable price forecast is only one possible motive. In each case the practical questions are the same: what quantity traded, at which prices, under which conditions, and with what remaining exposure?
The trade starts with an instruction
In a displayed order book, the best bid is the highest displayed buying price and the best ask is the lowest displayed selling price. An aggressive buyer can take available offers; an aggressive seller can take available bids. Their difference is the bid–ask spread. The midpoint is a useful reference between them, but it is not automatically an executable price.
A market order seeks execution against available liquidity without setting a limit price. A limit order caps the purchase price or sets a minimum sale price; it can execute immediately if it crosses the book, or wait if it does not. Price protection does not ensure a fill. FINRA's order guide explains this price-versus-completion trade-off for securities orders.
A quote also has a quantity and a timestamp. Larger orders may consume multiple price levels, and quotes may change before an order arrives. The SEC's execution guide explains why the price seen on screen can differ from the eventual fill. The example below deliberately removes that uncertainty so the cash accounting is visible.
A USD 50 move produces USD 26 of profit
Consider a synthetic, fully funded 100-share round trip within one trading session. Assume enough initial cash, at least 100 shares available at each stated execution price, and complete, exact fills at the two snapshots. Prices are USD per share. Commission is an assumed USD 2 on each side; there are no other charges, distributions, funding costs or taxes during the example. These are teaching assumptions, not observed market quotes or a strategy recommendation.
| Snapshot | Best bid | Best ask | Midpoint | Our execution |
|---|---|---|---|---|
| Entry | 99.90 | 100.10 | 100.00 | Buy 100 at 100.10 |
| Later exit | 100.40 | 100.60 | 100.50 | Sell 100 at 100.40 |
The midpoint rises by USD 0.50. A paper calculation that buys and sells 100 shares at those midpoints reports USD 50. The actual trade uses the ask on entry and the bid on exit:
| Cash event | Change in cash, USD | Shares held after event |
|---|---|---|
| Buy 100 shares | −10,010 | 100 |
| Entry commission | −2 | 100 |
| Sell 100 shares | +10,040 | 0 |
| Exit commission | −2 | 0 |
| Whole round trip | +26 | 0 |
The purchase consumes USD 10,012 including its commission; the sale returns USD 10,038 after its commission. Gross trading profit is USD 30 and net profit is
Original synthetic example. The two executions contain USD 20 of spread crossing relative to their respective midpoints. Adding USD 4 of commissions leaves USD 26 net cash profit; sufficient depth and exact fills are stipulated.
The USD 24 gap between paper and cash results is USD 10 paid above the entry midpoint, USD 10 received below the exit midpoint, and USD 4 of commissions. Because the execution prices already contain the spread crossing, subtracting another spread charge would count it twice. This is why transaction costs belong in a reconciled ledger rather than an arbitrary deduction from a chart.
A mark describes value; a fill changes the position
While the shares remain open, a chosen market price can mark their value for reporting. That mark might be a midpoint, last trade or another declared valuation convention. It is not evidence that the whole position can be sold at that price. A liquidation estimate must consider the available buying interest, size and charges.
For this simple closed long position, with no intervening cash flows, net profit is , where is the number of shares and is total explicit fees. This expression assumes the same quantity is bought and sold. Partial exits leave inventory and a valuation problem; derivatives introduce their own contract cash flows, so notional cannot simply be treated as the amount paid to own the contract.
The position also carries risk between entry and exit. A worse price move can outweigh the intended gain, thin liquidity can make an exit expensive, and leverage adds funding and collateral constraints. A stop instruction does not guarantee an exit at its trigger price. Risk controls therefore concern authorised exposure and feasible execution, as well as the model's forecast.
Follow the executed position
In a systematic process, a signal proposes a trade, portfolio decisions set the desired exposure, and execution tries to move the current position toward that target. Narang's Inside the Black Box separates these functions because forecasts, risk constraints and costs must be considered together. Automation can make instructions repeatable; it does not establish that the forecast or fill assumptions are sound.
Record submitted orders separately from confirmed fills, including partial executions, rejections and cancellation state. Reconcile positions and cash with execution reports. When evaluating backtesting, check whether the simulation could have received the information, accessed the liquidity and paid the costs it assumes.
To explore the mechanism, the public Order-book simulator offers buy/sell and market/limit controls, Thin/Normal/Deep books, 1–200-share orders and simulated market events. Its preset books differ from this example; its slippage display uses the pre-trade best bid or ask, and its paper account omits fees and margin. Use it to compare requested and filled quantities, then return to a cash ledger for net results.
For the full order lifecycle, Market, Limit and Conditional Orders develops marketable limits, partial fills and cancellation races. The public page is a preview; the full lesson requires membership.
Sources
- Rishi K. Narang, Inside the Black Box: A Simple Guide to Quantitative and High-Frequency Trading, 2nd edition (Wiley, 2013), Chapter 2, pp. 17–18 — roles of forecasts, risk, transaction costs, portfolio construction and execution. The cash example and figure here are original.
- FINRA: Order Types — market and limit orders, conditional instructions and uncertainty of price or completion in U.S. securities trading.
- U.S. SEC, Investor.gov: Executing an Order — order routing, finite quoted size and price changes between instruction and execution.