If you run this code, live or backtest it takes 5 weeks before it starts trading (you can also lower the number but the results are worse, is there any way you can force the code to use the data of the past 5 weeks instead of having to gather data for 5 weeks ?
context.past_queries.append(indicator)
if len(context.past_queries) > 5:
del context.past_queries[0]
if len(context.past_queries) == 5:
mean_indicator = np.mean(context.past_queries)