I'm just trying to pull the max high over the past 11 days and am running into problems. Any help would be greatly appreciated. Moe
import numpy as np
from pytz import timezone
from datetime import datetime, timedelta
def initialize(context):
# I want to convert to a list of stocks
context.stock = [sid(8554),sid(23921),sid(24)]
def handle_data(context, data):
for stock in data:
max_11_day_high = max(np.array(history()([stock])))(bar_count=11, frequency='1d', field='high')