How close all previous orders

 

hi

i tested a loop for selecting all orders and closing them but it didn't work what is your best suggestions?

 

Show your code.