private void ProcessCancelOrder(string id) { if (_cancelPendings.Contains(id)) { return; } if (!_orders.TryGetById(id, out var order)) { return; } if (string.IsNullOrEmpty(order.OrderID)) { _cancelPendings.Add(id); return; } var action = new CtpInputOrderAction(); (action.FrontID, action.SessionID, action.OrderRef) = CtpConvert.ParseId(order.ID); action.OrderSysID = order.OrderID; action.ExchangeID = order.ExchangeID.ToUpper(); action.InstrumentID = order.InstrumentID; action.ActionFlag = CtpActionFlagType.Delete; action.OrderActionRef = _client.GetNextRequestId(); action.InvestorID = _client.CtpLoginInfo.UserID; action.BrokerID = _client.CtpLoginInfo.BrokerID; _client.Api.ReqOrderAction(action, _client.GetNextRequestId()); }