Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Tool for Fundamental Algos in Zipline

I am working on a project that will make it easier to implement value based algorithms in Zipline. The code is @ https://github.com/andrewkittredge/financial_fundamentals, you can pip install it from https://pypi.python.org/pypi/FinancialFundamentals/.

FinancialFundamentals has a couple components. It scrapes the SEC's edgar system to find xbrl filings. Then it parses out accounting metrics, currently it only has EarningsPerShare. It can cache the values in either SQLite or mongodb, SQLite caching works with no configuration.

It can also cache price data downloaded from yahoo so you don't have to hit yahoo every time you run your algorithm. There is a tongue-in-cheek example @ https://github.com/andrewkittredge/financial_fundamentals/blob/master/examples/warren_buffet.py.

I am actively developing the project, I would love feedback and bug-reports. It doesn't integrate with quantopian as of now but I might put up something so you could get accounting metrics using quantopians csv importing feature.

3 responses

Andrew, this looks pretty darn cool. I think you should also post it to the Zipline group - that group will probably be equally excited, and a bit more likely to jump in and help.

I assume you saw the little bit of EDGAR work that Gus did?

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.

It might be useful to look at this as well https://github.com/lukerosiak/pysec

I looked at pysec, the author mentions it was translated from a VB script, which doesn't surprise me, it's also GNU. Snarkiness aside, pysec's XBRL capabilities are far beyond FinancialFundamental's at this point. Getting consistent metrics out of XBRL is not a trivial task, my initial whack at it might be hopelessly naive. Apparently http://www.calcbench.com/ are the pros put you pay for it.

I've reposted this on the zipline group. We'll see if anybody over there thinks markets are weak-form efficient.