I'm trying to better understand the @batch_transform decorator and I'm having some trouble.
For example this first test works...
@batch_transform(window_length=20, refresh_period=1)
def myTest(datapanel):
return datapanel['price']
def initialize(context):
context.stock = sid(23911)
pass
def handle_data(context, data):
log.debug(myTest(data))
However, this next example returns: "Runtime exception: KeyError: 'price'"
def initialize(context):
context.stock = sid(23911)
pass
def handle_data(context, data):
log.debug(data['price'])
I would expect that one should return a 20 day list of the price while the other would just yield a single day.