Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Ordering a single stock chosen from pipeline.

My pipeline returns one stock only based on a variety of factors and I would like to hold only this stock in my portfolio.

When I try to use order_target_percentage() and the stock the pipeline return changes, the algorithm buys the new stock without selling the old stock therefore massively over leveraging my portfolio.

How can I stop this from happening or should I be using order_optimal_portfolio?

Many thanks in advance.