@andi I just realized that the second column is already the actual portfolio value (i.e cash + positions).
Best posts made by andi
Latest posts made by andi
RE: How to create pyfolio round trip tearsheet?
When you get your dictionary to this stage, you need the datetime key and the second column, which is value, to send to quantstats.
Is there any fundamental reason why you ignore the first column (which is cash, if I understand it correctly)?
I suggest to add the cash value and the positions value in order to obtain the overall portfolio value.
backtrader2 on pypi
As far as I understand it, the original backtrader repo at https://github.com/mementum/backtrader isn't updated anymore. Updates/Fixes now take place at https://github.com/backtrader2/backtrader. Is this understanding still correct?
If so, I am wondering if the backtrader2 repo can be made available at pypi.org? The reason is that I am working behind a corporate firewall that doesn't allow for installations directly from Github. However, it is possible for me to install pypi packages.
RE: Portfolio strategies
@run-out Sounds good to me. However, just to clearify a point with respect to "portfolio evaluation": I definitely need performance reports/plots on an aggregated portfolio level. Is this possible or is the performance report only available for individual securities?
Also, just out of curiosity, I already have a pandas dataframe with trading signals as per close in the form of +1 / -1 for long and short signals. Would it be possible to use this dataframe?
I am considering to give backtrader a try. However, before diving deep into the code, I've got a general question regarding portfolio strategies.
Let's assume I have a pandas dataframe in wide format, i.e. columns representing individual assets and rows representing returns at a given time.
I am looking for setting up a relative momentum strategy. Therefore, for every row, I need to compute a ranking. The top
Nassets will then be bought while the worst
Nassets will be sold short.
At the end of the day, I am interested in the overall portfolio performance. Is a "portfolio strategy" like this possible to implement using backtrader or is backtrader more suited to analyze individual asset strategies?