ReqQuoteInsert
报价录入请求,如果出错,则返回响应OnRspQuoteInsert和OnErrRtnQuoteInsert;正确则推送OnRtnQuote、OnRtnOrder和OnRtnTrade。
单边报价和双边报价,都是用一个接口 ReqQuoteInsert。
在
单边报价的时候,只需要另一边的数量填0,交易核心就能区分开。
1.函数原型
virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0;
2.参数
pInputQuote:输入的报价
| 字段类型 | 字段名称 | 含义 | 值 |
|---|---|---|---|
| TThostFtdcBrokerIDType | BrokerID | 经纪公司代码 | 必填 |
| TThostFtdcInvestorIDType | InvestorID | 投资者代码 | 必填 |
| TThostFtdcInstrumentIDType | InstrumentID | 合约代码 | 必填 |
| TThostFtdcOrderRefType | QuoteRef | 报价引用 | 无 |
| TThostFtdcUserIDType | UserID | 用户代码 | 无 |
| TThostFtdcBusinessUnitType | BusinessUnit | 业务单元 | 无 |
| TThostFtdcOrderRefType | AskOrderRef | 衍生卖报单引用 | 自定义或不填 |
| TThostFtdcOrderRefType | BidOrderRef | 衍生买报单引用 | 自定义或不填 |
| TThostFtdcOrderSysIDType | ForQuoteSysID | 应价编号 | 无 |
| TThostFtdcExchangeIDType | ExchangeID | 交易所代码 | 必填 |
| TThostFtdcInvestUnitIDType | InvestUnitID | 投资单元代码 | 无 |
| TThostFtdcClientIDType | ClientID | 客户代码 | 无 |
| TThostFtdcIPAddressType | IPAddress | IP地址 | 无 |
| TThostFtdcMacAddressType | MacAddress | Mac地址 | 无 |
| TThostFtdcVolumeType | AskVolume | 卖数量 | 必填 |
| TThostFtdcVolumeType | BidVolume | 买数量 | 必填 |
| TThostFtdcRequestIDType | RequestID | 请求编号 | 无 |
| TThostFtdcOffsetFlagType | AskOffsetFlag | 卖开平标志 | 必填 |
| TThostFtdcOffsetFlagType | BidOffsetFlag | 买开平标志 | 必填 |
| TThostFtdcHedgeFlagType | AskHedgeFlag | 卖投机套保标志 | 投机 |
| TThostFtdcHedgeFlagType | BidHedgeFlag | 买投机套保标志 | 投机 |
| TThostFtdcPriceType | AskPrice | 卖价格 | 必填 |
| TThostFtdcPriceType | BidPrice | 买价格 | 必填 |
BidOrderRef:要比AskOrderRef大,请填写数字。
nRequestID:请求ID,对应响应里的nRequestID,无递增规则,由用户自行维护。
3.返回
0,代表成功。
-1,表示网络连接失败;
-2,表示未处理请求超过许可数;
-3,表示每秒发送请求数超过许可数。
4.示例调用
QuoteInsert()
{
CThostFtdcInputQuoteField quoteIn;
memset(&quoteIn, 0, sizeof(quoteIn));
strcpy(quoteIn.BrokerID, "8888");
strcpy(quoteIn.InvestorID, "880002");
strcpy(quoteIn.InstrumentID, "10002733");
strcpy(quoteIn.QuoteRef, "1");
quoteIn.AskPrice = 0.3;
quoteIn.BidPrice = 0.2;
quoteIn.AskVolume = 5;
quoteIn.BidVolume = 3;
quoteIn.AskOffsetFlag = THOST_FTDC_OF_Open;
quoteIn.BidOffsetFlag = THOST_FTDC_OF_Open;
quoteIn.AskHedgeFlag = THOST_FTDC_HF_Speculation;
quoteIn.BidHedgeFlag = THOST_FTDC_HF_Speculation;
m_pUserApi->ReqQuoteInsert(&quoteIn, nRequestID++);
}
5.FAQ
无