-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
@shaunpatterson
Description
Expected Behavior
Start with 1000ドル
Buy 100ドル of stock
self._broker._cash should be 900ドル.
Sell 150ドル of stock
self._broker._cash should be 1050ドル
Actual Behavior
Start with 1000ドル
Buy 100ドル of stock
self._broker._cash doesn't change
Sell 150ドル of stock
self._broker._cash is now 1050ドル (cash += closed_trade.pl)
I don't understand this behavior. The variable is named cash, but it's not really the current cash value.
If you want to make trades based on your actual available cash, self._broker.margin_available seems to be what you want... but that seems strange.
Am I missing something here?