ReqQryInvestorPosition


请求查询投资者持仓,对应响应OnRspQryInvestorPosition。CTP系统将持仓明细记录按合约,持仓方向,开仓日期(仅针对上期所和能源所,区分昨仓、今仓)进行汇总。

1. 函数原型

virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0;

2. 参数

pQryInvestorPosition:查询投资者持仓

字段类型字段名称含义是否可作为过滤条件
TThostFtdcBrokerIDType BrokerID 经纪公司代码
TThostFtdcInvestorIDType InvestorID 投资者代码
TThostFtdcInstrumentIDType InstrumentID 合约代码
TThostFtdcExchangeIDType ExchangeID 交易所代码
TThostFtdcInvestUnitIDType InvestUnitID 投资单元代码
TThostFtdcOldInstrumentIDType reserve1 保留的无效字段

nRequestID:请求ID,对应响应里的nRequestID,无递增规则,由用户自行维护。

3. 返回

0,代表成功。

-1,表示网络连接失败;

-2,表示未处理请求超过许可数;

-3,表示每秒发送请求数超过许可数。

4. 调用示例

CThostFtdcQryInvestorPositionField a = { 0 };
strcpy_s(a.BrokerID, "9999");
strcpy_s(a.InvestorID, "1000001");
strcpy_s(a.InstrumentID, "rb1809");//不填写合约则返回所有持仓
m_pUserApi->ReqQryInvestorPosition(&a, 1);

5. FAQ


< 前页 回目录 后页 >