From e4ab7cce204e26dd29daabcf9bcd1fe269be77fc Mon Sep 17 00:00:00 2001 From: Flipper1509 Date: Sun, 20 Aug 2023 15:43:36 +0000 Subject: [PATCH] change to get all positions for pyfolio --- backtrader/analyzers/pyfolio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtrader/analyzers/pyfolio.py b/backtrader/analyzers/pyfolio.py index d15bc9d04..0162d8df3 100644 --- a/backtrader/analyzers/pyfolio.py +++ b/backtrader/analyzers/pyfolio.py @@ -127,7 +127,7 @@ def get_pf_items(self): # # Positions pss = self.rets['positions'] - ps = [[k] + v[-2:] for k, v in iteritems(pss)] + ps = [[k] + v[:] for k, v in iteritems(pss)] cols = ps.pop(0) # headers are in the first entry positions = DF.from_records(ps, index=cols[0], columns=cols) positions.index = pandas.to_datetime(positions.index)