That could be the problem here is my_rebalance code:
for stock in context.output.index:
if stock in context.up_down_to_low_long.index:
if not get_open_orders(stock):
order_target_percent(stock,.1)
for stock in context.output.index:
if stock in context.up_down_to_low_short.index:
if not get_open_orders(stock):
order_target_percent(stock,-.1)
for stock in context.output.index:
if stock in context.buy_longs_f.index:
if not get_open_orders(stock):
order_target_percent(stock,.1)
for stock in context.portfolio.positions:
if context.portfolio.positions[stock].amount > 0:
if stock in context.negative_x.index:
if not get_open_orders(stock):
order_target_percent(stock,0)
if context.portfolio.positions[stock].amount < 0:
if stock in context.positive_x.index:
if not get_open_orders(stock):
order_target_percent(stock,0)