Updated demo notebook to work with the recent changes

This commit is contained in:
Javier Rodríguez Chatruc
2020-01-07 14:38:11 -03:00
parent 7cf17ec307
commit bc88387dc5
2 changed files with 732 additions and 505 deletions
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -207,9 +207,8 @@ class Strategy:
cost = sum(leg["cost"] for leg in dfs)
# Put qty of contracts to buy/sell in ['totals']['qty']
qty = np.floor(self.initial_capital / cost)
qty = self.initial_capital // cost
qty = np.abs(qty)
# qty = qty.astype(int)
totals = pd.DataFrame.from_dict({"cost": cost, "qty": qty, "date": date})
totals.columns = pd.MultiIndex.from_product([["totals"], totals.columns])