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:
Eddie Hebert
2013-05-06 16:26:38 -04:00
parent 1752f78447
commit 6afc85c17d
+1 -1
View File
@@ -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.