2
$\begingroup$

I am backtesting a strategy and have data generated from the returns of the strategy. Now I need performance metrics like maximum drawdown, Sharpe ratio, Treynor measure etc., I am writing functions individually. I am looking for a library which can generate these metrics taking the returns as input.

$\endgroup$
1
  • 1
    $\begingroup$ pyfolio, alphalens, bt, etc. $\endgroup$
    – Helin
    Commented Aug 20, 2018 at 5:13

3 Answers 3

1
$\begingroup$

Try backtrader at at Backtrader.com. It is a python based open source backtester with great documentation. You can implement analysers as part of your back test and get various performance metrics https://www.backtrader.com/docu/analyzers/analyzers.html?highlight=performance[Analysers][1]. I have used both Quantiacs and Backtrader and found that Quantiacs was limited to functionality required to enter their quant competition, however Backtrader is a full backtesting solution, including optimisisation, broker integration, useful graph output, multiprocessor support and framework that allows great flexibility in making your ideas come to life.

One huge difference is the community support - just take a look for yourself. I posted a question on quantiacs about six months ago and I am still waiting for a response. On backtrader I often post in the evening and have a response by the morning. Good luck with whatever you choose.

$\endgroup$
1
  • $\begingroup$ Yes, based on my review of Quantiacs, they are only interested in finding good strategies for their investors. It is not a truly open and active open source community. $\endgroup$ Commented Sep 28, 2020 at 6:44
3
$\begingroup$

Check out empyrical. This library provides methods for calculating several risk and performance metrics.

pyfolio is also a great tool for visualizing your portfolio's performance over time.

$\endgroup$
1
$\begingroup$

Have you looked at Quantiacs? Their Python toolkit generates a plethora of statistics based on the equity curve. You may want to take a look: www.quantiacs.com/For-Quants/GetStarted.aspx.

$\endgroup$
1
  • $\begingroup$ The link isn't a link and it's broken anyways. Should probably fix that. $\endgroup$
    – Theodore
    Commented Nov 9, 2018 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.