Skip to content

Commit edbc9b5

Browse files
authored
Merge pull request pmorissette#383 from MDDietz1/master
Prevent security_weights from overwriting values history
2 parents 6d08931 + d21071d commit edbc9b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bt/backtest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ def security_weights(self):
306306
for m in self.strategy.members:
307307
if isinstance(m, bt.core.SecurityBase):
308308
if self.strategy.fixed_income:
309-
m_values = m.notional_values
309+
m_values = m.notional_values.copy()
310310
else:
311-
m_values = m.values
311+
m_values = m.values.copy()
312312
if m.name in vals:
313313
vals[m.name] += m_values
314314
else:

0 commit comments

Comments
 (0)