Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Problem with Short position in IDE

I came across this problem a few nights ago, while I was back testing in IDE. Here is a glimpse into the simulation environment:

Setup

I have a dollar neutral (long-short) portfolio which has 60 positions at each time. My trade universe is a subset of market with stocks that:

  • Not listed on OTC,
  • Have a market cap,
  • Common stock and primary shares.
  • In addition, their "Vol-days" volume moving average to be equal or greater than "vol_mark". I have chose 21 days and 1e+6 in this test.

I used Morningstar's "fcfy - Free Cash Flow Yield" as a factor and at each day z-score the factor and find the top and bottom quantiles (10 bins). Then stock space is constructed as 100 shares that belong in top and bottom bins.

I used opt.MaximizeAlpha() as my objective and among other constraints, I selected opt.PositionConcentration.with_equal_bounds()for bounding the each position weight. So for the total position of 60, maximum long(short) position weight should be 1/30(-1/30) or roughly 3.3%. I chose very small starting cash to simplify the investigation.

Now the problem:

When I back-test, I saw significant drop in the return on '2018-11-08'. On the day before, the portfolio has a position of (-7924) shares of 'RSLS' at $0.02. A day after, the RSLS price jumps to $1.94 and results in almost $15k loss on the portfolio. Interestingly, I could not find the 'RSLS' on research environment after '2018-11-08'.

My curiosity in raising this question is to make sure the approach in general is right and I am not missing any significant step along the way. factor that I used is just an example and not the subject of my question. The main questions are:

  1. Is it a bug this specific stock price?
  2. How do you gals/guys prevent an event like this, especially for portfolios that have short positions?

Any feedback/comment is much appreciated.
Cheers,

2 responses
  1. On that date RSLS had a reverse split which apparently is not accounted for in the prices on Q.
  2. Simple: keep away from penny stocks, for example use QTradableStocksUS as your universe.
    There are some issues with these stocks, one of them I just mentioned. Further, most of them are thinly traded and have huge spreads so it's difficult to get an accurate simulation of what would realistically have happened when you order them.

Thank you Tentor for the advise and will do that way.