Participants, Brokers and Orders
Between deciding to buy and owning the shares there are at least six separate steps, and your idea can be damaged at several of them. A backtest, by contrast, executes the whole journey in one instruction: it decides you bought, at a price you nominated, in the quantity you asked for. The distance between those two descriptions is where a great deal of disappointing live performance comes from, so this lesson walks the journey properly.
By the end you should be able to describe what a broker does that you cannot do yourself, explain what changes hands at each stage of an order, and choose between the three basic order types on the basis of what each one controls rather than on habit.
Three ways to be in the market
Section titled “Three ways to be in the market”The words investor, trader and market maker describe different jobs, not a ranking. Each one is trying to be right about something different.
| Investor | Trader | Market maker | |
|---|---|---|---|
| Typical horizon | Months to decades | Minutes to months | Seconds to hours |
| Intended source of return | The asset’s cash flows and repricing | Changes in price | The difference between the buying and selling price, earned repeatedly |
| Must be right about | The business or the economy | The behaviour of price and flow | Inventory and who is trading against them |
| Main risk | The thesis is wrong and the horizon is long | The behaviour changes | Being filled repeatedly by better-informed traders |
Two observations matter more than the table. First, one person can occupy all three roles at once in different accounts, and the roles do not blend well within a single position: an entry taken as a two-day trade that becomes a two-year investment because it went against you is a failure of process, not a change of role. Second, your horizon determines almost everything downstream in this course — which interval you analyse, which costs dominate, how many independent observations you can gather, and therefore how much evidence you can ever collect.
Market makers deserve one extra sentence, because their behaviour shapes the prices you will analyse. They post a price at which they will buy and a higher price at which they will sell, and they aim to earn that difference many times a day while ending the day close to flat. The risk they manage is that the people who take their offers know something they do not. When that risk rises — around an announcement, or in a fast market — they defend themselves by widening the gap between their two prices and showing less size. This is why trading costs are highest exactly when the market is most interesting, a point the next lesson returns to.
What a broker actually does
Section titled “What a broker actually does”You cannot send an order to an exchange. Exchanges accept orders only from their members, and membership carries capital requirements, technology obligations and regulatory supervision. A broker is the entity that stands between you and that world, and it performs several distinct jobs that beginners tend to merge into one:
- Access. It is a member, or a client of a member, and can place orders on venues you cannot reach directly.
- Routing and execution. It decides where your order goes: to one exchange or another, to an alternative venue, to a wholesaler, or in some jurisdictions matched internally against another client or against the broker’s own book. The rules governing this differ by country and by account type, and they are worth reading once for the account you actually use.
- Custody and records. It holds the position, records the ownership, handles corporate actions such as splits and dividends, and reports to you and to the tax authority. Part 2 shows how much those corporate actions matter to a price history.
- Credit. It lends you money or securities if your account permits it, charges for that, and reserves the right to close positions if collateral falls short.
- Data. It usually supplies quotes and history, often with entitlement limits, delays or redistribution restrictions. Part 18 examines what that means when you want a real-time feed.
A distinction worth carrying: in an agency relationship the broker acts for you in a market and its interest in the price is limited to executing well. In a principal relationship — as with most contracts for difference and spread bets — your broker is the other side of the trade. Neither arrangement is automatically better, but they are not the same thing and the second one deserves you knowing it.
The path of an order
Section titled “The path of an order”From decision to settled trade
- DecisionYour rule fires on a bar that has closed. Everything after this point happens in the future relative to that bar
- OrderSymbol, side, quantity, order type, any limit or stop price, and how long it should live
- BrokerCredit and risk checks, then a routing decision about where the order should go
- VenueThe order either rests in the order book or crosses against orders already resting there
- Match and printA trade occurs, is reported publicly, and is confirmed to both sides
- Clearing and settlementA clearing house steps in between the parties and the trade settles on a defined cycle
Three features of that path do real damage to naive assumptions.
The price you acted on is already historical. By the time your decision becomes an order at a venue, some interval has passed. For an end-of-day system that interval is enormous: the signal is computed from a closing price and the order can only be worked the following session. Part 27 introduces the trade-delay setting that makes AmiBroker’s backtester reflect this, and Part 30 catalogues what happens when it is left wrong.
Your order is one of many. It joins a queue governed by the venue’s priority rules. You do not have a right to trade at the price you saw; you have a request that competes with everyone else’s.
The trade is not final at the match. Settlement takes place on a cycle, and until then the clearing arrangements matter. This rarely affects analysis directly, but it is one of several reasons that the cash from a sale is not instantly available again. Part 28’s portfolio backtesting works against a finite cash balance rather than an infinite wallet, which is the closest a simulation gets to this; it does not model the settlement cycle itself, and that remains one more small gap between the simulation and the account.
Order types, conceptually
Section titled “Order types, conceptually”There are many order types and their exact behaviour varies by venue and by broker. Three concepts cover almost everything and are enough for the whole course.
A market order says: trade now, at whatever the best available prices are. You are choosing certainty of execution and accepting uncertainty of price. In a heavily traded instrument during a calm session the difference between the price you saw and the price you get is normally small. At the open, in a thin instrument, or on a news release, it need not be small at all.
A limit order says: trade only at this price or better. You are choosing certainty of price and accepting uncertainty of execution. It has two failure modes rather than one. It may not execute at all, leaving you without the position your research said you should have. Or it may execute precisely when someone was keen to trade against you at that price, which is a different kind of problem — the fills you get are not a random sample of the fills you wanted.
A stop order says: do nothing until the market trades at or through this price, then send an order. In its usual form what it sends is a market order, so a stop price is a trigger, not a price you will receive. A stop-limit variant sends a limit order instead, which protects you from a bad price at the cost of possibly not trading at all — a genuinely uncomfortable trade-off when the purpose was to get out.
| Order type | You control | You do not control | Characteristic failure |
|---|---|---|---|
| Market | Whether you trade | The price | Paying much more than expected in a fast or thin market |
| Limit | The worst price you accept | Whether you trade | Missing the move entirely, or being filled only when it suits the other side |
| Stop | The condition that starts the order | The resulting fill price | A gap through the stop level fills you far from it |
Orders also carry a lifetime — valid for the day, valid until cancelled, or execute-immediately-or-cancel. The setting matters mainly because an order you forgot about is an exposure you did not decide to have.
Why the order type changes your fill
Section titled “Why the order type changes your fill”Four mechanisms, all of which reappear as cost assumptions later in the course.
Crossing the spread. Buying at the offer and selling at the bid means each round trip pays the gap between the two, whatever happens to the price afterwards. Lesson 3 puts numbers on this.
Queue position. A resting limit order sits behind everyone who arrived earlier at the same price. In a quiet instrument you may never reach the front. This is why a strategy that assumes it always buys passively at the bid is making a strong and usually unverified claim.
Partial fills. Your order for ten thousand shares meets two thousand at the best offer. The rest either walks up to worse prices, or rests and waits. Either way, the position you end up with is not necessarily the one your rule specified, and your average price is not the price on the chart.
Gaps. Between the close and the next open, information accumulates and no trading takes place. The next print can be far from the last one. Every stop, limit and target you place has to survive that discontinuity, and any backtest that models intraday stop levels on daily bars is making assumptions about a period it has no data for. This is one of the specific traps Part 30 examines.
The connecting idea is simple and worth stating plainly: a backtest fills you at a price you nominate, so you must be able to defend that price. If your rule buys at the close, ask whether you could have submitted an order in time. If it buys at the open, ask what the spread looked like in the first minutes. If it uses a stop, ask what happens on a gap. Doing this before you look at the results is the discipline; doing it afterwards is negotiation.
You can now follow an order from decision to settlement and name what happens at each stage. You know what your broker does and where its interests may differ from yours. You can describe the three basic order types in terms of what each one controls, and you have four concrete mechanisms that put a gap between the price on the chart and the price in your account.
The next lesson makes the largest of those mechanisms measurable: the two-sided market, what crossing it costs, and why liquidity decides which research questions you can honestly answer at all.
Check your understanding
Sources for this lesson
1 verified · checked 2026-08-31
- 01AFL Function Reference — SetTradeDelaysamibroker.com/guide/afl/settradedelays.html2026-08-31
Every technical claim on this page was checked against the official AmiBroker documentation on the date shown. Where the course disagrees with folklore, the source is how you can tell which one to trust.