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.
This commit is contained in:
Eddie Hebert
2013-06-27 19:12:01 -04:00
parent 832a39706e
commit 5d76c0b8a4
2 changed files with 3 additions and 8 deletions
+2 -2
View File
@@ -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)
+1 -6
View File
@@ -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))