From lots of logging I see my browser stuck. If I wait long enough it catches up. FF 56 (64-bit) and Win7.
First try commenting the last two lines, logging.
Secondly, the unfilled orders logging: The ordering at market close might be to reduce drawdown from partial fills and price drift. To reduce content to the logging window further while maintaining the partial fills limitation, ordering can be run at any time other than market close (with get_prices prior to it) and then this canceling of open orders. This can't be used at market close, that would prevent orders from occurring at all if cancel_oos were run also at market close in the same minute just after the ordering so you might simply move everything ahead of market close a few minutes. Returns can be higher allowing a few minutes before cancel_oos, you would have to decide how much of the increased drawdown from incomplete orders is acceptable.
schedule_function(cancel_oos, date_rules.every_day(), time_rules.market_close(minutes= [some number of minutes after ordering] ))
def cancel_oos(context, data): # Cancel open orders
oo = get_open_orders()
for s in oo:
for o in oo[s]:
Another idea to address drawdown by limiting partial fills: Since track_orders sees when an order is a partial fill, could inject some code into it to make decisions at that point, for example allowing the order to continue if its percentage is above some threshold. I find that beneficial.