BUG: Fix datetime when a benchmark is the only datum in a bar.

The datetime was only being set while updating the universe with the
bar's trade events.

Now that benchmarks are used as a clock, it is possible to have
benchmarks without having trade bars during that dt, so the datetime
should be updated via benchmark as well.
This commit is contained in:
Eddie Hebert
2013-05-09 03:50:45 -04:00
parent b33243da63
commit a12e907f55
+1
View File
@@ -126,6 +126,7 @@ class AlgorithmSimulator(object):
self.update_universe(event)
updated = True
if event.type == DATASOURCE_TYPE.BENCHMARK:
self.algo.set_datetime(event.dt)
bm_updated = True
txns, orders = self.algo.blotter.process_trade(event)
for data in chain(txns, orders, [event]):