I am implementing an addons that does not allow placing orders of any kind if a condition is met. I know that Account.CancellAllOrders (e.execution.instrument) does not work to cancel filled orders and I also know that using Account.Cancel (new [] {e.order}) is not recommended because the orders remain in Cancel Pending status and that It is also not advisable to disable the Charttrader buttons.
For example: If a defined daily loss limit has been reached, no order of any kind can be entered or canceled before being submitted. I have the logic of the condition but I would like to know what is the best practice to intercept the trades properly.
Thank you
Comment