backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

Allow for cash to be deposited or withdrawn during a backtest

Open AdiSai opened this issue 2 years ago • 1 comments

AdiSai avatar Mar 02 '23 04:03 AdiSai

Sorry for the late turnaround. I'm not yet decided, but certainly not strongly opposed to this change. However, in the style of the rest of this library, I'd prefer Strategy.cash being a @property.

Implementing this would prevent people from accessing self._broker._cash as in https://github.com/kernc/backtesting.py/issues/493, https://github.com/kernc/backtesting.py/issues/340, https://github.com/kernc/backtesting.py/issues/124, ...

kernc avatar Apr 01 '23 13:04 kernc