Wednesday, November 16, 2016

Pre-earnings Annoucement Strategies

Much has been written about the Post-Earnings Announcement Drift (PEAD) strategy (see, for example, my book), but less was written about pre-earnings announcement strategies. That changed recently with the publication of two papers. Just as with PEAD, these pre-announcement strategies do not make use of any actual earnings numbers or even estimates. They are based entirely on announcement dates (expected or actual) and perhaps recent price movement.

The first one, by So and Wang 2014, suggests various simple mean reversion strategies for US stocks that enter into positions at the market close just before an expected announcement. Here is my paraphrase of one such strategies:

1) Suppose t is the expected earnings announcement date for a stock in the Russell 3000 index.
2) Compute the pre-announcement return from day t-4 to t-2 (counting trading days only).
3) Subtract a market index return over the same lookback period from the pre-announcement return, and call this market-adjusted return PAR.
4) Pick the 18 stocks with the best PAR and short them (with equal dollars) at the market close of t-1, liquidate at market close of t+1.  Pick the 18 stocks with the worst PAR, and do the opposite. Hedge any net exposure with a market-index ETF or future.

I backtested this strategy using Wall Street Horizon (WSH)'s expected earnings dates data, applying it to stocks in the Russell 3000 index, and hedging with IWV. I got a CAGR of 9.1% and a Sharpe ratio of  1 from 2011/08/03-2016/09/30. The equity curve is displayed below.



Note that WSH's data was used instead of  Yahoo! Finance, Compustat, or even Thomson Reuters' I/B/E/S earnings data, because only WSH's data is "point-in-time". WSH captured the expected earnings announcement date on the day before the announcement, just as we would have if we were live trading. We did not use the actual announcement date as captured in most other data sources because we could not be sure if a company changed their expected announcement date on that same date. The actual announcement date can only be known with certainty after-the-fact, and therefore isn't point-in-time. If we were to run the same backtest using Yahoo! Finance's historical earnings data, the CAGR would have dropped to 6.8%, and the Sharpe ratio dropped to 0.8.

The notion that companies do change their expected announcement dates takes us to the second strategy, created by Ekaterina Kramarenko of Deltix's Quantitative Research Team. In her paper "An Automated Trading Strategy Using Earnings Date Movements from Wall Street Horizon", she describes the following strategy that explicitly makes use of such changes as a trading signal:

1) At the market close prior to the earnings announcement  expected between the current close and the next day's open, compute deltaD which is the last change of the expected announcement date for the upcoming announcement, measured in calendar days. deltaD > 0 if the company moved the announcement date later, and deltaD < 0 if the company moved the announcement date earlier.
2) Also, at the same market close, compute deltaU which is the number of calendar days since the last change of the expected announcement date.
3) If deltaD < 0 and deltaU < 45, buy the stock at the market close and liquidate on next day's market open. If deltaD > 0 and deltaU >= 45, do the opposite.

The intuition behind this strategy is that if a company moves an expected announcement date earlier, especially if that happens close to the expected date, that is an indication of good news, and vice versa. Kramarenko found a CAGR of 14.95% and a Sharpe ratio of 2.08 by applying this strategy to SPX stocks from 2006/1/3 - 2015/9/2.

In order to reproduce this result, one needs to make sure that the capital allocation is based on the following formula: suppose the total buying power is M, and the number of trading signals at the market close is n, then the trading size per stock is M/5 if n <= 5, and is M/n if n > 5.

I backtested this strategy from 2011/8/3-2016/9/30 on a fixed SPX universe on 2011/7/5, and obtained CAGR=17.6% and Sharpe ratio of 0.6.

Backtesting this on Russell 3000 index universe of stocks yielded better results, with CAGR=17% and Sharpe ratio=1.9.  Here, I adjust the trading size per stock to M/30 if n <=30, and to M/n if n > 30, given that the total number of stocks in Russell 3000 is about 6 times larger than that of SPX. The equity curve is displayed below:


Interestingly, a market neutral version of this strategy (using IWV to hedge any net exposure) does not improve the Sharpe ratio, but does significantly depressed the CAGR.

===

Acknowledgement: I thank Michael Raines at Wall Street Horizon for providing the historical point-in-time expected earning dates data for this research. Further, I thank Stuart Farr and  Ekaterina Kramarenko at Deltix for providing me with a copy of their paper and explaining to me the nuances of their strategy. 

===

My Upcoming Workshop

January 14 and 21: Algorithmic Options Strategies

This  online course is different from most other options workshops offered elsewhere. It will cover backtesting intraday option strategies and portfolio option strategies.

Wednesday, September 28, 2016

Really, Beware of Low Frequency Data

I wrote in a previous article about why we should backtest even end-of-day (daily) strategies with intraday quote data. Otherwise, the performance of such strategies can be inflated. Here is another brilliant example that I came across recently.

Consider the oil futures ETF USO and its evil twin, the inverse oil futures ETF DNO*. In theory, if USO has a daily return of x%, DNO will have a daily return of -x%. In practice, if we plot the daily returns of DNO against that of USO from 2010/9/27-2016/9/9, using the usual consolidated end-of-day data that you can find on Yahoo! Finance or any other vendor,





















we see that though the slope is indeed -1 (to within a standard error of 0.004), there are many days with significant deviation from the straight line. The trader in us will immediately think "arbitrage opportunities!"

Indeed, if we backtest a simple mean reversion strategy on this pair - just buy equal dollar amount of USO and DNO when the sum of their daily returns is less than 40 bps at the market close, hold one day, and vice versa - we will find a strategy with a decent Sharpe ratio of 1 even after deducting 5 bps per side as transaction costs. Here is the equity curve:





















Looks reasonable, doesn't it? However, if we backtest this strategy again with BBO data at the market close, taking care to subtract half the bid-ask spread as transaction cost, we find this equity curve:














We can see that the problem is not only that we lose money on practically every trade, but that there was seldom any trade triggered. When the daily EOD data suggests a trade should be triggered, the 1-min bar BBO data tells us that in fact there was no deviation from the mean.

(By the way, the returns above were calculated before we even deduct the borrow costs of occasionally shorting these ETFs. The "rebate rate" for USO is about 1% per annum on Interactive Brokers, but a steep 5.6% for DNO.)

In case you think this problem is peculiar to USO vs DNO, you can try TBT vs UBT as well.

Incidentally, we have just verified a golden rule of financial markets: apparent deviation from efficient market is allowed when no one can profitably trade on the arbitrage opportunity.

===
*Note: according to www.etf.com, "The issuer [of DNO] has temporarily suspended creations for this fund as of Mar 22, 2016 pending the filing of new paperwork with the SEC. This action could create unusual or excessive premiums— an increase of the market price of the fund relative to its fair value. Redemptions are not affected. Trade with care; check iNAV vs. price." For an explanation of "creation" of ETF units, see my article "Things You Don't Want to Know about ETFs and ETNs".

===

Industry Update
  • Quantiacs.com just recently registered as a CTA and operates a marketplace for trading algorithms that anyone can contribute. They also published an educational blog post for Python and Matlab backtesters: https://quantiacs.com/Blog/Intro-to-Algorithmic-Trading-with-Heikin-Ashi.aspx
  • I will be moderating a panel discussion on "How can funds leverage non-traditional data sources to drive investment returns?" at Quant World Canada in Toronto, November 10, 2016. 

===

Upcoming Workshops
Momentum strategies are for those who want to benefit from tail events. I will discuss the fundamental reasons for the existence of momentum in various markets, as well as specific momentum strategies that hold positions from hours to days.

A senior director at a major bank wrote me: "…thank you again for the Momentum Strategies training course this week. It was very beneficial. I found your explanations of the concepts very clear and the examples well developed. I like the rigorous approach that you take to strategy evaluation.”

Friday, June 17, 2016

Things You Don't Want to Know about ETFs and ETNs

Everybody loves trading or investing in ETPs. ETP is the acronym for exchange-traded products, which include both exchange-traded funds (ETF) and exchange-traded notes (ETN). They seem simple, transparent, easy to understand. But there are a few subtleties that you may not know about.

1) The most popular ETN is VXX, the volatility index ETF. Unlike ETF, ETN is actually an unsecured bond issued by the issuer. This means that the price of the ETN may not just depend on the underlying assets or index. It could potentially depend on the credit-worthiness of the issuer. Now VXX is issued by Barclays. You may think that Barclays is a big bank, Too Big To Fail, and you may be right. Nevertheless, nobody promises that its credit rating will never be downgraded. Trading the VX future, however, doesn't have that problem.

2) The ETP issuer, together with the "Authorized Participants"  (the market makers who can ask the issuer to issue more ETP shares or to redeem such shares for the underlying assets or cash), are supposed to keep the total market value of the ETP shares closely tracking the NAV of the underlying assets. However, there was one notable instance when the issuer deliberately not do so, resulting in big losses for some investors.

That was when the issuer of TVIX, the leveraged ETN that tracks 2x the daily returns of VXX, stopped all creation of new TVIX shares temporarily on February 22, 2012 (see sixfigureinvesting.com/2015/10/how-does-tvix-work/). That issuer is Credit Suisse, who might have found that the transaction costs of rebalancing this highly volatile ETN were becoming too high. Because of this stoppage, TVIX turned into a closed-end fund (temporarily), and its NAV diverged significantly from its market value. TVIX was trading at a premium of 90% relative to the underlying index. In other words, investors who bought TVIX in the stock market by the end of March were paying 90% more than they would have if they were able to buy the VIX index instead. Right after that, Credit Suisse announced they would resume the creation of TVIX shares. The TVIX market price immediately plummeted to its NAV per share, causing huge losses for those investors who bought just before the resumption.

3) You may be familiar with the fact that a β-levered ETF is supposed to track only β times the daily returns of the underlying index, not its long-term return. But you may be less familiar with the fact that it is also not supposed to track β times the intraday return of that index (although at most times it actually does, thanks to the many arbitrageurs.)

Case in point: during the May 2010 Flash Crash, many inverse levered ETFs experienced a decrease in price as the market was crashing downwards. As inverse ETFs, many investors thought they are supposed to rise in price and act as hedge against market declines. For example, this comment letter to the SEC pointed out that DOG, the inverse ETF that tracks -1x Dow 30 index, went down more than 60% from its value at the beginning (2:40 pm ET) of the Flash Crash. This is because various market makers including the Authorized Participants for DOG weren't making markets at that time. But an equally important point to note is that at the end of the trading day, DOG did return 3.2%, almost exactly -1x the return of DIA (the ETF that tracks the Dow 30). So it functioned as advertised. Lesson learned: We aren't supposed to use inverse ETFs for intraday nor long term hedging!

4) The NAV (not NAV per share) of an ETF does not have to change in the same % as the underlying asset's unit market value. For example, that same comment letter I quoted above wrote that GLD, the gold ETF, declined in price by 24% from March 1 to December 31, 2013, tracking the same 24% drop in spot gold price. However, its NAV dropped 52%. Why? The Authorized Participants redeemed many GLD shares, causing the shares outstanding of GLD to decrease from 416 million to 266 million.  Is that a problem? Not at all. An investor in that ETF only cares that she experienced the same return as spot gold, and not how much assets the ETF held. The author of that comment letter strangely wrote that "Investors wishing to participate in the gold market would not buy the GLD if they knew that a price decline in gold could result in twice as much underlying asset decline for the GLD." That, I believe, is nonsense.

For further reading on ETP, see www.ici.org/pdf/per20-05.pdf and www.ici.org/pdf/ppr_15_aps_etfs.pdf.

===

Industry Update

Alex Boykov co-developed the WFAToolbox – Walk-Forward Analysis Toolbox for MATLAB, which automates the process of using a moving window to optimize parameters and entering trades only in the out-of-sample period. He also compiled a standalone application from MATLAB that allows any user (having MATLAB or not) to upload quotes in csv format from Google Finance for further import to other programs and for working in Excel. You can download it here: wfatoolbox.com/epchan.

Upcoming Workshop

July 16 and 23, Saturdays: Artificial Intelligence Techniques for Traders

AI/machine learning techniques are most useful when someone gives us newfangled technical or fundamental indicators, and we haven't yet developed the intuition of how to use them. AI techniques can suggest ways to incorporate them into your trading strategy, and quicken your understanding of these indicators. Of course, sometimes these techniques can also suggest unexpected strategies in familiar markets.

My course covers the basic AI techniques useful to a trader, with emphasis on the many ways to avoid overfitting.

Thursday, April 07, 2016

Mean reversion, momentum, and volatility term structure

Everybody know that volatility depends on the measurement frequency: the standard deviation of 5-minute returns is different from that of daily returns. To be precise, if z is the log price, then volatility, sampled at intervals of τ, is 

volatility(τ)=√(Var(z(t)-z(t-τ)))

where Var means taking the variance over many sample times. If the prices really follow a geometric random walk, then Var(τ)≡Var((z(t)-z(t-τ)) ∝ τ, and the volatility simply scales with the square root of the sampling interval. This is why if we measure daily returns, we need to multiply the daily volatility by √252 to obtain the annualized volatility.

Traders also know that prices do not really follow a geometric random walk. If prices are mean reverting, we will find that they do not wander away from their initial value as fast as a random walk. If prices are trending, they wander away faster. In general, we can write

Var(τ)  ∝ τ^(2H)

where H is called the "Hurst exponent", and it is equal to 0.5 for a true geometric random walk, but will be less than 0.5 for mean reverting prices, and greater than 0.5 for trending prices.

If we annualize the volatility of a mean-reverting price series, it will end up having a lower annualized volatility than that of a geometric random walk, even if both have exactly the same volatility measured at, say, 5-min bars. The opposite is true for a trending price series.  For example, if we try this on AUDCAD, an obviously mean-reverting time series, we will get H=0.43.

All of the above are well-known to many traders, and are in fact discussed in my book. But what is more interesting is that the Hurst exponent itself can change at some time scale, and this change sometimes signals a shift from a mean reversion to a momentum regime, or vice versa. To see this, let's plot volatility (or more conveniently, variance) as a function of τ. This is often called the term structure of (realized) volatility. 

Start with the familiar SPY. we can compute the intraday returns using midprices from 1 minutes to 2^10 minutes (~17 hrs), and plot the log(Var(τ)) against log(τ). The fit, shown below,  is excellent. (Click figure to enlarge). The slope, divided by 2, is the Hurst exponent, which turns out to be 0.494±0.003, which is very slightly mean-reverting.




But if we do the same for daily returns of SPY, for intervals of 1 day up to 2^8 (=256) days, we find that H is now 0.469±0.007, which is significantly mean reverting. 




Conclusion: mean reversion strategies on SPY should work better interday than intraday.

We can do the same analysis for USO (the WTI crude oil futures ETF). The intraday H is 0.515±0.001, indicating significant trending behavior. The daily H is 0.56±0.02, even more significantly trending. So momentum strategies should work for crude oil futures at any reasonable time scales.


Let's turn now to GLD, the gold ETF. Intraday H=0.505±0.002, which is slightly trending. But daily H=0.469±0.007: significantly mean reverting! Momentum strategies on gold may work intraday, but mean reversion strategies certainly work better over multiple days. Where does the transition occur? We can examine the term structure closely:




We can see that at around 16-32 days, the volatilities depart from straight line extrapolated from intraday frequencies. That's where we should switch from momentum to mean reversion strategies.

One side note of interest: when we compute the variance of returns over periods that straddle two trading days and plot them as function of log(τ), should τ include the hours when the market was closed? It turns out that the answer is yes, but not completely.  In order to produce the chart above where the daily variances initially fall on the same straight line as the intraday variances, we have to count 1 trading day as equivalent to 10 trading hours. Not 6.5 (for the US equities/ETF markets), and not 24. The precise number of equivalent trading hours, of course, varies across different instruments.

===


Industry Update
Upcoming Workshops

There are a lot more to mean reversion strategies than just pairs trading. Find out how to thrive in the current low volatility environment favorable to this type of strategies.