mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-29 11:18:20 +08:00
BUG: Capital change deltas rely on cash, not portfolio_value
The value of holdings is irrelevant when altering the capital base of the current perf period.
This commit is contained in:
@@ -858,7 +858,7 @@ class TradingAlgorithm(object):
|
||||
if capital_change['type'] == 'target':
|
||||
target = capital_change['value']
|
||||
capital_change_amount = target - \
|
||||
self.updated_portfolio().portfolio_value
|
||||
self.updated_portfolio().cash
|
||||
self.portfolio_needs_update = True
|
||||
|
||||
log.info('Processing capital change to target %s at %s. Capital '
|
||||
|
||||
Reference in New Issue
Block a user