Try this Close_Profitable_Only = true; - close only profitable positions Close_Profitable_Only = false; - close all opened positionsPS Big THANK YOU for Paulus for his generosity, kindness and encouraging professionalism