Limit on close: what an LOC order is, and the conditions it carries
An LOC order buys or sells at the closing price, but only if that price is good enough for you. What the order does, the two conditions attached to it, and where it fits in a mechanical system.
By Baris Demirci · · Rev00
The idea
Most stock exchanges end the day with an auction. In the final minutes, buy and sell orders meant for the close are collected and matched at one price, the official closing price. That price is the close you see on a chart, and the close most backtests use.
There are two common ways to take part in that auction:
- Market on close (MOC). Buy or sell at the closing price, whatever it turns out to be.
- Limit on close (LOC). Buy or sell at the closing price, but only if it is at or better than a limit you set.
An LOC order is an MOC order with a price condition attached.
The two conditions
An LOC order carries two conditions, and both must be met.
1. A timing condition: only at the close. The order does nothing during the day. It waits for the closing auction, takes part in it, and is then either filled or cancelled. It never carries over to the next day.
2. A price condition: only at your limit or better.
- A buy LOC fills only if the closing price is at or below your limit.
- A sell LOC fills only if the closing price is at or above your limit.
When it fills, it fills at the closing price, not at your limit. The limit is a ceiling for a buy, or a floor for a sell. It is not the price you get.
An example
A fund is trading at $50.20 in the afternoon. You place a buy LOC with a limit of $50.00.
| Official close | What happens |
|---|---|
| $49.85 | Filled at $49.85, which is better than your limit |
| $50.10 | Not filled. The close was above your limit, so the order is cancelled |
| $50.00 exactly | May fill in full, in part or not at all |
The last row surprises people. When the close lands exactly on your limit, other orders often go ahead of yours. Orders willing to trade at any price, and orders with better limits, are matched first. Whatever is left at your price is shared out, so you may get some of your shares or none.
Rules of the auction you need to know
- There is a cutoff. Exchanges stop accepting closing-auction orders some minutes before the close. In the US that is around ten minutes before. After the cutoff, these orders generally cannot be changed or cancelled either. Many brokers set an earlier cutoff of their own, so check yours.
- You decide before the final price exists. Because of the cutoff, any rule that uses the day’s close has to be run on prices from a few minutes earlier. Usually the answer is the same. Occasionally a late move changes it.
- Not every broker or market offers it. Most large exchanges run a closing auction, but the names, times and rules differ. Some brokers do not offer LOC at all, or only for some instruments.
- The opening has the same pair. Market on open (MOO) and limit on open (LOO) work the same way in the opening auction.
Where it fits in a mechanical system
A mechanical system makes its decisions on rules, and many rules are written in terms of the close. The closing auction lets the order fill at the very price the rule was written around. That is why closing orders matter so much in systems that trade at the end of the day.
MOC and LOC solve slightly different problems:
- MOC makes sure you are in. You accept whatever price the auction produces. It is the simplest way to match a backtest that assumes every trade fills at the close.
- LOC makes sure you do not overpay. It protects you from an unusual closing price, for example a sharp move in the final minutes. It also lets you express a condition, such as “buy only if it closes at or below this level”.
LOC comes at a cost: some orders will not fill. A system using LOC has to account for that in its backtest. Every day, the test must check whether the close was at or better than the limit. It must also decide what happens when the close lands exactly on the limit, since a real order might not fill then. A test that assumes every LOC order filled is describing a different system from the one you will actually run.
The short version
An LOC order trades only in the closing auction, and only if the closing price is at or better than your limit. When it fills, you get the closing price. It gives you price protection and a built-in condition. In exchange you accept missed fills, a cutoff before the close, and a backtest that has to model both honestly.
Written for people building their own systematic portfolio management process. Nothing here is a recommendation to buy or sell anything. See the disclaimer.