deleting the portfolio object from every event.

This commit is contained in:
fawce
2013-02-05 21:41:15 -05:00
committed by Eddie Hebert
parent 983f3fab30
commit 372a714eb8
+8
View File
@@ -256,6 +256,14 @@ class AlgorithmSimulator(object):
"""
# Update our portfolio.
self.algo.set_portfolio(event.portfolio)
# the portfolio is modified by each event passed into the
# performance tracker (prices and amounts can change).
# Performance tracker sends back an up-to-date portfolio
# with each event. However, we provide the portfolio to
# the algorithm via a setter method, rather than as part
# of the event data sent to handle_data. To avoid
# confusion, we remove it from the event here.
del event.portfolio
# Update our knowledge of this event's sid
sid_data = self.universe[event.sid]