Sub topic 1
Your broker: the gateway to the market
Prerequisites
This chapter assumes you know what a share of stock represents, understand the bid (highest price a buyer will pay) and ask (lowest price a seller will accept), and have used a brokerage app or website.
Your broker as the gateway
What the broker does
Your broker is a firm that receives your order and sends it to the market on your behalf. You do not connect to an exchange directly. The broker checks that you have enough cash or buying power, records the order, and transmits it to a trading venue. The broker also keeps track of the trade once it is complete.
Market and limit orders
Market orders
A market order tells the broker to buy or sell immediately at the best available price. It guarantees execution, but not the price. In a fast-moving or thin market, the fill can be well above the last quote you saw.
Limit orders
A limit order sets the maximum price you will pay for a buy, or the minimum you will accept for a sell. It guarantees the price but not the execution. If no seller meets your limit, the order may sit unfilled.
from dataclasses import dataclass
@dataclass
class Order:
side: str
quantity: int
order_type: str # "market" or "limit"
limit_price: float | None = None
order = Order(side="buy", quantity=120, order_type="limit", limit_price=10.02)
print(order)Where your order goes
Routing and best execution
Brokers send orders to several venues. Under US rules, a broker must seek best execution, meaning the most favorable terms reasonably available for the customer. Price is the main factor, but speed, likelihood of fill, and cost also matter. Some brokers receive payment for order flow, which is a conflict of interest that regulators require them to disclose.
Exchanges, alternative trading systems, and market makers
Trading venues
| Venue type | What it does |
|---|---|
| Exchange | Publishes quotes and matches orders in a public order book |
| Alternative trading system (ATS) | Matches orders privately, often for large trades |
| Market maker | Trades from its own inventory and quotes both bid and ask |
Exercise
A limit buy order is set at 10.02, and the best ask is 10.05. Will the order fill immediately, and why?
Show answer
No. The lowest seller wants 10.05, which is above the 10.02 limit, so the order rests in the book until a seller accepts 10.02 or less.