From d901a12e93f588e766b627b525d1dd793ef56773 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Tue, 9 Jul 2013 12:45:56 -0400 Subject: [PATCH] BUG: Prevent algorithm init failure due to missing fill_delay. Provide a default value for data_frequency, choosing 'daily', so that the fill_delay is set even when a data_frequency value is not in kwargs. This does open up a place for disjointedness if the sim_params that is passed to run does not match the data_frequency set during initialize. --- zipline/algorithm.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 270985b1..434aba44 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -109,10 +109,7 @@ class TradingAlgorithm(object): self.slippage = VolumeShareSlippage() self.commission = PerShare() - if 'data_frequency' in kwargs: - self.set_data_frequency(kwargs.pop('data_frequency')) - else: - self.data_frequency = None + self.set_data_frequency(kwargs.pop('data_frequency', 'daily')) # Override annualizer if set if 'annualizer' in kwargs: