mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-02 11:35:24 +08:00
deleting the portfolio object from every event.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user