Just a minor fix to be able to run minute backtest.
Minute backtest was raising a KeyError
That was because of
2005-01-03handle_data:1698ERRORNo data for TLT at 2005-01-03 14:31:00+00:00, skipping processing of bar and continuing.
so rebalance function was failing and so context.rebalance_date wasn't defined as so
if data[context.gold].datetime > context.rebalance_date + datetime.timedelta(days=90):
was raising an error :
There was a runtime error on line 53.
I just changed
context.first_time = False
context.first_time = False # after rebalancing!
to fix this