Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
New Feature! set_universe Is Live

We're happy to share a new feature with you - set_universe.

set_universe is important because it helps you remove yet another potential source of bias from your algorithm. Up until now, Quantopian has only supported testing up to ten, hand-picked securities. The risk is that your ten stocks might not be a valid sample, and you can learn the wrong lesson from your testing. With set_universe, you can eliminate the bias of your stock picks and replace them with a cross-section of stocks based on their ranked dollarvolume. Quantopian already helps you avoid risks like survivorship bias and look-ahead bias. Now we're helping your remove stock picking bias, too.

There is a much longer description in our help documentation, but here is a short version to get you started. And of course, you can clone the sample algorithm below.

def initialize(context):  
    set_universe(universe.DollarVolumeUniverse(floor_percentile=98.0, ceiling_percentile=100.0))  

The paint is still wet on this feature; as you find bugs, missing documentation, or more general suggestions, please let us know. You can either reply to this thread or drop us a note at [email protected]. As we've done our internal testing we've found this feature is particularly good at finding problems with our data source. We found several missing dividends and a few other odds and ends, and I expect there are still a few more waiting to be found. Please let us know.

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.

2 responses

Simply awesome, thanks Dan!

Can we get all of the stocks available in Quantopian using: set_universe(universe.DollarVolumeUniverse(floor_percentile=1.0, ceiling_percentile=100.0)) ?