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.

Clone Algorithm
Backtest from to with initial capital
Total Returns
Information Ratio
Benchmark Returns
Max Drawdown
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 512f89dccc862908bbc01f3d
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.
1 response

Simply awesome, thanks Dan!