From fb9e1abb920d4b5b77b9169c37d4e0dec09d5d1d Mon Sep 17 00:00:00 2001 From: Andrew Liang Date: Wed, 25 May 2016 11:58:05 -0400 Subject: [PATCH] LOG: Log the dt and amount when each capital change executes --- zipline/gens/tradesimulation.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zipline/gens/tradesimulation.py b/zipline/gens/tradesimulation.py index 138a049f..b13b1ef8 100644 --- a/zipline/gens/tradesimulation.py +++ b/zipline/gens/tradesimulation.py @@ -153,10 +153,10 @@ class AlgorithmSimulator(object): if midnight_dt in algo.capital_changes: # process any capital changes that came overnight - perf_tracker.process_capital_changes( - algo.capital_changes[midnight_dt], - is_interday=True - ) + change = algo.capital_changes[midnight_dt] + log.info('Processing capital change of %s at %s' % + (change, midnight_dt)) + perf_tracker.process_capital_changes(change, is_interday=True) # Get the positions before updating the date so that prices are # fetched for trading close instead of midnight @@ -218,8 +218,11 @@ class AlgorithmSimulator(object): # process any capital changes that came between the last # and current minutes + change = algo.capital_changes[dt] + log.info('Processing capital change of %s at %s' % + (change, dt)) algo.perf_tracker.process_capital_changes( - algo.capital_changes[dt], + change, is_interday=False ) else: