mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 12:51:33 +08:00
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:
@@ -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]):
|
||||
|
||||
Reference in New Issue
Block a user