Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Question on "pyfolio"

I stumbled across "pyfolio" as a possible cross check on the performance of my model.
The model is written in python and C++ and produces entries, exits and of course emerging PNL.
How easy is it to use the "pyfolio" library to ingest a csv file of PNL for the model and output statistics and
what I think you call tear sheets as a cross check on the information that I am calculating.

Because my model is tick based, in order to calculate intraday MAXDD, I have fairly large files.
Can "pyfolio" handle the importing of tick?

Thanks

4 responses

The common ways to use pyfolio

"How easy" kinda depends on adept you are using Python libraries. It's super-easy if you're familiar, and probably a tough slog if you don't know anything about Python. That said, pyfolio is designed to work on any returns stream; it doesn't matter how you created it.

The file limit for our research environment is about 30MB.

We mostly use it for looking at daily returns. I'm don't know how it will work under the hood on tick data.

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.

Hi Dan,

Thanks for your reply. As a follow-up question, are there any restrictions on using the program with respect to distribution of the output pages.
In other words, am I free to produce graphs and tear sheets from the program and share them as I wish?

Thanks,
Elliott

You're welcome to use Pyfolio and distribute your output across any channel. Simply include the credit to Quantopian. We're looking forward to seeing your work!

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.

Thanks Alisa.

Trying to figure out if the library will work with external trade data. My model is written from scratch, modeled in Python so
I can easily output data needed by Pyfolio. I am trying to find documentation on the format needed to import into Pyfolio.

Any help is appreciated. Thanks!

I have trade data that in the following format currently:

Trade Type Num Date Side EntryPrice EntryTime unixEntry ExitPrice ExitTime PNL Unreal Dur Fund

'Trade Stats' 1 '08/30' 'long' 1.12095 '23:44:00' 1440992641 1.12261 '01:11:01' 16.6 -5.1 1.45 10016.6 'Trade Stats' 2 '08/30' 'short' 1.12174 '01:29:00' 1440998941 1.12205 '01:34:41' -3.1 -7.4 0.09 10013.5 'Trade Stats' 3 '08/30' 'short' 1.12289 '02:09:00' 1441001341 1.12318 '02:09:39' -2.9 -4.7 0.01 10010.6 'Trade Stats' 4 '08/30' 'short' 1.12345 '03:29:52' 1441006166 1.12391 '06:16:17' -4.6 -28.1 2.78 10006 'Unrealized Trade Stats' 1 '08/30' 'long' 1.12402 '06:34:05' 1441017241 1.12102 '11:30:01' -30 -43.5 4.93 10006 'Trade Stats' 5 '09/01' 'long' 1.12646 '02:03:01' 1441087381 1.12869 '06:07:01' 22.3 -4.4 4.07 10028.3 'Trade Stats' 6 '09/01' 'short' 1.12842 '06:24:01' 1441103041 1.1274 '09:02:05' 10.2 -48.2 2.63 10038.5