From 381df3534d5723ebe24cde856eb58b6dd4e6b765 Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Fri, 10 May 2013 12:00:43 -0400 Subject: [PATCH] MAINT: Ensure we're not setting the blotter to None. --- zipline/algorithm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 64d552fc..e4135265 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -120,7 +120,9 @@ class TradingAlgorithm(object): if self.sim_params: self.sim_params.data_frequency = self.data_frequency - self.blotter = kwargs.pop('blotter', Blotter()) + self.blotter = kwargs.pop('blotter', None) + if not self.blotter: + self.blotter = Blotter() # an algorithm subclass needs to set initialized to True when # it is fully initialized.