Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Getting fundamental data for specific securities

From example code I have seen, this is how I can get fundamental data on all matching securities:

fundamental_df = get_fundamentals(  
        query(  
            fundamentals.operation_ratios.roa,  
            fundamentals.valuation_ratios.pe_ratio  
        )  
        .filter(fundamentals.operation_ratios.roa > 0.25)  
        .order_by(fundamentals.valuation_ratios.pe_ratio)  
        .limit(10)  
    )  

How can I limit this to certain specific tickers, e.g. just "MSFT" and "AAPL"

6 responses

Sam,
Check out the docs of the individual fields.

There is symbol and primary_symbol that let you look up by ticker symbol, for example. There is other company reference information you could use as well.

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.

Did you find primary_symbol worked? I tried to filter on that... when I inspected it closer it seems its unicode, not ASCII.

I'm digging into how to access it.

i thought we couldn't run backtest for fundamental algorithms

You can't live trade them. Backtest should work.

Hey rob,

ran the algorithm you posted earlier with the Google ticker, but its showing errors on the backtest. wondering if you could put up the results.

Saif, Not sure what backtest of Rob's you're refering but Google can be complicated in this situation because of the changes in the share class. To see the fundamental data for Google, I use the attached algo where I use the standard_name field.