Back

Piotroski F-Score Fundamental Filter / Value Screen

I could only find an example of this written in C#, so I figured it would be helpful to others to share a Python implementation of a custom scoring model using fundamental data. This is just an example but I threw in the 5 year normalized PE ratio as the final ranking metric, and used a FScore value of greater than 6 to filter down from the course universe. You can read the original white paper here:

http://www.chicagobooth.edu/~/media/FE874EE65F624AAEBD0166B1974FD74D.pdf

Enjoy,

Aaron Gilman

Update Backtest








Thank you so much Aaron for making the Python implementation available. This is indeed a seminal paper which seems to pass the test of time!

0

You are welcome! I also have Altman Z Score and Beneish M Score (more beneficial for helping to filter out companies with high probability of bankruptcy/ruin) that I will share once I clean them up a bit.

0

Thanks for this Aaron. Would also be interested in the Z-Score.

0

Lexx7,

Here you go:

https://www.quantconnect.com/forum/discussion/3239/altman-z-score-in-python
1

How to limited this strategy Leverage under 100% ?

0

Hi,
I am new for this forum & thanks for your post

0

DEVON,

I actually ran into that problem repeatedly so I started tracking the Leverage within the algorithms using the Charting API (I left that part out in this sample code) and found that Leverage never goes above 1. I emailed support and they said it is a bug within the reports that they will fix. Not sure why it occurs as it is only with algorithms that use CourseSelection and FineSelection for the Universe screening. I added it to this backtest for you to see, just click on the strategy info chart button to plot it during the backtest. You can see it never goes above 1.

Thanks,

Aaron

0


Aaron,

Thanks you kindly share this strategy and solve my issue.

Best Regard

0

What is the purpose of flag1, flag2, and flag3 and what is the logic behind it?

0

Jon,

It was in one of the example algos I started using initially (the coursefinecomboalgorithm) and it is so the Coarse and Fine Selection functions only run when they are scheduled, instead of daily like they are by default. The rebalance function is called monthly, which assigns a value to 1 to flag 1, so then the Course Selection runs, followed by Fine Selection, etc. Hope that makes sense.

Thanks,
Aaron

0

Thank you so much Aaron for making the Python implementation available. This is indeed a seminal paper which seems to pass the test of time!

0

Does anyone know why line 29 of the above backtest 'SecurityChanges.None' has a syntax error?

2

Jonathan -

Try changing line to:

self.changes = None

you will also need to fix lines 

90 -                 if self.changes == None: return

99 -                 self.changes = None;

 

My build succeeds, but stuill working on backtest...

2

Hi David

Thanks for your help - as you say the build works but the backtest doesn't. I will look into it and let you know if I figure it out.

Thanks

0

For those looking for the answer. Change all the self._changes = SecurityChanges.None to self._changes = None

1

Update Backtest





0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed