Intercept Close order (manual) during strategy or addon

I am looking for a way to avoid user using CLOSE button during a strategy or an addon.
I had a first result using OnOrderUpdate on an addon, and if order.Name == “Close” and order.OrderState == OrderState.Initialized (I have tried any values) then order.Account.Cancel(new [ ] { order}).
It was running fine for days until… it wont again. I have tried anything, rollback my code change. Technically it is not my code issue. Then something changed into NT8.

So I am looking again how to do that. The issue is now the Account.OrderUpdate is called after the strategy is Disabled. (apparently from log/print).

Using : RealtimeErrorHandling.IgnoreAllErrors
Trying to intercept order during strategy and addon.

Using IsUnmanaged = true (but same with false).

Thanks

I don’t think you can. I’m sure this was by design. You can probably hide it though.

Yes thank you, it seems, but what was confusing is during few day it worked, until I forgot it and tried if it was always working. I don’t know why they don’t allow this behavior. I think to another solution but more complexe. If the addon can know the strategy was disabled, it could submit stop/limit order removed by the CLOSE action.
At least the position stay open using the CANCEL. The major issue is it see the CANCELLATION as a fatal error for the strategy (then it disable).

Finally, I did the job using the AddOn to manage orders. That is a but more complexe but seems the only solution.