StratoQuant
EN
Get the free code

B-05 · Build · execution

Buy the close, sell the open

A trading day has two halves, the session and the night. Much of a stock index's long-run rise has arrived in the second. What a system that holds only overnight is doing, and why execution decides whether it works at all.

By Baris Demirci · · Rev00


The idea

Split every trading day in two. The session runs from the open to the close. The night runs from one day’s close to the next day’s open, and includes weekends and holidays.

Day 1 Day 2 Held Session Night Session Buy at the close market on close Sell at the open market on open
Illustration. A pure overnight system holds from one day's close to the next day's open, and is out of the market for the whole session. Weekends and holidays make some nights longer.

Researchers who measured the two halves separately on US stocks found something odd. Over long periods, most of the rise in broad stock indices came overnight, and the session contributed little (Cliff, Cooper and Gulen, 2008; Kelly and Clark, 2011). A system that buys at the close and sells at the next open tries to hold only the half that has historically done the work, and to stand aside for the other.

Why it might exist

Nobody has settled why, and that matters for anyone building on it. The main explanations:

  • Holding when you cannot act. Overnight the market is closed. News arrives, and you cannot react until the open. Someone has to carry that risk, and may be paid for it. Hendershott, Livdan and Rösch (2020) found that market risk is rewarded overnight but not during the session.
  • Who trades when. Attention-driven buying tends to land at the open and push opening prices up, and the effect fades during the day (Berkman, Koch, Tuttle and Zhang, 2012).
  • A tug of war between clienteles. Different kinds of investors dominate the two halves of the day, and their flows pull prices in different directions (Lou, Polk and Skouras, 2019).

Each explanation implies something different about whether the pattern lasts. A risk premium can persist. A pattern caused by the habits of one group of traders can fade once those habits change, or once enough people trade against it.

What the trade looks like

A pure overnight system holds one broad index fund from the close to the open, and holds nothing during the session. Some versions hold every night. Others add a condition that skips some nights. Our free Owl_SPY is one of these: it holds only after a weak session.

The behaviour follows from the design:

  • Many small trades. Each night is its own trade, so there are hundreds a year, each worth very little on its own.
  • You miss the session, both ways. Strong days and weak days happen without you.
  • Losses come as gaps. The worst nights are the ones where bad news lands while the market is closed. There is no stop to hit and no exit until the open, so the loss arrives all at once.
  • Dividends still count. A fund that goes ex-dividend opens lower by roughly the dividend. If you held it at the previous close, you are owed the dividend, so the drop is not a loss. A backtest that ignores this is wrong in one direction or the other.
Minutes before the close: run the rule Hold tonight? Buy in the closing auction (MOC) Stay in cash Market closed: news can gap the price Sell in the opening auction (MOO) Yes No
Illustration of one night for a pure overnight system. The decision is made on prices from a few minutes before the close, both trades go through the auctions, and nothing can be done between them.

Execution decides everything

The move on a typical night is small, often similar in size to the bid-ask spread. That is why this kind of system lives or dies on how the orders are placed.

  • Use the auctions. Exchanges run a closing auction and an opening auction. A market-on-close order fills at the official closing price, and a market-on-open order fills at the official opening price. Most backtests of this idea assume exactly those prices. Buying near the close or selling near the open with ordinary orders pays the spread and some drift twice a night, every night.
  • Mind the cutoff. Closing-auction orders must reach the exchange before a deadline, and many brokers set an earlier one of their own. A rule that reads the day’s final prices has to be run on prices from a few minutes before the close. Now and then a late move will change the answer.
  • Charge real costs in the test. Commissions, fees and even a sliver of slippage are multiplied by hundreds of trades a year. Run the backtest at zero slippage, then at small amounts of slippage, and see how quickly the result disappears. If it only survives at zero, you need auction fills, not ordinary orders near the bell.
  • Be wary of old data. When the minimum price step was large relative to a night’s move, a backtest could not represent the trade honestly. Start the test where the market’s structure looks like today’s.

Limits, plainly

Most of the evidence comes from US stock indices. The pattern has varied over time and may weaken as more people trade it. Overnight gaps can be violent, as they were in March 2020. Every filter added to skip nights is another setting that can be fitted to history, so test the neighbourhood around it, not just the value you like. And because the gain per night is so small, two traders running the same rules with different brokers can end up with different systems.

The short version

Buying at the close and selling at the open holds the part of the day when the market is shut. There are credible reasons why that half has carried much of the long-run rise, but no settled one. The idea is simple. Making it work in practice is mostly an execution problem: auction orders, honest costs, and a plan for the night the gap goes the wrong way.


Written for people building their own systematic portfolio management process. Nothing here is a recommendation to buy or sell anything. See the disclaimer.

← All articles