Back to Community
Why are the two lists different? pipeline Q500US vs fundamentals.

Newbie question. I have a profitable algorithm using fundamentals API. But when I switch to pipeline the profits disappear. I tried to check if they both return same securities and am having trouble. Could someone help identify why both APIs return different securities?

Loading notebook preview...
Notebook previews are currently unavailable.
2 responses

Hi Pravin,

I took a look and I think your get_fundamentals filters are a little bit different than what's used in the Q500US. Here's the definition of the Q500US from the help docs:

A default universe containing approximately 500 US equities each day.

Constituents are chosen at the start of each calendar month by selecting the top 500 “tradeable” stocks by 200-day average dollar volume, capped at 30% of equities allocated to any single sector

A stock is considered “tradeable” if it meets the following criteria:

The stock must be the primary share class for its company.  
The company issuing the stock must have known market capitalization.  
The stock must not be a depository receipt.  
The stock must not be traded over the counter (OTC).  
The stock must not be for a limited partnership.  
The stock must have a known previous-day close price.  
The stock must have had nonzero volume on the previous trading day.  

Note the dollar volume and sector balancing components of the definition.

Also, in the cell where you are sorting newstyle and getting the stocks in it, sort_values is not sorting the DataFrame in place. You can sort it in place by passing an inplace=True argument to sort_values. I did it a bit differently to show the similarities/differences between the two universe setting approaches.

I hope this helps.

Loading notebook preview...
Notebook previews are currently unavailable.

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 Jamie.