Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
set_universe bug with minute data?

Using the example set_universe code from https://www.quantopian.com/help#ide-universe hangs the backtester that runs after pressing Ctrl-b to "Build": I see "Backtesting: 0%" and "Waiting for logs" but nothing's happening. If I add logging before and after set universe, I never see the log output that's supposed to be generated after the set_universe call (in the below example, I see "initialize" in the log output but not "done initialize"). Am I missing something obvious?

def initialize(context):  
    log.info("initialize")  
    set_universe(universe.DollarVolumeUniverse(floor_percentile=99.6, ceiling_percentile=100.0))  
    log.info("done initialize")  
def handle_data(context, data):  
    for sid in data:  
        log.info(str(sid))

If I try to run a full backtest, it hangs at "Initializing..." status. If I click on "Log output", I see the same "initialize" but not "done initialize".

6 responses

Here's the backtest.

Pallas, there's something about that daterange that is making it barf. If you change the daterange it works. (I changed the end date to 2003).

Obviously that's a lousy failure mode and I'll write up a bug to fix that.

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.

Hello Dan,

This is pedantic but logs from within 'initialize' show as e,g.:

1970-01-01initialize:2INFOinitialize  

Would it be nicer to show the current date or no date at all?

Regards,

Peter

Hi Peter - that was intentional because the initialize code is so special. We don't want to use current date because that will be confusing with live trading. Perhaps we could use no date, but having a log line without any timestamp also seems weird. Perhaps there is another solution.

I'm having the same problem. When I click 'build algorithm' it just hangs. Can it be to do with any settings of my browser? I tried the simplest demo and still happening (see attached).

Weird, when I attach it here, it shows results.. In my developer window it's still 'Backtesting..' at 0%.