Balance now has stock qty disaggregated by symbol

This commit is contained in:
Javier Rodríguez Chatruc
2020-03-20 11:53:14 -03:00
parent 63e307b0fa
commit 0569f34e1f
+4
View File
@@ -304,6 +304,10 @@ class Backtest:
add['puts capital'] = puts_value
add['stocks qty'] = self._stocks_inventory['qty'].sum()
for _index, row in self._stocks_inventory.iterrows():
symbol = row['symbol']
add[symbol + ' qty'] = row['qty']
# sort=False means we're assuming the updates are done in chronological order, i.e,
# the dates in add are the immediate successors to the ones at the end of self.balance.
# Pass sort=True to ensure self.balance is always sorted chronologically if needed.