From 0dbdf5b1d3d829254c80798ad3b8d32fee7875a3 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Thu, 11 Jul 2013 15:44:38 -0400 Subject: [PATCH] BUG: Fix duplicated values for multi-stock TALib transform. A multi-stock TALib transform was returning the same value for all stocks, specifically the value for the first stock in the panel. Index into the datapanel using `sid` instead of using the `[0:]` index which was used when only supporting one sid. --- zipline/transforms/ta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/transforms/ta.py b/zipline/transforms/ta.py index 82e85e72..70a01808 100644 --- a/zipline/transforms/ta.py +++ b/zipline/transforms/ta.py @@ -38,7 +38,7 @@ def zipline_wrapper(talib_fn, key_map, data): for talib_key, zipline_key in key_map.iteritems(): # if zipline_key is found, add it to talib_data if zipline_key in data: - talib_data[talib_key] = data[zipline_key].values[:, 0] + talib_data[talib_key] = data[zipline_key][sid].values # if zipline_key is not found and not required, add zeros elif talib_key not in req_inputs: talib_data[talib_key] = np.zeros(data.shape[1])