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.
This commit is contained in:
Eddie Hebert
2013-07-11 15:44:38 -04:00
parent fa845cbf03
commit 0dbdf5b1d3
+1 -1
View File
@@ -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])