private void ProcessNewOrder(NewOrderEvent e) { var data = CtpConvert.GetCtpOrder(e.Order); data.InvestorID = _client.CtpLoginInfo.UserID; data.BrokerID = _client.CtpLoginInfo.BrokerID; _client.Api.ReqOrderInsert(data, _client.GetNextRequestId()); _orders.AddOrder(e.Order); }
private void ProcessNewOrder(NewOrderEvent e) { _orders.AddOrder(e.Order); if (e.Order.Status == OrderStatus.NotSent) { var data = CtpConvert.GetInputOrder(e.Order); data.InvestorID = _client.CtpLoginInfo.UserID; data.BrokerID = _client.CtpLoginInfo.BrokerID; _client.Api.ReqOrderInsert(data, _client.GetNextRequestId()); } }
private void ProcessNewOrder(NewOrderEvent e) { _orders.AddOrder(e.Order); if (e.Order.Status == OrderStatus.NotSent) { var data = CtpConvert.GetInputOrder(e.Order); data.InvestorID = _client.ctpLoginInfo.UserID; data.BrokerID = _client.ctpLoginInfo.BrokerID; data.OrderRef = e.Order.LocalID; var ret = _client.api.ReqOrderInsert(data, _client.GetNextRequestId()); if (ret == 0) { return; } ProcessOrderReject(data, new CtpRspInfo { ErrorID = -1, ErrorMsg = "连接中断发送失败" }); } }