I think I understand what's going on, but I'm not personally enough of a Python whiz to tell you the solution.
I turned the debugger on for the line
return my_stocks
And then I stepped through from there. The debugger logs the return, which starts like this:
Returning from function with:
set([0, Equity(10240, symbol='OSBC', asset_name='OLD SECOND BANCORP INC', exchange='NASDAQ GLOBAL SELECT MARKET', start_date=Timestamp('1993-11-16 00:00:00+0000', tz='UTC'), end_date=Timestamp('2015-07-21 00:00:00+0000', tz='UTC'), first_traded=None), Equity(45960,
I believe the problem is that first entry in the set is '0' and that is blowing up the algo.
What you've got here is a repro case for a bug that I've seen in the logs, but not known what causes it. It was on my list of things to get fixed soon, and this will help fix it faster!
Until then, you need to modify your my_universe() function to remove that 0 from the set, and I bet it will work.
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.