Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Algorithmic trading and Short sales

Anyone have any suggestions or experience around an algorithm that "likes" to short and a regulation, like in 2008, that stopped the shorting of some stocks. Maybe I should try to short some of those stocks in 2008 and see what the simulation has to offer. More to the point, what happens to an IB account if an algorithm starts shorting a stock that has been denied via some regulation? Thoughts?

4 responses

W/ IB, there are a couple of ways that a short sale can fail. They generally fall into two categories -- one is regulation (no-short list in '08, alternative uptick rule that's still in effect, etc) and the other is IB lacking the borrow for the stock. I believe that in both cases, IB will accept the order but will hold it and not send it to the market until the restriction is lifted (or borrow is located, etc). In IB Trader Workstation, the order is marked as 'held' but last I checked, IB didn't expose this. In my algo, I attempt to detect it with some heuristics around sell short orders that are suspiciously unfilled for a long time.s

Additionally, depending on the specific stocks you're interested in, the cost of borrowing stock to short can be non-trivial. For some speculative stocks, it can be 20% / year or more; I believe that for some, it can be >100%. I don't believe this info is available through Quantopian, so be careful when backtesting your algo to that heavily relies on shorting.

Seconding Alex S.'s comments.

In addition, you can effectively stick with the most liquid securities and be assured of locating shortable shares (unless you're doing something crazy like trying to short 1/2 M or more. Historically available shortable shares might be derived from volume, but I'd be super conservative there. When the market is up you can check this site IBs View Shortable Stocks. It even works now (non-market hours), but I'd be wary of the numbers.

There were no doubt liquidity squeezes during the '08 descent. But you should be able to model it adequately. Flashcrashes are another matter of course. Nobody is prepared for those.

Alex, is there any way to get data on the shorting costs for various equities at various times? I would love to have this data for backtesting...

Simon, in TWS there's a stock borrow/loan tool (SLB rates) that will have historical borrowing rates for stocks. I'm not sure what the best to export the data is, or how far the historical rates go back though.