Updating the Implied Volatility L/S Strategy (6/21/2016)

There are two versions of this strategy that I have previously tracked and reported. The original strategy consists of forming weekly portfolios each held for a period of four (4) weeks before being liquidated. The second strategy is a higher frequency version which forms weekly portfolios with a holding period of one (1) week. Thus far, both strategies have exceeded expectations. Their apparent theoretical success is so far beyond expectations it required much deeper investigation and better simulation. The returns being reported needed better validation. The rest of the post is organized as follows:

  • Simulation (Backtest) Issues
    • Default Slippage Model (volume constraints)
    • Default Cancel All EOD Unfilled Orders
  • Reporting Issues
    • Gross Returns vs Simulated Net Returns
    • Unintended compounding assumptions
  • Solutions
  • Results

Simulation (Backtest) Issues

Recently I've been able to spend more time exploring the updated Quantopian (Q) platform and refactoring code. I identified code that could be improved and fixed some subtle bugs. There were a few integrated issues that needed to be addressed.

Quantopian Platform Default Slippage Model (volume constraints)

The Quantopian (Q) platform is powerful. To wield that power effectively requires understanding some of the intricacies of real-world trading and how the Q platform addresses the topic. 

Quantopian Slippage Model @ Quantopian.com

Underlined by @blackarbsceo for emphasis

This is a deep subject that is simple to grasp but difficult to model. First let me say that Q does a great job creating a generalizable structure to allow many different slippage models (estimates). However, in the earlier iterations of the model I failed to consider if the default slippage model assumptions were appropriate given the strategy. After consideration and testing my stance is that it was not appropriate.  

The implied volatility strategy is tested on liquid, popular ETFs. Q's default assumption for some of the less actively traded, but large AUM ETFs is that the algo can only fill to a maximum of 2.5% of the historically available volume per minute. To date I haven't seen why this is anything but arbitrarily conservative. Furthermore, with the popularity of hidden order types (reserve/iceberg orders) and hidden liquidity in dark pools, historical volume may not be a good proxy of actual total liquidity available, especially in large AUM ETFs. 

Let's see a simple example of how this works (approximated):

This is the iShares Russell Mid-Cap ETF (IWR) key facts. We can see that it has a NAV of ~12.4B. It has 15 years of trading history. It is also not actively traded. 20 Day Avg Volume is 30,322 shares per day. Fine print also tells us that this volume only represents trades on the primary exchange. Assuming Q gets an aggregated data feed this number is likely too low. The site etfdb.com gives a higher estimate.

Assume etfdb.com has a more accurate volume number. Let's do the math to see how much liquidity the algo can hypothetically access under the default assumptions.

192,454 shares * 2.5% max volume constraint = 4,811 shares

4,811 available shares * $167.62pps = $806,478 dollar volume available. 

A dollar allocation to buy $1.0M IWR at 167.62 would require 5966 shares. 

The Q platform would only fill for the first 4,811 shares and at the end of the day Q will cancel the remaining order to buy 1155 shares. This leaves your order (1,155/4,811=) 19% under allocated.

Default Cancel All EOD Unfilled Orders

As mentioned in the example above, by default Q cancels all unfilled orders at the end of day. 

Failing to account for these issues can lead to spurious backtest results which may give inaccurate representations of algo (signal) profitability and risk. In my case, earlier algo iterations did not account for the liquidity constraints and the cascading effects of cancelled orders. This led to unintended market exposure(s), an artificially inflated beta, and inaccurate total returns. 

Reporting Issues

Gross Returns vs Simulated Net Returns

This primarily concerns the original strategy with 4 week holding periods.

Previously I reported simulated gross returns of the strategy by simply aggregating the average cumulative log returns of each long/short portfolio each week and summing them. The first problem with this is it fails to consider both explicit transaction costs (commissions) and implicit transaction costs (slippage, execution). Gross returns assume perfect execution at close prices that don't truly exist. As should be expected, by not modeling these real trading frictions we can grossly overestimate the profitability and underestimate the risk of a strategy. Furthermore, my previous reports made no distinction between overlapping and non-overlapping portfolio returns or that they may be different. 

Unintended compounding assumptions

Failing to define whether reported gross returns were overlapping provided an opportunity for a subtle and unintended performance overestimation. After more extensive testing it appears this oversight likely led to double counting and/or unintended compounding of individual portfolio and/or weekly returns. Confused? I was, which is why I realized the necessity to model and report these returns more accurately.

Solutions

Simulation (backtest) issues

To address issues of position allocations and cancelled orders, I refactored my code to construct a persistent target portfolio. The target portfolio is a representation of the algorithm's ideal assets and target weights. Instead of adding complexity through more order logic, the code compares the current actual portfolio to the target portfolio and if the current portfolio has a position weight(s) outside of the rebalance corridors, it rebalances the entire portfolio to the target. 

To address the slippage model I only made changes to the second strategy which consists of the shorter weekly holding period. In that case I increased the volume constraint to 50% from 2.5% of available liquidity while lowering price impact from .1 to .005. For the 4-week holding period version I haven't made any changes to the volume constraint or slippage model. 

How to best model slippage and price impact is a subject that requires more research on my part to determine realistic parameters moving forward.

Reporting issues

To address the reporting issues concerning the 4-week holding period version of the strategy, I simulated each portfolio individually using the Q platform. I then recorded the portfolio values at the EOD for each rebalancing period. I input these values in a spreadsheet assuming a maximum of $4M is invested each week with a $1M minimum investment in each portfolio.

The spreadsheet accounts for the overlapping portfolio values, cash liquidation and reinvestment, and simulated cumulative returns given transaction costs, and liquidity constraints. The spreadsheet also calculates the return of each portfolio individually as if an investor invested in only one portfolio at a time. By clearly separating these calculations, and more realistically simulating investment performance I believe I have eliminated any double counting or compounding issues. 

Results

Fortunately I can say after more rigorous testing and reporting on the two strategies they are both theoretically profitable. 

Original 4-week holding period strategy

The original 4-week holding period strategy now has more realistic looking returns. As of 6/20/2016, cumulative net returns are about 8.86% with a 0.35% average weekly return. Total gains are $341,680 on an average investment value of $3.76M. Average weekly cash gains are $13,667, with a max weekly loss of ($25,726) and a max weekly gain of $44,554. 

 4-week holding period strategy sample

4-week holding period strategy sample

Download the spreadsheet here

1-week holding period strategy 

The bad news is the strategy total returns are less than previously reported. I think the earlier iteration was showing roughly 10-11% returns thus far. The updated and refactored strategy has returned a net 7.4% over the period.

The good news is the risk metrics are much improved and more inline with a true long/short strategy. Beta is now in the single digits hovering near zero (0.03) and the max drawdown has declined to 1% with volatility at 4%. 

 Simulated strategy performance (1-week holding periods) target leverage = 1

Simulated strategy performance (1-week holding periods) target leverage = 1

Annualized performance estimates using Q's portfolio analysis tool Pyfolio is especially enticing.

quantopian research platform pyfolio tearsheet analysis of strategy 2 (TARGET LEVERAGE=2)

With the market risk exposures near zero, low volatility, and positive returns this strategy is a candidate for leverage. Let's see how the strategy performs with a target leverage of 2!

SIMULATED STRATEGY PERFORMANCE (1-WEEK HOLDING PERIODS) TARGET LEVERAGE = 2

QUANTOPIAN RESEARCH PLATFORM PYFOLIO TEARSHEET ANALYSIS OF STRATEGY 2 (target leverage=2)

Impressive.