Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
how to pick top N & bottom N using pipeline?

How would I find the top N stocks, by gap? And the bottom N? Thought I might continue to try to learn this pipeline thingy.

4 responses

HI Grant,

Thanks for posting this. The problem I am having with this approach is that you detect the gappers from the previous day. So for example, in place_orders, when examining context.output, you would have a list of stocks that gapped the day before. How could you see the rappers for the current trading day?.

Thanks

Jorge,

You could use pipeline to generate a universe of stocks. Then, in the first minute of trading, scan through the list to determine which ones gapped.

Grant

Hi Grant,

Oh I see, that makes sense. For some reason I assumed this was possible with pipelines.

Thanks a lot for the help!

Pipeline runs before the open, so it does not have access to the data. Note also that, as I understand, it needs to see a first trade in a security to admit it. So, effectively the earliest you can use pipeline with IPOs is 1 day after the IPO date.