Saturday, October 3, 2015

Momentum signals in the term structure of commodity futures - Boons, Prado 2015

Basis-momentum (the difference between the momentum of nearby and next nearby contracts) strongly predicts spot returns. It also predicts the spread return. These returns are beyond the classical momentum and carry returns for commodity futures. This does not depend on the presence of institutional investors in commodity markets.


Literature states that cross-sectional variation in commodity futures returns in largely driven by the characteristics basis (carry) and momentum. Portfolio sorted on basis-momentum predicts both outright and spread with an IR of around 1. This is 12-1 kind of momentum on the cross-section. Basis momentum effectively captures the interaction effect between basis and momentum. The motivation for looking at basis-momentum is that there should be additional information in the decision of producers, consumers, and speculators as to where in the futures curve they take their positions, due to seasonality in production and demand.


Continuous contracts are rolled on the last day of the month before expiry. The basis is defined as $B(t)=\frac{F_{T_1}(t)}{F_{T_2}(t)}-1$. The momentum is defined as $M(t)=\prod_{s=t-11}^{t-1}(1+r_{T_1}(s))-1$. Finally, the basis momentum is $BM(t)=\prod_{s=t-11}^{t-1}(1+r_{T_1}(s))-\prod_{s=t-11}^{t-1}(1+r_{T_2}(s))$ and spread return momentum is $SM(t)=\prod_{s=t-11}^{t-1}(1+r_{T_1-T_2}(s))-1$. Spread returns are defined as $r_{T_1-T_2}(t)=\frac{(F_{T_1}(t)-F_{T_2}(t))-(F_{T_1}(t-1)-F_{T_2}(t-1))}{F_{T_1}(t-1)}$

We see that $$r_{T_1-T_2}(t) = r_{T_1}(t)-r_{T_2}(t)  + r_{T_2}(t)\frac{B(t-1)}{1+B(t-1)}.$$ which translates to $$ SM(t) = BM(t) + \sum\left(r_{T_2}(t)\frac{B(t-1)}{1+B(t-1)}\right).$$ The second term is the interaction effect, which consists of next nearby momentum and carry momentum.

A large literature shows that sorting commodities on the basis (carry) leads to large spot returns. Szymanowska (2014) show that basis also predicts spreading returns. Similarly, a large literature shows that sorting commodities on momentum leads to large spot returns as well. Szymanowska (2014) show that momentum do not predict spreading returns. This paper shows that sorting commodities based on basis momentum outperforms the previous two. Persistence in the tilting of the term structure is what basis-momentum tries to capture.

Tests and results

  1. Does Basis-momentum predict returns in the cross-section?: We regress the spot and spread returns over the three factors Basis, momentum and basis-momentum in two regressions. - We see that all three signals have predictability but it is basis-momentum which beats them all. Basis momentum is the only factor predicting cross-sectional spreading returns.
  2. Is Basis-momentum a priced risk factor?: We do time series regressions to determine whether the basis-momentum factors are spanned by basis and momentum factors. Then we conduct Fama-MacBeth cross-sectional regressions for commodity factor pricing models containing basis, momentum and basis-momentum. - basis momentum provides the best Sharpe of 0.93 for spot and 0.99 for spreading returns.

Currency Momentum Strategies

Menkhoff, Sarno, Schmeling, Schrimpf 2011


Significant cross-sectional spread gives excess returns of 10% pa, not explained by traditional risk factors but explained by under and over reactions of investors. Different from carry trade.


Momentum in stocks poses challenge to standard finance theory. Apart from conventional risk-factors, factors like credit risk/bankruptcy risk, limits to arbitrage, under reaction, or high transaction costs have been proposed. 

FX time series momentum strategies like moving average cross-overs, filter rules, channel breakouts deteriorate over time. FX cross-sectional strategies are less examined. We study 1976 - 2010 with 48 currencies. We decompose these momentum returns into systematic and unsystematic risk components, compare momentum strategies to carry and trading rules, qualify the importance of transaction cost and investigating non-standard sources of momentum returns like under- and over- reaction and limits to arbitrage.

We find evidence of return continuation and subsequent reversal over 36 months. These are different from carry returns and technical trading rules. Momentum profits are skewed towards currencies with high transaction costs. But these returns are not systematically related to standard proxies for business cycle risk, liquidity risk, carry trade risk factor, volatility risk, three Fama-French factors, Carhart four factor. These profits vary significantly over time suggesting limit to arbitrage. Momentum in countries with higher risk rating tend to yield significantly positive excess returns. Similar effect is found for a measure of exchange rate stability risk.

Related Literature

Stock market momentum - We established empirically, explained by

  1. risk-based and characteristic-based explanations: not linked to macroeconomic risk, but firm-specific risks, e.g. stronger in smaller firms, firms with lower credit rating, firms with higher revenue growth volatility, firms with higher likelihood to go bankrupt.
  2. behavioral biases: investor's under reaction to news, weak analyst coverage causes stronger momentum.
  3. Transaction costs or limit to arbitrage: reasonably high transaction costs may wipe out momentum profits.
Bonds and commodities momentum - Momentum strategies don't work for investment grade bonds or bonds at the country level, but yield positive returns for non-investment grade corporate bonds. Momentum returns are not related to liquidity but seem to reflect default risk in the winner and loser portfolios. Commodities high momentum returns are related to low levels of inventories.

Currency momentum - Mostly time series momentum has been analyzed. 
  1. Technical trading in FX  markets: highly correlated to trend following. Filter rules (like go long if moving returns are >1%) and moving average cross-over rules seem to work. This has slowed down recently.
  2. Contribution of this paper: cross-sectional momentum of FX and its analysis.

Data and currency portfolio

spot and 1 month forward rate from 1976-2010, end of month data. 48 countries. Interest rate differential (forward discount) contribute a significant share of the excess return of currency investments. We track pure spot returns as well to identify source of momentum. The long short portfolio is dollar neutral.

Characterizing Currency Momentum Returns

  1. Returns to Momentum strategies in currency markets - Returns driven by spot rates momentum and not mostly driven by interest rate changes (like for carry trades), especially for 1 year momentum with 1 month holding period. (1,1) is the best of the all. Though the cross-section of currencies is small relative to equities, the performance is still good because of much lower correlations in the currencies vs equities. 
  2. Out of sample perspective - do specific momentum strategies identified to be attractive in-sample continue to do well? Out of the universe of 144 strategies, we look for momentum in the lagged momentum returns! We find that 1 month lagged best portfolio is equally good (0.94) and hence can be seen as an out of sample test. These strategies have been stable over time.
  3. Comparing momentum and technical trading rules -  moving average cross overs of 1-20, 1-50 and 1-200 is used as a proxy for technical trading strategies (IR from 0.88 to 0.77). These are correlated to momentum but there is significant economic alpha. Similarly the cross-sectional momentum strategy has alpha over time series momentum strategies as well. 
  4. Comparing Currency momentum and the carry trade - Interest rate differentials are strongly auto-correlated and spot rate changes do not seem to adjust to compensate for this interest rate differential (forward rate puzzle). Hence, it may be the case that lagged high returns simply proxy for lagged high interest rate differentials and that cross-sectional momentum is simply carry. We show that that is not the case. Carry trade has negative skewness while momentum has slightly positive skewness. The high-low momentum strategies are uncorrelated with high-low carry strategies. Double sorting ( divide currencies into two portfolios based on median lagged forward discount and then divided each into three portfolios based on lagged returns) shows no material difference in long-short momentum returns among high vs low interest rate currencies. Cross-sectional Fama-Macbeth regression of currency excess returns on lagged excess returns over the last $l$-months, lagged forward discounts and lagged spot rate changes for each month show that lagged spot returns explain the regressions.
  5. Post-formation momentum returns - Initial under-reaction is accompanied by over-reaction which gets corrected over the long run. This causes reversal over longer periods. There is a clear pattern of increasing returns which peaks after 8-12 months across strategies and a subsequent period of declining excess returns, more pronounced for momentum strategies with longer formation periods, suggesting equity and currency momentum have similar origins.
Currency momentum seem similar to equity momentum. But the highly liquid FX markets are dominated by professional traders, where irrationality should be quickly arbitraged away. Hence examining possible limits to arbitrage activity which could explain the persistence of momentum profits in FX markets. 

Understanding the results

  1. Transaction cost - full bid-ask spread used. The 1,1 momentum returns from 10 to 4 percent. FX momentum strategies are much more profitable in the later part of the sample, but they do not always deliver high returns. There is much variation in profitability. Transaction costs can be decomposed into turnover across portfolios and bid-ask spreads across portfolio. Turnover can be extremely high for 1,1 momentum strategy, up to 70% per month. Winner and loser currencies do have higher transaction costs than the average exchange rate and the markup ranges from about 2.5 to 7 basis points per month. Transaction costs have declined over time due to more efficient trading technologies. This could imply (i) higher momentum returns due to lower trading costs (ii) lower momentum returns since lower cost facilitates more capital being deployed for arbitrage activity. Looking at 1,1 strategy for 1992 to 2010, we find profitability. Thus, lower bid-ask spreads do not necessarily lead to lower excess returns, which further indicate that trading costs are not the sole driving force behind momentum returns. Also suggesting that momentum returns are a phenomenon which is still exploitable.
  2. Momentum returns and Business cycle risk - Various univariate regressions on business cycle state variables - real growth in non-durables and service consuption expenditures, nonfarm employment growth, ISM manufacturing index, real industrial production, inflation rate, real money balances, growth in real disposable personal income, TED spread (3m libor - t-bill rate), term spread (20y - 3m tbill rate), carry trade long-short portfolio, global FX volatility - yield no explanation power. Regression on Fama-French three factors is also not explanatory. 
  3. Limit to Arbitrage: Time-variation in momentum profitability - 36 months moving window returns plot shows that there is time variation in performance. Hence, investor seeking to profit from momentum returns has to have a long enough investment horizon. Since the bulk of currency speculation is accounted for by professional market participants with rather short horizon. 
  4. Limit to Arbitrage: Idiosyncratic volatility - We investigate whether momentum returns are different between currencies with high or low idiosyncratic volatility (relative to an FX asset pricing model). When we double sort with respect to lagged idiosyncratic volatility and returns we find high idiosyncratic volatility explain higher returns.
  5. Limit to Arbitrage: Country risk - we sort on a measure of country risk and a measure of exchange rate stability risk. Data based on International Country Risk Guide (ICRG) database from the Political Risk Services group. We employ relative to US values. Momentum returns are significantly positive and always larger in high-risk countries than in low-risk countries. Hence country risk should be an important limit to arbitrage activity in FX markets. These risk ratings are not simple proxies for interest rate differentials, because the country risk and exchange rate risk are high both for winner and loser momentum currencies. Sorting based on forward discount show that country risk highest for carry trade target countries and lowest for carry trade funding currency. For top 15 developed countries, the momentum returns are non-existent after transaction cost. 

Robustness and additional tests

  1. Capital account restrictions and readability - 

Thursday, September 17, 2015

Diversified Statistical Abritrage: Dynamically combining mean reversion and momentum investment strategies - James Velissaris 2010


A dynamically adjusted strategy between mean-reversion and momentum (2008, 2009). Stocks are grouped together using PCA. The idiosyncratic returns is calculated by comparing the returns of the stock to the returns of the entire group. This residual return often oscillates around a long-term mean. This strategy is dollar neutral and have high turnover. The medium-term momentum strategy trade the 9 sector ETFs, based on technical trading rules. Dynamic allocation was done between the  11 strategies, with rebalancing at the end of each month. Out of sample IR of 2.27, with beta 35%

Equity mean reversion model

The decomposition of the stock returns is given by $$r_t = \alpha + \sum_{j=1}^n \beta_j F_t + \epsilon_t.$$ PCA of the normalized returns (after data centering and normalization in 252 day moving window) is used and the first 12 factors are retained. The Eigenportfolio returns $F_{jt}$ are given by $\sum_i \frac{v^{(j)}_i}{\sigma_i}R_{it}$. We, further, neglect the drift in returns. The model we implement is $dX_t=k(m-X_t)dt+\sigma dW_t$. The mean reversion time is $\tau = 1/k$. Use stock with mean reversion within 20 days, and for the s-score $s=\frac{X_t-m}{\sigma_{eq}}$ at +1.25 go short and get out at +0.75 (similarly for long). Trading cost of 10 bps. The model is two-times levered per side or four-times levered gross (industry standard).

Momentum strategy

S&P500 industry sector ETFs, S&P500 ETF and SPY. 60 and 5 day exponentially moving average is used. Signal long if 5d EMA is above 60d EMA for the previous 4 or more trading days. In all other scenarios the signal is short. There is no rebalancing the trade and 10 bps cost assumed.

In-sample analysis

2005-2007 in sample show mean-reversion strategy being much better than momentum with an IR of 1.28. The equally weighted strategy has an IR of 0.49.

Optimization and out-of-sample results

There are returns to be made by dynamically optimizing the weights of different strategies. We can use Quadratic programming with the objective function and constraints as $$\min_x \frac{1}{2}x^THx+f^Tx \quad Ax \le b, \quad A_{eq}x=b_{eq}, \quad lb \le x \le ub.$$
An important input into the process is lower and upper bounds for each variable. Using expected returns and allocation targets, we can customize the optimization process to best suit our portfolio specifications. The goal of this optimization is to maximize the Sharpe ratio of the diversified portfolio with a penalty for marginal risk contribution. The portfolio was optimized at the end of each month using the returns from the previous 252 trading days. There was no transaction cost used, except flat 10 bps per trade. The diversified strategy IR is 2.27 vs static allocation IR of 1.56, out-of-sample. The mean reversion strategy has a beta exposure. Optimization can be used to control beta, volatility and leverage as well to control drawdowns.


  • Potential benefit of including both mean-reversion and momentum in portfolio.
  • Did not hedge the beta risk using SPY, but can be done.
  • Momentum signal using PCA eigen-portfolios is not apparent at individual stock level.
  • Potentially greater alpha at finer time scales.
  • Varying time-scales with signal decay for both momentum and mean reversion can be useful.

Wednesday, September 16, 2015

Scaling by correlation matrix

We analyze the effect of scaling a signal by the inverse of correlation matrix here. We start by assuming that the two assets $A_1$ and $A_2$ have unit variance. This reduces the co-variance matrix to correlation matrix. We assume a simple correlation matrix of the form $$\begin{bmatrix} 1 & c \\ c & 1 \end{bmatrix}.$$ Now let's say we have generated a signal of $\mu_1$ and $\mu_2$ for the two assets before scaling. This means that the unscaled portfolio can be written as $$\mu_1 A_1 + \mu_2 A_2.$$ Now the inverse of the correlation matrix is $$\frac{1}{1-c^2}\begin{bmatrix} 1 & -c \\ -c & 1\end{bmatrix}.$$ This makes the scaled signal ($\Sigma^{-1}\mu$) $$\frac{\mu_1-c\mu_2}{1-c^2}A_1+\frac{\mu_2-c\mu_1}{1-c^2}A_2.$$ We can see that based on the 'original signal' ($\mu_1$ and $\mu_2$) and the correlation value ($c$) the 'scaled signal' is altered. Another way to look at the 'scaled signal' is to write the portfolio as $$\mu_1\left[\frac{1}{1-c^2}A_1-\frac{c}{1-c^2}A_2\right] + \mu_2\left[\frac{1}{1-c^2}A_1-\frac{c}{1-c^2}A_2\right].$$ This is another way of saying that we trade the same original signal but replace the assets $A_1$ and $A_2$ with the spreads $\left[\frac{1}{1-c^2}A_1-\frac{c}{1-c^2}A_2\right]$ and $\left[\frac{1}{1-c^2}A_2-\frac{c}{1-c^2}A_1\right]$. In the table below we look at this 'spread' for different values of correlation coefficient $c$.  We also see the 'altered' signal value for the assets $A_1$ and $A_2$.
c & \text{$\mu_1$} & \text{$\mu_2$} &A_1 & A_2  \\
+0.9 & 5.3A_1-4.7A_2 & 5.3A_2-4.7A_1 & 5.3\mu_1-4.7\mu_2 & 5.3\mu_2-4.7\mu_1  \\
+0.5 & 1.3A_1-0.7A_2 & 1.3A_2-0.7A_1 & 1.3\mu_1-0.7\mu_2 & 1.3\mu_2-0.7\mu_1 \\
+0.1 & 1.0A_1-0.1A_2 & 1.0A_2-0.1A_1 & 1.0\mu_1-0.1\mu_2& 1.0\mu-0.1\mu \\
0.0 & A_1 & A_2 & \mu_1 & \mu_2\\
-0.1 & 1.0A_1+0.1A_2 & 1.0A_2+0.1A_1 & 1.0\mu_1+0.1\mu_2 & 1.0\mu_2+0.1\mu_1  \\
-0.5 & 1.3A_1+0.7A_2 & 1.3A_2+0.7A_1  & 1.3\mu_1+0.7\mu_2 & 1.3\mu_2+0.7\mu_1   \\
-0.9 & 5.3A_1+4.7A_2 & 5.3A_2+4.7A_1  & 5.3\mu_1+4.7\mu_2 & 5.3\mu_2+4.7\mu_1
For the case of high absolute correlations, till $\mu_1$ and $\mu_2$ are comparable the total portfolio values are within limits. But if $\mu_1$ and $\mu_2$ differ substantially huge positive and negative positions can be created, which may be undesirable. This is a likely scenario as signals are based on recent updated information while the correlations rely on slow window.

What if we add a third asset $A_3$ with signal $\mu_3$ which is uncorrelated to the first two assets? We have the correlation matrix as $$\begin{bmatrix} 1 & c & 0 \\ c & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix},$$ the inverse of this matrix is $$\frac{1}{1-c^2}\begin{bmatrix}1 & -c & 0\\ -c & 1 & 0 \\ 0 & 0 & 1-c^2\end{bmatrix}.$$ This results in the following 'altered' portfolio $$\frac{\mu_1-c\mu_2}{1-c^2}A_1+\frac{\mu_2-c\mu_1}{1-c^2}A_2+\mu_3A_3.$$ This shows that the signal of the uncorrelated asset is not changed.

Pairs trading the commodity futures curve - Antti Nikkanen

Notes on Antti Nikkanen Master's thesis Aug 2012

Ch1. Introduction

Commodity futures trading strategy, which exploits the roll returns of commodity futures as its main driver of excess return. To minimize the volatility of returns, pairs trading methodology is used to trade the futures curve, with a Sharpe of 3. Liquidity is taken into account with trading cost of 3.3 bps. Commodity is still unknown because of lack of good data, it being a derivative security, short maturity claim on a real asset and have pronounced seasonality in prices levels and volatility.

Ch2. Literature Review

Hong and Yogo (2012) show that aggregate basis (ratio of futures price to commodity price) is the most important predictor of commodity returns. The main factor behind the fluctuation of the aggregate basis is hedging pressure (how much producers short commodity futures to hedge their long positions in the underlying spot).

Erb and Harvey (2006) show that roll returns explain more than 90% of long-run cross-sectional variation of commodity futures returns over 1982-2004. The time-series variation of future returns is mostly explained by spot price movement. To become spot neutral the author creates spreads.

Fuertes and Miffre (2010) show tactical position of shorting contangoed and long backwarded futures. They also include momentum.

Gorton and Rouwenhorst (2005) state that the commodity futures returns are negatively correlated with those of equity and bond returns. But this low correlation exists only in 'normal' markets. The spread strategy reduces correlation even in 'abnormal' markets.

Ch3. Theory

Commodity markets do not fit the CAPM (Bodie and Rosansky 1980) because it is difficult to make a distinction between systematic risk/return and unsystematic risk/return. Also, the price is dependent on demand and supply factors, not perceived adequate risk premiums.

Stocks (like Finnish mining company Talvivaara) follow closely the price of underlying commodity (nickel). But many companies, especially the oil companies have hedged away its oil exposure e.g. ExxonMobile. With commodity ETFs there may be large tracking error e.g. USO is an oil ETF but lagged massively the movements in oil prices after the 2008 crash due to rolling the portfolio in times of negative roll returns. GLD on the other hand tracks the spot gold quite closely.

Less than 1% of futures contract result in a delivery of the underlying asset. Commodity futures do not represent direct exposures to actual commodities. They are bets on expected future spot prices (Gourton and Rouwenhorst 2005). The relationship between the futures and spot price is $F=Se^{(r+c-y)(T-t)}$, where $r$ is the risk free rate, $c$ is the storage cost (storage facilities, insurance, inspections, transportation and maintenance, spoilage and financing), $y$ is the convenience yield (ability to profit from local supply demand imbalances, leasing of gold to jewelry manufacturers).

Economics of backwardation and contango

Upward sloping (contango) and downward sloping (backwardation) are determined by demand, supply and seasonal changes. For a hedger who is inherently long (petroleum producer long on crude through exposure to oil exploration, developing refining and marketing), speculators are going to take the long risk if the price is sufficiently discounted vs spot price, i.e they are in backwardation. (Anson 2009). Contango occurs for commodities in which the hedger is inherently short to the exposure of commodity (e.g. aircraft manufacturers that does not have aluminum mines, willing to purchase the futures contract of a future aluminum delivery). Hence, profits for the speculator is determined by the amount the hedgers have interest for risk capital, not the long-term price trends of the commodity markets (Anson 2009).

Hicks' rational expectations hypothesis states that the price of an asset for delivery in future must be the market's current forecast of the spot price on the future delivery date (spot does not move in presence of any further information). This has proven not to be useful practically. Storage models have been better at explaining practicality, which states that relationship between the spot and future depends on storage levels and expected storage levels in the future (i.e. inventory). This mean there is an expectation of the spot price to move as well through maturity. A difficult to store commodity (NG) has steep forward curve. When inventories are high relative to demand, the curve will be upward-sloping and when tight downward-sloping (Till, Feldman 2006). These, difficult to store commodities (HO, HG, LC, LH) have the highest average excess returns versus easy to store commodities.

Commodity futures returns composition

Commodity returns is the sum of spot return, risk-free rate and roll return. Commodity markets are usually favorable for sudden spot price rises but show mean-reverting tendency over longer periods.


Generally trend following, in contrast to market timing strategies where statistical techniques are used to predict the trends before they become apparent. Managed futures strategies are either technical or fundamental in either systematic or discretionary manner. Most do technical systematically. Bridgewater, an exception, does fundamental systematically, e.g. in 2008 they spotted the possibility for either an inflationary or a deflationary deleveraging through contraction in private credit growth, declining stock market and a widening credit spread and adjusted their positions based on 1920s Germany, 1980s Latin American inflationary deleveraging and the deflationary deleveraging of Great depression in the 1930s and Japan in 1990s (Schwager 2012).

A hedge against inflation

In inflationary periods, usually long commodity future positions benefit and stock and bond returns are negatively impacted, because the purchasing power of the money declines and earning power of the corporation erodes.

Pairs Trading

Johansen test can check the cointegration of multiple time series at a time. It is a relative strategy and does not care about absolute value of the assets. With stocks, it is more common that just one of the assets is over or under priced (Gatev, Goetzmann, Rouwenhorst 2006). For futures curve, even the underpriced contracts when in contango, usually have a negative expected return.

The main reason to pairs trade the future curve is to hedge price movement risk and only capture the part of the commodity futures roll return. This strategy could be made dynamically adjusting to be more profitable.

For two time series to move together there needs to be something called the error correction, which causes correction of prices and hence mean reversion. Usually the order of integration is first determined with a unit root test before running an actual cointegration test (crucial to check with common sense and graphics). Augmented Dickey-Fuller test takes care of the autocorrelation in the difference variable series. Johansen test is based on the error-correction representation of the VAR equation and testing for reduced rank and then using Granger's representation theorem to get the cointegration vector.

Ch4. Empirical work

1991 to 2012. Daily frequency of 12 nearest contracts of 20 commodities. Transaction cost of 3.3 bps per leg per trade and contracts with open interest less than 20000 not traded.


  1. Determine the shape (contango vs backwardation) by taking the difference of the first five contracts, and taking an average of them. $$\frac{1}{5}\sum_{i=1}^5(f_i-f_{i+1}).$$
  2. If the result is positive (backwardation), go long the 'most' backwarded contract (maximum absolute slope), which is equivalently the most out of its path regarding its cointegration with the other data points in the curve. The position is taken onto the further contract.
  3. The short position is determined by taking the smallest value of differenced contracts and going short on the further contract.
  4. The pair is chosen only if both have open interest more than 20000.
  5. If contango, the process is same but reversed. Take position into the largest difference and a long position into the smallest absolute difference.
  6. At the start of each month the portfolio is set up for next 30 days, with equal weights.
All the commodity curves are found to be cointegrated. The information ratio is 3.1 for monthly rebalancing. All assets show positive returns. This can be bifurcated between roll returns (alpha genration) and hedged returns (to reduce volatility). Feeder cattle is invested only 3% of the time period while CL is invested 100%. daily traded strategy is similar with more trading cost, but good returns.


  1. The current strategy is suboptimal in terms of when to trade.
  2. Entry should be based on price deviations form the equilibrium level.
  3. Best 5 instead of all would produce better results.
  4. To choose the 'hedging pair' from the real difference of the futures price and not the absolute price difference. This would capture the, though rare, instances where the futures curve has elements of both backwardation and contango.

Four Essays in Stat Arb - Jozef Rudy

These are my notes on the phd thesis 'Four Essay in Statistical Arbitrage in Equity Markets' by Jozef Rudy. Hoping to implement some of these eventually.

Ch 1 - Introduction

This is just a summary chapter. The work is mostly about Pairs trading and its modifications, concentrating on daily trading but also applying high frequency data and other modification. There is also a chapter on mean reversion strategies - fitting under statistical arbitrage.

The standard market approach is daily sampling (Gatev 2006). In the standard form, the edge such strategies provide seems to be dissipating. Going to higher frequency can potentially achieve higher information (Aldridge 2009). Nonstandard half-daily sampling frequency and using ETFs can further help the performance.

Ch 2 - Literature Review

Nunzio Tartaglia is credited for developing pairs trading at Morgan Stanley in 1980s. Hugely successful but profits have come down recently. That is why one needs to go into higher frequencies Marshall et al. (2010). Similarly, Shulmeister (2007) finds that technical are profitable, but only on higher time frames. That motivates half-daily timeframe. 

Engle and Granger (1987) brought cointegration to limelight. Johansen (1988) developed the critical test. For a pair, the simpler method is to first calculate the beta using $P_{1t}=\beta P_{2t}+\epsilon_t$. Then check the residual using Augmented Dickey-Fuller unit root test (ADF) at 95% confidence using 
$$\Delta \epsilon_t = \phi+\gamma\epsilon_{t-1}+\sum_{i=1}^{p}\alpha_i\Delta \epsilon_{t-1}+u_t.$$
We include the most significant lags in an iterative sense and then check for the no cointegration using $\gamma=0$, against the hypothesis $\gamma<0$. 

For more than two assets one need to use Johansen method. Non-parametric distance method (Gatev 2006) and stochastic approach (Mudchanatongsuk 2008) has also been used.

Time adaptive models like Kalman filter have been shown to be superior to rolling window OLS based methods due to forward looking methodology of the former. Double exponential smoothing-based prediction based models can give comparable results to Kalman filter but run order of magnitude times faster.

'Market neutral' hedge funds are generally pairs trading kind of funds.

Ch 3 - Stats Arb. and HF data 

The main innovation is to apply statistical arbitrage technique of pairs trading to high-frequency equity data (Eurostoxx 50 stocks). This is done for 5-minute interval (IR~3) to daily frequency (IR~1). Pairs are chosen based on best in-sample IR and highest in-sample t-stats of the ADF test of the residuals of the cointegrating regression sampled at daily frequency. 5 best pairs are chosen. The simplest method is Engle and Granger (1987) cointegration approach. To make beta parameter adaptive the following techniques can be used - rolling OLS, DESP model and Kalman filter.

Cointegration model

Take pairs from same industry based on economic reasoning and apply OLS regression on them:
$$Y_t=\beta X_t + \epsilon_t$$
Then test the residuals of the OLS regression for stationarity using the Augmented Dickey-Fuller unit root test.

Rolling OLS

Similarly we can calculate the rolling beta using rolling OLS. This approach suffers from 'ghost effect', 'lagging effect' and 'drop-out-effect'. The window can be optimized for maximum in-sample IR. This was around 200 periods. This was used for out of sample.

Double Exponential smoothing prediction model

We first calculate $\beta_t=Y_t/X_t$. We then do double smoothing by:
$$S_t = \alpha \beta_t+(1-\alpha)S_{t-1}$$
$$T_t=\alpha S_t + (1-\alpha)T_{t-1}$$
Using these the prediction of beta at time period $t+1$ is 
$$\hat{\beta}_{t+1} = \Bigg[2S_t-T_t\Bigg] + k \Bigg[\frac{\alpha}{1-\alpha}(S_t-T_t)\Bigg].$$
$k$ is the number of look-back periods. the optimized values of $\alpha$ and $k$ are 0.8126 and 30.

Time-varying parameter model with Kalman filter

This is more optimal than OLS for adaptive parameter estimation. The measurement equation is
$$Y_t=\beta_t X_t+\epsilon_t$$
and the state equation is
The idea to add second equation is based on the intuition that there is some characteristic of beta, i.e. auto-correlation which can be added as information for better estimation. The noise ratio is to be optimized yielding $3e^{-7}$.

The pair trading model

Choosing the pairs within an industry makes us immune to industry wide shock. The spread between the pairs is calculated as $z_t=P_{Y_t}-\beta_{t}P_{X_t}$. We did not include a constant in any of the models. This spread is normalized by subtracting the mean and divided by the standard deviation. Entry is at 2 standard deviation and exit near 0.5 standard deviation. Once the entry is triggered we wait one period before we enter. We choose money neutral investment by putting equal money in the two  sides (irrespective of the $\beta$). There is no re-balancing. When normalized spread returns to its long term mean, it is caused by the combination of two things: real reversal of the spread and adaptation of beta to new equilibrium value - leading to not total reversal in dollar value even when the spread has totally reversed. 

In sample indicators are used with the objective to identify out of sample performance:
1) t-stat from ADF test on the residuals of the OLS regression.
2) the information ratio
3) half life of mean-reversion. 
The half-life is given by $-ln(2)/k$, where k is the median unbiased estimate of the strength of  mean-reversion OU equation
$$dz_t = k(\mu-z_t)dt+\sigma dW_t$$
where $z_t$ is the value of the spread, $\sigma$ is the standard devation. The higher the $k$, the faster the spread tends to revert to its long term mean. In sample IR is also used as a metric (IR 2 means strategy is profitable every month, IR 3 means strategy is profitable every day). IR is overestimated if the returns are auto-correlated.

Out of sample performance 

Assuming a trading cost of 30 bps one way. The best result comes out for 30 minute interval. Kalman is the best out of - fixed beta, rolling OLS, DESP and Kalman, with the smoothest beta (Table 3-3).

Further investigations

Relationship between the in-sample t-stats and the out-of-sample information ratio

The in-sample t-stats for the fit is positively correlated to out of sample information ratio for upto 10 minutes frequency. Beyond this the correlation is statistically indistinguishable from 0. 

Relationship between t-stats for different high-frequency and pairs

Trading pairs have similar t-stats across all frequencies is ascertained by the first PCA explaining almost all of the variance (after standardizing the t-stats of ADF test for all pairs). This has the following implication - once a pair has been found to be co-integrated at a certain frequency, it tends to be co-integrated across all frequencies. 

Does cointegration in daily data imply higher frequency cointegration 

The correlation between t-stats (of the ADF test) of daily data and 5-minute data has an interval of [-0.03,0.33] using bootstrapping. Hence, co-integration found at daily frequency implies there is co-integration at 5-min interval as well.

Does in-sample information ratio and the half-life of mean reversion indicate what the out-of-sample information ratio will be?

 Using bootstrapping the confidence bounds indicate that the in-sample information ratio can positively predict the out-of-sample information ratio to a certain extent. Also, There is negative relation between the half-life of mean reversion and subsequent out-of-sample information ratio.

A diversified pair trading strategy

Using the indicators presented above, best 5 pairs are selected. Best in-sample IR - gives attractive the out of sample performance. Half-life of mean reversion - does not work out. In-sample t-stats of the ADF test of the cointegrating regression as indicator only works for 5 to 10 minute strategies. A combination is worse than individual indicators. Finally, a daily IR of 1.34 and high frequency IR of 3.24 comes out to be better than simple long.

Ch 4 - Profitable Pair Trading: A comparison using the S&P 100 constituent stocks and the 100 Most liquid ETFs

The greatest known risk to pairs trading is a stock going bankrupt. ETFs can avoid that. But are they equally profitable? It turns out they are than stocks based on adaptive long-short strategy (IR of 1 vs 0), extending in-sample period (1.7 vs 0.2) and preselecting pairs based on in-sample IR (2.93 vs 0.46).The ratio can be made time adaptive via Kalman filter. Pairs trading strategy in its basic form might be becoming unprofitable.

Datastream is used to get data for 100 most liquid ETFs and S&P100 stocks. In-sample period of 3/4 and 5/6 is used. Based of if there is cointegration or not 428 ETF pairs and 693 stock pairs are evaluated.


Bollinger bands are used with 20 day moving window with 2 standard deviation windows for entry/exit triggers, in general. These parameters are optimized for max in-sample IR and differ from one pair to another.


The spread is calculated using adaptive beta using Kalman filter, based on prices. By optimizing the noise ratio $Q/H$, an increase in ratio makes the beta more adaptive and decrease more smooth. Constant level is not used to reduce parameter. We invest the same amount of dollars on each side of the trade. Once invested, we wait for the spread to revert back. The initial money neutral positions are not dynamically rebalanced.

Out of sample results 

With 75% in-sample the IR for ETF and stocks are 1.06 and 0.08 respectively. This increases to 1.71 and 0.22 for 83% in-sample respectively. ETFs used are index trackers, thus they contain lower idiosyncratic risk as shares. Index divergence is more probable to reverse than stock divergence, where the reason could be more fundamental. Much better results of ETFs could also be a result of a stronger autocorrelations of ETF pairs compared to shares. Lower volumes traded (only marginally) also makes ETF market less competitive

Results for the best 50 pairs

The correlation between in-sample and out-of-sample IR is 0.24 and 0.14 for ETFs and Stocks. This motivates using better performing in-sample pairs in out of sample. This increases the IR to 1.58 and 0.13 for 75% in-sample case for ETFs and Stocks respectively. And an IR of 2.93 and 0.46 for 83% in-sample case.


  1. ETFs are better than Stocks because of non-existence of idiosyncratic risk in ETFs.
  2. Decreasing out-of-sample period improves performance. Hence, re-estimating the model once per week will improve the results.
  3. In-sample IR predicts out of sample IR.

Ch 5 - Mean Reversion based on Autocorrelation: A comparison using the S&P 100 constituents and the 100 most liquid ETFs

Simple strategy based on normalized previous period's return and the actual conditional autocorrelation can give traders and edge. ETFs are more suitable than Stocks and half-daily frequency improves the performance.


  1. Form pairs with 30 days trailing conditional correlation above the threshold of 0.8
  2. Eliminate pairs with a previous day's normalized spread returns smaller than 1.
  3. Select pairs with first order autocorrelation within certain bounds.
Two different samplings - daily and half-daily are used, with 4 year in sample and out of sample period.

Contrarian profits, explained by overreaction hypothesis causing negative autocorrelation, have decreased in recent periods (Khandani and Lo 2007). Higher frequencies still have some juice (Dunis et al 2010). Market neutral strategies have been shown to be exposed to general market factors. S&P 100 stocks and 100 ETFs are used with investment exactly for one trading period.


JPMorgan (1996) method is used to calculate conditional (time-varying) volatility and conditional correlation (cutoff 0.8), over a period of 30 days. $$cov(r_A, r_B)_t=\lambda cov(r_A,r_B)_{t-1}+(1-\lambda)r_A r_B,$$ where $\lambda$ is the constant 0.94, corresponding to 30 days. The return of the spread is simply the difference of the returns of the constituents. The conditional autocorrelation of the pair is calculated as $$\rho_t=\frac{cov(r_t,r_{t-1})_t}{\sigma_t \sigma_{t-1}},$$  where $r_t$ is the returns of the spread pair. The conditional covariance of the pair is calculated as $$cov(r_t,r_{t-1})_t=\lambda cov(r_t,r_{t-1})_{t-1}+(1-\lambda)r_t r_{t-1}.$$ The normalized returns of the spread is simply $$R_t=\frac{r_t}{\sigma_t}.$$ We only trade pairs with normalized returns above 1. If the autocorrelation is negative we bet on the reversal otherwise be bet the pair will continue to move in the same direction as in current period, with each pair held only for one period. 5 best pairs with highest normalized returns are chosen.

Trading results

Trading cost of 20 bps per pair trade is assumed. Net of cost IR for in-sample and out-of-sample top 1, 5, 10 and 20 best pairs for different autocorrelation ranges is all negative for stocks. The results are positive both for in-sample and out-of-sample for ETFs (5, 10, 20 pairs) for the range -0.4 to 0 (but not -1 to -0.4).

For half-daily frequency results are better but still not good enough for shares. For ETFs the results are stupendous for the full negative autocorrelation range. Positive autocorrelation range is not that productive.

The out of sample results are consistent till 2009 after which it is flat. Adding more pairs makes the equity curve more consistent.

Ch 6 - Profitable Mean Reversion after large price drops: A story of Day and Night in the S&P500, 400 Mid Cap and 600 Small Cap Indices

Open-to-close (day) and close-to-open (night) have information. The worst performing shares during the day (resp. night) are bought and held during night (resp. day). The alpha is not explained by Fama and French 3-factors and Carhart 5-factors.

Literature review

Contrarian returns have been reducing (Khandani and Lo 2007). Most strategies use close to close information and don't make use of the opening prices into account. Existence of contrarian profits can be explained by overreaction hypothesis (Lo and MacKinlay 1990), with a negative autocorrelation assumption. De Bondt (1985) show that for 3 years rebalancing losers beat the past winners, with the outperformance continuing as late as 5 years after the portfolio have been formed. Predictability of short-term returns are exploited either by momentum or reversion. Serletis and Rosenberg (2009) show the Hurst exponent for the four major US stock market indices during 1971-2006 display mean-reverting behavior. Bali (2008) find that the speed of the mean reversion is higher during periods of large falls in prices.

De Gooijer et al. (2009) find non-linear relationship between overnight price and opening price. Cliff et. al. (2008) show that night returns are positive while day returns are 0. The effect is partly driven by the higher opening prices which decline during the first trading hour of the session.

Financial Data

Stocks consisting of - S&P 500, S&P 400 MidCap and S&P 600 SmallCap are used. Data from 2000-2010 adjusted prices. 5bps trading cost one way.  We calculate open-to-close day returns and close-to-open night returns. The average return of holding the shared during day and night is very similar for the constituent stocks of S&P 500 index and is slightly positive for both. For S&P 400 MidCap the daily returns are positive and overnight returns negative, similar to S&P 600 SmallCap. These differences are not profitable after trading cost.

Trading Strategy

Exploit the mean reverting behavior of the largest losers either during the day or night. Version 1 (day holding) buys n worst performing shares during the close-to-open period (decision period) with shares bought at the market open and sold at market close, equally weighted. Version 2 (night holding) buys n worst performing shares during the open-to-close period (decision period). The Benchmark strategy buys the n worst losers based on full day returns.

Strategy Performance

For S&P 600 small cap, the first two deciles (stocks with largest decline during the decision period) produce high IRs and the last two negative (a short strategy will work, which is not examined here). This holds true for both day and night strategies. There is a clear structure present going from top to bottom deciles. Overreaction is not as strong for mid cap stocks as it for small caps. But the pattern is similar and extreme deciles are profitable.

The benchmark strategy (close to close decision period with subsequent close to close as holding period) has been unprofitable for Small, Mid and S&P500 cross section more recently. Version 1 and version 2 have been more profitable.

Park (1995) claims that the profitability of mean reversion strategy disappears once the average bid-ask price is used instead of a closing price, i.e. the most significant part of the close-to-close contrarian strategy is caused by the bid-ask bounce and is not achievable in practice. The two versions shown here are better than the benchmark (close-to-close) and hence this strategy is immune to bid-ask bounce.

Multi-factor Models

Style factors:
  • CPAM model by Sharpe (1964) - market returns.
  • Fama and French 3-factor model (1992) - Mkt, small-big, value-growth.
  • Adj. Carhart's 5 factor model (1997) - Mkt, small-big, value-growth, Momentum: High returns - low returns (M2 to M12), reversion: low returns - high returns (M1).
$\alpha$ comes out positive for each case. Momentum factor turns out to be negative while the reversal factor comes out positive, as expected.

Ch 7 - General Conclusions

Two ways to improve trading results:
  1. Using more data - higher frequency, bigger universe. Even including opening prices can be hugely beneficial. Getting opening price and instantly process is a challenge.
  2. Using advanced modeling - Kalman can be fast and efficient vs OLS. Factor neutralizing the pairs ratio (not only industry neutral as done here) can further improve the results. Neural networks and SVM can be used to predict the future direction of spreads instead of using fixed std. level for the spread entry specification.
Delving more into model complexity, as opposed to data complexity, would be more beneficial.

Monday, September 7, 2015

Option trading: Pricing and Volatility strategies and techniques - Euan Sinclair

Traders are pragmatic, interested in results. But focusing on the process can take care of the results. Good traders learn this. But good traders are intellectually parsimonious due to the demand of trading. But more knowledge brings more adaptability in uncertain times.

Derivatives traders don't need technical or fundamental analysis but sound knowledge of market structure and arbitrage relationships. Causality need to be investigated in every model.

Ch1. History

Options are not modern invention. They have a longer history than either stocks or bonds. Options are legal contracts, and hence subject to changes in the legal system (e.g. Dutch Tulips crash case in 1636). The South Sea bubble crash of 1720 involved a form of call options. The first exchange to list standardized contracts was the CBOE in 1973. Black-Scholes-Merton model published the same year. Options may well have been a tool in the speculative bubble, but were not the root cause. They are inevitable for modern risk management.  

Ch2. Introduction to Options

One must simply know  all details of the instrument's specifications. For example, FXP gives twice the daily negative returns of FXI, does not mean the compounded returns over a period of time will have the same relationship. Key words are: options, right not obligation, underlying, premium, maturity. Options can be created out of thin air, till there is ability to collateralize it. They have nonlinear payoffs. 

Specifications for an option contract

  1. Option type - calls and puts. 
  2. Underlying asset - certain number of stocks, indices (times a multiple), futures.
  3. Strike price - exercise price
  4. Expiration date - last date on which the option exists.
  5. Exercise style - American and European. Bermudan (on specific days).
  6. Contract unit - multiplier. Need to be aware of the effects of corporate actions. 

Uses of options

Replication of options using underlying is possible but expensive so options are not redundant. The subtle difference between the option and underlying replicating portfolio is where the professional traders make money.

  1. Hedging - A position in underlying can be protected from falls by buying a protective put. Presence of hedging activity shows the fallacy in methods that use the number of outstanding puts or calls to predict the direction of any underlying security.
  2. Speculation - If we think stocks will fall we can but a put. Out of money puts give greater leverage. 
  3. Creation of structured products - e.g. equity linked note. Investors are torn between fear and greed. Equity linked note are ideal product which promise principle and give an upside if the index is over a certain percentage.
  4. Volatility trading - A position in options and underlying can be used to trade change of volatility(and not directions or returns).
  5. Structured product arbitrage - Many financial products contain options like features, e.g. convertible bond. These can be replicated, hedge against or speculated using options.

Market structure

An options trade can be put with a broker after completing Securities account, options account and Options Clearing Corporation risk disclosure agreements. Market or Limit orders for Call or Put can be placed with details provided. Main exchanges in the US are Boston, Chicago Board, International Securities, NASDAQ Options, NYSE Alternext and Philadelphia. These markets are linked on a real-time basis. Ticks are either $0.05 or $0.01 generally in the US. There is also a private inter-dealer market called the 'call-around market'. The United States equity options market is served by a single clearing house, the Options Clearing Corporation (OCC), which the exchanges collectively own. The appropriate cash transfer happens the next business day. Transaction cost includes broker and exchange commissions. The margins are of two types - strategy based margin and portfolio based margin. 

Ch3. Arbitrage Bounds for Option Prices

Law of one price is behind these bounds. Sometimes what appears to be an arbitrage is merely a situation with larger than anticipated transaction costs, or unconsidered risk. The future price of a stock is related by $F=Se^{rT}$, where $r$ is the risk free rate. This is because of absence of arbitrage. A different borrowing and lending rate will give a no-arbitrage band instead of a value. Dividends and storage cost should be properly accommodated in the stock price. If interest rates are positively correlated with the underlying the futures are slightly more valuable than the forwards.

We can use this information to get bounds on options, which if violated can be exploited.

  1. American options are always expensive that European, both call and put. $c\le C$ and $p\le P$.
  2. A call can't cost more than underlying. $c\le S$.
  3. A put can never by more than the strike price (discounted to present for European). $P\le X$ and $p\le Xe^{-rt}$.
  4. The minimum value of call option is $c\ge S-Xe^{-rt}$. $C \ge Max(0,S-X)$.
  5. The minimum value of put option is $p \ge Xe^{-rt}-S$. $P \ge Max(0,X-S)$.

Sunday, August 23, 2015

Range-based estimation of Stochastic Volatility Models

Alizadeh, Brandt and Diebold (2001)

Theoretically, numerically and empirically the range is not only a highly efficient volatility proxy, but also that it is approximately Gaussian and robust to microstructure noise. Two factor models - one persistent and other mean reverting - do a better job describing simultaneously the high and low frequency dynamics of volatility - to explain both autocorrelation of volatility and the volatility of volatility.

Volatility is not constant. It is both time-varying and predictable. Gaussian quasi-maximum likelihood estimation (QMLE) for estimating stochastic volatility falls wayside because the volatility models are non-Gaussian - log absolute or squared returns. Range - difference of highest and lowest log security prices is a much more efficient estimator - due to its near normality.

Sunday, August 16, 2015

Expected Returns on Major Asset Classes - Ilmanen (2012)

This article is written by Ilmanen from AQR. It is a very good summary of fundamental ideas (mostly smart beta) floating in different asset classes. 

Ch1 Introduction
Asset class expected returns and risk premia are time varying and somewhat predictable.

Ch2 Equity Risk Premium
Ch3 Bond Risk Premium
Ch4 Credit Risk Premium
Ch5 Alternative Risk Premium

Saturday, August 15, 2015

Algorithmic Trading - Ernest Chan

Profits are not derived from some subtle, complicated cleverness of the strategy but from an intrinsic inefficiency in the market that is hidden in plain sight. 

Two kind of strategies - Mean reversion (ADF test, Hurst exponent, Variance ratio test, half-life, Johansen test) using linear, bollinger band, kalman filter - both temporal and cross sectional. Momentum (roll returns, forced asset sales and purchases, news, sentiment, order flow). Nuances - data-snooping bias, survivor ship bias, primary vs consolidated quotes,  venue dependence of currency quotes, short-sales constraints, construction of futures continuous contracts, closing vs settlement prices, regime shift. Kelly criteria for risk management, risk indicators, Monte Carlo simulations. Lessons - never manually override, under-leveraged is better, strategy performance mean reverts, overconfidence in a strategy is a poison pill.

Ch1 - Backtesting and automated execution

Statistical significance of the numbers is important to establish. Regime shifts are unputdownable, they need to be investigated. Good Backtesting platform is the the life blood of productive endevour. Common pitfalls:
  1. Look-ahead bias - using future information to construct signal. Trading and back-testing should be on same platform
  2. Data-snooping bias - out of sample testing, cross validation, make the model as simple as possible with as few parameters, assuming simple Gaussian, linear price predication and allocation formula. e.g. $rank_s=\sum_i^n sign(i) rank_s(i)$. Walk forward test as a final true-out-of-sample testing. After all this, be happy if the live trading generates a Sharpe better than half its backtest value.
  3. Stock splits and Dividend adjustments - and
  4. Survivorship Bias in Stock Database - get delisted stock data -,,
  5. Primary vs Consolidated Stock Prices - use tradable data. be skeptic in a healthy way.
  6. Venue Dependence of currency quotes - get the data where it will be traded.
  7. Short sale constraint - hard to borrow stocks (huge short interest) should be modeled realistically. This data is broker dependent. Backtest will be inflated otherwise. 
  8. Futures continuous contracts - take care of roll jumps.
  9. Futures close versus settlement prices - use synchronous prices, settlement is preferred.

Statistical significance of backtesting: Hypothesis testing

Hypothesis testing: we find the probability $p$ in the tail bigger than test statistic, with null hypothesis supposing the true value is zero. A very low value rejects the 'null hypothesis' and gives credence to the number. Three methods to evaluate the probability distribution for the statistical significance of backtesting on finite sample size:

  1. Gaussian distribution: Sharpe ($\times \sqrt{n}$) of 2.32 means $p$ is less than 0.01
  2. Monte Carlo to generate simulated historical price data and feed these simulated data into our strategy to determine empirical probability of distribution of profits.
  3. Generate set of simulated trades, with number of long short entry trades is the same as in the backtest with same average holding as in the backtest, but distributed randomly. 
Failure to reject null might inspire insights, which success may be a slightly weaker preposition. Seriously flawed strategies:

  • Annualized returns of 30% and Sharpe of 0.3 and draw down duration of 2 years.
  • Strategy worse than buy and hold.
  • Survivorship biased dataset.
  • Neural net with 100 nodes with Sharpe 6.
  • High frequency strategies with high Sharpe, not taking into account market response.

Will a backtest be predictive of future returns?

Regime shift are important to determine by observing the market, and statistically if possible. 
  • Decimalization of US stocks in 2001. Profits of statistical strategies decreased and profits of high frequency strategies increased.
  • 2008 crisis decreased average daily trading and caused a subsequent decrease in average volatility but increasing frequency of sudden outbursts. General decrease in profits of mean reverting strategies. Multi year bear market in momentum strategies started as well.
  • 2007 obsolescence of the NYSE block trade and removal of old uptick rule for short sales. 

Ch2 - The Basics of Mean Reversion

Financial price series are geometrical random walk, it's the returns which which distribute around a mean of zero, but we can't trade them (but anti-serial correlation or returns which is same as mean reversion of prices can be traded). We can manufacture a lot of price series that are mean-reverting (tested using ADF test, Hurst exponent and Variance Ratio test) in prices, though the price series of individual components are not. This is called cointegration. This can be tested using (CADF test and Johansen test). This is called time-series mean-reversion. The other type is cross-sectional mean reversion (short-term relative returns of the instruments are serially anti-correlated).

Mean-reverting series means that change in the price series in the next period is proportional to the difference between the mean price and the current price. ADF test tests whether we can reject the null hypothesis that the proportionality constant is zero. A stationary price-series has variance of the log of prices increasing slower than that of a geometric random walk, i.e. sublinear function of time. That is for $\tau^{2H}$, where $\tau$ is the time separating two price measurements, $H$ is the Hurst exponent, if less than 0.5 the price-series is stationary. The variance Ratio test can be used to see whether we can reject the null hypothesis that the Hurst exponent is actually 0.5.

ADF test

If a price series is mean reverting, then if the price level is higher than the mean, the next move will be downward and vice versa. We can describe the price change dynamics via $$\Delta p_t = \lambda p_{t-1} + (\mu + \beta t) + \sum_{i=1}^{k} \alpha_i\Delta p_{t-i}+\epsilon_t,$$ where $\Delta p_t = p_t-p_{t-1}$, etc. The ADF test has the null hypothesis of $\lambda=0$. If the null hypothesis can be rejected it means the price series is not a random walk and mean reverts. Since we expect mean regression, the test statistic $\lambda/SE(\lambda)$ has to be negative. When the model is fit we can use DW stats (equivalent to $2(1-\rho)$)to check if the residuals have autocorrelation.

Hurst exponent and variance ratio test

A stationary price series means that the prices diffuse slowly than the geometric random walk would. The variance for a time period $\tau$ is defined as $Var(\tau)=<|z(t+\tau)-z(t)|^2>$, where $z=log(p)$. For the geometric walk we know this variance is $\sim\tau$, but for mean reverting or trending process this is $\sim \tau^{2H}$, where $H$ is the Hurst exponent. $H=0.5$ for random walk, $H>0.5$ for trending series and $H<0.5$ for mean reverting series. $H$ serves as an indicator for the degree of mean reversion or trendiness. The statistical significance of $H$ can be provided by the Variance ratio test, which tests whether the following ratio is equal to 1. $$\frac{Var[z_t-z_{t-\tau}]}{\tau Var[z_t-z_{t-1}]}.$$

Half life of mean reversion

In practical trading we can be successful with less demanding tests. We just need $\lambda$ negative enough to make a trading strategy practical, even if we can't reject the null hypothesis. $\lambda$ is a measure of how long it takes for a price to mean revert. Converting the difference equation to a continuous form  (ignoring the trend and the lagged differences) $$dp_t=(\lambda p_t-1+\mu)dt + d\epsilon,$$ which solves to $$E[p_t] \propto e^{\lambda t}.$$ The expected time for half decay is $-log(2)/\lambda.$ Notice that $\lambda$ us negative. This determines the natural lookback period of our strategy as well, some small multiple of half-life period to avoid brute force optimization of lookback period.

A linear Mean-reverting trading strategy

One the tests confirm mean reversion, and half-life is appropriate in terms of our holding period expectations we determine the normalized deviation of the price from its moving average (with look back period equal to half-life) and maintain number of units of assets negatively proportional to this normalized deviation. Given a price series that passed the stationarity statistical tests, or at least one with a short enough half-life, we can be assured that we can eventually find a profitable trading strategy, maybe just not the one that we had backtested.


We can proactively create a portfolio of individual price series so that the  market value series of this portfolio is stationary. This is the notion of cointegration. The most common combination is a pair.

Cointegrated Augmented Dickey-Fuller Test (CADF) 

Since we do not know apriori what hedge ratio we should use to combine the pairs usual mean reversion test wouldn't work. Using Engle and Granger (1987) process we first determine the optimal hedge ratio by running a linear regression fit between the two price series, use this hedge ratio to form a portfolio, and then finally run a stationarity test on this portfolio. The order of the price series will change the hedge ratio (will not be exact reciprocal). Generally only one of those ratios is correct, yields the most negative t-stats.

Johansen Test

For more than two variables we need to use the Johansen test. We first present the matrix form of the equation $$\Delta P_t = \Gamma P_{t-1} + M + \sum_{i=1}^{k}A_i \Delta P_{t-i}+\pmb{\epsilon}_t. $$ If $\Gamma=\pmb{0}$ (or each eigenvalue is 0), we don not have cointegration. If the rank of the matrix is $r$ and the number of price series are $n$, then the number of independent portfolios that can be formed by various linear combinations of the cointegrating price series is equal to $r$. The Johansen test does the analysis based on trace statistic and eigen statistic. The null hypothesis $r=0$ (no cointegration relationship), should be rejected to find mean reversion, followed by $r\le 1$, ..., up to $r \le n-1$. If all these hypothesis are rejected, then we have $r=n$. The eigenvectors found can be used as our hedge ratios for the individual price series to form a stationary portfolio.

This also reveals the inverse relationship ( not generally reciprocal), i.e. Johansen test is independent of the order of the price series. The cointegrating relationship is the strongest for the highest eigenvalue, have the shortest half-life for mean reversion.

Linear Mean-reverting trading on a portfolio

We determine the portfolio vector and accumulate units of the portfolio proportional to the z-score of the 'unit' portfolio's price, determined by Johansen eigenvector. At the outset we cannot really enter and exit an infinitesimal number of shares whenever the price moves by an infinitesimal amount. To avoid data snooping, we should determine Johansen vector in a moving window fashion (unlike in the book). The lookback can be half-life. Shorter the half-life, more significant are the results.

Pros and cons of mean-reverting strategies

Portfolio trading is the most profitable and has most opportunities. There is also often a good fundamental story behind a mean-reverting pair. Canadian and Australian market are cointegrated because they are commodities economy. GDX and GLD cointegrate because the value of gold-mining companies is very much based on the value of gold. Even when a cointegrating pair falls apart, we can often understand the reason. And with understanding comes remedy. This availability of fundamental reasoning is in contrast to many momentum strategies whose only justification is that there are investors who are slower than we are in reacting to the news, i.e. there are greater fools out there. Mean-reverting strategies also span a great variety of time scales. 

Unfortunately, it is because of the seemingly high consistency of mean-reverting strategy that may lead to sudden break down. This often happens when the leverage is maximum after an unbroken string of successes. Hence, risk management is particularly important and difficult since usual stop losses cannot be logically deployed. 

Ch3 - Implementing Mean Reversion Strategies

In practice, we do not necessarily need true stationarity or cointegration in order to implement a successful mean reversion strategy. We can capture short-term or seasonal mean reversion (during specific period of the day or under specific conditions), and liquidate our positions before the prices go to their next equilibrium level. Conversely, not all stationary series will lead to great profits, particularly when the half life is longer. A more practical version of the implementation is using Bollinger bands. Kalman filter can be used for better estimation of the hedge ratio.

Trading pairs using price spreads, log price spreads, or ratios

Consider the 'unit' portfolio time series $y$ as the trading signal, which is just a weighted sum. Instead of prices we could also use log prices (with different coefficients estimated, of course if stationary). Unlike prices, using log prices would not represent shares of the portfolio or constituents. To understand the log price relationship we take a time difference of this equation. The difference of this series gives linear combination of returns.

Price based portfolio's constants represent number of shares, while return based series' constants represent the market value of the assets together with a cash component implicitly included. Note that a cash component must be implicitly included because the constants are the market values, and there is no other way that the market value of the portfolio can change with time. This cash does not show up in the difference equation because it is constant from $t-1$ to $t$ and is rebalanced then. This requires the trader to constantly rebalance the portfolio, which is necessitated by using the log of prices.

The ratio $p_1/p_2$ does not necessarily form a stationary series, but may have advantage when the underlying pair is not truly cointegrating, but there is short term mean reversion present. This also keeps the hedge ratio 1. This may come handy during currency trading, where ratios of currency pairs may have a real meaning.

Bollinger Bands

The linear strategy deployed till now is not practical as it does not limit the deployed capital. Bollinger bands can be used to state the entry Z-score and exit Z-scores. The performance of the example improves but there are additional parameters introduced.

Does Scaling-in work?

Scaling-in/ averaging-in is the idea that one invests more as the price deviates more from the mean (assuming mean reversion happens). This is what a linear mean-reversal strategy does. This reduces price impact and can make profits even when the price never reverts to its mean. Multiple entry exits using Bollinger bands and mimic the situation. Schoenberg and Corwin (2010) show that entering or exiting at two more more Bollinger bands is never optimal, with the implicit assumption that probabilities of changes are constant, which is not the case. Practically, scaling in may well outperform the all-in method out-of-sample.

Kalman Filter as Dynamic Linear Regression

What is the best way to estimate hedge ratio when it can vary with time? Moving window can have ghost effects, entry-drop off effects. EWM can improve this, but it is not clear if it is optimal. Kalman filter is an optimal linear algorithm that updates the expected value of a hidden variable based on the latest value of an observable variable. If we assume the noises are Gaussian and relationships are linear, it is the best filter available. We need to figure out observable and hidden variable and observation and state transition model matrices. In the measurement equation $$y_t=x_t \beta_t + \epsilon_t,$$ $y_t$ is the observable price, $x_t$ the price series augmented with ones($N\times 2$ matrix) is the observation model matrix. $\beta_t$ is the $2\times 1$ hidden variable denoting both the intercept and the slope. $V_{\epsilon}$ is the variance of the Gaussian noise $\epsilon_t$. Next we make a crucial assumption that the regression coefficient at time $t$ is the same as that at time $t-1$ plus noise $$\beta_t=\beta_{t-1}+\omega_{t-1},$$ where $\omega$ is also a Gaussian noise with covariance $V_{\omega}$, i.e. the state transition model here is just the identity matrix.

Kalman filter can now iteratively generate the expected value of the hidden variables $\beta$ given an observation at time $t$, which not only includes the dynamic hedge ratio between the two assets, but also the 'moving average' of the spread. It also generates an estimate of the standard deviation of the forecast error of the observable variable which can be used in place of the moving standard deviation of the Bollinger band! We also need to specify $V_{\epsilon}$ and $V_{\omega}$.

If $R(t|t-1)$ is $Cov(\beta_t-\hat{\beta}(t|t-1))$, measuring the covariance of the error of the hidden variable estimates we have given the quantities $\hat{\beta}(t-1|t-1)$ and $R(t-1|t-1)$ at time $t-1$, $$\hat{\beta}(t|t-1)=\hat{\beta}(t-1|t-1) \quad (\mbox{State prediction})$$ $$R(t|t-1)=R(t-1|t-1)+V_{\omega} \quad (\mbox{State Covariance prediction})$$ $$\hat{y}(t)=x(t)\hat{\beta}(t|t-1)\quad (\mbox{Measurement prediction})$$ $$Q(t)=x(t)^TR(t|t-1)x(t)+V_{\epsilon}\quad (\mbox{Measurement Variance prediction}),$$ where $\epsilon(t)=y(t)-x(t)\hat{\beta}(t|t-1)$ is the forecast error for $y(t)$ given observations at $t-1$, and $Q(t)$ is $Var(\epsilon(t))$, measuring the variance of the forecast error. After observing the measurement at time $t$, Kalman filter update equations are $$\hat{\beta}(t|t)=\hat{\beta}(t|t-1)+K(t)\epsilon(t)\quad (\mbox{State update})$$ $$R(t|t)=R(t|t-1)-K(t)x(t)R(t|t-1)\quad (\mbox{State Covariance update}),$$ where $K(t)$ is the Kalman gain given by $$K(t)=R(t|t-1)x(t)/Q(t).$$ To start the recursions, we assume $\hat{\beta}(1|0)=0$ and $R(0|0)=0.$ $V_{\omega}$ and $V_{\epsilon}$ need to be provided or estimated from data (Rajamani and Rawlings 2009). Following Montana we assume $V_{\omega}=\frac{\delta}{1-\delta}I$, where $\delta$ is between 0 and 1. If $\delta=0$ it becomes a OLS while with $\delta=1$ $\beta$ will fluctuate wildly. The optimal values can be obtained via training data, we pick $\delta=0.0001$ and $V_{\epsilon}=0.001.$

Kalman Filter as market-making model

We are concerned here with a single mean-reverting price series, intending to mind the mean price and standard deviation. This is a favorite model for the market makers to update their estimate of the mean price of an asset (Sinclair 2010). So mean price $m_t$ is the hidden variable and price $y_t$ is the observable variable. $$y_t = m_t + \epsilon_t \quad (\mbox{Measurement equation})$$ $$m_t=m_{t-1}+\omega_{t-1}\quad (\mbox{State equation})$$ $$m(t|t)=m(t|t-1)+k(t)(y(t)-m(t|t-1))\quad (\mbox{State update})$$ The variance of forecast is $$Q(t)=Var(m(t))+V_{\epsilon}$$ Kalman gain is $$K(t)=R(t|t-1)/(R(t|t-1)+V_{\epsilon}),$$ $$R(t|t)=(1-K(t))R(t|t-1)\quad (\mbox{State Variance update}).$$ To make these equations more practical, practitioners make further assumptions about the measurement error $V_{\epsilon}$ which measures the uncertainty in the observed transaction price. If the trade size is large the uncertainty is small, and vice versa. So $V_{\epsilon}$ becomes a time dependent function, specifically on trade size $T$ $$V_{\epsilon}=R(t|t-1)\left( \frac{T}{T_{max}}-1\right)$$
If $T=T_{max}$ there is no uncertainty and the Kalman gain is 1 and the mean estimate price is exactly equal to the observed price!$T_{max}$ can be some fraction of total trading volume of the previous day. This is similar to VWAP approach to determine mean price/fair value along with time weighted average price.

The danger of data errors

Particularly insidious on both backtesting and executing mean-reverting strategies. 'Outliers' inflate the backtest of a mean-reversion strategy (Thomas Falkenberry 2002). But they suppress the backtest performance of a momentum strategy. In live trading they produce wrong trades for both strategies. 

Ch4 - Mean Reversion of Stocks and ETFs

Stock from same sectors are good candidates for forming pairs, diversification is easy. Simple mean-reverting strategies actually work better for ETF pairs and triplets than stocks. In short term (seasonal), most stocks exhibit mean-reverting properties under normal circumstances (there isn't any news on stock). Over the long term stock prices follow geometric random walk. Index arbitrage is another familiar mean-reverting strategy, stock vs futures, stock vs ETFs. Profits have decreased so the strategy has to be modified. Cross-sectional mean reversion is prevalent in basket of stocks. The statistical tests for time series mean reversion are largely irrelevant for cross-sectional mean reversion. Due to huge attraction and ease of finding mean-reversion profits have decreased.

The difficulties of trading stock pairs

The daily frequency mean-reversion is a game of past. The intraday and seasonal mean-reverting properties are still exploitable. Out-of-sample cointegration is difficult to find. It is difficult to consistently make profits in mean reversion unless one has a fundamental understanding of each of the companies and can exit a position in time before bad news on one of them become public. Law of large numbers done not come to rescue (due to lack of independence) because the small profits gained by the 'good' pairs have been completely overwhelmed by the large losses of the pairs that have gone 'bad'. Further, there are short sale constraint resulting in short squeeze. The new alternative uptick rule also creates uncertainty in both backtesting and live trading. Once the circuit breaker is triggered, we are essentially forbidden to send short market orders. Since the profits have decreased it becomes imperative to enter and exit positions intraday to capture the best prices. Avoiding overnight positions also avoid changes in fundamental valuations that plague longer-term positions. The bid-ask spread and size has become very small due to prevalence of using dark pools, icebergs, high frequency trading and decimalization of US stock prices. So pairs traders who act as a type of market markers, find that their market-making profits have decreased as well. But other countries and US ETFs are still profitable.

Trading ETF Pairs (and Triplets) 

Once found to be conintegrating, ETF pairs are less likely to fall apart in out-of-sample data (vs stocks), because the fundamental economics of a basket changes more slowly than that of a single company (e.g. EWA-EWC Australian, Canadian ETF). We need to find ETFs that are exposed to common economic factors, e.g. country ETFs, sector ETFs (retail fund RTH vs consumer staples fund XLP). 

Another ETF pair is between commodity ETF and an ETF of companies that produce that commodity, e.g. GLD vs GDX. They have conintegrated till 2008, after which oil shock became a big part of mining expenses. Introducing USO as a triplet we find them cointegrated. Oil fund USO and energy sector fund XLE do not cointegrated because USO tracks the oil futures and not the spot oil. Mean reversion trading of such pairs would be much less risky if the commodity fund holds the actual commodity rather than the futures. 

Intraday Mean Reversion: Buy-on-Gap Model

Daily prices are indeed geometric random walks. There are many seasonal mean reversion occurring at the intraday time frames even for stocks.

Select all stocks near the market open whose returns from their previous day's low to today's open are lower than 1 standard deviation based on daily close-to-close returns of past 90 days. These are the 'gapped down' stocks. Apply a momentum filter by requiring their open prices to be higher than the 20-day moving average of the closing prices. Buy the top 10 stocks in this list and liquidate the position at the end of the day. Similarly a short strategy can be constructed. The rational is that for an up-trending stock, if the stock is down before the open, panic selling will depress it further but it will appreciate over the course of the day. Usually, a stock that has dropped a little bit has a better chance of reversal than the one that has dropped a lot because the latter are often due to negative news, which are permanent and less likely to revert. The fact that a stock is higher than long-term moving average attracts selling pressure from larger players with longer horizons. This demand for liquidity at the open may exaggerate the downward pressure on the price, but liquidity driven moves are more likely to revert when such demand vanish. The long only strategy may present some risk management challenge and have low capacity.

For realistic backtest one can use pre-open prices (e.g. at ARCA) to determine the trading signals. Also trading can't be ascertained at the open price. This induces signal noise. Intraday data can be used for more realistic numbers. Primary exchange prices should be used vs consolidated prices. Short sale strategies suffer the short sale constraint pitfall. This strategy is well known among traders and there are many variations on the same theme. A hedged version can be traded which is long the stocks but short the index futures. Sector restrictions can be applied. Buying period can be extended beyond the market open. Intraday profit caps can be imposed. The lesson is: price series do not exhibit mean reversion when sampled with daily bars but can exhibit strong mean reversion during specific periods. This is conditional seasonality at work at shorter time scale.

Arbitrage between and ETF and its component stocks

Index arbitrage trades on the difference in value between a portfolio of stocks constituting the index and the futures on that index. If the stocks are weighted same as index construction the cointegration is too tight to be exploited. Sophisticated traders can still profit by trading intraday, at high frequency. In order to increase these differences, we can select only a subset of the stocks in the index to from the portfolio. Same idea can be applied to ETF and its constituents. One selection method is to just pick all the stocks that cointegrate individually with the ETF with 90 percent probability using Johansen test. Then we form a portfolio of these stocks with equal weights. We reconfirm using the Johansen test that this long-only portfolio still cointegrates with the ETF (SPY e.g.). We are using log prices so the weights are capital on each stock, as we expect to rebalance it every day. After the cointegration is confirmed in-sample, we can backtest the linear mean reversion strategy. We can't test all the stocks and the index together via Johansen test because the test can take only a maximum number of symbols and would admit long-short positions which we may not want because that may double short some stocks increasing specific risks.

Another method of constructing long-only portfolio is to first test each stock vs the index using Johansen test. This subset is then used via constrained optimization method (e.g. genetic algorithm or simulated annealing) to minimize the average absolute difference between this stock portfolio price and the index price series. The variable of optimization are the hedge ratios, with the constraint that all weights are positive. Short sale constraint is less harmful here as there is enough diversification.

Cross-sectional mean reversion: A linear long-short model

In this type of so-called "cross-sectional" mean reversion strategies, the individual stock price revert to their short-term relative returns. These, generally, don't work for futures and currencies. We rely on the serial anti-correlation of these relative returns to generate profits. We expect the under-performer to outperform and vice versa. We should not expect profits from each stock, as some may serve as hedge. Proposed by Khandani and Lo (2007) the weights are $$w_i=-\frac{(r_i-<r_j>)}{\sum_k |r_k-<r_j>|},$$ where $r_i$ is the daily return of the $i^{th}$ stock, $<r_j>$ is the average daily return of all the stocks in the index. We rebalance everyday to $1. Usually backtesting on a smaller cap universe will generate even higher returns.

The return of this strategy can be enhanced by using the returns from the previous close to today's open to determine the weights for entry at the open. All the positions will be liquidated at the market close, thus turning it into an intraday strategy. This open-to-close strategy will have double the transaction cost and will have signal noise like the buy-on-gap model.

There are possibly other factors that are better at predicting cross-sectional mean reversion of stock prices than the relative returns that we have used. One popular variable is price-earnings ratio from last quarter, or may be projected earnings estimated by the analysts or the companies themselves. If price moves are justified by fundamental mean reversion will not occur and we should avoid shorting such stocks if we use P/E ratio to rank the stocks.

Ch5 - Mean Reversion of Currencies and Futures

Most CTAs are momentum based. Most currency and futures pairs will not cointegrate and most portfolios of currencies or futures do not exhibit cross-sectional mean reversion. Mean reversion opportunities are limited but not non-existent, e.g. future calendar spreads and volatility future vs stock index future. Currency portfolio must be valued in same base currency and rollover interest must be accounted for.

Trading Currency cross-rates

Commodity currencies (Australian dollar, Canadian dollar, South African Rand, Norwegian Krone) may be cointegrated.  Liquidity in currencies is higher compared to corresponding stock index ETFs. Higher leverage can be employed. There are no short-sale constraints. And it trades around the clock and we can employ stop losses in a meaningful way (If market is closed for a long period stop losses are useless as the market can gap up or down when it reopens). 

  1. In the pair AUD.ZAR, AUD is the base currency and ZAR is the quote currency.
  2. A quote of 5 for AUD.ZAR means it takes it takes 5 ZAR to buy 1 AUD. 
  3. Buying 100 AUD.ZAR means buying 100 AUD and selling 500 ZAR. 
  4. Very few brokers offer AUD or ZAR as a cross-rate. So we have to buy 100 USD.ZAR and sell 100 USD.AUD to effectively buy 100 AUD.ZAR
  5. USD.ZAR/USD.AUD is the synthetic pair for AUD.ZAR
The non-local currencies should be regularly converted to base USD to remove currency risk. In order to interpret the eigenvector from the Johansen test as capital weights, the two price series must have the same quote currency. The trades can be appropriately places for the right order of currency pair. If we find cointegration between two entirely different cross-rates, care should be taken to calculate the returns correctly. The key step in backtesting currency arbitrage strategies is not the complexity of the strategies, but the right way to prepare the data series for cointegration tests, and the right formula to measure returns!

Rollover interests in currency strategy

A feature of trading currency cross-rate is the differential interest rate earned or paid if the cross-rate position is held overnight (till or beyond 5 PM ET). If we are long the currency pair B.Q the interest we earn is $i_B-i_Q$. When $i_Q>i_B$ we pay this interest and it is called the rollover interest. For $T+2$ settlement if T+3 is a holiday or weekend for either currency holiday are added to the interest, so anything past 5PM ET Wednesday will accrue excess rollover interest. For USD.CAD and USD.MXN it is $T+1$ settlement so anything past 5PM ET Thursday would accrue weekend interest as well. 

For intraday positions rollover interest is zero. For trading a long-short dollar neutral equity portfolio, for futures position the financing cost is zero. In the case of currency cross-rates, we should add the rollover interest to the percentage change of the cross-rate, i.e. we need to modify the return calculation for cross rate strategies. 

Trading Futures Calendar Spread

In reality, calendar spreads do not generally mean-revert. To understand why we need to understand the drivers of the returns of futures in general. Roll returns and spot returns constitute the total returns of a future. An ETF of commodity producers (XLE) may cointegrate with the spot prices but not with futures prices because of the presence of the roll returns. If we assume that spot and roll returns are truly constant throughout time ($F(t,T)=Ce^{\alpha t}e^{\gamma (t-T)}$), we can use linear regression to estimate their values. Spot returns can be directly regressed on time, but to find the roll return we need to regress the price vs the time to maturity. This will be different for different maturities and hence $\gamma$ will vary with time. In general, average roll returns are much larger in magnitude than spot returns.

Volatility, and hence the VIX index, is mean reverting. But the futures VX are not, they just inexorably decline, all due to roll return. This roll returns has been mostly negative. If we define the spread of log prices of the two legs and maintain the market value of the two legs to be the same at every period, it turns out to be $\gamma(T_1-T_2)$, which is simply roll returns and independent of the spot price. Hence, spreads are returns but only roll returns component. This log spread series mean-reverts. 

Do calendar spreads mean-revert?

We may expect the calendar spread components to be cointegrated and hence mean-revert, but in reality roll returns derail our intuition. The difference of log prices of the two legs, maintaining the market value of the two legs to be same at every period, is simply $\gamma(T_1-T_2)$, which is simply roll returns and independent of the spot. Hence, we are considering on the roll returns part of the total returns. The log spread series indeed mean-reverts. We apply the strategy of holding period for a pair of 61 trading days, roll 10 days before expiration, and the contracts are 1 year apart. We get an IR of 1.3 for CL. 

Seasonality is often a prominent feature for commodities. For a particular market, only calendar spreads of certain months (and certain months apart) mean-revert. Same reversion of spreads can be applied to VIX calendar spreads, but do not work! However the ratio back/front for VX is mean reverting (verified by ADF test), but only from 2008 when a regime change happened. This gives an IR of 1.5 from oct 2008 to Apr 2012.

Futures Inter-market Spreads

It is almost impossible to find futures with different underlyings that are mean reverting. The Prices need to be synchronous for the  mean reversion to be tested (taking care of multipliers). The possible candidates are 
  • Crack spread - the 3:2:1 ratio does not have a mean reverting behavior, fails ADF
  • CL:BZ - fails ADF. BZ has outperformed CL due to increase in production in US, pipeline bottleneck at Cushing and geopolitical concerns like Iranian embargo, which effected Europe and hence BZ more than US.
  • basket of CL, BZ, RB and HO

Volatility Futures versus Equity Index Futures

Volatility is anti-correlated with the stock equity market index: When the market goes down, volatility shoots up, and to a lesser extent, vice versa. There appears to be two regimes in a plot of VX vs ES futures - before 2008 and after 2008 (low vol but with greater range!). Applying liner regression or apply the Johansen test to a mixture of both regimes would be not correct. Hence, we can apply Engle-Granger process post 2008 after multiplying the multiple. The IR is 1.4, for two year 2010 to 2012. There is also a VX-ES momentum strategy discussed in next chapter.

Ch6 - Interday Momentum Strategies

Causes of momentum - persistence of roll returns, particularly the sign (futures), slow diffusion of news, forced sales or purchase by funds, market manipulation by high frequency traders. There is a time-series and cross-sectional version. Interday momentum suffers from a recently discovered weakness, which intraday momentum are less affected by.

Tests for Time series Momentum

Time series momentum means that past returns are positively correlated with the future returns. Correlation between past n day and future m days returns can be tested. Or else the correlation of signs could also be checked. For long term trends we can check the Hurst exponent or the variance ratio test to rule out random walk hypothesis. We present numbers for TU, two year treasury.

In computing the correlations of pairs or returns, we must take care not to use overlapping data. If look-back is greater than the holding period, we have to shift forward by the holding period to generate a new returns pair. If the holding period is greater than the look-back, we have to shift forward by the look-back period. With a one day shift the t-stats would be artificially high, but the correlations would still be correct. Hence, to estimate the right p-value non-overlapping windows are essential. A look-back of 60 and 250 days with a holding of 10 to 25 days. The Hurst exponent is 0.44 and the variance ratio test is rejected, i.e. it is a random walk - the time series exhibits momentum and mean reversion at different time frames. 

Time Series Strategies

Paper by Moskowitz, Yao and Pedersen 2012 present momentum with 12 month holding period and holding for 1 month. This can be rolled over every day with 1/25 th fraction invested each day. For TU the IR is 1.0 with very low margin. 

Why do many futures returns exhibit serial correlations and why do they occur only at a fairly long time scale? The explanation lies in the roll returns. Typically a future stays in contango or backwardation over long period of time. The spot return however can vary rapidly. So, in longer, terms if roll returns dominate the spot returns we will get serial correlation (Corn is an exception). Hence, if we use lagged roll returns as a signal it might be cleaner. Applying this makes the IR of TU 2.1 with reduced drawdowns as well!

Other possible entry signals can be - buy when prices reach N-day high, when prices exceed N-day moving average or exponential moving average, when the prices exceeds the upper Bollinger band, when the number of up days exceeds the number of down days in a moving period. Alexander Filter - buy when the daily returns moves up at least x percentage, and then sell and go short if the prices moves down at least x percentage from a subsequent high. 

Sometimes the combination of mean-reverting and momentum strategy may work better. One example strategy on CL - But at the market close if the price is lower than that of 30 days ago and is higher than that of 40 days ago; vice versa for shorts. There are are Mutual funds selling diversified momentum indicators. The true test always is true out-of-sample testing.

Extracting Roll Returns through Futures versus ETF arbitrage

If contango, but the underlying and short the future; and vice versa if backwardation. This arbitrage strategy is likely to result in a shorter holding period and a lower risk, since in the previous strategy we needed to hold the future for a long time before the noisy spot return can be averaged out.

The logistics of buying and especially shorting the underlying asset is not simple. But ETF for many precious metals can be found. But in contrast to owning futures, owning ETF (e.g. GLD) acutally incurs financing cost, which generally eats up the roll returns. ETFs and Futures settle at different times, so the asynchronicity is a pitfall. 

Outside precious metals it is difficult to find ETFs that hold underlying commodities. But ETFs containing commodity producing companies often cointegrate with the spot price of those commodities. We can use these ETFs as a proxy for the spot prices. For example arbitrage between the energy sector ETF XLE and ETF USO (the WTI crude oil futures CL has different closing time). Short USO and long XLE whenever the CL is in contango, and vice versa for backwardation. The IR is 1.0 from 2006 to 2012.

VX does not have an underlying trading commodity, but a basket of options, which is very hard to replicate. But we can find an index highly correlated or anti-correlated with the spot returns. In case of VIX, the familiar ETF SPY fits the bill, because it has insignificant roll returns. 

Volatility futures versus equity index futures: redux

VX is highly anti-correlated with ES. We can use large roll return magnitude of VX, the small roll return magnitude of ES to develop a momentum strategy. If the price of the front contract of VX is higher than that of VIX by 0.1 point (contango) times the number of trading days until settlement, short 0.4 front contracts of VX and short 1 front contract of ES, holding for a day. Vice versa for backwardation. VX forward price don not fall on a straight line, so the curve can't be used to estimate the roll returns like for other commodities. The hedge ratio is based on the regression fit between the VX versus ES prices (not between returns!). This gives a Sharpe of 1 from 2010 to 2012.

Cross - sectional strategies

If we believe that commodities' spot prices are positively correlated with economic growth or some other macroeconomic indices, we can just buy a portfolio of futures in backwardation, and simultaneously short a portfolio of futures in contango, leaving us with favorable roll returns. Daniel and Moskowitz 2011 described the cross-sectional momentum with longer holding period. Ranking based on 12-month returns and holding for 1 month the long short portfolio give good performance but not during the great financial crisis. The same strategy works for universe of world stocks, currencies, international stocks and US socks. 

We can rank the stocks by many other factors as well (except lagged returns). Total returns can be decomposed into spot return and roll return. Similar it can be decomposed to market return and factor return. A cross-sectional portfolio will eliminate the market component. We can rank based on fundamentals like earnings growth, book to price ratio or some linear combination thereof. Or it could be statistical factors like PCA. All these factors except PCA change very slowly resulting in long holding periods. For futures we could use GDP growth, inflation rate or PCA. 

News Sentiment as fundamental factor

With machine-readable news it is now possible to programmatically capture all news items, not just earning and merger and acquisition activities. Sentiment score can be applied based on price impact of the article. Aggregation of these sentiment scores from multiple news articles was found to be predictive of its future return. Hafez and Xie (2012) give a sorting based on RavenPack's sentiment score with IR of 5.3 before cost. This also demonstrate slow diffusion of news is the cause of stock momentum. Other vendors are Recorded Futures,, Thomas Reuters News Analytics. Newsware offers a low-cost version of news feeds. Bloomber Event-Driven Trading, Dow Jones Elementized News Feed, and Thomas Reuters Machine readable News are the lower latency and better coverage options. 

The general mood of the society using 'Twitter' feeds is predictive of market index itself (Bollen, Mao, Zeng 2010).

Mutual Funds Asset Fire Sale and Forced Purchases

Coval and Stafford (2007) found that mutual funds experiencing large redemption are likely to reduce or eliminate their existing stock positions. This is not surprising as mutual funds are mostly fully invested with no cash reserves. Funds experiencing large capital inflows increase their existing positions rater than investing in newer ideas. The 'fire sale' by poor performing mutual funds cause the stocks to experience negative returns and is contagious and causes further redemption by other funds. The same situation occurs in reverse for stocks held by superbly performing mutual funds with large capital inflows. This order flow based momentum is applicable at all time scales.

A factor can be constructed to measure the selling (buying) pressure on a stock based on the net percentage of funds holding them that experienced redemption (inflows). This can be defined as $$Pressure(i,t)=\frac{\sum_j \mathcal{I}(Buy_{i,j,t}|flow_{j,t}>5\%) - \sum_j\mathcal{I}(Sell_{i,j,t}|flow_{j,t}<-5\%)}{\sum_j \mathcal{I}(1_{j,i,t-1})}$$ Weighing Buy by NAV may give better results. Coval and Stafford (with quarterly updates) found that the market-neutral portfolio formed based on shorting stocks with highest selling pressure and buying stocks with highest buying pressure generates annualized returns of about 17 percent before transaction costs. 

Furthermore, capital flows into and out of mutual funds can be predicted with good accuracy based on their past performance and capital flows (herd like behavior of retail investors). Based on these predictions we can predict the future values of the pressure factors noted above, i.e. we can front-run the mutual funds in our selling of the stocks that are currently owned. This front running strategy generates another 17 percent annualized before transaction cost. 

Finally, since these stocks experience such selling and buying pressure due to liquidity-driven reasons, and suffer suppression or elevation of their prices (not because of fundamental reason) they often mean-revert after the pressure is over. Indeed, buying stocks that experienced the most selling pressure in the t-4 up to t-1 quarters, and vice versa, generates another 7 percent annualized returns. 

Combining all three strategies (momentum, front running, and mean reverting) generates a total return of about 41 percent before transaction costs. The slippage might be significant because of delay in mutual fund holding data at the end of the quarter. The data from Center for research in security prices (CRSP) costs 10K an year. 

Apart from mutual funds, index funds and levered ETFs ignite similar momentum as well. In fact, forced asset sales and purchases by hedge funds can also lead to momentum in stocks, as in the August 2007 quant funds meltdown.

Pros and Cons of momentum strategies

Momentum strategies are diametrically opposite to mean-reverting strategies. Starting with the cons, it is harder to create profitable momentum strategies and they tend to have lower Sharpe than mean-reverting strategies because

  1. Have long look-back periods, so the number of independent trading signals is few and far in between leading to lower Sharpe. 
  2. Momentum crashes - these strategies perform miserably for several years after crashes. During this period momentum is replaced by mean reversion. Momentum crashes are caused by strong rebound of short positions following market crisis.
  3. The duration over which news-driven momentum remain in force gets progressively shorter as more traders catch on to it. This constantly shortening of holding period has no predictable schedule.
Looking at the pros:
  1. Ease of risk management - there are two common type of exit strategies for momentum: time-based and stop-loss. Stop-losses are consistent with momentum strategies. If momentum has changed direction we should enter the opposite position and hence this change of momentum serves as a natural stop-loss. Stop-losses are not consistent with mean-reversion. Hence, momentum losses are always limited. 
  2. Momentum strategies can thrive in risky environment as well. For mean-reverting strategies the upside is limited by the mean they will revert to but the downside can be unlimited. For momentum strategies, their upside is unlimited, while their downside is limited. The more often 'black swan' event occurs, the more likely that a momentum strategy will benefit from them. The thicker the tails of the return distribution curve, or higher the kurtosis, the better that market is for momentum strategies. 
  3. Most futures and currencies exhibit momentum, allowing us to truly diversify the risk across different asset-classes and countries. 

Ch7 - Intraday Momentum Strategies

Time series momentum is typically long - month or longer, resulting in lower Sharpe and lower statistical significance due to infrequent independent trading signals. They also suffer from under performance after crashes. Short term intraday strategies do not suffer from these drawbacks. Apart from roll returns reason the other three reasons for momentum also operate at intraday time frame. An additional reason for intraday momentum is 'triggering of stops', causing breakout strategies. 

Intraday momentum can be triggered by specific events beyond just price actions like corporate news of earning announcements, analyst recommendation changes, or macro-economic news. Intraday momentum can also be triggered by actions of large funds, e.g. daily rebalancing of leveraged ETFs leads to short-term momentum.  Finally, the imbalance of bid and ask sizes, the changes in order flows, or nonuniform distribution of stop orders can all induce momentum in prices. 

Opening Gap strategy

Buying when the instrument gaps up, and shorting when it gaps down. Works best for Dow Jones STOXX 50. This produces an IR of 1.4 from 2004 to 2012. For currencies the daily "open" and "close" need to be defined differently, close to 5 PM ET and open to 5 AM ET (London open). The same strategy for GBPUSD has an IR of 1.3 from 2007-2012. Overnight or weekend gap trigger momentum because they accumulate un-acted information. The execution of the stop orders often lead to momentum because a cascade effect may trigger stop orders placed further away from the open price as well. Alternatively, there may be significant events that occurred over-night.

News driven momentum strategy

Slow diffusion of news makes the momentum at few days, hours, or seconds after post-earnings, and other corporate and macroeconomic news. Post earning announcement drift still exist but the duration has reduced. As recent as 2011, if we enter the market open after earning announcement was made after previous close, buying back the stock if the returns are very positive and shorting if the returns are very negative, and liquidate the position at the day's close we can make good returns. has such data. We can use 90 day moving standard deviation of previous-close-to-next day's open return as the benchmark for deciding whether the announcement is 'surprising' enough to generate the post announcement drift. For a universe of S&P 500 stocks an IR of 1.5 is available from 2011-2012. This can be levered up 4 times as it is an intraday strategy. Holding the positions overnight is not rewarding, the returns overnight are negative. 10-20 years ago PEAD lasted 1-2 days, more recently the momentum has shortened. 

Drift due to other events

Earning guidance, analyst ratings and recommendation changes, same store sales, airline load factors (provided by Dow Jones Newswire delivered by Newsware which is machine readable). See Hafez 2011 for a comprehensive list. Merger and acquisitions can also deliver news momentum kind of strategies. It is interesting to note that acquiree's stock price falls more than the acquirer's after the initial announcement of the acquisition.

Index composition changes generate buying and selling and create momentum. When a stock is added to an index there is buying pressure immediately after the announced changes. These drift horizons have changed from days to intraday.

The impact of macroeconomic events such as Federal Open Market Committee's rate decisions or the release of latest consumer price index do not produce any significant momentum on EURUSD. Clare and Courtenay 2001 report that UK macroeconomic data releases and Bank of England interest rate announcements induced momentum in GBPUSD for up to 10 minutes.

Levered ETF Strategy

The constant leverage requirement has some counter-intuitive consequences. If there is a big drop one would need to substantially reduce the positions in the levered portfolio to keep the leverage constant. and vise versa as a holder of the leveraged ETF. These rebalancing happen at market close and produce momentum. As a strategy buy DRN (real estate ETF) if return from previous day's close to 15 minutes before market close is greater than 2 percent, and sell if the returns are smaller than -2 percent. Exit at market close. This gives and IR of 1.8 from 2011-2012.

As the aggregate assets of these ETF increase the returns of the strategy increase. The total AUM of levered ETFs is 19 billion Cheng and Madhavan 2009 which can create a big order at close. Rodier, Haryanto, Shum and Hejazi 2012 have updated this analysis.

The flow of investor's cash also effect the momentum. A large inflow will cause positive momentum on the underlying's price. A large inflow into short leveraged ETF will cause negative momentum.

High frequency strategies

Most of them extract information from the order book. e.g. if bid size is much bigger than the ask size, expect the price to tick up and vice versa (Maslov and Mills 2001). The effect is stronger for lower volume stocks. Books on microstructure (Arnuk and Saluzzi 2012, Durbin 2010, Harris 2003, Sinclair 2010) describe a lot of hig-frequency momentum strategy. 'Ratio trades' can be used for momentum profits in markets that fill orders on a pro-rata basis such as eurodollar futures on CME. 'Ticking or quote matching' can be used when the bid-ask spread is bigger than two ticks, and there is expectation of an uptick.

'Momentum ignition' is to create an illusion of buying pressure (or vice versa). This works for market with time priority for orders. 'Flipping' can be used to generate artificial imbalance. Private data feed from exchanges like ITCH from Nasdaq, EDGX from Direct edge, PITCH from BATS can be used to detect flippers.

These strategies and defenses show that high-frequency traders can profit from slower traders only. Due to this the quote sizes have decreased and large orders are broken into smaller orders. 'Stop hunting' strategies exploit the short-term momentum when the resistance is breached. These resistance levels are either reported daily by banks or just be round numbers in the proximity of the current price levels. This is because there are  a large number of stop orders placed at or near the support and resistance level.

Order flow information is good predictor of price movements, because market makers can distill important fundamental information from order flow information, and set bid-ask accordingly. The urgency of using market orders indicates that the information is new and not widely known. For Stocks and futures we can monitor and record every tick and determine whether a transaction took place at bid or ask. We can then compute the cumulative or average order flow over some look-back period and use that to predict whether the price will move up or down.

Ch8 - Risk Management

Risk aversion - an average human being needs to have the potential for making 2 to compensate for the risk of losing 1 (which is why Sharpe of 2 is so appealing Kahneman 2011). This dislike for risk is not rational. The goal should be maximizing long term equity growth. The key concept is the prudent use of leverage, which can be optimized using Kelly formula or some numerical methods that maximize compounded growth rate. In short term draw-down control is much more important, which can be limited by stop-losses, but it is problematic. The other way is constant proportion portfolio insurance, which tries to maximize the upside of the account in addition to preventing large drawdowns. Finally, stopping trading during high risk of loss can be used using leading indicators of risk as an effective loss-avoidance technique.

Optimal Leverage

For managing own money, where maximizing net worth over long term is important and short-term draw-downs and volatility of returns are not important 

Kelly Formula

Optimization of Expected Growth Rate using simulated returns

Optimization of historical growth rate

Maximum drawdown

Constant Proportion portfolio Insurance

Stop Loss

Risk Indicators