From 5d76c0b8a448e29edd19464b308d0f884601012f Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Thu, 27 Jun 2013 19:12:01 -0400 Subject: [PATCH] ENH: Remove need to pass sid to TALib transform constructor. Now that BatchTransforms use RollingPanels under the hood, passing an sid is no longer needed, passing the data will to handle_data will suffice. --- tests/test_transforms.py | 4 ++-- zipline/transforms/ta.py | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/test_transforms.py b/tests/test_transforms.py index 7564a778..7d3b7aa9 100644 --- a/tests/test_transforms.py +++ b/tests/test_transforms.py @@ -344,8 +344,8 @@ class TestTALIB(TestCase): # factory.create_test_panel_ohlc_source(self.sim_params) def test_multiple_talib_with_args(self): - zipline_transforms = [ta.MA(0, window_length=10), - ta.MA(0, window_length=25)] + zipline_transforms = [ta.MA(window_length=10), + ta.MA(window_length=25)] talib_fn = talib.abstract.MA algo = TALIBAlgorithm(talib=zipline_transforms) algo.run(self.source) diff --git a/zipline/transforms/ta.py b/zipline/transforms/ta.py index 16d6a053..4f0fb5eb 100644 --- a/zipline/transforms/ta.py +++ b/zipline/transforms/ta.py @@ -56,8 +56,7 @@ def make_transform(talib_fn, name): -------- A moving average of a data column called 'Oil' with timeperiod 5, - for sid 'XYZ': - talib.transforms.ta.MA('XYZ', close='Oil', timeperiod=5) + talib.transforms.ta.MA(close='Oil', timeperiod=5) The user could find the default arguments and mappings by calling: help(zipline.transforms.ta.MA) @@ -66,8 +65,6 @@ def make_transform(talib_fn, name): Arguments --------- - sid : zipline sid - open : string, default 'open' high : string, default 'high' low : string, default 'low' @@ -83,7 +80,6 @@ def make_transform(talib_fn, name): """ def __init__(self, - sid, close='price', open='open', high='high', @@ -160,7 +156,6 @@ def make_transform(talib_fn, name): super(TALibTransform, self).__init__( func=zipline_wrapper, - sids=sid, refresh_period=refresh_period, window_length=max(1, self.lookback + 1))