@anshul96go
To get the actual statistics you currently have to calculate them like so:
And if you really need them as xls file you can do:
stats.to_pandas().to_excel('stats.xls') # I got a ModuleNotFoundError the first time - pip install did the trick.Allthough I can't recommend xls because at least LibreOffice becomes very slow / unresponsive when handling such a file.
Getting the statistics after a backtest could be a little simpler, which brings me to a feature request:
@support
Do you think you could add a parameter to the backtester which makes it return the statistics? They get calculated anyway by default, but we only see a truncated printout or the plots and can't use them for further analysis.
.
In my local environment I did it like this in qnt.backtester.py:
This might not be the most elegant solution but you get the idea.
Now I can get the statistics immediately after the backtest with
and can do further analysis.
For instance, I started to calculate the correlations between my strategies to avoid uploading more of the same to the contest.
It would be nice to have this feature in a future version, so I don't have to mess with the backtester after each update 😉
Best regards