如果您需要利用CTP进行程序化交易开发,接入实盘需要向期货公司申请穿透式监管授权码。在获得实盘接入授权码之前,期货公司会让您填写申请表,先申请仿真账户,通过CTP进行交易测试,等交易测试完成后,才可获得期货公司提供的实盘账户授权码,整个测试过程我们协助您完成。
ReqAuthenticate(UserProductInfo, AuthCode);
void CTraderSpi::ReqAuthenticate(const char *UserProductInfo,const char *AuthCode)
{
if(pUserApi[accountid] == NULL ){return;}
//认证码
CThostFtdcReqAuthenticateField pReqAuthenticateField;
memset(&pReqAuthenticateField, 0, sizeof(CThostFtdcReqAuthenticateField));
strcpy(pReqAuthenticateField.BrokerID, BROKER_ID);
strcpy(pReqAuthenticateField.UserID, INVESTOR_ID);
strcpy(pReqAuthenticateField.UserProductInfo, UserProductInfo); //产品标识
strcpy(pReqAuthenticateField.AuthCode, AuthCode); //认证码
int iResult = pUserApi[accountid]->ReqAuthenticate(&pReqAuthenticateField, ++iRequestID);
cerr << "--->>> 发送认证请求: " << ((iResult == 0) ? "成功" : "失败") << endl;
}
|