1
$\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
    $\begingroup$ pyfolio, alphalens, bt, etc. $\endgroup$ – Helin Aug 20 '18 at 5:13
1
$\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$
  • $\begingroup$ The link isn't a link and it's broken anyways. Should probably fix that. $\endgroup$ – Theodore Weld Nov 9 '18 at 17:42
0
$\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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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