Hmm. Are you saying that the phantom orders are actually being placed by your strategy in response to a corrupt state?
If that's the case, why can't you prevent the orders from being placed in the first place, rather than trying to close them after the fact? Are you concerned about the time...