ReferencesAdd OnAccount ClassCancel()Ask a question|Copy page|View as Markdown|More actionsDefinition Cancels specified Order object(s). Syntax Cancel(IEnumerable\<order\> orders) Parameters ParameterDescriptionordersOrder(s) to cancel Examples 1private Account myAccount;2Order stopOrder = null;34protected override void OnStateChange()5{6 if (State == State.SetDefaults)7 {8 // Initialize myAccount9 }10}1112private void OnExecutionUpdate(object sender, ExecutionEventArgs e)13{14 // Cancel the stop order if an execution results in a long position15 if(e.MarketPosition == MarketPosition.Long)16 myAccount.Cancel(new[] { stopOrder });17}