Original paper
Abstract
Since the formal development of the efficient market hypothesis, studies of actual market performance have revealed a number of apparent inconsistencies (anomalies). Herein we report on our discovery of evidence anomaly which relates to the behavior of the overnight and subsequent intraday returns.
According to the weak form of the efficient market hypothesis, a time series of returns is supposed to contain no useable degree of auto correlation. Numerous studies have provided strong support for this viewpoint. We may, however, have found evidence which is inconsistent with this hypothesis.
The present study grew out of another study which focuses on the behavior of closed end fund returns. In that study we explored the daily return performance of such funds in conjunction with the daily performance of the funds' NAVs. We bifurcated the daily closed end return into an overnight return which reflect that part of the return that takes place between the close and the next day's open and the intraday return which encompasses that part of the return that occurs from the open to the close. The two pieces of the daily return exhibited a very strong negative autocorrelation. Naturally we wanted to explore whether a similar phenomenon was occurring for stocks in general. That is the question that this study seeks to answer.
The short answer is yes, we have found the same type of negative auto correlation for stocks in general as we found for the shares of closed end funds. We have found this result for stocks listed on the NYSE, AMEX and NASDAQ. We have found it for both the 2000 to 2005 and 1994 to 1999 periods. When we divide the data into size categories, we find significant relationships for each sub sample. The correlations do, however, tend to be almost monotonically stronger as market capitalization decreases. Not only do we find a powerful negative correlation between the overnight and intraday returns but we also find a relationship between overnight and the prior intraday and the prior overnight returns. The signs of the correlations alternate with adjacent periods having negative correlations and one step back being positively related. We find that the relations hold up as anticipated in a multivariate context. When we add the S&P return to take account of the market return's impact, we find that the regressions' R squares rise but the coefficients on the other dependent variables are largely unaffected. All of our results are highly significant statistically. Most of the R squares are in the low to mid single digits.
Keywords:Â market efficiency, overnight return, intraday return, anomaly
Trading rules
- Buy SPY ETF at daily closing price
- Sell SPY ETF at daily opening price
- Consider slippage costs and fees
- Combine with a more sophisticated strategy
- Use as a trade execution strategy for entry/exit improvements
Python code
Backtrader
import backtrader as bt
class OvernightAnomaly(bt.Strategy):
params = (
('slippage', 0.001),
('commission', 0.001),
)
def __init__(self):
self.spy = self.datas[0]
self.order = None
self.buy_price = None
self.sell_price = None
def notify_order(self, order):
if order.status in [order.Submitted, order.Accepted]:
return
if order.status in [order.Completed]:
if order.isbuy():
self.buy_price = order.executed.price * (1 + self.params.slippage)
self.buy_comm = order.executed.comm
else:
self.sell_price = order.executed.price * (1 - self.params.slippage)
self.sell_comm = order.executed.comm
self.order = None
def next(self):
if self.position:
self.sell(data=self.spy, exectype=bt.Order.Market, size=self.position.size)
else:
self.buy(data=self.spy, exectype=bt.Order.Close)
def stop(self):
pnl = self.broker.getvalue() - self.broker.startingcash
print('PnL: %.2f' % pnl)
if __name__ == '__main__':
cerebro = bt.Cerebro()
data = bt.feeds.YahooFinanceData(dataname='SPY', fromdate='2000-01-01', todate='2021-12-31', adjclose=True)
cerebro.adddata(data)
cerebro.addstrategy(OvernightAnomaly)
cerebro.broker.setcash(100000.0)
cerebro.broker.setcommission(commission=0.001)
cerebro.run()
Please note that this code snippet demonstrates a simple implementation of the Overnight Anomaly strategy using Backtrader. It does not include the combination with a more sophisticated strategy or using it as a trade execution strategy for entry/exit improvements. These features would require additional customization and are beyond the scope of a single code snippet.