We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9399a6d commit a229978Copy full SHA for a229978
src/backtest_bay/plot/plot_portfolio.py
@@ -60,9 +60,9 @@ def _calculate_years(stock):
60
return years
61
62
63
-def _calculate_trades(stock):
+def _calculate_trades(shares):
64
"""Calculate the number of trades by counting changes in the shares held."""
65
- trades = stock.diff().ne(0).sum()
+ trades = shares.diff().ne(0).sum()
66
return trades
67
68
0 commit comments