Skip to content

Commit

Permalink
Change unspent money to cash.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilsmurphy committed Dec 28, 2021
1 parent 8065b0f commit 3a5ccf0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lumibot/strategies/examples/fast_trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}

Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions lumibot/strategies/examples/intraday_momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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====================
Expand Down
2 changes: 1 addition & 1 deletion options_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a5ccf0

Please sign in to comment.