I need a script to close all pending order in Certain conditions.
Conditions :
First : closing of all pending order when specified number of trades are opened like 1 or 2 or 5 trades.
Secondly : it is shutting down all pending order at the end of a specified period.