ReqCombActionInsert
申请组合录入请求
错误响应: OnErrRtnCombActionInsert,OnRspCombActionInsert
正确响应: OnRtnCombAction
1.函数原型
virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0;
2.参数
pInputCombAction:输入的申请组合
| 字段类型 | 字段名称 | 含义 | 值 |
|---|---|---|---|
| TThostFtdcBrokerIDType | BrokerID | 经纪公司代码 | 必填 |
| TThostFtdcInvestorIDType | InvestorID | 投资者代码 | 必填 |
| TThostFtdcInstrumentIDType | InstrumentID | 合约代码 | 必填 |
| TThostFtdcOrderRefType | CombActionRef | 组合引用 | 选填 |
| TThostFtdcUserIDType | UserID | 用户代码 | 无 |
| TThostFtdcExchangeIDType | ExchangeID | 交易所代码 | 必填 |
| TThostFtdcVolumeType | Volume | 数量 | 必填 |
| TThostFtdcDirectionType | Direction | 买卖方向 | 必填 |
| TThostFtdcCombDirectionType | CombDirection | 组合指令方向 | 申请组合或者申请拆分 |
| TThostFtdcHedgeFlagType | HedgeFlag | 投机套保标志 | 必填 |
| TThostFtdcTradeIDType | ComTradeID | 拆分组合编号 | 无 |
| TThostFtdcIPAddressType | IPAddress | IP地址 | 无 |
| TThostFtdcMacAddressType | MacAddress | Mac地址 | 无 |
| TThostFtdcInvestUnitIDType | InvestUnitID | 投资单元代码 | 无 |
ComTradeID:申请组合不需要填写,申请拆分时可以填写。
nRequestID:请求ID,对应响应里的nRequestID,无递增规则,由用户自行维护。
3.返回
0,代表成功。
-1,表示网络连接失败;
-2,表示未处理请求超过许可数;
-3,表示每秒发送请求数超过许可数。
4.调用示例
// 申请组合
CombActionInsert()
{
CThostFtdcInputCombActionField CombInAc;
memset(&CombInAc, 0, sizeof(CombInAc));
strcpy(CombInAc.BrokerID, "8888");
strcpy(CombInAc.InvestorID, "880002");
strcpy(CombInAc.InstrumentID, "10002731&10002732");
strcpy(CombInAc.CombActionRef, "");
CombInAc.Direction = '0';
CombInAc.Volume = 1;
CombInAc.CombDirection = THOST_FTDC_CMDR_Comb;
CombInAc.HedgeFlag = '1';
strcpy(CombInAc.ComTradeID, "");
strcpy(CombInAc.UserID, "880002");
strcpy(CombInAc.ExchangeID, "SSE");
strcpy(CombInAc.InvestUnitID, "");
strcpy(CombInAc.IPAddress, "");
strcpy(CombInAc.MacAddress, "");
m_pUserApi->ReqCombActionInsert(&CombInAc, nRequestID++);
}
// 申请拆分
CombActionInsert()
{
CThostFtdcInputCombActionField CombInAc;
memset(&CombInAc, 0, sizeof(CombInAc));
strcpy(CombInAc.BrokerID, "8888");
strcpy(CombInAc.InvestorID, "880002");
strcpy(CombInAc.InstrumentID, "10002731&10002732");
strcpy(CombInAc.CombActionRef, "");
CombInAc.Direction = '0';
CombInAc.Volume = 1;
CombInAc.CombDirection = THOST_FTDC_CMDR_UnComb;
CombInAc.HedgeFlag = '1';
strcpy(CombInAc.ComTradeID, "2021030100001590");
strcpy(CombInAc.UserID, "880002");
strcpy(CombInAc.ExchangeID, "SSE");
strcpy(CombInAc.InvestUnitID, "");
strcpy(CombInAc.IPAddress, "");
strcpy(CombInAc.MacAddress, "");
m_pUserApi->ReqCombActionInsert(&CombInAc, nRequestID++);
}
5.FAQ
无