Hi everyone,
As I wish to close all my positions as signal shows, I use
for stock in sell_pos:
if context.portfolio.positions[stock].amount != 0:
order_target(stock, 0 )
However, the position does not all down to zero. It only sells one shares: (please see the screenshot via the link)
screenshot
Could you guys please advise where is wrong with my code? Thanks in advance!