vnpy/vn.femas/pyscript/femas_md_function.cpp
WOLF e05fd91545 1. 完成了飞马接口的封装,并已加入vn.trader
2. 完成金仕达黄金T+D接口的封装,但没有测试账号尚未进行测试
2015-12-17 10:15:12 +08:00

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;
};