Back to Community
Ranking and Trading on "Days to Cover"

At our meetups in NYC and Boston this month, Jess Stauth explained how short interest can be used as a signal for investing. She has developed a very refined model at Thomson Reuters, and we collaborated on a simplified version here.

First I built a csv file of data for "days to cover" from the Nasdaq site, and threw it into s3. "Days to cover" is the number of average volume days required to cover the total short interest in a security.

I coded the attached algorithm that chooses a universe of stocks and ranks them based on the days to cover data. The algorithm looks for changes in the top ten and bottom ten stocks in the days to cover ranking, and rebalances the portfolio to have an equal dollar investment long in the top decile, and short in the short portfolio.

In addition to the algorithm returns and benchmark returns, I recorded four intermediate values:

  • decile_count -- the number of stocks in a decile, to gauge the number of positions we're building in the portfolio
  • top_turnover -- the percentage change in the top decile. only updates when the ranking changes.
  • bottom_turnover -- the percentage change in the bottom decile. only updates when the ranking changes.
  • dtoc_is_one_count -- NASDAQ doesn't report less than 1 day to cover, so this is a check to see how many stocks in the ranking are hitting the floor.

I also chose to rebalance whenever the deciles change, rather than on a monthly or bi-monthly schedule. The rebalance is incremental, so the transaction costs shouldn't be too onerous.

I'd love to see this ported to run on minutely data, to use the quandl api, or to rebalance on a monthly schedule rather than in and "event-driven" mode. Feedback is appreciated!

thanks,
fawce

aside: I mentioned my script to the guys at Quandl and they offered to put it into their mill, so now you can get short interest through their lovely api and never worry about updating the results. However, I haven't figured out yet how to get the data from quandl for a wide swath of stocks.

Clone Algorithm
710
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 528cfb076de5ab20ecbbe6d4
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.
Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

5 responses

Hey John:

Quandl is few weeks away from being able to take a list of tickers in the API so you can download an entire exchange if you want to. End of month maybe…

T.

Thanks Tammer! I'll keep an eye out for it.
thanks,
fawce

I'm keeping an eye out for selecting the universe using a ranking :)

Just a quick update, I converted this algo to use the new order_target_value method. The new method is a bit more savvy with building the positions than my original, so the orders placed and the resulting performance differ slightly.

thanks,
fawce

Clone Algorithm
710
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 52b5b0b8cf5e62121b19e6d4
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

Re minutely data, how would that be useful since short data is only updated once every two weeks (http://www.nasdaqtrader.com/trader.aspx?id=shortintpubsch)? Or minutely just for comparison to the index?

Also, an interesting extension would be to include shorting costs. Many academic papers have pointed to the lack of incorporation of shorting costs as a distortion back testing returns, though you have chosen fairly liquid securities for this strategy.

Finally, am I correct in assuming that you are going long the stocks that have the highest days to cover (ie the most shorted stocks) and long the ones that have the lowest days to cover (lines 123 to 126)? The blog post that you refer to (and my knowledge of academic papers on this topic) indicate that we should be doing the opposite?

Quote: Aggregated open short interest level provides a profitable, low turnover signal rooted in buy-side sentiment, aka “the smart money.”

Perhaps I'm reading the code wrong -- I'm new to Python.