I need to mark the 15 minute high of the day for all stocks that are in data. How might I do this? I tried many methods and no luck. Here is what I have atm...
Here is what I added to my code so far for this.
def initialize(context):
#Create a dataframe for the 15 minute high of the day.
context.stocks_15h = pd.DataFrame([])
# Schedule times for mothods/functions to run.
schedule_function(mark_15h, date_rules.every_day(), time_rules.market_open(minutes=15))
def mark_15h(context, data):
history_15h = history(15, "1m", "high")
context.stocks_15h.append([max(history_15h)])