本文整理汇总了C#中QuantBox.CSharp2CTP.CThostFtdcRspInfoField类的典型用法代码示例。如果您正苦于以下问题:C# CThostFtdcRspInfoField类的具体用法?C# CThostFtdcRspInfoField怎么用?C# CThostFtdcRspInfoField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CThostFtdcRspInfoField类属于QuantBox.CSharp2CTP命名空间,在下文中一共展示了CThostFtdcRspInfoField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnErrRtnOrderInsert
private void OnErrRtnOrderInsert(IntPtr pTraderApi, ref CThostFtdcInputOrderField pInputOrder, ref CThostFtdcRspInfoField pRspInfo)
{
SingleOrder order;
string strKey = string.Format("{0}:{1}:{2}", _RspUserLogin.FrontID, _RspUserLogin.SessionID, pInputOrder.OrderRef);
if (_OrderRef2Order.TryGetValue(strKey, out order))
{
tdlog.Error("交易所回应:{0},{1},开平{2},价{3},原量{4},引用{5},{6}#{7}",
pInputOrder.InstrumentID, pInputOrder.Direction, pInputOrder.CombOffsetFlag, pInputOrder.LimitPrice,
pInputOrder.VolumeTotalOriginal,
pInputOrder.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);
EmitRejected(order, order.Text);
//没得办法,这样全撤了状态就唯一了
Dictionary<string, CThostFtdcOrderField> _Ref2Action;
if (_Orders4Cancel.TryGetValue(order, out _Ref2Action))
{
lock (_Ref2Action)
{
_Ref2Action.Remove(strKey);
if (0 == _Ref2Action.Count())
{
_Orders4Cancel.Remove(order);
return;
}
Cancel(order);
}
}
}
}
示例2: OnErrRtnOrderAction
private void OnErrRtnOrderAction(IntPtr pTraderApi, ref CThostFtdcOrderActionField pOrderAction, ref CThostFtdcRspInfoField pRspInfo)
{
SingleOrder order;
string strKey = string.Format("{0}:{1}:{2}", pOrderAction.FrontID, pOrderAction.SessionID, pOrderAction.OrderRef);
if (_OrderRef2Order.TryGetValue(strKey, out order))
{
tdlog.Error("交易所回应:{0},价{1},变化量{2},前置{3},会话{4},引用{5},{6}#{7}",
pOrderAction.InstrumentID, pOrderAction.LimitPrice,
pOrderAction.VolumeChange,
pOrderAction.FrontID, pOrderAction.SessionID, pOrderAction.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);
}
}
示例3: OnRspQryDepthMarketData
public void OnRspQryDepthMarketData(IntPtr pTraderApi, ref CThostFtdcDepthMarketDataField pDepthMarketData, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
if (0 == pRspInfo.ErrorID)
{
CThostFtdcDepthMarketDataField DepthMarket;
if (!_dictDepthMarketData.TryGetValue(pDepthMarketData.InstrumentID, out DepthMarket))
{
//没找到此元素,保存一下
_dictDepthMarketData[pDepthMarketData.InstrumentID] = pDepthMarketData;
}
tdlog.Info("已经接收查询深度行情 {0}", pDepthMarketData.InstrumentID);
//通知单例
CTPAPI.GetInstance().FireOnRspQryDepthMarketData(pDepthMarketData);
}
else
{
tdlog.Error("nRequestID:{0},ErrorID:{1},OnRspQryDepthMarketData:{2}", nRequestID, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
EmitError(nRequestID, pRspInfo.ErrorID, "OnRspQryDepthMarketData:" + pRspInfo.ErrorMsg);
}
}
示例4: OnErrRtnOrderAction_callback
private void OnErrRtnOrderAction_callback(IntPtr pTraderApi, ref CThostFtdcOrderActionField pOrderAction, ref CThostFtdcRspInfoField pRspInfo)
{
if (null != OnErrRtnOrderAction)
{
OnErrRtnOrderAction(this, new OnErrRtnOrderActionArgs(pTraderApi, ref pOrderAction, ref pRspInfo));
}
}
示例5: OnErrRtnOrderInsert_callback
private void OnErrRtnOrderInsert_callback(IntPtr pTraderApi, ref CThostFtdcInputOrderField pInputOrder, ref CThostFtdcRspInfoField pRspInfo)
{
if (null != OnErrRtnOrderInsert)
{
OnErrRtnOrderInsert(this, new OnErrRtnOrderInsertArgs(pTraderApi, ref pInputOrder, ref pRspInfo));
}
}
示例6: OnErrRtnOrderActionArgs
public OnErrRtnOrderActionArgs(IntPtr pTraderApi, ref CThostFtdcOrderActionField pOrderAction, ref CThostFtdcRspInfoField pRspInfo)
{
this.pTraderApi = pTraderApi;
this.pOrderAction = pOrderAction;
this.pRspInfo = pRspInfo;
}
示例7: OnRspQryTradingAccountArgs
public OnRspQryTradingAccountArgs(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
this.pTraderApi = pTraderApi;
this.pTradingAccount = pTradingAccount;
this.pRspInfo = pRspInfo;
this.nRequestID = nRequestID;
this.bIsLast = bIsLast;
}
示例8: OnRspQryInvestorPosition_callback
private void OnRspQryInvestorPosition_callback(IntPtr pTraderApi, ref CThostFtdcInvestorPositionField pInvestorPosition, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
if (null != OnRspQryInvestorPosition)
{
OnRspQryInvestorPosition(this, new OnRspQryInvestorPositionArgs(pTraderApi, ref pInvestorPosition, ref pRspInfo, nRequestID, bIsLast));
}
}
示例9: OnRspQryTradingAccount_callback
private void OnRspQryTradingAccount_callback(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
if (null != OnRspQryTradingAccount)
{
OnRspQryTradingAccount(this, new OnRspQryTradingAccountArgs(pTraderApi, ref pTradingAccount, ref pRspInfo, nRequestID, bIsLast));
}
}
示例10: OnErrRtnOrderAction
private void OnErrRtnOrderAction(IntPtr pTraderApi, ref CThostFtdcOrderActionField pOrderAction, ref CThostFtdcRspInfoField pRspInfo)
{
tdlog.Error("交易所回应:{0},价{1},变化量{2},前置{3},会话{4},引用{5},{6}#{7}",
pOrderAction.InstrumentID, pOrderAction.LimitPrice,
pOrderAction.VolumeChange,
pOrderAction.FrontID, pOrderAction.SessionID, pOrderAction.OrderRef,
pRspInfo.ErrorID, pRspInfo.ErrorMsg);
GenericOrderItem item;
string strKey = string.Format("{0}:{1}:{2}", pOrderAction.FrontID, pOrderAction.SessionID, pOrderAction.OrderRef);
if (orderMap.TryGetValue(strKey, out item))
{
EmitCancelReject(item, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
EmitCancelLastStatus(item);
}
}
示例11: OnRspQryDepthMarketData_callback
private void OnRspQryDepthMarketData_callback(IntPtr pTraderApi, ref CThostFtdcDepthMarketDataField pDepthMarketData, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
if (null != OnRspQryDepthMarketData)
{
OnRspQryDepthMarketData(this, new OnRspQryDepthMarketDataArgs(pTraderApi, ref pDepthMarketData, ref pRspInfo, nRequestID, bIsLast));
}
}
示例12: OnRspOrderInsert
private void OnRspOrderInsert(IntPtr pTraderApi, ref CThostFtdcInputOrderField pInputOrder, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
SingleOrder order;
string strKey = string.Format("{0}:{1}:{2}", _RspUserLogin.FrontID, _RspUserLogin.SessionID, pInputOrder.OrderRef);
if (_OrderRef2Order.TryGetValue(strKey, out order))
{
tdlog.Error("CTP回应:{0},{1},开平{2},价{3},原量{4},引用{5},{6}",
pInputOrder.InstrumentID, pInputOrder.Direction, pInputOrder.CombOffsetFlag, pInputOrder.LimitPrice,
pInputOrder.VolumeTotalOriginal,
pInputOrder.OrderRef, pRspInfo.ErrorMsg);
order.Text = string.Format("{0}|{1}", order.Text, pRspInfo.ErrorMsg);
EmitRejected(order, order.Text);
//这些地方没法处理混合报单
//没得办法,这样全撤了状态就唯一了
//但由于不知道在错单时是否会有报单回报,所以在这查一次,以防重复撤单出错
//找到对应的报单回应
Dictionary<string, CThostFtdcOrderField> _Ref2Action;
if (_Orders4Cancel.TryGetValue(order, out _Ref2Action))
{
lock (_Ref2Action)
{
_Ref2Action.Remove(strKey);
if (0 == _Ref2Action.Count())
{
_Orders4Cancel.Remove(order);
return;
}
Cancel(order);
}
}
}
}
示例13: OnRspQryInstrument
private void OnRspQryInstrument(IntPtr pTraderApi, ref CThostFtdcInstrumentField pInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
if (0 == pRspInfo.ErrorID)
{
_dictInstruments[pInstrument.InstrumentID] = pInstrument;
if (bIsLast)
{
tdlog.Info("合约列表已经接收完成,共{0}条",_dictInstruments.Count);
}
}
else
{
tdlog.Error("nRequestID:{0},ErrorID:{1},OnRspQryInstrument:{2}", nRequestID, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
EmitError(nRequestID, pRspInfo.ErrorID, "OnRspQryInstrument:" + pRspInfo.ErrorMsg);
}
}
示例14: OnRspOrderAction
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);
}
}
示例15: OnDisconnect
private void OnDisconnect(IntPtr pApi, ref CThostFtdcRspInfoField pRspInfo, ConnectionStatus step)
{
if (m_pMdApi == pApi)//行情
{
if (isConnected)
{
mdlog.Error("Step:{0},ErrorID:{1},ErrorMsg:{2},等待定时重试连接", step, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
}
else
{
mdlog.Info("Step:{0},ErrorID:{1},ErrorMsg:{2}", step, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
}
}
else if (m_pTdApi == pApi)//交易
{
if (isConnected)//如果以前连成功,表示密码没有错,只是初始化失败,可以重试
{
tdlog.Error("Step:{0},ErrorID:{1},ErrorMsg:{2},等待定时重试连接", step, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
}
else
{
tdlog.Info("Step:{0},ErrorID:{1},ErrorMsg:{2}", step, pRspInfo.ErrorID, pRspInfo.ErrorMsg);
}
}
if (!isConnected)//从来没有连接成功过,可能是密码错误,直接退出
{
//不能在线程中停止线程,这样会导致软件关闭进程不退出
//_Disconnect();
}
else
{
//以前连接过,现在断了次线,要等重连
ChangeStatus(ProviderStatus.Connecting);
EmitDisconnectedEvent();
}
}