An order is an instruction to a broker: buy or sell this much, on these terms. Different order types let you state different terms. This part explains the common ones with plain pictures and illustrative numbers, follows an order through its life, and then shows how trading software models that life. Each section has an Expert view. This is general education about how orders work, not advice about which to use.
The four common order types
- Market orderTrade now at whatever price is available
- Limit orderTrade only at your price or better
- Stop orderStay dormant until a trigger price is reached, then become a market order
- Stop-limit orderStay dormant until a trigger price, then become a limit order
Market order
- Very likely to be filled, if anyone is trading
- The price you get is not fixed
Limit order
- You control the worst price
- It may not be filled at all, or only partly
Illustrative numbers
All prices below are illustrative. Suppose a share is priced at 100, with a best ask of 100.10 and a best bid of 99.90.
| Order type | What it is | When it triggers | The main risk |
|---|---|---|---|
| Market (buying) | A purchase at the best available prices, straight away | Immediately | The fill price may differ from the price you saw |
| Limit (buying) at 99.80 | A purchase only at 99.80 or lower | Waits in the book until a seller accepts 99.80 | It may never be filled |
| Stop (selling) at 95 | A sale that activates if the price falls to 95 | When trading reaches the trigger of 95 | It becomes a market order, so the price can be worse than 95 |
| Stop-limit (selling), trigger 95, limit 94 | A sale at 94 or better, activated once 95 is reached | When trading reaches 95, then it rests as a limit order | The price may jump past 94 and nothing is sold |
Expert viewTriggers and conditions
A stop trigger is usually tested against a particular price (for example the last traded price), and brokers and venues differ in which one, and in whether the stop lives at the broker or the venue. A stop order is a conditional order: until triggered it is not in the order book at all. A stop-limit gives price control after the trigger, but, like any limit order, offers no assurance of execution. Always read the exact behaviour in your broker's own documentation.
- You to Broker You place a buy limit order, priced at 99.80 or lower.
- Broker to Exchange The broker passes it to the venue.
- Exchange to Broker (reply) The venue confirms the order is valid.
- Exchange (to itself) The order waits, because nobody is asking 99.80 yet.
- Exchange (to itself) Later, a seller accepts 99.80, so the prices meet.
- Exchange to Broker (reply) The venue reports the trade.
- Broker to You (reply) You see the fill at 99.80 or better.
Takeaway. A limit order may wait, and it fills only if the market reaches its price.
The life of an order
Along the way things can go differently: the order may be rejected, only partly filled, or cancelled before it is completed.
- CreatedYou fill in side, size and type
- SentIt leaves for the broker and then the venue
- Accepted or rejectedThe venue confirms it is valid, or refuses it
- Partly filledSome of the quantity has traded
- Filled or cancelledAll traded, or the remainder withdrawn
| From state | To state | What causes it |
|---|---|---|
| Created | Sent | The order passes checks and is transmitted |
| Sent | Accepted | The venue confirms the order |
| Sent | Rejected | The order breaks a rule |
| Accepted | Partly filled | Some quantity matches |
| Partly filled | Filled | The rest matches |
| Accepted or partly filled | Cancelled | A cancel request is confirmed |
- Created to Sent The order is transmitted.
- Sent to Accepted The venue confirms the order.
- Sent to Rejected The order is refused, and nothing trades.
- Accepted to Partly filled Part of the quantity trades.
- Partly filled to Filled The remaining quantity trades.
- Accepted to Cancelled A confirmed cancel request ends the order.
- Partly filled to Cancelled The unfilled part is withdrawn.
Takeaway. Only certain moves are allowed, and Filled, Cancelled and Rejected are final.
Partial fills
An order for 500 may find only 200 waiting at its price. The first 200 trade, and the other 300 remain open (or are cancelled, depending on the terms).
- 500shares requested
- 200filled so far
- 300still open
Expert viewPartial fill arithmetic
Suppose an order to buy 500 fills in two pieces: 200 at 100.10 and 300 at 100.20 (illustrative). Total cost is 200 x 100.10 + 300 x 100.20 = 20,020 + 30,060 = 50,080. The average fill price is 50,080 / 500 = 100.16. Software tracks the cumulative quantity filled, the remaining quantity, and the average price, and the remaining quantity must always equal ordered minus filled.
Why orders get rejected
- Invalid sizeThe quantity is zero, negative or not an allowed multiple
- Price outside limitsThe price is far from the current market, or outside an allowed band
- Not enough funds or marginThe account cannot cover the order
- Market closedThe venue is not accepting orders of that type right now
A rejection is usually a good thing for the system: a clear refusal is better than a silent mistake.
- 1Is the size zero, negative or not an allowed multiple?Yes Rejected for invalid size.No keep going
- 2Is the price far from the market or outside a band?Yes Rejected for price outside limits.No keep going
- 3Can the account cover the order?Yes If not, rejected for funds or margin.No keep going
- 4Is the market closed for that order type?Yes Rejected, because the venue is not accepting it now.No keep going
- 5OtherwiseEvery check passes, so the order goes on to the venue.
Takeaway. A clear refusal with a reason is better than a silent mistake.
Expert viewRisk checks before an order leaves
Well-designed systems run pre-trade checks before an order is sent: maximum order size, maximum price distance from the market, available funds, limits on total exposure, and duplicate detection. Checks run in a fixed order and produce a specific reason code, so a rejection can always be explained and logged.
Slippage
Slippage is the gap between the price you expected and the price you actually got.
The price you saw
- A best ask of 100.10 on your screen
The price you got
- A fill at 100.16 on average, because the book moved or your size used up the first level
Time in force
Time in force says how long an order lives. In general terms, a day order expires at the end of the trading session, and a good until cancelled order stays until it is filled or you withdraw it. Venues and brokers offer different options and use different names, so check what the one you use calls them.
A common misunderstanding is that a limit order always gets filled eventually. In fact a limit order is filled only if the market reaches its price, and it may expire, or stay open for a long time, without any fill. Another is that a day order and a good until cancelled order differ only in name: they differ in how long they stay exposed to the market, including during sudden moves.
An order is a small state machine
Software that handles orders models each one as a state machine: a fixed set of states, and only certain moves between them. Every change is recorded as an event, so the history of an order can be replayed later. This is the idea behind the Trading platform section on the home page.
Expert viewState machine design
Good designs follow a few rules. Valid transitions only: a filled order can never become open again, and any message implying that is rejected and flagged. Idempotent handling: the same message can arrive twice, so processing it again must change nothing; a unique event identifier makes duplicates easy to detect. Reconciliation with the venue: periodically compare your own record of every open order and fill with the venue's, and investigate any difference. Events are stored in order, so the current state is simply the result of replaying them. A useful test of a design is to ask whether the whole history of a day could be rebuilt from the event log alone, and whether two copies built that way would agree. Where they do not, there is a bug or a missing event, and the difference is the thing to investigate.
An order is not a click, it is a life with a beginning, a middle and an end.
Frequently asked questions
Which order type is safest?
None is safe in every case. Each exchanges one kind of certainty for another, such as certainty of a fill versus certainty of price.
Can a stop order lose more than the trigger price suggests?
Yes. Once triggered it may become a market order, and the fill can be worse than the trigger.
What happens to the unfilled part of an order?
It stays open, expires, or is cancelled, depending on the order terms.
Why might my order be rejected?
Typical reasons are an invalid size, a price outside limits, insufficient funds or margin, or a closed market.