Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to get a list of daily "Top Gainers"

I'd like to experiment with some momentum strategies using the previous days "Top Gainers". For example, the data from this page:

http://www.finviz.com/screener.ashx?v=110&s=ta_topgainers

Does anyone know a public download location that Fetcher can use for this type of data?

The only other way to do this would be to have a Universe that supports ~8,000 stocks (a large increase from the current limit of 500). With this large universe, I could use the history function to calculate the daily gain for every stock and sort them by daily gain.

Thanks,

Tristan

7 responses

I created this with Kimono labs:https://www.kimonolabs.com

needs to be optimised, but this would be a start:

https://www.kimonolabs.com/api/csv/403y92oo?apikey=py1Kp8bdN5tjk48mI1vE4WxyFcx9gYBH

Peter,

Wow, Kimono Labs is an incredibly powerful and easy to use tool! Thanks!

I am going to try to create a CSV file based on my custom Finviz screening criteria, since it passes those parameters in the URL.

After that, I need to learn how to use Fetcher and see if I can get a custom universe based on my Finviz screen that was downloaded by Kimono.

Thanks again!

share the algo with me then I can help and learn from your criteria. I can dream fetcher by now.....

We're working on making this type of filtering possible in Quantopian. From a high level, you'll be able to scan all tradeable securities at the beginning of the trading day and filter them on the basis of price, volume, corporate fundamental data, or any other supported data source.

I think the workarounds here are interesting, and I hope we can make them obsolete =)

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Right now it is possible to do your own daily ranking if you use the "set_universe " function. You will be restricted to some percentile of the dollarVolumeUniverse as of now, but it can be done.

This algo ranks the upper percentile of the dollarVolumeUniverse based on the price change since the open at 30 minutes into the day, it buys the gainers and sells the losers. It doesn't look terrible, but commissions and slippage are 0 in this backtest.

Dan, Thanks for that info. I agree that screen scraping Finfiz is only a temporary patch, and not a long-term solution to the problem. I am very confident in Q's ability to add more features as time goes by.

Regarding the specific improvements you mentioned, do you think we can identify the previous day's top gainers and losers? "Filtering on price" might not provide that, if the filter just selects a price range based on closing prices. (i.e. $1.00 < closing price > $10.00).

David, Thanks for your example; I am going to use some of that code to help me get started. I look forward to the next increase of universe size limit!

Perhaps the future limit could be based on (history days * number of stocks)? This will allow me to use (8,000 stocks * 2 days of history) = 16,000 units, compared to the same processing of (500 stocks * 32 history days) = 16,000 units. I understand that this might be too simplistic of a model to estimate the impact on processing algorithms.

I saw someone mention on these forums about a possible new feature that will give us the ability to work with a large universe once a day, while the market is closed, using the "before_trading_start" function.

If this is true, I think it is a brilliant idea, because it will allow us to do number crunching with the entire universe, during a time when the server load is low and when the algorithms don't need to complete in 60 seconds or less. During this period, we can select the smaller universe that we want available when the markets open.

I look forward to the future!