LOG: Log the dt and amount when each capital change executes

This commit is contained in:
Andrew Liang
2016-05-25 11:58:05 -04:00
parent d34b1b9224
commit fb9e1abb92
+8 -5
View File
@@ -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: