Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
piotroski long/short using pipeline

Hi
i have done my version of the piotroski skore model.
In my code the last year value of fundamental data is 200 bars (days) ago and new shares are calculated with a minus sign (line 65) to check that no new shares has been created from last year.
The stock selection has no filter beside the classic piotroski score an it's limited to 100 stock on the long side and 100 stock on the short side.

So actually the question, is.. why does it perform so bad, do you see some issue in the code or something?...

7 responses

this is the same thing with different code (cloned) and slightly modified to be long / short

how can i understand from this performance if this is a good starting point to build a market neutral strategy?

Thank you very much for putting this up. I have one question

roa[-1] > roa[0])

does this really compare roa from the last year vs roa from the most recent? I thought Piotroski makes you compare roa from the most recent vs 12 months ago roa.

If it is this easy to get historical fundamental, why are staffs in quantopian keep saying that historical fundamental is not there yet, but on the short list.

finally can you get both quarterly as well as annual fundamental from pipline? How can you command it to get each?
Thank you

Hi Ujae,
You can get historical fundamentals. For example, you can get a fundamentals field (lets use shares outstanding for example) in pipeline with a window length of 300, and you will get an array with the last 300 days of shares outstanding. This will reflect what was reported, and then it will be forward filled. That works, and is easy.

What is hard, is if you just want the last 4 quarterly reported values on the day they were reported. This is what is on the short list and we need to make easier to get it.

Hope that makes sense.

KR

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.

Karen,
Thank you for the information. That makes sense. So what we are getting in the fundamental is annual data or quarterly? I am guessing that it is quarterly fundamental data (these quarterly fundamentals are season biased you know). Do you have a sample code what would show how to pull annual data? Or is it not possible.

With Morningstar fundamentals, we currently only surface quarterly metrics or metrics that are updated daily (like market cap, enterprise value and many per-share ratios). Definitely on our roadmap but not an imminent project.

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.

Giuseppe,
Are you still working with this algorithm? I found this post while searching to see if there were any already made pipelines with the Piotroski score.
It doesn't look like any has answered your original question. I would guess the poor performance comes from a misapplication of the principle. Piotroski developed his score to assess the financial strength firms with high book-to-market ratios (Piotroski 2000). It was intended to enhance the already positive performance of value stocks. You might want to try modifying your algorithm to sort on value and see if the results are improved.

Here is a version with a few quick changes I changed market cap from being a sorting factor to a filter and then sorted on price to book ratio instead.

...There is nothing quick about running the backtests, though. It probably needs to be updated to fully take advantage of the new "Q2" features.