I saw in one of the earlier posts the strategy results are stored in dataframe. If this is available one can easily create the pyfolio tearsheet as follows:
1. Install pyfolio using the command: pip install pyfolio
Then in your note book import it as follows:
Code:
import pyfolio as pf
%matplotlib inline
# silence warnings
import warnings
warnings.filterwarnings('ignore')
pf.create_full_tear_sheet(strategy_returns, benchmark_rets=nifty50_retruns)
#where strategy_returns is a series of daily return indexed by date
# nifty50_returns is a series of daily return of your benchmark in this case nifty50.
#benchmark_rets can be skipped if not required.
However I got a slightly different result than my stats, have not debugged it.
View attachment 28935
View attachment 28936