From 3a5ccf060544b5e6b8a6795c99f3fcf82f638bf4 Mon Sep 17 00:00:00 2001 From: Neil Murphy Date: Thu, 16 Dec 2021 09:13:02 -0500 Subject: [PATCH] Change unspent money to cash. --- lumibot/strategies/examples/fast_trading.py | 4 ++-- lumibot/strategies/examples/intraday_momentum.py | 4 ++-- options_tutorial.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lumibot/strategies/examples/fast_trading.py b/lumibot/strategies/examples/fast_trading.py index 53df3820..e6037180 100644 --- a/lumibot/strategies/examples/fast_trading.py +++ b/lumibot/strategies/examples/fast_trading.py @@ -113,7 +113,7 @@ def trace_stats(self, context, snapshot_before): """ # Get the values of all our variables from the last iteration row = { - "old_unspent_money": snapshot_before.get("unspent_money"), + "old_cash": snapshot_before.get("cash"), "old_portfolio_value": snapshot_before.get("portfolio_value"), } @@ -126,7 +126,7 @@ def trace_stats(self, context, snapshot_before): ) # Add all of our values to the row in the CSV file. These automatically get - # added to portfolio_value, unspent_money and return + # added to portfolio_value, cash and return return row def before_market_closes(self): diff --git a/lumibot/strategies/examples/intraday_momentum.py b/lumibot/strategies/examples/intraday_momentum.py index 80c030d3..48adb45f 100644 --- a/lumibot/strategies/examples/intraday_momentum.py +++ b/lumibot/strategies/examples/intraday_momentum.py @@ -87,7 +87,7 @@ def trace_stats(self, context, snapshot_before): row = { "old_best_asset": snapshot_before.get("asset"), "old_asset_quantity": snapshot_before.get("quantity"), - "old_unspent_money": snapshot_before.get("unspent_money"), + "old_cash": snapshot_before.get("cash"), "old_portfolio_value": snapshot_before.get("portfolio_value"), "new_best_asset": self.asset, "new_asset_quantity": self.quantity, @@ -104,7 +104,7 @@ def trace_stats(self, context, snapshot_before): row[f"{symbol}_{key}"] = item[key] # Add all of our values to the row in the CSV file. These automatically get - # added to portfolio_value, unspent_money and return + # added to portfolio_value, cash and return return row # =============Helper methods==================== diff --git a/options_tutorial.md b/options_tutorial.md index d8a892d7..a1d0fed9 100644 --- a/options_tutorial.md +++ b/options_tutorial.md @@ -212,7 +212,7 @@ In the strangle example, `cash`, `value` and `positions` are set. These will be orders are issued throughout the `on_trading_iteration` lifecylce. ``` value = self.portfolio_value -cash = self.unspent_money +cash = self.cash positions = self.get_tracked_positions() ``` `filled_asset` is a list assets for active positions. This allows for easy checking to verify if