As the title says.
How can I make a pipeline that get's the stocks that did gain the most in procent. Yesterday?
As the title says.
How can I make a pipeline that get's the stocks that did gain the most in procent. Yesterday?
The easiest way is to use the built in 'Returns' factor with a window_length = 2. This will return the 1 day percent gain for every security. By default it will be the ratio of yesterdays close to the day before yesterdays close.
Use the 'top' method to create a filter with just the top n gainers. You may also want to mask the results with one of the built-in 'tradable universe' filters such as Q1500US to eliminate ETFs and OTC stocks and other not so easily tradable securities.
Attached is a notebook with an example.
Morten,
Check out the tutorial https://www.quantopian.com/tutorials/pipeline. Also look at the API documentation https://www.quantopian.com/help#pipeline-title. It's very instructional to look at some of the algorithms posted here in the forums to see how to put it all together (such as https://www.quantopian.com/posts/pfcf-with-momentum-strategy).
A word of caution about the forums... The Quantopian platform is constantly being added to and improved. This unfortunately makes some of the old discussions and code in the forums here obsolete or at a minimum perhaps not 'best current practices'.
Good luck!