e05fd91545
2. 完成金仕达黄金T+D接口的封装,但没有测试账号尚未进行测试
67 lines
2.0 KiB
C++
67 lines
2.0 KiB
C++
ReqUserLogin
|
|
{
|
|
CUstpFtdcReqUserLoginField myreq = CUstpFtdcReqUserLoginField();
|
|
memset(&myreq, 0, sizeof(myreq));
|
|
getChar(req, "MacAddress", myreq.MacAddress);
|
|
getChar(req, "UserProductInfo", myreq.UserProductInfo);
|
|
getChar(req, "UserID", myreq.UserID);
|
|
getInt(req, "DataCenterID", &myreq.DataCenterID);
|
|
getChar(req, "TradingDay", myreq.TradingDay);
|
|
getChar(req, "InterfaceProductInfo", myreq.InterfaceProductInfo);
|
|
getChar(req, "BrokerID", myreq.BrokerID);
|
|
getChar(req, "ProtocolInfo", myreq.ProtocolInfo);
|
|
getChar(req, "Password", myreq.Password);
|
|
getChar(req, "IPAddress", myreq.IPAddress);
|
|
int i = this->api->ReqUserLogin(&myreq, nRequestID);
|
|
return i;
|
|
};
|
|
|
|
ReqUserLogout
|
|
{
|
|
CUstpFtdcReqUserLogoutField myreq = CUstpFtdcReqUserLogoutField();
|
|
memset(&myreq, 0, sizeof(myreq));
|
|
getChar(req, "UserID", myreq.UserID);
|
|
getChar(req, "BrokerID", myreq.BrokerID);
|
|
int i = this->api->ReqUserLogout(&myreq, nRequestID);
|
|
return i;
|
|
};
|
|
|
|
ReqSubscribeTopic
|
|
{
|
|
CUstpFtdcDisseminationField myreq = CUstpFtdcDisseminationField();
|
|
memset(&myreq, 0, sizeof(myreq));
|
|
getInt(req, "SequenceNo", &myreq.SequenceNo);
|
|
getInt(req, "SequenceSeries", &myreq.SequenceSeries);
|
|
int i = this->api->ReqSubscribeTopic(&myreq, nRequestID);
|
|
return i;
|
|
};
|
|
|
|
ReqQryTopic
|
|
{
|
|
CUstpFtdcDisseminationField myreq = CUstpFtdcDisseminationField();
|
|
memset(&myreq, 0, sizeof(myreq));
|
|
getInt(req, "SequenceNo", &myreq.SequenceNo);
|
|
getInt(req, "SequenceSeries", &myreq.SequenceSeries);
|
|
int i = this->api->ReqQryTopic(&myreq, nRequestID);
|
|
return i;
|
|
};
|
|
|
|
ReqSubMarketData
|
|
{
|
|
CUstpFtdcSpecificInstrumentField myreq = CUstpFtdcSpecificInstrumentField();
|
|
memset(&myreq, 0, sizeof(myreq));
|
|
getChar(req, "InstrumentID", myreq.InstrumentID);
|
|
int i = this->api->ReqSubMarketData(&myreq, nRequestID);
|
|
return i;
|
|
};
|
|
|
|
ReqUnSubMarketData
|
|
{
|
|
CUstpFtdcSpecificInstrumentField myreq = CUstpFtdcSpecificInstrumentField();
|
|
memset(&myreq, 0, sizeof(myreq));
|
|
getChar(req, "InstrumentID", myreq.InstrumentID);
|
|
int i = this->api->ReqUnSubMarketData(&myreq, nRequestID);
|
|
return i;
|
|
};
|
|
|