vnpy/vn.ctp/pyscript/ctp_md_function.cpp

29 lines
1.0 KiB
C++
Raw Normal View History

int MdApi::reqUserLogin(dict req, int nRequestID)
{
CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField();
memset(&myreq, 0, sizeof(myreq));
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);
int i = this->api->ReqUserLogin(&myreq, nRequestID);
return i;
};
int MdApi::reqUserLogout(dict req, int nRequestID)
{
CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField();
memset(&myreq, 0, sizeof(myreq));
getStr(req, "UserID", myreq.UserID);
getStr(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqUserLogout(&myreq, nRequestID);
return i;
};