public OnRspOrderActionArgs(IntPtr pTraderApi, ref CZQThostFtdcInputOrderActionField pInputOrderAction, ref CZQThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { this.pTraderApi = pTraderApi; this.pInputOrderAction = pInputOrderAction; this.pRspInfo = pRspInfo; this.nRequestID = nRequestID; this.bIsLast = bIsLast; }
private void OnRspOrderAction_callback(IntPtr pTraderApi, ref CZQThostFtdcInputOrderActionField pInputOrderAction, ref CZQThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (null != OnRspOrderAction) { OnRspOrderAction(this, new OnRspOrderActionArgs(pTraderApi, ref pInputOrderAction, ref pRspInfo, nRequestID, bIsLast)); } }
private void OnRspOrderAction(IntPtr pTraderApi, ref CZQThostFtdcInputOrderActionField pInputOrderAction, ref CZQThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { SingleOrder order; if (_OrderRef2Order.TryGetValue(string.Format("{0}:{1}:{2}", _RspUserLogin.FrontID, _RspUserLogin.SessionID, pInputOrderAction.OrderRef), out order)) { if (OutputLogToConsole) { Console.WriteLine("CTP回应:{0},价{1},变化量{2},引用{3},{4}", pInputOrderAction.InstrumentID, pInputOrderAction.LimitPrice, pInputOrderAction.VolumeChange, pInputOrderAction.OrderRef, pRspInfo.ErrorMsg); } order.Text = string.Format("{0}|{1}", order.Text, pRspInfo.ErrorMsg); EmitCancelReject(order, order.Text); } }
private void OnRspOrderAction(IntPtr pTraderApi, ref CZQThostFtdcInputOrderActionField pInputOrderAction, ref CZQThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { SingleOrder order; string strKey = string.Format("{0}:{1}:{2}", pInputOrderAction.FrontID, pInputOrderAction.SessionID, pInputOrderAction.OrderRef); if (_OrderRef2Order.TryGetValue(strKey, out order)) { OrdStatus status; if (_PendingCancelFlags.TryGetValue(order, out status)) { _PendingCancelFlags.Remove(order); EmitExecutionReport(order, status); } tdlog.Error("CTPZQ回应:{0},价{1},变化量{2},前置{3},会话{4},引用{5},{6}#{7}", pInputOrderAction.InstrumentID, pInputOrderAction.LimitPrice, pInputOrderAction.VolumeChange, pInputOrderAction.FrontID, pInputOrderAction.SessionID, pInputOrderAction.OrderRef, pRspInfo.ErrorID, pRspInfo.ErrorMsg); order.Text = string.Format("{0}|{1}#{2}", order.Text.Substring(0, Math.Min(order.Text.Length, 64)), pRspInfo.ErrorID, pRspInfo.ErrorMsg); EmitCancelReject(order, order.OrdStatus, order.Text); } }