mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 17:42:42 +08:00
BUG: Fix missing and delayed transaction last_sale_price's.
Critical that trade events be last, so that the perf tracker's position information be updated with both the transaction and the trade for last_sale. Without, the first transaction would be recorded with a last_sale of 0. With @fawce
This commit is contained in:
@@ -128,7 +128,7 @@ class AlgorithmSimulator(object):
|
||||
if event.type == DATASOURCE_TYPE.BENCHMARK:
|
||||
bm_updated = True
|
||||
txns, orders = self.algo.blotter.process_trade(event)
|
||||
for data in chain([event], txns, orders):
|
||||
for data in chain(txns, orders, [event]):
|
||||
self.algo.perf_tracker.process_event(data)
|
||||
|
||||
# Update our portfolio.
|
||||
|
||||
Reference in New Issue
Block a user