vnpy/vn.ksotp/pyscript/ksotp_md_function.cpp
WOLF 47d8f1d0d3 增加金仕达期权接口的封装vn.ksotp,并已加入vn.trader。
同时对vn.trader的CTA模块进行了一些修改。
2015-12-09 11:19:45 +08:00

45 lines
1.3 KiB
C++

SubscribeMarketData
{
CKSOTPSpecificInstrumentField myreq = CKSOTPSpecificInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->SubscribeMarketData(&myreq, nRequestID);
return i;
};
UnSubscribeMarketData
{
CKSOTPSpecificInstrumentField myreq = CKSOTPSpecificInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->UnSubscribeMarketData(&myreq, nRequestID);
return i;
};
ReqUserLogin
{
CKSOTPReqUserLoginField myreq = CKSOTPReqUserLoginField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "MacAddress", myreq.MacAddress);
getChar(req, "UserProductInfo", myreq.UserProductInfo);
getChar(req, "UserID", myreq.UserID);
getChar(req, "BrokerID", myreq.BrokerID);
getChar(req, "ClientIPAddress", myreq.ClientIPAddress);
getChar(req, "Password", myreq.Password);
int i = this->api->ReqUserLogin(&myreq, nRequestID);
return i;
};
ReqUserLogout
{
CKSOTPUserLogoutField myreq = CKSOTPUserLogoutField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "UserID", myreq.UserID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqUserLogout(&myreq, nRequestID);
return i;
};