当前位置: 首页>>代码示例>>C#>>正文


C# ThostFtdcRspInfoField类代码示例

本文整理汇总了C#中ThostFtdcRspInfoField的典型用法代码示例。如果您正苦于以下问题:C# ThostFtdcRspInfoField类的具体用法?C# ThostFtdcRspInfoField怎么用?C# ThostFtdcRspInfoField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ThostFtdcRspInfoField类属于命名空间,在下文中一共展示了ThostFtdcRspInfoField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnRspUserLogin

 public override void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (pRspInfo.ErrorID != 0)
     {
         LogCenter.Error("交易登录失败:" + pRspInfo.ErrorMsg);
         return;
     }
     LogCenter.Log("交易登录成功");
     AccountCenter.Instance.IsTDLogin = true;
     this.instruments.Clear();
     LogCenter.Log("请求查询合约");
     int i = this.ReqQryInstrument(new ThostFtdcQryInstrumentField(), 0);
     if (i != 0)
     {
         LogCenter.Error("请求查询合约错误:" + CTPErrorHelper.GetError(i));
     }
     var field = new ThostFtdcSettlementInfoConfirmField
     {
         BrokerID = AccountCenter.Instance.Account.BrokerID,
         InvestorID = AccountCenter.Instance.Account.InvestorID,
         ConfirmDate = DateTime.Today.ToString(),
         ConfirmTime = DateTime.Now.ToLongTimeString()
     };
     LogCenter.Log("投资者结算结果确认");
     i = this.ReqSettlementInfoConfirm(field, 0);
     if (i != 0)
     {
         LogCenter.Error("投资者结算结果确认错误:" + CTPErrorHelper.GetError(i));
     }
 }
开发者ID:botvs,项目名称:QTS,代码行数:30,代码来源:TraderAdapter.cs

示例2: OnRspQryInstrument

 public override void OnRspQryInstrument(ThostFtdcInstrumentField pInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     this.instruments.Add(new Instrument(pInstrument));
     if (bIsLast)
     {
         string[] instrumentIDs = this.instruments.Select(p => p.InstrumentID).ToArray();
         MdAdapter.Instance.Start(instrumentIDs);
         Instrument[] instruments = this.instruments.OrderBy(p => p.InstrumentID).ToArray();
         InstrumentListViewModel.Instance.Instruments = instruments;
         InstrumentDAL.Save(instruments);
     }
 }
开发者ID:botvs,项目名称:QTS,代码行数:12,代码来源:TraderAdapter.cs

示例3: OnRspOrderInsert

 public override void OnRspOrderInsert(ThostFtdcInputOrderField pInputOrder, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     throw new NotImplementedException();
 }
开发者ID:botvs,项目名称:QTS,代码行数:4,代码来源:TraderAdapter.cs

示例4: OnRspUserLogout

 public void OnRspUserLogout(ThostFtdcUserLogoutField pUserLogout, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
 }
开发者ID:handgod,项目名称:CTP-TRADER,代码行数:3,代码来源:MainForm.cs

示例5: OnRspError

 public override void OnRspError(ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     LogCenter.Error("交易错误:{0} {1}", pRspInfo.ErrorMsg, pRspInfo.ErrorID);
 }
开发者ID:botvs,项目名称:QTS,代码行数:4,代码来源:TraderAdapter.cs

示例6: OnRspError

 /// <summary>
 /// 错误应答
 /// </summary>
 /// <param name="pRspInfo"></param>
 /// <param name="nRequestID"></param>
 /// <param name="bIsLast"></param>
 void OnRspError(ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     DebugPrintFunc(new StackTrace());
     IsErrorRspInfo(pRspInfo);
 }
开发者ID:Kingstar-Future,项目名称:KSFT_API,代码行数:11,代码来源:Program.cs

示例7: OnRspUserLogin

 /// <summary>
 /// 登入应答
 /// </summary>
 /// <param name="pRspUserLogin"></param>
 /// <param name="pRspInfo"></param>
 /// <param name="nRequestID"></param>
 /// <param name="bIsLast"></param>
 void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     DebugPrintFunc(new StackTrace());
     if (bIsLast && !IsErrorRspInfo(pRspInfo))
     {
         //获取当前交易日
         Console.WriteLine("--->>> 获取当前交易日 = " + api.GetTradingDay());
         // 请求订阅行情
         SubscribeMarketData();
     }
 }
开发者ID:Kingstar-Future,项目名称:KSFT_API,代码行数:18,代码来源:Program.cs

示例8: OnRspUnSubForQuoteRsp

 public override void OnRspUnSubForQuoteRsp(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     throw new NotImplementedException();
 }
开发者ID:botvs,项目名称:QTS,代码行数:4,代码来源:MdAdapter.cs

示例9: OnRspSubMarketData

 public override void OnRspSubMarketData(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { }
开发者ID:botvs,项目名称:QTS,代码行数:1,代码来源:MdAdapter.cs

示例10: OnRspOrderInsert

 public override void OnRspOrderInsert(ThostFtdcInputOrderField pInputOrder, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     LogCenter.Error("报单录入请求响应:{0} {1}", pRspInfo.ErrorMsg, pRspInfo.ErrorID);
 }
开发者ID:botvs,项目名称:QTS,代码行数:4,代码来源:TraderAdapter.cs

示例11: OnRspError

 public override void OnRspError(ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     throw new NotImplementedException();
 }
开发者ID:botvs,项目名称:QTS,代码行数:4,代码来源:MdAdapter.cs

示例12: OnRspUserLogin

 public override void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (pRspInfo.ErrorID != 0)
     {
         LogCenter.Error("行情登录失败:" + pRspInfo.ErrorMsg);
         return;
     }
     LogCenter.Log("行情登录成功");
     AccountCenter.Instance.IsMDLogin = true;
     int i = this.SubscribeMarketData(subscribeSet.ToArray());
     if (i != 0)
     {
         LogCenter.Error("订阅行情错误:" + CTPErrorHelper.GetError(i));
     }
 }
开发者ID:botvs,项目名称:QTS,代码行数:15,代码来源:MdAdapter.cs

示例13: OnRspUserLogin

 public override void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     this.instruments.Clear();
     this.ReqQryInstrument(new ThostFtdcQryInstrumentField(), 0);
 }
开发者ID:botvs,项目名称:QTS,代码行数:5,代码来源:TraderAdapter.cs

示例14: OnRspUnSubMarketData

 public override void OnRspUnSubMarketData(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (pRspInfo.ErrorID != 0)
     {
         LogCenter.Error("取消订阅行情错误:" + pRspInfo.ErrorMsg);
     }
 }
开发者ID:botvs,项目名称:QTS,代码行数:7,代码来源:MdAdapter.cs

示例15: IsErrorRspInfo

 bool IsErrorRspInfo(ThostFtdcRspInfoField pRspInfo)
 {
     // 如果ErrorID != 0, 说明收到了错误的响应
     bool bResult = ((pRspInfo != null) && (pRspInfo.ErrorID != 0));
     if (bResult)
         cMainForm.SetTDErrorRspInfo((object)pRspInfo);
     return bResult;
 }
开发者ID:handgod,项目名称:CTP-TRADER,代码行数:8,代码来源:MainForm.cs


注:本文中的ThostFtdcRspInfoField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。