diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 625459df..839812ff 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -283,9 +283,13 @@ class TradingAlgorithm(object): then set self.mavg to some value and it will be recorded. """ - if isinstance(names, basestring): + if not isinstance(names, list): names = [names] + for name in names: + if not isinstance(name, basestring): + raise TypeError("record_variables expects only strings") + if self.initialized: raise Exception(MESSAGES.ERRORS.CALL_RECORD_VARIABLES_POST_INIT)