wds3817 / Publications Main Codes Close All Positions include pending ones. for MetaTrader 4 This one may not be the fastest, but it will definitely close all your positions