Hello:
What would be the better/right way to liquidize all the positions in my portfolio? The following for loop could serve the purpose. However, I don't suppose order_target_percent() can be used in the contest since a contest participating algorithm is required to place all of its orders with the order_optimal_portfolio function. Other ordering methods in the Quantopian API are not allowed in the contest.
Thanks for the advice...
for position in context.portfolio.positions:
order_target_percent(position, 0)