private void OnRspOrderAction_callback(IntPtr pTraderApi, ref CThostFtdcInputOrderActionField pInputOrderAction, ref CThostFtdcRspInfoField 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 CThostFtdcInputOrderActionField pInputOrderAction, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { tdlog.Error("CTP回应:{0},价{1},变化量{2},前置{3},会话{4},引用{5},{6}#{7}", pInputOrderAction.InstrumentID, pInputOrderAction.LimitPrice, pInputOrderAction.VolumeChange, pInputOrderAction.FrontID, pInputOrderAction.SessionID, pInputOrderAction.OrderRef, pRspInfo.ErrorID, pRspInfo.ErrorMsg); GenericOrderItem item; string strKey = string.Format("{0}:{1}:{2}", pInputOrderAction.FrontID, pInputOrderAction.SessionID, pInputOrderAction.OrderRef); if (orderMap.TryGetValue(strKey, out item)) { EmitCancelReject(item, pRspInfo.ErrorID, pRspInfo.ErrorMsg); EmitCancelLastStatus(item); } }
public OnRspOrderActionArgs(IntPtr pTraderApi, ref CThostFtdcInputOrderActionField pInputOrderAction, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { this.pTraderApi = pTraderApi; this.pInputOrderAction = pInputOrderAction; this.pRspInfo = pRspInfo; this.nRequestID = nRequestID; this.bIsLast = bIsLast; }
private void OnRspOrderAction(IntPtr pTraderApi, ref CThostFtdcInputOrderActionField pInputOrderAction, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { SingleOrder order; if (_OrderRef2Order.TryGetValue(string.Format("{0}:{1}:{2}", _RspUserLogin.FrontID, _RspUserLogin.SessionID, pInputOrderAction.OrderRef), out order)) { tdlog.Error("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 CThostFtdcInputOrderActionField pInputOrderAction, ref CThostFtdcRspInfoField 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)) { tdlog.Error("CTP回应:{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); } }