本文整理汇总了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));
}
}
示例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);
}
}
示例3: OnRspOrderInsert
public override void OnRspOrderInsert(ThostFtdcInputOrderField pInputOrder, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
throw new NotImplementedException();
}
示例4: OnRspUserLogout
public void OnRspUserLogout(ThostFtdcUserLogoutField pUserLogout, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
}
示例5: OnRspError
public override void OnRspError(ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
LogCenter.Error("交易错误:{0} {1}", pRspInfo.ErrorMsg, pRspInfo.ErrorID);
}
示例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);
}
示例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();
}
}
示例8: OnRspUnSubForQuoteRsp
public override void OnRspUnSubForQuoteRsp(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
throw new NotImplementedException();
}
示例9: OnRspSubMarketData
public override void OnRspSubMarketData(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { }
示例10: OnRspOrderInsert
public override void OnRspOrderInsert(ThostFtdcInputOrderField pInputOrder, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
LogCenter.Error("报单录入请求响应:{0} {1}", pRspInfo.ErrorMsg, pRspInfo.ErrorID);
}
示例11: OnRspError
public override void OnRspError(ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
throw new NotImplementedException();
}
示例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));
}
}
示例13: OnRspUserLogin
public override void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
this.instruments.Clear();
this.ReqQryInstrument(new ThostFtdcQryInstrumentField(), 0);
}
示例14: OnRspUnSubMarketData
public override void OnRspUnSubMarketData(ThostFtdcSpecificInstrumentField pSpecificInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
{
if (pRspInfo.ErrorID != 0)
{
LogCenter.Error("取消订阅行情错误:" + pRspInfo.ErrorMsg);
}
}
示例15: IsErrorRspInfo
bool IsErrorRspInfo(ThostFtdcRspInfoField pRspInfo)
{
// 如果ErrorID != 0, 说明收到了错误的响应
bool bResult = ((pRspInfo != null) && (pRspInfo.ErrorID != 0));
if (bResult)
cMainForm.SetTDErrorRspInfo((object)pRspInfo);
return bResult;
}