Hi,
I am trying to filter stocks belonging to energy sector from Q1500US() in research platform but it does not seem to work. Could someone please advise how to filter them?
Best regards,
Pravin
Hi,
I am trying to filter stocks belonging to energy sector from Q1500US() in research platform but it does not seem to work. Could someone please advise how to filter them?
Best regards,
Pravin
Hi Pravin,
From what I can tell, the sector filter is working. Can you give me some more detail on what you are expecting to see? Attached is a notebook with the sector added to the pipeline as a column.
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.
Ah my bad. I was hoping that the functionality is similar to algorithms so that I can use something like this to screen stocks:
pipe.set_screen(Q500US() & sector_filter)
But that does not filter.
Hi Pravin,
That actually does filter. In my version of your notebook, I didn't change anything other than the added 'sector' column which was done just for display purposes. Can you show me an example where you are getting an unexpected result?
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.
Please find attached. I get too many stocks when I try to filter energy stocks. I was hoping to find an intersection of Q500US() and Sector().eq(309).
The resulting shape of (1143,)
in that notebook is coming from the fact that the pipeline was run for 22 days. You get ~50 stocks per day * the 20 days. If you want to look at the output for a single day, you can either run the pipeline for one day, or get the result for one of the days from your resulting DataFrame:
stocks.index[stocks.index.get_level_values(0) == '2014-01-02'].get_level_values(1)
Does this help?
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.