Skip to content

Commit a229978

Browse files
Rename argument for _calculate_trades, since shares is more informative for the purpose of the function.
1 parent 9399a6d commit a229978

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backtest_bay/plot/plot_portfolio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ def _calculate_years(stock):
6060
return years
6161

6262

63-
def _calculate_trades(stock):
63+
def _calculate_trades(shares):
6464
"""Calculate the number of trades by counting changes in the shares held."""
65-
trades = stock.diff().ne(0).sum()
65+
trades = shares.diff().ne(0).sum()
6666
return trades
6767

6868

0 commit comments

Comments
 (0)