mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-07 16:15:18 +08:00
Revert "BUG: Capital change deltas rely on cash, not portfolio_value" (#1470)
This reverts commit 5b1aa5ec55.
The paradigm is: we're calculating a new capital base for the
performance period. We are therefore using the total
portfolio_value, not just the cash, to calculate the
difference from the specified target as the algorithm
has meaningful holdings.
This commit is contained in:
@@ -862,7 +862,8 @@ class TradingAlgorithm(object):
|
||||
if capital_change['type'] == 'target':
|
||||
target = capital_change['value']
|
||||
capital_change_amount = target - \
|
||||
(self.updated_portfolio().cash - portfolio_value_adjustment)
|
||||
(self.updated_portfolio().portfolio_value -
|
||||
portfolio_value_adjustment)
|
||||
self.portfolio_needs_update = True
|
||||
|
||||
log.info('Processing capital change to target %s at %s. Capital '
|
||||
|
||||
Reference in New Issue
Block a user