vnpy/vn.lts/pyscript/lts_qry_function.cpp
2016-07-02 11:12:56 +08:00

339 lines
12 KiB
C++

int QryApi::reqUserLogin(dict req, int nRequestID)
{
CSecurityFtdcReqUserLoginField myreq = CSecurityFtdcReqUserLoginField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "MacAddress", myreq.MacAddress);
getChar(req, "RandCode", myreq.RandCode);
getChar(req, "UserProductInfo", myreq.UserProductInfo);
getChar(req, "UserID", myreq.UserID);
getChar(req, "AuthCode", myreq.AuthCode);
getChar(req, "TradingDay", myreq.TradingDay);
getChar(req, "InterfaceProductInfo", myreq.InterfaceProductInfo);
getChar(req, "BrokerID", myreq.BrokerID);
getChar(req, "ClientIPAddress", myreq.ClientIPAddress);
getChar(req, "OneTimePassword", myreq.OneTimePassword);
getChar(req, "ProtocolInfo", myreq.ProtocolInfo);
getChar(req, "Password", myreq.Password);
getChar(req, "HDSerialNumber", myreq.HDSerialNumber);
int i = this->api->ReqUserLogin(&myreq, nRequestID);
return i;
};
int QryApi::reqUserLogout(dict req, int nRequestID)
{
CSecurityFtdcUserLogoutField myreq = CSecurityFtdcUserLogoutField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "UserID", myreq.UserID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqUserLogout(&myreq, nRequestID);
return i;
};
int QryApi::reqFetchAuthRandCode(dict req, int nRequestID)
{
CSecurityFtdcAuthRandCodeField myreq = CSecurityFtdcAuthRandCodeField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "RandCode", myreq.RandCode);
int i = this->api->ReqFetchAuthRandCode(&myreq, nRequestID);
return i;
};
int QryApi::reqQryExchange(dict req, int nRequestID)
{
CSecurityFtdcQryExchangeField myreq = CSecurityFtdcQryExchangeField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryExchange(&myreq, nRequestID);
return i;
};
int QryApi::reqQryInstrument(dict req, int nRequestID)
{
CSecurityFtdcQryInstrumentField myreq = CSecurityFtdcQryInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "ExchangeInstID", myreq.ExchangeInstID);
getChar(req, "ProductID", myreq.ProductID);
int i = this->api->ReqQryInstrument(&myreq, nRequestID);
return i;
};
int QryApi::reqQryInvestor(dict req, int nRequestID)
{
CSecurityFtdcQryInvestorField myreq = CSecurityFtdcQryInvestorField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryInvestor(&myreq, nRequestID);
return i;
};
int QryApi::reqQryTradingCode(dict req, int nRequestID)
{
CSecurityFtdcQryTradingCodeField myreq = CSecurityFtdcQryTradingCodeField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "BrokerID", myreq.BrokerID);
getChar(req, "ClientID", myreq.ClientID);
int i = this->api->ReqQryTradingCode(&myreq, nRequestID);
return i;
};
int QryApi::reqQryTradingAccount(dict req, int nRequestID)
{
CSecurityFtdcQryTradingAccountField myreq = CSecurityFtdcQryTradingAccountField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryTradingAccount(&myreq, nRequestID);
return i;
};
int QryApi::reqQryBondInterest(dict req, int nRequestID)
{
CSecurityFtdcQryBondInterestField myreq = CSecurityFtdcQryBondInterestField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryBondInterest(&myreq, nRequestID);
return i;
};
int QryApi::reqQryMarketRationInfo(dict req, int nRequestID)
{
CSecurityFtdcQryMarketRationInfoField myreq = CSecurityFtdcQryMarketRationInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryMarketRationInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryInstrumentCommissionRate(dict req, int nRequestID)
{
CSecurityFtdcQryInstrumentCommissionRateField myreq = CSecurityFtdcQryInstrumentCommissionRateField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "OffsetFlag", myreq.OffsetFlag);
getChar(req, "Direction", myreq.Direction);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryInstrumentCommissionRate(&myreq, nRequestID);
return i;
};
int QryApi::reqQryETFInstrument(dict req, int nRequestID)
{
CSecurityFtdcQryETFInstrumentField myreq = CSecurityFtdcQryETFInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "ETFInstrumentID", myreq.ETFInstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryETFInstrument(&myreq, nRequestID);
return i;
};
int QryApi::reqQryETFBasket(dict req, int nRequestID)
{
CSecurityFtdcQryETFBasketField myreq = CSecurityFtdcQryETFBasketField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "ETFInstrumentID", myreq.ETFInstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryETFBasket(&myreq, nRequestID);
return i;
};
int QryApi::reqQryOFInstrument(dict req, int nRequestID)
{
CSecurityFtdcQryOFInstrumentField myreq = CSecurityFtdcQryOFInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "OFInstrumentID", myreq.OFInstrumentID);
int i = this->api->ReqQryOFInstrument(&myreq, nRequestID);
return i;
};
int QryApi::reqQrySFInstrument(dict req, int nRequestID)
{
CSecurityFtdcQrySFInstrumentField myreq = CSecurityFtdcQrySFInstrumentField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "SFInstrumentID", myreq.SFInstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQrySFInstrument(&myreq, nRequestID);
return i;
};
int QryApi::reqQryInstrumentUnitMargin(dict req, int nRequestID)
{
CSecurityFtdcQryInstrumentUnitMarginField myreq = CSecurityFtdcQryInstrumentUnitMarginField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryInstrumentUnitMargin(&myreq, nRequestID);
return i;
};
int QryApi::reqQryPreDelivInfo(dict req, int nRequestID)
{
CSecurityFtdcQryPreDelivInfoField myreq = CSecurityFtdcQryPreDelivInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryPreDelivInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryCreditStockAssignInfo(dict req, int nRequestID)
{
CSecurityFtdcQryCreditStockAssignInfoField myreq = CSecurityFtdcQryCreditStockAssignInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryCreditStockAssignInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryCreditCashAssignInfo(dict req, int nRequestID)
{
CSecurityFtdcQryCreditCashAssignInfoField myreq = CSecurityFtdcQryCreditCashAssignInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryCreditCashAssignInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryConversionRate(dict req, int nRequestID)
{
CSecurityFtdcQryConversionRateField myreq = CSecurityFtdcQryConversionRateField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryConversionRate(&myreq, nRequestID);
return i;
};
int QryApi::reqQryHisCreditDebtInfo(dict req, int nRequestID)
{
CSecurityFtdcQryHisCreditDebtInfoField myreq = CSecurityFtdcQryHisCreditDebtInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryHisCreditDebtInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryMarketDataStaticInfo(dict req, int nRequestID)
{
CSecurityFtdcQryMarketDataStaticInfoField myreq = CSecurityFtdcQryMarketDataStaticInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryMarketDataStaticInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryExpireRepurchInfo(dict req, int nRequestID)
{
CSecurityFtdcQryExpireRepurchInfoField myreq = CSecurityFtdcQryExpireRepurchInfoField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryExpireRepurchInfo(&myreq, nRequestID);
return i;
};
int QryApi::reqQryBondPledgeRate(dict req, int nRequestID)
{
CSecurityFtdcQryBondPledgeRateField myreq = CSecurityFtdcQryBondPledgeRateField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryBondPledgeRate(&myreq, nRequestID);
return i;
};
int QryApi::reqQryPledgeBond(dict req, int nRequestID)
{
CSecurityFtdcQryPledgeBondField myreq = CSecurityFtdcQryPledgeBondField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
int i = this->api->ReqQryPledgeBond(&myreq, nRequestID);
return i;
};
int QryApi::reqQryOrder(dict req, int nRequestID)
{
CSecurityFtdcQryOrderField myreq = CSecurityFtdcQryOrderField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "InsertTimeStart", myreq.InsertTimeStart);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
getChar(req, "OrderSysID", myreq.OrderSysID);
getChar(req, "InsertTimeEnd", myreq.InsertTimeEnd);
int i = this->api->ReqQryOrder(&myreq, nRequestID);
return i;
};
int QryApi::reqQryTrade(dict req, int nRequestID)
{
CSecurityFtdcQryTradeField myreq = CSecurityFtdcQryTradeField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "TradeTimeStart", myreq.TradeTimeStart);
getChar(req, "ExchangeID", myreq.ExchangeID);
getChar(req, "TradeID", myreq.TradeID);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
getChar(req, "TradeTimeEnd", myreq.TradeTimeEnd);
int i = this->api->ReqQryTrade(&myreq, nRequestID);
return i;
};
int QryApi::reqQryInvestorPosition(dict req, int nRequestID)
{
CSecurityFtdcQryInvestorPositionField myreq = CSecurityFtdcQryInvestorPositionField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InstrumentID", myreq.InstrumentID);
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryInvestorPosition(&myreq, nRequestID);
return i;
};
int QryApi::reqQryFundTransferSerial(dict req, int nRequestID)
{
CSecurityFtdcQryFundTransferSerialField myreq = CSecurityFtdcQryFundTransferSerialField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "BrokerID", myreq.BrokerID);
getChar(req, "AccountType", myreq.AccountType);
getChar(req, "AccountID", myreq.AccountID);
int i = this->api->ReqQryFundTransferSerial(&myreq, nRequestID);
return i;
};
int QryApi::reqQryFundInterTransferSerial(dict req, int nRequestID)
{
CSecurityFtdcQryFundInterTransferSerialField myreq = CSecurityFtdcQryFundInterTransferSerialField();
memset(&myreq, 0, sizeof(myreq));
getChar(req, "InvestorID", myreq.InvestorID);
getChar(req, "BrokerID", myreq.BrokerID);
int i = this->api->ReqQryFundInterTransferSerial(&myreq, nRequestID);
return i;
};