ReferencesAdd OnAccount ClassCancelAllOrders()Ask a question|Copy page|View as Markdown|More actionsDefinition Cancels all Order of an instrument. Syntax CancelAllOrders(Instrument instrument) Parameters ParameterDescriptioninstrumentInstrument of the orders to be cancelled Example 1private Account myAccount;23protected override void OnStateChange()4{5 if (State == State.SetDefaults)6 {7 // Initialize myAccount8 }9}1011private void OnExecutionUpdate(object sender, ExecutionEventArgs e)12{13 // Cancel all orders if an execution is triggered after 9pm14 if (e.Time > new DateTime(now.Year, now.Month, now.Day, 21, 0, 0))15 myAccount.CancelAllOrders(e.Execution.Instrument);16}