Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Stock universe issue

Good afternoon,
Thanks to this paper: http://www.sciencedirect.com/science/article/pii/S1059056016301563
I developed this strategy in which I predict the direction of the overnight SPY and of the first 30 minutes of trading based on the last 30 minutes of the day before.

Now I wanted to use the same strategy, but applied to a universe of stocks instead of a single index. I wanted to go long only on the top 10% performing stocks of the S&P500 and go short in the bottom 10% stocks. In particular, if the return in the last 30 minutes of trading is positive, I want to go long overnight (or vice-versa). In addition, if the overnight ends up being positive for real, I want to go short in the first 30 minutes of trading of the next morning (or vice-versa).

I'm kind of new in the use of pipeline, do you have any tips on how to approach this problem? or where I could look at to implement this strategy?
Thanks a lot in advance,
Mattia

1 response

You could use pipeline with the Q500US Universe to filter long and short stocks. I understand what you are trying to do with the 30 minute return before close aspect of your strategy but how would you account for liquidity even if you found a way to implement your strategy into the code?