What is a more efficient (i.e. uses less memory) way to accomplish the following? I am trying to find the current day's high for a list of securities within the handle_data function. This is what I have currently:
context.securities = [sid(123), sid(456), sid(789), sid(876)]
context.curr_min = 0 #set within before_trading_start(); resets to zero each morning
def handle_data(context, data):
c = context; d = data
c.curr_min += 1
day_hist = d.history(c.securities,"price",c.curr_min,"1m")
day_high = day_hist.max()