Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
research notebook w/ error

I'm getting an error that I think is related to the default setting of handle_missing in the get_pricing function. I can't find complete documentation on get_pricing. How should I set the options to ignore symbols that are not available in the data base? And how can I get a list of the ones that were ignored, so I can figure out why?

Thanks,

Grant

5 responses

Hi - If you hit tab, the function name will autocomplete. If you hit shift-tab a pop-up will appear with the full docstring of the function. It is widely debated which is more awesome :). Try hitting shift-tab several times in a row, it will cycle through various display options.

It appears that we have a bug, but both the symbols function and the get_pricing function take a parameter for handling missing symbols:

handle_missing : {'raise', 'log', 'ignore'}

    String specifying how to handle unmatched securities.  
    Defaults to 'log'.  

Right now, it seems that the parameter is being ignored. I'll file a ticket.

thanks,
fawce

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.

Thanks Fawce,

So there is no work-around? At this point, I'm just playing around, so I can shorten the list of securities to ones that don't fail, but if there is a work-around, why wait for the fix. I'd like to see if I can do a simple screen on ~ 2000 securities.

Grant

Here's the work-around I came up with:

m = {}  
for s in symbols:  
    try:  
        data = get_pricing(s,start_date='2013-03-20',end_date='2015-03-20',fields='price',frequency='minute')  
        m[s] = data.mean()  
    except:  
        pass  

It is presently churning away, but I have no way to know what it's doing. When a cell is running, is there a way to send output to a separate window? If so, then I could monitor the progress (e.g. see the count of the number of securities processed).

The code above worked, and I was able to analyze 1796 securities (although it looks like there are a few nan's). Cool. How would I post an updated notebook to this thread? --Grant

I think (for now) you need to start a new thread.

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.