
“Buy SPY ETF 1 day (some papers say 4 days) before the end of the month and sell the 3rd trading day of the new month at the close.”
ASSET CLASS: CFDs, ETFs, funds, futures, options | REGION: United States | FREQUENCY: Daily | MARKET: Equity | KEYWORD: Calendar
STRATEGY IN A NUTSHELL
This strategy entails buying SPY ETF shares, which mimic the S&P 500, one day (or in some cases, four days) before a month ends and selling them on the close of the new month’s third trading day. Aimed at exploiting the anticipated shifts in market sentiment and liquidity at month’s end and start, this approach seeks to leverage potential short-term gains from these predictable patterns. Such a method requires precise timing for buy and sell orders, focusing on capturing slight, regular market movements rather than long-term investments, potentially offering an edge over traditional investment strategies.
ECONOMIC RATIONALE
The turn-of-the-month anomaly, presenting higher stock returns around month-end, remains an academic conundrum. This phenomenon is observed across both small-cap, low-price and large-cap, high-price stocks, and is not exclusive to turn-of-the-year or quarter-end periods, challenging the notion that it could stem from higher risk or systematic shifts in interest rates. Interestingly, this pattern is not unique to the U.S., occurring in 30 markets worldwide. While Ogden (1990) suggested it might be linked to the timing of income receipts, pushing equity prices up as investors seek to deploy their funds, this theory has been contested. McConnell and Xu’s work echoes the sentiment that the anomaly persists without a clear explanation. Some attribute it to monthly pension fund cash flows and the rebalancing of trading models, which could amplify the effect. Nevertheless, employing this strategy requires caution as such calendar effects may diminish or shift unpredictably over time.
SOURCE PAPER
Equity Returns at the Turn of the Month [Click to Open PDF]
- Wei Xu, Purdue University; HSBC School of Business, Peking University
- John J. McConnell, Purdue University
<Abstract>
A turn-of-the-month effect in U.S. equity returns was initially identified by Lakonishok and Smidt (1988) using the DJIA for the period 1897-1986. According to the turn-of-the-month effect, equity returns over the interval beginning the last trading day of the month and ending three days later are significantly higher than over other days. Using CRSP daily returns, we find that the turn-of-the-month effect persists over the recent interval of 1987-2005: in essence, over this 19-year period (and over the 109-year period of 1897-2005) all of the excess market return occurred during the four-day turn-of-the-month interval. Thus, during the other 16 trading days of the month, on average, investors received no reward for bearing market risk. We further find that the turn-of-the-month effect is not confined to small or low-priced stocks; it is not confined to the December-January turn-of-the-month; it is not confined to calendar-quarter-ends; it is not confined to the U.S.; and it is not due to market risk as traditionally measured: the standard deviation of returns at the turn-of-the-month is no higher than during other days. This persistent peculiarity in equity returns poses a challenge to both “rational” and “behavioral” models of asset pricing.


BACKTEST PERFORMANCE
| Annualised Return | 7.2% |
| Volatility | 6.9% |
| Beta | 0.202 |
| Sharpe Ratio | 0.013 |
| Sortino Rato | 0.007 |
| Maximum Drawdown | 24.6% |
| Win Rate | 57% |
FULL PYTHON CODE
from AlgoLib import *
class MonthlyMarketTiming(XXX):
def Initialize(self):
self.SetStartDate(1998, 1, 1) # Set the start date
self.SetCash(100000) # Set the initial capital
self.spy = self.AddEquity("SPY", Resolution.Daily).Symbol # Add SPY ETF
self.readyToSell = False # Flag to trigger selling
self.tradeDaysCount = 0 # Count trade days since buying
# Schedule the buy action at the month's end
self.Schedule.On(self.DateRules.MonthEnd(self.spy), self.TimeRules.AfterMarketOpen(self.spy), self.EnterPosition)
# Schedule the sell action 3 trading days after the start of the month
self.Schedule.On(self.DateRules.MonthStart(self.spy), self.TimeRules.AfterMarketOpen(self.spy), self.InitiateSell)
def EnterPosition(self):
self.SetHoldings(self.spy, 1) # Invest all in SPY
def InitiateSell(self):
self.readyToSell = True # Set flag to start counting days to sell
def OnData(self, data):
if self.readyToSell:
self.tradeDaysCount += 1 # Increment the day count
if self.tradeDaysCount == 3: # On the third day, sell
self.Liquidate(self.spy) # Sell all SPY shares
self.readyToSell = False # Reset the flag
self.tradeDaysCount = 0 # Reset the day count