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:
John Ricklefs
2016-09-05 14:12:04 -04:00
committed by GitHub
parent 9a301dc59b
commit c09f7ab04c
2 changed files with 11 additions and 11 deletions
+2 -1
View File
@@ -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 '