// Prerequisites: Variable "order" of type FIXRegularOrder. FIXMessage cancelReqMsg = order.CreateOrderCancelRequest(); // Add fields such as "ClOrdID" etc ... // No need to acquire the global lock (See FIXOrderManager.SyncRoot). try { // Note: An exception may be thrown out. // The exception may be caused by application program error (e.g. duplicated ClOrdID); // or system error (e.g. underlying FIX session connection is down; depends on FIXSessionOrderManagerSettings.AlwaysSendCancelRequest). // See FIXRegularOrder.AddOrderCancelRequest for more details. order.AddOrderCancelRequest(cancelReqMsg); // Event FIXSessionOrderManager.OrderCancelRequestAdded will be triggered // immediately before the method <c>AddOrderCancelRequest</c> returns, within the same thread context. } catch (Exception ex) { // TODO: Your own error handling logic ... }
This operation is thread safe.
This example works with FIX versions from 4.1 to 5.0+.