If such Orders are created, when the AddOn is terminated, the Orders go into OrderState.CancelPending. This would be acceptable if one could easily remove such Orders, preferably by being able to Cancel them (although since they are already supposedly cancelled, this makes no sense) or actually deleting them. However, that appears to not be possible. It would be of little consequence if these Orders caused no discernible consequences other than appearing in logs or historical records.
Unfortunately, such Orders do cause issues. First, they always appear in the Orders Grid. Since they were never intended to be submitted, this is at best a distraction, at worst, has the potential for erroneous actions because of a confusing display of multiple Orders that are no longer "genuine" mixed with genuine Orders that may be in the same OrderState but that have real issues.
More particularly of concern, trying to disconnect a Connection to which the Account (in this case, a Simulation Account) for which the Orders were created, causes a popup Warning notification of the form "You have X active orders(s). Do you really want to disconnect?". This message is generated every time an attempt is made to disconnect from the Connection of the relevant Account. Shutting down and restarting NinjaTrader does not stop this from happening.
I have read in other Forum posts that issues of this nature occur because all Orders that are created, even those not submitted, are entered into the NinjaTrader database and never deleted. This being so, the only way to remove such Orders is to clean re-install NinjaTrader or Reset the database. Both of these are not acceptable as "standard" ways to achieve this, since the consequences are far beyond the scope of just those Orders.
It is entirely valid, I believe, to create such Orders in full expectation that they should be and can be easily deleted in a fully supported manner.
Please advise on this matter.
Thanks.
Comment