vnpy/vn.api/vn.sgit/pyscript/sgit_md_function.cpp

29 lines
1.0 KiB
C++
Raw Normal View History

2016-07-02 03:12:44 +00:00
int MdApi::reqUserLogin(dict req, int nRequestID)
{
2017-04-27 02:51:45 +00:00
CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField();
2016-07-02 03:12:44 +00:00
memset(&myreq, 0, sizeof(myreq));
2017-04-27 02:51:45 +00:00
getStr(req, "MacAddress", myreq.MacAddress);
getStr(req, "UserProductInfo", myreq.UserProductInfo);
getStr(req, "UserID", myreq.UserID);
getStr(req, "TradingDay", myreq.TradingDay);
getStr(req, "InterfaceProductInfo", myreq.InterfaceProductInfo);
getStr(req, "BrokerID", myreq.BrokerID);
getStr(req, "ClientIPAddress", myreq.ClientIPAddress);
getStr(req, "OneTimePassword", myreq.OneTimePassword);
getStr(req, "ProtocolInfo", myreq.ProtocolInfo);
getStr(req, "Password", myreq.Password);
2016-07-02 03:12:44 +00:00
int i = this->api->ReqUserLogin(&myreq, nRequestID);
return i;
};
int MdApi::reqUserLogout(dict req, int nRequestID)
{
2017-04-27 02:51:45 +00:00
CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField();
2016-07-02 03:12:44 +00:00
memset(&myreq, 0, sizeof(myreq));
2017-04-27 02:51:45 +00:00
getStr(req, "UserID", myreq.UserID);
getStr(req, "BrokerID", myreq.BrokerID);
2016-07-02 03:12:44 +00:00
int i = this->api->ReqUserLogout(&myreq, nRequestID);
return i;
};