Back to Community
sector performance notebook

Hello i have done this work that i'd like consider as a starting point to further research based on sector performance related to the benchmark, now before i move (since it's kind of slow in gathering more than 5 years data) do you think there is a more efficient or more pythonic or more panda-friendly way to do this using pipeline?
I want to keep the pipeline approach because i want to put more factors rather then just sectors in the future.

Loading notebook preview...
3 responses

Since i have posted a general isue about efficency and code style, now i brung up a problem: when i produce plots i often have spykes and strange values mabye they depend on company failures.. is there a way i can get rid of these spykes mabye even looking forward in the future prices?

Take a look for example at the values of Apr 2008 o r August 2008 where the industrial sector does not even show up until the end of the graph

Loading notebook preview...

Great stuff! I cloned your notebook and investigates the big downward spikes (the one in Real Estate in April 2008, and the two in Industrials in April and June 2008), and they were cause by delisted securities. The way that I determined this was by looking at significant drops in returns in the dataframe resulting from run_pipeline(). After this, you can either look at the symbols(sid).start_date and symbols(sid).end_date to confirm that those securities were delisted. I added it to your notebook here so you can play around with it!

Loading notebook preview...

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.

hello Jamie thank you for the time to inspect my code!
I have used your NB and i have added In [154]:

delisted_df = myPipe[abs(myPipe['returns']) > (1.5)].unstack()  
delisted = list(delisted_df['returns'].columns.values)  

now the spikes are gone :)

Loading notebook preview...