• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ThostFtdcRspInfoField类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: OnRspError

 public void OnRspError(ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (!IsErrorRspInfo(pRspInfo))
     {
     }
 }
开发者ID:handgod,项目名称:CTP-TRADER,代码行数:6,代码来源:MainForm.cs


示例17: OnRspSubMarketData

 public void OnRspSubMarketData(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (!IsErrorRspInfo(pRspInfo))
     {
     }
 }
开发者ID:handgod,项目名称:CTP-TRADER,代码行数:6,代码来源:MainForm.cs


示例18: OnRspUserLogin

 public void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (!IsErrorRspInfo(pRspInfo))
     {
         cMainForm.SetMDLoginState((object)"已连接");
     }
 }
开发者ID:handgod,项目名称:CTP-TRADER,代码行数:7,代码来源:MainForm.cs


示例19: OnRspQryInvestorPosition

 public override void OnRspQryInvestorPosition(ThostFtdcInvestorPositionField pInvestorPosition, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (pRspInfo != null && pRspInfo.ErrorID != 0)
     {
         LogCenter.Error("请求查询投资者持仓错误:" + pRspInfo.ErrorMsg);
         return;
     }
     if (pInvestorPosition == null)
     {
         return;
     }
     var position = new InvestorPosition
     {
         InstrumentID = pInvestorPosition.InstrumentID,
         BrokerID = pInvestorPosition.BrokerID,
         InvestorID = pInvestorPosition.InvestorID,
         PosiDirection = (PosiDirection)pInvestorPosition.PosiDirection,
         HedgeFlag = (HedgeFlag)pInvestorPosition.HedgeFlag,
         PositionDate = (PositionDateType)pInvestorPosition.PositionDate,
         YdPosition = pInvestorPosition.YdPosition,
         Position = pInvestorPosition.Position,
         LongFrozen = pInvestorPosition.LongFrozen,
         ShortFrozen = pInvestorPosition.ShortFrozen,
         LongFrozenAmount = pInvestorPosition.LongFrozenAmount,
         ShortFrozenAmount = pInvestorPosition.ShortFrozenAmount,
         OpenVolume = pInvestorPosition.OpenVolume,
         CloseVolume = pInvestorPosition.CloseVolume,
         OpenAmount = pInvestorPosition.OpenAmount,
         CloseAmount = pInvestorPosition.CloseAmount,
         PositionCost = pInvestorPosition.PositionCost,
         PreMargin = pInvestorPosition.PreMargin,
         UseMargin = pInvestorPosition.UseMargin,
         FrozenMargin = pInvestorPosition.FrozenMargin,
         FrozenCash = pInvestorPosition.FrozenCash,
         FrozenCommission = pInvestorPosition.FrozenCommission,
         CashIn = pInvestorPosition.CashIn,
         Commission = pInvestorPosition.Commission,
         CloseProfit = pInvestorPosition.CloseProfit,
         PositionProfit = pInvestorPosition.PositionProfit,
         PreSettlementPrice = pInvestorPosition.PreSettlementPrice,
         SettlementPrice = pInvestorPosition.SettlementPrice,
         TradingDay = pInvestorPosition.TradingDay,
         SettlementID = pInvestorPosition.SettlementID,
         OpenCost = pInvestorPosition.OpenCost,
         ExchangeMargin = pInvestorPosition.ExchangeMargin,
         CombPosition = pInvestorPosition.CombPosition,
         CombLongFrozen = pInvestorPosition.CombLongFrozen,
         CombShortFrozen = pInvestorPosition.CombShortFrozen,
         CloseProfitByDate = pInvestorPosition.CloseProfitByDate,
         CloseProfitByTrade = pInvestorPosition.CloseProfitByTrade,
         TodayPosition = pInvestorPosition.TodayPosition,
         MarginRateByMoney = pInvestorPosition.MarginRateByMoney,
         MarginRateByVolume = pInvestorPosition.MarginRateByVolume,
         StrikeFrozen = pInvestorPosition.StrikeFrozen,
         StrikeFrozenAmount = pInvestorPosition.StrikeFrozenAmount,
         AbandonFrozen = pInvestorPosition.AbandonFrozen,
     };
     this.positions.Add(position);
     if (bIsLast)
     {
         PositionViewModel.Instance.Update(this.positions);
     }
 }
开发者ID:botvs,项目名称:QTS,代码行数:63,代码来源:TraderAdapter.cs


示例20: OnRspQryTradingAccount

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Thread类代码示例发布时间:2022-05-24
下一篇:
C# ThisReferenceExpression类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap