diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..775cbfd4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# C++源代码 +ipch/ +Release/ + +*.sdf +*.sln +*.suo +*.exp +*.pdb +*.filters +*.vcxproj +*.cd + +# Python编译文件 +*.pyc + +# WingIDE文件 +*.wpr +*.wpu + +# 压缩文件 +*.zip + +# API的.con文件 +*.con \ No newline at end of file diff --git a/vn.lts/ltsapi/SecurityFtdcMdApi.h b/vn.lts/ltsapi/SecurityFtdcMdApi.h new file mode 100644 index 00000000..377485b8 --- /dev/null +++ b/vn.lts/ltsapi/SecurityFtdcMdApi.h @@ -0,0 +1,135 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcMdApi.h +///@brief ͻ˽ӿ +///////////////////////////////////////////////////////////////////////// + +#if !defined(SECURITY_FTDCMDAPI_H) +#define SECURITY_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SecurityFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_MD_API_EXPORT +#define MD_API_EXPORT __declspec(dllexport) +#else +#define MD_API_EXPORT __declspec(dllimport) +#endif +#else +#define MD_API_EXPORT +#endif + +class CSecurityFtdcMdSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + + ///Ӧ + virtual void OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData) {}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility push(default) + #endif +#endif + +class MD_API_EXPORT CSecurityFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CSecurityFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = ""); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CSecurityFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount, char* pExchageID) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount, char* pExchageID) = 0; + + ///û¼ + virtual int ReqUserLogin(CSecurityFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CSecurityFtdcMdApi(){}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility pop + #endif +#endif + +#endif diff --git a/vn.lts/ltsapi/SecurityFtdcTraderApi.h b/vn.lts/ltsapi/SecurityFtdcTraderApi.h new file mode 100644 index 00000000..594eaa31 --- /dev/null +++ b/vn.lts/ltsapi/SecurityFtdcTraderApi.h @@ -0,0 +1,299 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcTraderApi.h +///@brief ͻ˽ӿ +///////////////////////////////////////////////////////////////////////// + +#if !defined(SECURITY_FTDCTRADERAPI_H) +#define SECURITY_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SecurityFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_API_EXPORT __declspec(dllexport) +#else +#define TRADER_API_EXPORT __declspec(dllimport) +#endif +#else +#define TRADER_API_EXPORT +#endif + +class CSecurityFtdcTraderSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + ///Ӧ + virtual void OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CSecurityFtdcExchangeField *pExchange, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CSecurityFtdcTradingCodeField *pTradingCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯծȯϢӦ + virtual void OnRspQryBondInterest(CSecurityFtdcBondInterestField *pBondInterest, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵϢӦ + virtual void OnRspQryMarketRationInfo(CSecurityFtdcMarketRationInfoField *pMarketRationInfo, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CSecurityFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯETFԼӦ + virtual void OnRspQryETFInstrument(CSecurityFtdcETFInstrumentField *pETFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯETFƱӦ + virtual void OnRspQryETFBasket(CSecurityFtdcETFBasketField *pETFBasket, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯOFԼӦ + virtual void OnRspQryOFInstrument(CSecurityFtdcOFInstrumentField *pOFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯSFԼӦ + virtual void OnRspQrySFInstrument(CSecurityFtdcSFInstrumentField *pSFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CSecurityFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CSecurityFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo) {}; + + ///LiberӦ + virtual void OnRspFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Liber֪ͨ + virtual void OnRtnFundOutByLiber(CSecurityFtdcFundTransferField *pFundTransfer) {}; + + ///Liberر + virtual void OnErrRtnFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo) {}; + + ///з֪ͨ + virtual void OnRtnFundInByBank(CSecurityFtdcFundTransferField *pFundTransfer) {}; + + ///ʽת˲ѯӦ + virtual void OnRspQryFundTransferSerial(CSecurityFtdcFundTransferField *pFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽתӦ + virtual void OnRspFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽתˮѯӦ + virtual void OnRspQryFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽתˮ֪ͨ + virtual void OnRtnFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial) {}; + + ///ʽתر + virtual void OnErrRtnFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo) {}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility push(default) + #endif +#endif + +class TRADER_API_EXPORT CSecurityFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CSecurityFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CSecurityFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// SECURITY_TERT_RESTART:ӱտʼش + /// SECURITY_TERT_RESUME:ϴյ + /// SECURITY_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(SECURITY_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// SECURITY_TERT_RESTART:ӱտʼش + /// SECURITY_TERT_RESUME:ϴյ + /// SECURITY_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(SECURITY_TE_RESUME_TYPE nResumeType) = 0; + + ///û¼ + virtual int ReqUserLogin(CSecurityFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CSecurityFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CSecurityFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CSecurityFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CSecurityFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CSecurityFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CSecurityFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯծȯϢ + virtual int ReqQryBondInterest(CSecurityFtdcQryBondInterestField *pQryBondInterest, int nRequestID) = 0; + + ///ѯֵϢ + virtual int ReqQryMarketRationInfo(CSecurityFtdcQryMarketRationInfoField *pQryMarketRationInfo, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CSecurityFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯETFԼ + virtual int ReqQryETFInstrument(CSecurityFtdcQryETFInstrumentField *pQryETFInstrument, int nRequestID) = 0; + + ///ѯETFƱ + virtual int ReqQryETFBasket(CSecurityFtdcQryETFBasketField *pQryETFBasket, int nRequestID) = 0; + + ///ѯOFԼ + virtual int ReqQryOFInstrument(CSecurityFtdcQryOFInstrumentField *pQryOFInstrument, int nRequestID) = 0; + + ///ѯSFԼ + virtual int ReqQrySFInstrument(CSecurityFtdcQrySFInstrumentField *pQrySFInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CSecurityFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CSecurityFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CSecurityFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///Liber + virtual int ReqFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, int nRequestID) = 0; + + ///ʽת˲ѯ + virtual int ReqQryFundTransferSerial(CSecurityFtdcQryFundTransferSerialField *pQryFundTransferSerial, int nRequestID) = 0; + + ///ʽת + virtual int ReqFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, int nRequestID) = 0; + + ///ʽתˮѯ + virtual int ReqQryFundInterTransferSerial(CSecurityFtdcQryFundInterTransferSerialField *pQryFundInterTransferSerial, int nRequestID) = 0; +protected: + ~CSecurityFtdcTraderApi(){}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility pop + #endif +#endif + +#endif diff --git a/vn.lts/ltsapi/SecurityFtdcUserApiDataType.h b/vn.lts/ltsapi/SecurityFtdcUserApiDataType.h new file mode 100644 index 00000000..0e398b8d --- /dev/null +++ b/vn.lts/ltsapi/SecurityFtdcUserApiDataType.h @@ -0,0 +1,2080 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcUserApiDataType.h +///@brief ҵ +///////////////////////////////////////////////////////////////////////// + +#ifndef SECURITY_FTDCDATATYPE_H +#define SECURITY_FTDCDATATYPE_H + +enum SECURITY_TE_RESUME_TYPE +{ + SECURITY_TERT_RESTART = 0, + SECURITY_TERT_RESUME, + SECURITY_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcExchangeNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_EXP_Normal '0' +///ݳɽɱ +#define SECURITY_FTDC_EXP_GenOrderByTrade '1' + +typedef char TSecurityFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define SECURITY_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define SECURITY_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define SECURITY_FTDC_ECS_GotInformation '9' + +typedef char TSecurityFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInstrumentIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define SECURITY_FTDC_PC_Futures '1' +///Ȩ +#define SECURITY_FTDC_PC_Options '2' +/// +#define SECURITY_FTDC_PC_Combination '3' +/// +#define SECURITY_FTDC_PC_Spot '4' +///ת +#define SECURITY_FTDC_PC_EFP '5' +///֤ȯA +#define SECURITY_FTDC_PC_StockA '6' +///֤ȯB +#define SECURITY_FTDC_PC_StockB '7' +///ETF +#define SECURITY_FTDC_PC_ETF '8' +///ETF +#define SECURITY_FTDC_PC_ETFPurRed '9' + +typedef char TSecurityFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define SECURITY_FTDC_PT_Net '1' +///ۺϳֲ +#define SECURITY_FTDC_PT_Gross '2' + +typedef char TSecurityFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define SECURITY_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define SECURITY_FTDC_PDT_NoUseHistory '2' + +typedef char TSecurityFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define SECURITY_FTDC_IP_NotStart '0' +/// +#define SECURITY_FTDC_IP_Started '1' +///ͣ +#define SECURITY_FTDC_IP_Pause '2' +/// +#define SECURITY_FTDC_IP_Expired '3' + +typedef char TSecurityFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightModelIDTypeһƱȨģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRightModelIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightModelNameTypeһƱȨģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRightModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosTradeTypeTypeһֲֽ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define SECURITY_FTDC_PTT_CanSelTodayPos '1' +///ֲֲ +#define SECURITY_FTDC_PTT_CannotSellTodayPos '2' + +typedef char TSecurityFtdcPosTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInvestorIDType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define SECURITY_FTDC_ICT_EID '0' +///֤ +#define SECURITY_FTDC_ICT_IDCard '1' +///֤ +#define SECURITY_FTDC_ICT_OfficerIDCard '2' +///֤ +#define SECURITY_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define SECURITY_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define SECURITY_FTDC_ICT_HouseholdRegister '5' +/// +#define SECURITY_FTDC_ICT_Passport '6' +///̨֤ +#define SECURITY_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define SECURITY_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define SECURITY_FTDC_ICT_LicenseNo '9' +///˰ǼǺ +#define SECURITY_FTDC_ICT_TaxNo 'A' +///֤ +#define SECURITY_FTDC_ICT_OtherCard 'x' + +typedef char TSecurityFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcClientIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAccountIDType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ͨ +#define SECURITY_FTDC_CLT_Normal '1' +///ý +#define SECURITY_FTDC_CLT_Credit '2' +///Ʒ˻ +#define SECURITY_FTDC_CLT_Derive '3' +/// +#define SECURITY_FTDC_CLT_Other '4' + +typedef char TSecurityFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define SECURITY_FTDC_FC_ForceUserLogout '2' +///û +#define SECURITY_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define SECURITY_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define SECURITY_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define SECURITY_FTDC_FC_OrderInsert '6' +/// +#define SECURITY_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define SECURITY_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define SECURITY_FTDC_FC_SyncBrokerData '9' +///ѯ +#define SECURITY_FTDC_FC_SuperQuery 'B' +/// +#define SECURITY_FTDC_FC_ParkedOrderInsert 'C' +/// +#define SECURITY_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define SECURITY_FTDC_FC_SyncOTP 'E' +///δ֪ +#define SECURITY_FTDC_FC_UnkownOrderAction 'F' +///תй +#define SECURITY_FTDC_FC_DepositoryTransfer 'G' +///ȯת +#define SECURITY_FTDC_FC_ExcessStockTransfer 'H' + +typedef char TSecurityFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define SECURITY_FTDC_UT_Investor '0' +///Ա +#define SECURITY_FTDC_UT_Operator '1' +///Ա +#define SECURITY_FTDC_UT_SuperUser '2' + +typedef char TSecurityFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define SECURITY_FTDC_BFC_ForceUserLogout '1' +///û +#define SECURITY_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define SECURITY_FTDC_BFC_SyncBrokerData '3' +/// +#define SECURITY_FTDC_BFC_OrderInsert '5' +/// +#define SECURITY_FTDC_BFC_OrderAction '6' +///ȫѯ +#define SECURITY_FTDC_BFC_AllQuery '7' +///δ֪ +#define SECURITY_FTDC_BFC_UnkownOrderAction '8' +///תй +#define SECURITY_FTDC_BFC_DepositoryTransfer '9' +///ȯת +#define SECURITY_FTDC_BFC_ExcessStockTransfer 'A' +///ʽת +#define SECURITY_FTDC_BFC_FundInterTransfer 'B' +///ϵͳܣ/dz/޸ +#define SECURITY_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define SECURITY_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define SECURITY_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define SECURITY_FTDC_BFC_Trade 'd' +///ת +#define SECURITY_FTDC_BFC_Virement 'e' +///ѯ/ѯỰ˵ +#define SECURITY_FTDC_BFC_Session 'g' +///̬ͬ +#define SECURITY_FTDC_BFC_SyncOTP 'E' + +typedef char TSecurityFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ͨ˻ +#define SECURITY_FTDC_AcT_Normal '1' +///˻ +#define SECURITY_FTDC_AcT_Credit '2' +///Ʒ˻ +#define SECURITY_FTDC_AcT_Derive '3' +/// +#define SECURITY_FTDC_AcT_Other '4' + +typedef char TSecurityFtdcAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_DR_All '1' +///ܹ֯ +#define SECURITY_FTDC_DR_Group '2' +///һͶ +#define SECURITY_FTDC_DR_Single '3' + +typedef char TSecurityFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define SECURITY_FTDC_URT_Logon '1' +///ת +#define SECURITY_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define SECURITY_FTDC_URT_EMail '3' +///㵥 +#define SECURITY_FTDC_URT_Fax '4' +/// +#define SECURITY_FTDC_URT_ConditionOrder '5' + +typedef char TSecurityFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define SECURITY_FTDC_HF_Speculation '1' +///ױ +#define SECURITY_FTDC_HF_Hedge '3' + +typedef char TSecurityFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_D_Buy '0' +/// +#define SECURITY_FTDC_D_Sell '1' +///ETF깺 +#define SECURITY_FTDC_D_ETFPur '2' +///ETF +#define SECURITY_FTDC_D_ETFRed '3' +///ֻֽر +#define SECURITY_FTDC_D_CashIn '4' +///ծȯ +#define SECURITY_FTDC_D_PledgeBondIn '5' +///ծȯ +#define SECURITY_FTDC_D_PledgeBondOut '6' +/// +#define SECURITY_FTDC_D_Rationed '7' +///תй +#define SECURITY_FTDC_D_DepositoryTransfer '8' +///˻ +#define SECURITY_FTDC_D_CreditRationed '9' +///Ʒ +#define SECURITY_FTDC_D_BuyCollateral 'A' +///Ʒ +#define SECURITY_FTDC_D_SellCollateral 'B' +///Ʒת +#define SECURITY_FTDC_D_CollateralTransferIn 'C' +///Ʒת +#define SECURITY_FTDC_D_CollateralTransferOut 'D' +/// +#define SECURITY_FTDC_D_MarginTrade 'E' +///ȯ +#define SECURITY_FTDC_D_ShortSell 'F' +///ȯ +#define SECURITY_FTDC_D_RepayMargin 'G' +///ȯȯ +#define SECURITY_FTDC_D_RepayStock 'H' +///ֱӻ +#define SECURITY_FTDC_D_DirectRepayMargin 'I' +///ֱӻȯ +#define SECURITY_FTDC_D_DirectRepayStock 'J' +///ȯת +#define SECURITY_FTDC_D_ExcessStockTransfer 'K' +///OF깺 +#define SECURITY_FTDC_D_OFPur 'L' +///OF +#define SECURITY_FTDC_D_OFRed 'M' +///SF +#define SECURITY_FTDC_D_SFSplit 'N' +///SFϲ +#define SECURITY_FTDC_D_SFMerge 'O' +/// +#define SECURITY_FTDC_D_Covered 'P' +///֤ȯ()/ⶳ(ƽ) +#define SECURITY_FTDC_D_Freeze 'Q' +///Ȩ +#define SECURITY_FTDC_D_Execute 'R' + +typedef char TSecurityFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ͨɽ +#define SECURITY_FTDC_TRDT_Common '0' +///Ȩִ +#define SECURITY_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define SECURITY_FTDC_TRDT_OTC '2' +///תɽ +#define SECURITY_FTDC_TRDT_EFPDerived '3' +///ɽ +#define SECURITY_FTDC_TRDT_CombinationDerived '4' +///ETF깺 +#define SECURITY_FTDC_TRDT_EFTPurchase '5' +///ETF +#define SECURITY_FTDC_TRDT_EFTRedem '6' + +typedef char TSecurityFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCreationredemptionStatusTypeһ깺״̬ +///////////////////////////////////////////////////////////////////////// +///깺 +#define SECURITY_FTDC_CDS_Forbidden '0' +///ʾ깺 +#define SECURITY_FTDC_CDS_Allow '1' +///깺 +#define SECURITY_FTDC_CDS_OnlyPurchase '2' +///깺 +#define SECURITY_FTDC_CDS_OnlyRedeem '3' + +typedef char TSecurityFtdcCreationredemptionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcETFCurrenceReplaceStatusTypeһETFֽ־ +///////////////////////////////////////////////////////////////////////// +///ֹֽ +#define SECURITY_FTDC_ETFCRS_Forbidden '0' +///ֽ +#define SECURITY_FTDC_ETFCRS_Allow '1' +///ֽ +#define SECURITY_FTDC_ETFCRS_Force '2' + +typedef char TSecurityFtdcETFCurrenceReplaceStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInterestTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcInterestType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepurchaseMaxTimesTypeһعŴ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcRepurchaseMaxTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalStockTypeTypeһɱ +///////////////////////////////////////////////////////////////////////// +///ͨɱ +#define SECURITY_FTDC_CPTSTOCK_TOTALSTOCK '1' +///ͨɱ +#define SECURITY_FTDC_CPTSTOCK_CIRCULATION '2' + +typedef char TSecurityFtdcCapitalStockTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define SECURITY_FTDC_MPT_SettlementPrice '2' +///ɽ +#define SECURITY_FTDC_MPT_AveragePrice '3' +///ּ +#define SECURITY_FTDC_MPT_OpenPrice '4' + +typedef char TSecurityFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define SECURITY_FTDC_AG_All '1' +///ӯƣ +#define SECURITY_FTDC_AG_OnlyLost '2' +///ӯƣ +#define SECURITY_FTDC_AG_OnlyGain '3' +///ӯ +#define SECURITY_FTDC_AG_None '4' + +typedef char TSecurityFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define SECURITY_FTDC_ICP_Include '0' +///ƽӯ +#define SECURITY_FTDC_ICP_NotInclude '2' + +typedef char TSecurityFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///ܿ +#define SECURITY_FTDC_AWT_Enable '0' +///ܿ +#define SECURITY_FTDC_AWT_Disable '2' +///޲ֲܿ +#define SECURITY_FTDC_AWT_NoHoldEnable '3' + +typedef char TSecurityFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_HPA_Base '1' +///ǽ +#define SECURITY_FTDC_HPA_NoneTrade '4' +///֤ȯ +#define SECURITY_FTDC_HPA_Stock '5' + +typedef char TSecurityFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define SECURITY_FTDC_TPID_EncryptionStandard 'E' +///ûỰ +#define SECURITY_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define SECURITY_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define SECURITY_FTDC_TPID_IsAuthForce 'A' +///Ƿû¼ +#define SECURITY_FTDC_TPID_GenUserEvent 'G' +///ʼر +#define SECURITY_FTDC_TPID_StartOrderLocalID 'O' +///ȯȯȯ㷨 +#define SECURITY_FTDC_TPID_RepayStockAlgo 'R' +///Ʒ˻ʽȡ +#define SECURITY_FTDC_TPID_DeriveWithdrawRatio 'D' + +typedef char TSecurityFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_IR_All '1' +///Ͷ +#define SECURITY_FTDC_IR_Group '2' +///һͶ +#define SECURITY_FTDC_IR_Single '3' + +typedef char TSecurityFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define SECURITY_FTDC_DS_Asynchronous '1' +///ͬ +#define SECURITY_FTDC_DS_Synchronizing '2' +///ͬ +#define SECURITY_FTDC_DS_Synchronized '3' + +typedef char TSecurityFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define SECURITY_FTDC_TCS_NotConnected '1' +///Ѿ +#define SECURITY_FTDC_TCS_Connected '2' +///ѾԼѯ +#define SECURITY_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define SECURITY_FTDC_TCS_SubPrivateFlow '4' + +typedef char TSecurityFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define SECURITY_FTDC_OAS_Submitted 'a' +///Ѿ +#define SECURITY_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define SECURITY_FTDC_OAS_Rejected 'c' + +typedef char TSecurityFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define SECURITY_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define SECURITY_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define SECURITY_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define SECURITY_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define SECURITY_FTDC_OST_NoTradeNotQueueing '4' +/// +#define SECURITY_FTDC_OST_Canceled '5' +///δ֪ +#define SECURITY_FTDC_OST_Unknown 'a' +///δ +#define SECURITY_FTDC_OST_NotTouched 'b' +///Ѵ +#define SECURITY_FTDC_OST_Touched 'c' + +typedef char TSecurityFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define SECURITY_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define SECURITY_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define SECURITY_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define SECURITY_FTDC_OSS_Accepted '3' +///Ѿܾ +#define SECURITY_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define SECURITY_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define SECURITY_FTDC_OSS_ModifyRejected '6' + +typedef char TSecurityFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define SECURITY_FTDC_PSD_Today '1' +///ʷֲ +#define SECURITY_FTDC_PSD_History '2' + +typedef char TSecurityFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_ER_Broker '1' +///Ӫ +#define SECURITY_FTDC_ER_Host '2' +/// +#define SECURITY_FTDC_ER_Maker '3' + +typedef char TSecurityFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_PD_Net '1' +///ͷ +#define SECURITY_FTDC_PD_Long '2' +///ͷ +#define SECURITY_FTDC_PD_Short '3' +/// +#define SECURITY_FTDC_PD_Covered '4' + +typedef char TSecurityFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +///ʱɽʣ೷м۵ +#define SECURITY_FTDC_OPT_AnyPrice '1' +///޼ +#define SECURITY_FTDC_OPT_LimitPrice '2' +///嵵ʱɽʣ೷м۵ +#define SECURITY_FTDC_OPT_BestPrice '3' +///嵵ʱɽʣת޼м۵ +#define SECURITY_FTDC_OPT_BestLimitPrice '4' +///ȫɽм۵ +#define SECURITY_FTDC_OPT_AllPrice '5' +///ż۸м۵ +#define SECURITY_FTDC_OPT_ForwardBestPrice '6' +///Էż۸м۵ +#define SECURITY_FTDC_OPT_ReverseBestPrice '7' +///ʱɽʣת޼м۵ +#define SECURITY_FTDC_OPT_Any2LimitPrice '8' +///ȫɽ޼۵ +#define SECURITY_FTDC_OPT_AllLimitPrice '9' +///A +#define SECURITY_FTDC_OPT_ActiveANetPassSvrCode 'G' +///עA +#define SECURITY_FTDC_OPT_InactiveANetPassSvrCode 'H' +///B +#define SECURITY_FTDC_OPT_ActiveBNetPassSvrCode 'I' +///עB +#define SECURITY_FTDC_OPT_InactiveBNetPassSvrCode 'J' +///عע +#define SECURITY_FTDC_OPT_Repurchase 'K' +///ָ +#define SECURITY_FTDC_OPT_DesignatedCancel 'L' +///ָǼ +#define SECURITY_FTDC_OPT_Designated 'M' +///֤ȯ깺 +#define SECURITY_FTDC_OPT_SubscribingShares 'N' +///֤ȯ +#define SECURITY_FTDC_OPT_Split 'O' +///ҪԼչǼ +#define SECURITY_FTDC_OPT_TenderOffer 'P' +///ҪԼչ +#define SECURITY_FTDC_OPT_TenderOfferCancel 'Q' +///֤ȯͶƱ +#define SECURITY_FTDC_OPT_Ballot 'R' +///תծתǼ +#define SECURITY_FTDC_OPT_ConvertibleBondsConvet 'S' +///תծ۵Ǽ +#define SECURITY_FTDC_OPT_ConvertibleBondsRepurchase 'T' +///Ȩ֤Ȩ +#define SECURITY_FTDC_OPT_Exercise 'U' +///ʽ깺 +#define SECURITY_FTDC_OPT_PurchasingFunds 'V' +///ʽ +#define SECURITY_FTDC_OPT_RedemingFunds 'W' +///ʽϹ +#define SECURITY_FTDC_OPT_SubscribingFunds 'X' +///ʽתйת +#define SECURITY_FTDC_OPT_LOFIssue 'Y' +///ʽ÷ֺ췽ʽ +#define SECURITY_FTDC_OPT_LOFSetBonusType 'Z' +///ʽתΪ +#define SECURITY_FTDC_OPT_LOFConvert 'a' +///ծȯ +#define SECURITY_FTDC_OPT_DebentureStockIn 'b' +///ծȯ +#define SECURITY_FTDC_OPT_DebentureStockOut 'c' +///ETF깺 +#define SECURITY_FTDC_OPT_PurchasesETF 'd' +///ETF +#define SECURITY_FTDC_OPT_RedeemETF 'e' + +typedef char TSecurityFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_OF_Open '0' +///ƽ +#define SECURITY_FTDC_OF_Close '1' +///ǿƽ +#define SECURITY_FTDC_OF_ForceClose '2' +///ƽ +#define SECURITY_FTDC_OF_CloseToday '3' +///ƽ +#define SECURITY_FTDC_OF_CloseYesterday '4' +///ǿ +#define SECURITY_FTDC_OF_ForceOff '5' +///ǿƽ +#define SECURITY_FTDC_OF_LocalForceClose '6' + +typedef char TSecurityFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define SECURITY_FTDC_FCC_NotForceClose '0' +///ʽ +#define SECURITY_FTDC_FCC_LackDeposit '1' +///ͻ +#define SECURITY_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define SECURITY_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define SECURITY_FTDC_FCC_NotMultiple '4' +///Υ +#define SECURITY_FTDC_FCC_Violation '5' +/// +#define SECURITY_FTDC_FCC_Other '6' +///Ȼٽ +#define SECURITY_FTDC_FCC_PersonDeliv '7' + +typedef char TSecurityFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_ORDT_Normal '0' +/// +#define SECURITY_FTDC_ORDT_DeriveFromQuote '1' +/// +#define SECURITY_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define SECURITY_FTDC_ORDT_Combination '3' +/// +#define SECURITY_FTDC_ORDT_ConditionalOrder '4' +/// +#define SECURITY_FTDC_ORDT_Swap '5' + +typedef char TSecurityFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define SECURITY_FTDC_TC_IOC '1' +///Ч +#define SECURITY_FTDC_TC_GFS '2' +///Ч +#define SECURITY_FTDC_TC_GFD '3' +///ָǰЧ +#define SECURITY_FTDC_TC_GTD '4' +///ǰЧ +#define SECURITY_FTDC_TC_GTC '5' +///ϾЧ +#define SECURITY_FTDC_TC_GFA '6' + +typedef char TSecurityFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define SECURITY_FTDC_VC_AV '1' +///С +#define SECURITY_FTDC_VC_MV '2' +///ȫ +#define SECURITY_FTDC_VC_CV '3' + +typedef char TSecurityFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_CC_Immediately '1' +///ֹ +#define SECURITY_FTDC_CC_Touch '2' +///ֹӮ +#define SECURITY_FTDC_CC_TouchProfit '3' +///Ԥ +#define SECURITY_FTDC_CC_ParkedOrder '4' +///¼۴ +#define SECURITY_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define SECURITY_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define SECURITY_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define SECURITY_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define SECURITY_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define SECURITY_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define SECURITY_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define SECURITY_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define SECURITY_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define SECURITY_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define SECURITY_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define SECURITY_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TSecurityFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define SECURITY_FTDC_AF_Delete '0' +///޸ +#define SECURITY_FTDC_AF_Modify '3' + +typedef char TSecurityFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define SECURITY_FTDC_TR_Allow '0' +///ܽ +#define SECURITY_FTDC_TR_Forbidden '2' + +typedef char TSecurityFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define SECURITY_FTDC_OSRC_Participant '0' +///ԹԱ +#define SECURITY_FTDC_OSRC_Administrator '1' + +typedef char TSecurityFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define SECURITY_FTDC_PSRC_LastPrice '0' +///ίм +#define SECURITY_FTDC_PSRC_Buy '1' +///ίм +#define SECURITY_FTDC_PSRC_Sell '2' + +typedef char TSecurityFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TSecurityFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TSecurityFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define SECURITY_FTDC_UET_Login '1' +///dz +#define SECURITY_FTDC_UET_Logout '2' +///׳ɹ +#define SECURITY_FTDC_UET_Trading '3' +///ʧ +#define SECURITY_FTDC_UET_TradingError '4' +///޸ +#define SECURITY_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define SECURITY_FTDC_UET_Authenticate '6' +/// +#define SECURITY_FTDC_UET_Other '9' + +typedef char TSecurityFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define SECURITY_FTDC_OTP_NONE '0' +///ʱ +#define SECURITY_FTDC_OTP_TOTP '1' + +typedef char TSecurityFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define SECURITY_FTDC_TSRC_NORMAL '0' +///Բѯ +#define SECURITY_FTDC_TSRC_QUERY '1' + +typedef char TSecurityFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchIDTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBranchIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockPriceTypeһ֤ȯ׼۸ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcStockPriceType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightModelIDTypeһƱȨģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRightModelIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentRangeTypeһƱȨ޷ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_INR_All '1' +///Ʒ +#define SECURITY_FTDC_INR_Product '2' +///ƱȨģ +#define SECURITY_FTDC_INR_Model '3' +///Ʊ +#define SECURITY_FTDC_INR_Stock '4' +///г +#define SECURITY_FTDC_INR_Market '5' + +typedef char TSecurityFtdcInstrumentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserSessionHashTypeһûỰHashֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcUserSessionHashType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockTradeTypeTypeһ֤ȯ +///////////////////////////////////////////////////////////////////////// +///ɽ֤ȯ +#define SECURITY_FTDC_STT_Stock '0' +/// +#define SECURITY_FTDC_STT_BuyNetService '1' +///عע +#define SECURITY_FTDC_STT_CancelRepurchase '2' +///ָ +#define SECURITY_FTDC_STT_CancelRegister '3' +///ָǼ +#define SECURITY_FTDC_STT_Register '4' +///뷢깺 +#define SECURITY_FTDC_STT_PurchaseIssue '5' +/// +#define SECURITY_FTDC_STT_Allotment '6' +///ҪԼչ +#define SECURITY_FTDC_STT_SellTender '7' +///ҪԼչ +#define SECURITY_FTDC_STT_BuyTender '8' +///ͶƱ +#define SECURITY_FTDC_STT_NetVote '9' +///תծ +#define SECURITY_FTDC_STT_SellConvertibleBonds 'a' +///Ȩ֤Ȩ +#define SECURITY_FTDC_STT_OptionExecute 'b' +///ʽ깺 +#define SECURITY_FTDC_STT_PurchaseOF 'c' +///ʽ +#define SECURITY_FTDC_STT_RedeemOF 'd' +///ʽϹ +#define SECURITY_FTDC_STT_SubscribeOF 'e' +///ʽתйת +#define SECURITY_FTDC_STT_OFCustodianTranfer 'f' +///ʽֺ +#define SECURITY_FTDC_STT_OFDividendConfig 'g' +///ʽת +#define SECURITY_FTDC_STT_OFTransfer 'h' +///ծȯ +#define SECURITY_FTDC_STT_BondsIn 'i' +///ծȯ +#define SECURITY_FTDC_STT_BondsOut 'j' +///EFT깺 +#define SECURITY_FTDC_STT_PurchaseETF 'k' +///EFT +#define SECURITY_FTDC_STT_RedeemETF 'l' +///תծ۵Ǽ +#define SECURITY_FTDC_STT_ConvertibleRegister 'm' + +typedef char TSecurityFtdcStockTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_HTAA_Base '1' + +typedef char TSecurityFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockWthTypeһƱʹˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcStockWthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockSeqTypeһƱʹˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcStockSeqType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWTFSTypeһίзʽ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcWTFSType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWTLBTypeһί +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcWTLBType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWTRQTypeһί +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcWTRQType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINTEGERTypeһһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINTEGERType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINT3Typeһλ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINT3Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINT6Typeһλ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINT6Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINT12Typeһʮλ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINT12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR1TypeһһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR1Type[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR2TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR2Type[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR3TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR3Type[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR4TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR4Type[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR5TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR5Type[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR6TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR6Type[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR8TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR8Type[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR10TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR10Type[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR11TypeһʮһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR11Type[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR12TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR12Type[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR13TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR13Type[14]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR14TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR14Type[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR16TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR16Type[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR19TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR19Type[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR20TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR20Type[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR21TypeһʮһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR21Type[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR23TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR23Type[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR30TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR30Type[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR32TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR32Type[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR50TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR50Type[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR64TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR64Type[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR65TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR65Type[66]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR4TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR4Type[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR6TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR6Type[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR8TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR8Type[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR10TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR10Type[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR12TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR12Type[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR16TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR16Type[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR20TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR20Type[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR30TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR30Type[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR50TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR50Type[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR60TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR60Type[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR65TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR65Type[66]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR80TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR80Type[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR84TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR84Type[85]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR255TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR255Type[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR1024TypeһһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR1024Type[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL8P3Typeһ˵ʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL8P3Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL9P3Typeһŵʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL9P3Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL9P6Typeһŵʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL9P6Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL10P4Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL10P4Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL16P2Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL16P2Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL16P8Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL16P8Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL22P2Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL22P2Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLiberSerialTypeһLiberϵͳˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcLiberSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_FIOT_FundIO '1' +///ת +#define SECURITY_FTDC_FIOT_Transfer '2' + +typedef char TSecurityFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define SECURITY_FTDC_FT_Deposite '1' +///ʽ +#define SECURITY_FTDC_FT_ItemFund '2' +///˾ +#define SECURITY_FTDC_FT_Company '3' + +typedef char TSecurityFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_FD_In '1' +/// +#define SECURITY_FTDC_FD_Out '2' + +typedef char TSecurityFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_BF_ICBC '1' +///ũҵ +#define SECURITY_FTDC_BF_ABC '2' +///й +#define SECURITY_FTDC_BF_BC '3' +/// +#define SECURITY_FTDC_BF_CBC '4' +///ͨ +#define SECURITY_FTDC_BF_BOC '5' +/// +#define SECURITY_FTDC_BF_Other 'Z' + +typedef char TSecurityFtdcBankFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define SECURITY_FTDC_FS_Record '1' +///Ѹ +#define SECURITY_FTDC_FS_Check '2' +///ѳ +#define SECURITY_FTDC_FS_Charge '3' + +typedef char TSecurityFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerBranchIDTypeһ͹˾֧ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define SECURITY_FTDC_LF_Yes '0' +///Ƭ +#define SECURITY_FTDC_LF_No '1' + +typedef char TSecurityFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define SECURITY_FTDC_CUSTT_Person '0' +/// +#define SECURITY_FTDC_CUSTT_Institution '1' + +typedef char TSecurityFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_YNI_Yes '0' +/// +#define SECURITY_FTDC_YNI_No '1' + +typedef char TSecurityFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFeeTypeһӦվ͹˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcBrokerFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define SECURITY_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define SECURITY_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define SECURITY_FTDC_FPF_SHA '2' + +typedef char TSecurityFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define SECURITY_FTDC_BAT_BankBook '1' +/// +#define SECURITY_FTDC_BAT_SavingCard '2' +///ÿ +#define SECURITY_FTDC_BAT_CreditCard '3' + +typedef char TSecurityFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define SECURITY_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define SECURITY_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define SECURITY_FTDC_BPWDF_EncryptCheck '2' + +typedef char TSecurityFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForBrokerTypeһжԾ͹˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankCodingForBrokerType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_TRFS_Normal '0' +/// +#define SECURITY_FTDC_TRFS_Repealed '1' + +typedef char TSecurityFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define SECURITY_FTDC_AVAF_Invalid '0' +///Ч +#define SECURITY_FTDC_AVAF_Valid '1' +/// +#define SECURITY_FTDC_AVAF_Repeal '2' + +typedef char TSecurityFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepayStockAlgoTypeһȯȯ㷨 +///////////////////////////////////////////////////////////////////////// +///Ĭ㷨 +#define SECURITY_FTDC_RSA_Original '0' +///ȯ +#define SECURITY_FTDC_RSA_Ratio '1' +///Min[1,2] +#define SECURITY_FTDC_RSA_Min '2' + +typedef char TSecurityFtdcRepayStockAlgoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +///ͨҵ +#define SECURITY_FTDC_TS_Common '1' +///Ȩ +#define SECURITY_FTDC_TS_Options '2' + +typedef char TSecurityFtdcTradeSpanType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleSystemTypeTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define SECURITY_FTDC_SST_Aboss '1' +///ϵͳ +#define SECURITY_FTDC_SST_HS '2' + +typedef char TSecurityFtdcSettleSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIndexTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcTradeIndexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSplitMergeStatusTypeһֺϲ״̬ +///////////////////////////////////////////////////////////////////////// +///ʾֺͺϲ +#define SECURITY_FTDC_SMS_Allow '0' +///֡ϲ +#define SECURITY_FTDC_SMS_OnlySplit '1' +///֡ϲ +#define SECURITY_FTDC_SMS_OnlyMerge '2' +///ֺͺϲ +#define SECURITY_FTDC_SMS_Forbidden '3' + +typedef char TSecurityFtdcSplitMergeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundInterTransferTypeTypeһʽת +///////////////////////////////////////////////////////////////////////// +///ת +#define SECURITY_FTDC_FITT_TransferIn '0' +///ת +#define SECURITY_FTDC_FITT_TransferOut '1' + +typedef char TSecurityFtdcFundInterTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentTypeTypeһԼ +///////////////////////////////////////////////////////////////////////// +///ͨ +#define SECURITY_FTDC_IT_Normal '0' +///Ȩ +#define SECURITY_FTDC_IT_CallOptions '1' +///Ȩ +#define SECURITY_FTDC_IT_PutOptions '2' + +typedef char TSecurityFtdcInstrumentTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorLevelTypeһͶȨ׵ȼ +///////////////////////////////////////////////////////////////////////// +///һ +#define SECURITY_FTDC_IL_Level_1 '0' +/// +#define SECURITY_FTDC_IL_Level_2 '1' +/// +#define SECURITY_FTDC_IL_Level_3 '2' + +typedef char TSecurityFtdcInvestorLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDirectionTypeһƽַ +///////////////////////////////////////////////////////////////////////// +///ƽ +#define SECURITY_FTDC_CD_CloseBuy '!' +///ƽ +#define SECURITY_FTDC_CD_CloseSell '@' +///ƽ +#define SECURITY_FTDC_CD_CloseCover '#' + +typedef char TSecurityFtdcCloseDirectionType; + +#endif diff --git a/vn.lts/ltsapi/SecurityFtdcUserApiStruct.h b/vn.lts/ltsapi/SecurityFtdcUserApiStruct.h new file mode 100644 index 00000000..2c91e1c4 --- /dev/null +++ b/vn.lts/ltsapi/SecurityFtdcUserApiStruct.h @@ -0,0 +1,2312 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcUserApiStruct.h +///@brief ҵݽṹ +///////////////////////////////////////////////////////////////////////// + +#if !defined(SECURITY_FTDCSTRUCT_H) +#define SECURITY_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SecurityFtdcUserApiDataType.h" + +///ӦϢ +struct CSecurityFtdcRspInfoField +{ + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CSecurityFtdcExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcExchangeNameType ExchangeName; + /// + TSecurityFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CSecurityFtdcProductField +{ + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; + ///Ʒ + TSecurityFtdcProductNameType ProductName; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ʒ + TSecurityFtdcProductClassType ProductClass; + ///Լ + TSecurityFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TSecurityFtdcPriceType PriceTick; + ///м۵µ + TSecurityFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TSecurityFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TSecurityFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TSecurityFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TSecurityFtdcPositionTypeType PositionType; + ///ֲ + TSecurityFtdcPositionDateTypeType PositionDateType; + ///ETFС׵λ + TSecurityFtdcVolumeType EFTMinTradeVolume; +}; + +///Լ +struct CSecurityFtdcInstrumentField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; + ///Ʒ + TSecurityFtdcProductClassType ProductClass; + /// + TSecurityFtdcYearType DeliveryYear; + /// + TSecurityFtdcMonthType DeliveryMonth; + ///м۵µ + TSecurityFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TSecurityFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TSecurityFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TSecurityFtdcVolumeType MinLimitOrderVolume; + ///Լ + TSecurityFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TSecurityFtdcPriceType PriceTick; + /// + TSecurityFtdcDateType CreateDate; + /// + TSecurityFtdcDateType OpenDate; + /// + TSecurityFtdcDateType ExpireDate; + ///ʼ + TSecurityFtdcDateType StartDelivDate; + /// + TSecurityFtdcDateType EndDelivDate; + ///Լ״̬ + TSecurityFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TSecurityFtdcBoolType IsTrading; + ///ֲ + TSecurityFtdcPositionTypeType PositionType; + ///ܷ񳷵 + TSecurityFtdcBoolType OrderCanBeWithdraw; + ///Сµλ + TSecurityFtdcVolumeType MinBuyVolume; + ///Сµλ + TSecurityFtdcVolumeType MinSellVolume; + ///ƱȨģ + TSecurityFtdcRightModelIDType RightModelID; + ///ֲֽ + TSecurityFtdcPosTradeTypeType PosTradeType; + ///г + TSecurityFtdcInstrumentIDType MarketID; + ///Ȩִм۸ + TSecurityFtdcPriceType ExecPrice; + ///Ȩֱ֤ + TSecurityFtdcMoneyType UnitMargin; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; + ///Ȩ֤1 + TSecurityFtdcRatioType OptionsMarginParam1; + ///Ȩ֤2 + TSecurityFtdcRatioType OptionsMarginParam2; +}; + +///͹˾ +struct CSecurityFtdcBrokerField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///͹˾ + TSecurityFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TSecurityFtdcBrokerNameType BrokerName; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///Ա;͹˾ձ +struct CSecurityFtdcPartBrokerField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///Ͷ +struct CSecurityFtdcInvestorField +{ + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TSecurityFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TSecurityFtdcPartyNameType InvestorName; + ///֤ + TSecurityFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TSecurityFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///ϺӪҵ + TSecurityFtdcTraderIDType SHBranchID; + ///Ӫҵ + TSecurityFtdcTraderIDType SZBranchID; + ///ϵͳ + TSecurityFtdcSettleSystemTypeType SettleSystemType; + ///ͶȨ׵ȼ + TSecurityFtdcInvestorLevelType InvestorLevel; +}; + +///ױ +struct CSecurityFtdcTradingCodeField +{ + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///AccountID + TSecurityFtdcAccountIDType AccountID; + ///׵Ԫ + TSecurityFtdcTraderIDType PBU; + ///ClientType + TSecurityFtdcClientTypeType ClientType; +}; + +///û +struct CSecurityFtdcSuperUserField +{ + ///û + TSecurityFtdcUserIDType UserID; + ///û + TSecurityFtdcUserNameType UserName; + /// + TSecurityFtdcPasswordType Password; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///ûȨ +struct CSecurityFtdcSuperUserFunctionField +{ + ///û + TSecurityFtdcUserIDType UserID; + ///ܴ + TSecurityFtdcFunctionCodeType FunctionCode; +}; + +///͹˾û +struct CSecurityFtdcBrokerUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///û + TSecurityFtdcUserNameType UserName; + ///û + TSecurityFtdcUserTypeType UserType; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///Ƿʹ + TSecurityFtdcBoolType IsUsingOTP; +}; + +///͹˾ûȨ +struct CSecurityFtdcBrokerUserFunctionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///͹˾ܴ + TSecurityFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///ʽ˻ +struct CSecurityFtdcTradingAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + ///ϴѺ + TSecurityFtdcMoneyType PreMortgage; + ///ϴö + TSecurityFtdcMoneyType PreCredit; + ///ϴδ + TSecurityFtdcMoneyType PreDeposit; + ///ϴν׼ + TSecurityFtdcMoneyType PreBalance; + ///ϴռõı֤ + TSecurityFtdcMoneyType PreMargin; + ///Ϣ + TSecurityFtdcMoneyType InterestBase; + ///Ϣ + TSecurityFtdcMoneyType Interest; + /// + TSecurityFtdcMoneyType Deposit; + /// + TSecurityFtdcMoneyType Withdraw; + ///ı֤ + TSecurityFtdcMoneyType FrozenMargin; + ///ʽ + TSecurityFtdcMoneyType FrozenCash; + /// + TSecurityFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TSecurityFtdcMoneyType CurrMargin; + ///ʽ + TSecurityFtdcMoneyType CashIn; + /// + TSecurityFtdcMoneyType Commission; + ///׼ + TSecurityFtdcMoneyType Balance; + ///ֽ + TSecurityFtdcMoneyType Available; + ///ȡʽ + TSecurityFtdcMoneyType WithdrawQuota; + ///׼ + TSecurityFtdcMoneyType Reserve; + /// + TSecurityFtdcDateType TradingDay; + ///֤ + TSecurityFtdcMoneyType Credit; + ///Ѻ + TSecurityFtdcMoneyType Mortgage; + ///֤ + TSecurityFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TSecurityFtdcMoneyType DeliveryMargin; + ///֤ + TSecurityFtdcMoneyType ExchangeDeliveryMargin; + ///Ĺ + TSecurityFtdcMoneyType FrozenTransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType FrozenStampTax; + /// + TSecurityFtdcMoneyType TransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType StampTax; + /// + TSecurityFtdcMoneyType ConversionAmount; + ///Ŷ + TSecurityFtdcMoneyType CreditAmount; + ///֤ȯֵܼ + TSecurityFtdcMoneyType StockValue; + ///ծعռʽ + TSecurityFtdcMoneyType BondRepurchaseAmount; + ///ծعռʽ + TSecurityFtdcMoneyType ReverseRepurchaseAmount; + /// + TSecurityFtdcCurrencyCodeType CurrencyCode; + ///˻ + TSecurityFtdcAccountTypeType AccountType; + /// + TSecurityFtdcMoneyType MarginTradeAmount; + ///ȯ + TSecurityFtdcMoneyType ShortSellAmount; + ///ʳֲӯ + TSecurityFtdcMoneyType MarginTradeProfit; + ///ȯֲӯ + TSecurityFtdcMoneyType ShortSellProfit; + ///ȯֵ + TSecurityFtdcMoneyType SSStockValue; + ///άֵ + TSecurityFtdcRatioType CreditRatio; + ///Ȩʽ + TSecurityFtdcMoneyType FrozenExecCash; +}; + +///ֹ¼û +struct CSecurityFtdcLoginForbiddenUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +/// +struct CSecurityFtdcDepthMarketDataField +{ + /// + TSecurityFtdcDateType TradingDay; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TSecurityFtdcPriceType LastPrice; + ///ϴν + TSecurityFtdcPriceType PreSettlementPrice; + /// + TSecurityFtdcPriceType PreClosePrice; + ///ֲ + TSecurityFtdcLargeVolumeType PreOpenInterest; + /// + TSecurityFtdcPriceType OpenPrice; + ///߼ + TSecurityFtdcPriceType HighestPrice; + ///ͼ + TSecurityFtdcPriceType LowestPrice; + /// + TSecurityFtdcVolumeType Volume; + ///ɽ + TSecurityFtdcMoneyType Turnover; + ///ֲ + TSecurityFtdcLargeVolumeType OpenInterest; + /// + TSecurityFtdcPriceType ClosePrice; + ///ν + TSecurityFtdcPriceType SettlementPrice; + ///ͣ + TSecurityFtdcPriceType UpperLimitPrice; + ///ͣ + TSecurityFtdcPriceType LowerLimitPrice; + ///ʵ + TSecurityFtdcRatioType PreDelta; + ///ʵ + TSecurityFtdcRatioType CurrDelta; + ///޸ʱ + TSecurityFtdcTimeType UpdateTime; + ///޸ĺ + TSecurityFtdcMillisecType UpdateMillisec; + ///һ + TSecurityFtdcPriceType BidPrice1; + ///һ + TSecurityFtdcVolumeType BidVolume1; + ///һ + TSecurityFtdcPriceType AskPrice1; + ///һ + TSecurityFtdcVolumeType AskVolume1; + ///۶ + TSecurityFtdcPriceType BidPrice2; + /// + TSecurityFtdcVolumeType BidVolume2; + ///۶ + TSecurityFtdcPriceType AskPrice2; + /// + TSecurityFtdcVolumeType AskVolume2; + /// + TSecurityFtdcPriceType BidPrice3; + /// + TSecurityFtdcVolumeType BidVolume3; + /// + TSecurityFtdcPriceType AskPrice3; + /// + TSecurityFtdcVolumeType AskVolume3; + /// + TSecurityFtdcPriceType BidPrice4; + /// + TSecurityFtdcVolumeType BidVolume4; + /// + TSecurityFtdcPriceType AskPrice4; + /// + TSecurityFtdcVolumeType AskVolume4; + /// + TSecurityFtdcPriceType BidPrice5; + /// + TSecurityFtdcVolumeType BidVolume5; + /// + TSecurityFtdcPriceType AskPrice5; + /// + TSecurityFtdcVolumeType AskVolume5; + ///վ + TSecurityFtdcPriceType AveragePrice; + ///ҵ + TSecurityFtdcDateType ActionDay; +}; + +///ͶߺԼȨ +struct CSecurityFtdcInstrumentTradingRightField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSecurityFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcDirectionType Direction; + ///Ȩ + TSecurityFtdcTradingRightType TradingRight; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ƱȨ޷ + TSecurityFtdcInstrumentRangeType InstrumentRange; +}; + +///Ͷֲ߳ϸ +struct CSecurityFtdcInvestorPositionDetailField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TSecurityFtdcHedgeFlagType HedgeFlag; + /// + TSecurityFtdcDirectionType Direction; + /// + TSecurityFtdcDateType OpenDate; + ///ɽ + TSecurityFtdcTradeIDType TradeID; + /// + TSecurityFtdcVolumeType Volume; + ///ּ + TSecurityFtdcPriceType OpenPrice; + /// + TSecurityFtdcDateType TradingDay; + ///ɽ + TSecurityFtdcTradeTypeType TradeType; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ͷ֤߱ + TSecurityFtdcMoneyType Margin; + ///֤ + TSecurityFtdcMoneyType ExchMargin; + /// + TSecurityFtdcPriceType LastSettlementPrice; + /// + TSecurityFtdcPriceType SettlementPrice; + ///ƽ + TSecurityFtdcVolumeType CloseVolume; + ///ƽֽ + TSecurityFtdcMoneyType CloseAmount; + /// + TSecurityFtdcMoneyType TransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType StampTax; + /// + TSecurityFtdcMoneyType Commission; + ///AccountID + TSecurityFtdcAccountIDType AccountID; + ///Ѻ + TSecurityFtdcVolumeType PledgeInPosition; + ///Ѻⶳ + TSecurityFtdcVolumeType PledgeInFrozenPosition; + ///عʹõı׼ȯ + TSecurityFtdcVolumeType RepurchasePosition; + ///ȯ + TSecurityFtdcMoneyType Amount; + ///ĺԼ + TSecurityFtdcInstrumentIDType UnderlyingInstrumentID; +}; + +///ծȯϢ +struct CSecurityFtdcBondInterestField +{ + /// + TSecurityFtdcDateType TradingDay; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ϣ + TSecurityFtdcInterestType Interest; +}; + +///ֵϢ +struct CSecurityFtdcMarketRationInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcVolumeType RationVolume; +}; + +///Լ +struct CSecurityFtdcInstrumentCommissionRateField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSecurityFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcDirectionType Direction; + ///ӡ˰ + TSecurityFtdcRatioType StampTaxRateByMoney; + ///ӡ˰() + TSecurityFtdcRatioType StampTaxRateByVolume; + /// + TSecurityFtdcRatioType TransferFeeRateByMoney; + ///() + TSecurityFtdcRatioType TransferFeeRateByVolume; + ///׷ + TSecurityFtdcRatioType TradeFeeByMoney; + ///׷() + TSecurityFtdcRatioType TradeFeeByVolume; + ///׸ӷ + TSecurityFtdcRatioType MarginByMoney; + ///С׷ + TSecurityFtdcPriceType MinTradeFee; +}; + +///ȯϢ +struct CSecurityFtdcExcessStockInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///ȯ + TSecurityFtdcVolumeType ExcessVolume; + ///ȯ + TSecurityFtdcVolumeType ExcessFrozenVolume; +}; + +///ETFԼ +struct CSecurityFtdcETFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; + ///ETFӦ + TSecurityFtdcInstrumentIDType ETFPurRedInstrumentID; + ///С깺صλӦETF + TSecurityFtdcVolumeType CreationRedemptionUnit; + ///ֽ + TSecurityFtdcRatioType Maxcashratio; + ///깺״̬ + TSecurityFtdcCreationredemptionStatusType Creationredemption; + ///Ԥ + TSecurityFtdcMoneyType EstimateCashComponent; +}; + +///ETFƱ +struct CSecurityFtdcETFBasketField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; + ///Ʊ֤ȯ + TSecurityFtdcInstrumentIDType StockInstrumentID; + ///Ʊ֤ȯ + TSecurityFtdcInstrumentNameType StockInstrumentName; + ///Ʊ + TSecurityFtdcVolumeType Volume; + ///־ + TSecurityFtdcETFCurrenceReplaceStatusType CurrenceReplaceStatus; + ///۱ + TSecurityFtdcRatioType Premium; + ///ܽ + TSecurityFtdcMoneyType Amount; +}; + +///OFԼ +struct CSecurityFtdcOFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///OF + TSecurityFtdcInstrumentIDType InstrumentID; + ///깺״̬ + TSecurityFtdcCreationredemptionStatusType Creationredemption; + ///ֵ + TSecurityFtdcPriceType NetPrice; +}; + +///ETFԼ +struct CSecurityFtdcSFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcInstrumentIDType InstrumentID; + ///SF + TSecurityFtdcInstrumentIDType SFInstrumentID; + ///ֺϲ״̬ + TSecurityFtdcSplitMergeStatusType SplitMergeStatus; + ///С + TSecurityFtdcVolumeType MinSplitVolume; + ///Сϲ + TSecurityFtdcVolumeType MinMergeVolume; + ////ϲ + TSecurityFtdcVolumeType VolumeRatio; + ///ֵ + TSecurityFtdcPriceType NetPrice; +}; + +///Ա̻ +struct CSecurityFtdcTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + /// + TSecurityFtdcPasswordType Password; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TSecurityFtdcTraderConnectStatusType TraderConnectStatus; + /// + TSecurityFtdcDateType ConnectRequestDate; + ///ʱ + TSecurityFtdcTimeType ConnectRequestTime; + ///ϴα + TSecurityFtdcDateType LastReportDate; + ///ϴαʱ + TSecurityFtdcTimeType LastReportTime; + /// + TSecurityFtdcDateType ConnectDate; + ///ʱ + TSecurityFtdcTimeType ConnectTime; + /// + TSecurityFtdcDateType StartDate; + ///ʱ + TSecurityFtdcTimeType StartTime; + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; +}; + +///鱨̻ +struct CSecurityFtdcMDTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + /// + TSecurityFtdcPasswordType Password; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TSecurityFtdcTraderConnectStatusType TraderConnectStatus; + /// + TSecurityFtdcDateType ConnectRequestDate; + ///ʱ + TSecurityFtdcTimeType ConnectRequestTime; + ///ϴα + TSecurityFtdcDateType LastReportDate; + ///ϴαʱ + TSecurityFtdcTimeType LastReportTime; + /// + TSecurityFtdcDateType ConnectDate; + ///ʱ + TSecurityFtdcTimeType ConnectTime; + /// + TSecurityFtdcDateType StartDate; + ///ʱ + TSecurityFtdcTimeType StartTime; + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; +}; + +///ǰ״̬ +struct CSecurityFtdcFrontStatusField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///ϴα + TSecurityFtdcDateType LastReportDate; + ///ϴαʱ + TSecurityFtdcTimeType LastReportTime; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///ûỰ +struct CSecurityFtdcUserSessionField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///¼ + TSecurityFtdcDateType LoginDate; + ///¼ʱ + TSecurityFtdcTimeType LoginTime; + ///IPַ + TSecurityFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TSecurityFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSecurityFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSecurityFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TSecurityFtdcMacAddressType MacAddress; +}; + +/// +struct CSecurityFtdcOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///۸ + TSecurityFtdcOrderPriceTypeType OrderPriceType; + /// + TSecurityFtdcDirectionType Direction; + ///Ͽƽ־ + TSecurityFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSecurityFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSecurityFtdcStockPriceType LimitPrice; + /// + TSecurityFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSecurityFtdcTimeConditionType TimeCondition; + ///GTD + TSecurityFtdcDateType GTDDate; + ///ɽ + TSecurityFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSecurityFtdcVolumeType MinVolume; + /// + TSecurityFtdcContingentConditionType ContingentCondition; + ///ֹ + TSecurityFtdcPriceType StopPrice; + ///ǿƽԭ + TSecurityFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSecurityFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcRequestIDType RequestID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ύ״̬ + TSecurityFtdcOrderSubmitStatusType OrderSubmitStatus; + ///˻ + TSecurityFtdcAccountIDType AccountID; + ///ʾ + TSecurityFtdcSequenceNoType NotifySequence; + /// + TSecurityFtdcDateType TradingDay; + /// + TSecurityFtdcOrderSysIDType OrderSysID; + ///Դ + TSecurityFtdcOrderSourceType OrderSource; + ///״̬ + TSecurityFtdcOrderStatusType OrderStatus; + /// + TSecurityFtdcOrderTypeType OrderType; + ///ɽ + TSecurityFtdcVolumeType VolumeTraded; + ///ʣ + TSecurityFtdcVolumeType VolumeTotal; + /// + TSecurityFtdcDateType InsertDate; + ///ίʱ + TSecurityFtdcTimeType InsertTime; + ///ʱ + TSecurityFtdcTimeType ActiveTime; + ///ʱ + TSecurityFtdcTimeType SuspendTime; + ///޸ʱ + TSecurityFtdcTimeType UpdateTime; + ///ʱ + TSecurityFtdcTimeType CancelTime; + ///޸ĽԱ + TSecurityFtdcTraderIDType ActiveTraderID; + ///Ա + TSecurityFtdcParticipantIDType ClearingPartID; + /// + TSecurityFtdcSequenceNoType SequenceNo; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///û˲ƷϢ + TSecurityFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TSecurityFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TSecurityFtdcBoolType UserForceClose; + ///û + TSecurityFtdcUserIDType ActiveUserID; + ///͹˾ + TSecurityFtdcSequenceNoType BrokerOrderSeq; + ///ر + TSecurityFtdcOrderSysIDType RelativeOrderSysID; + ///Ӫҵ + TSecurityFtdcBranchIDType BranchID; + ///ɽ + TSecurityFtdcMoneyType TradeAmount; + ///ǷETF + TSecurityFtdcBoolType IsETF; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; +}; + +/// +struct CSecurityFtdcOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcOrderActionRefType OrderActionRef; + /// + TSecurityFtdcOrderRefType OrderRef; + /// + TSecurityFtdcRequestIDType RequestID; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///־ + TSecurityFtdcActionFlagType ActionFlag; + ///۸ + TSecurityFtdcPriceType LimitPrice; + ///仯 + TSecurityFtdcVolumeType VolumeChange; + /// + TSecurityFtdcDateType ActionDate; + ///ʱ + TSecurityFtdcTimeType ActionTime; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///ر + TSecurityFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSecurityFtdcOrderActionStatusType OrderActionStatus; + ///û + TSecurityFtdcUserIDType UserID; + ///Ӫҵ + TSecurityFtdcBranchIDType BranchID; + ///״̬Ϣ + TSecurityFtdcErrorMsgType StatusMsg; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; +}; + +///󱨵 +struct CSecurityFtdcErrOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///۸ + TSecurityFtdcOrderPriceTypeType OrderPriceType; + /// + TSecurityFtdcDirectionType Direction; + ///Ͽƽ־ + TSecurityFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSecurityFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSecurityFtdcStockPriceType LimitPrice; + /// + TSecurityFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSecurityFtdcTimeConditionType TimeCondition; + ///GTD + TSecurityFtdcDateType GTDDate; + ///ɽ + TSecurityFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSecurityFtdcVolumeType MinVolume; + /// + TSecurityFtdcContingentConditionType ContingentCondition; + ///ֹ + TSecurityFtdcPriceType StopPrice; + ///ǿƽԭ + TSecurityFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSecurityFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcRequestIDType RequestID; + ///ûǿ־ + TSecurityFtdcBoolType UserForceClose; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +///󱨵 +struct CSecurityFtdcErrOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcOrderActionRefType OrderActionRef; + /// + TSecurityFtdcOrderRefType OrderRef; + /// + TSecurityFtdcRequestIDType RequestID; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///־ + TSecurityFtdcActionFlagType ActionFlag; + ///۸ + TSecurityFtdcPriceType LimitPrice; + ///仯 + TSecurityFtdcVolumeType VolumeChange; + /// + TSecurityFtdcDateType ActionDate; + ///ʱ + TSecurityFtdcTimeType ActionTime; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///ر + TSecurityFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSecurityFtdcOrderActionStatusType OrderActionStatus; + ///û + TSecurityFtdcUserIDType UserID; + ///Ӫҵ + TSecurityFtdcBranchIDType BranchID; + ///״̬Ϣ + TSecurityFtdcErrorMsgType StatusMsg; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; +}; + +///ɽ +struct CSecurityFtdcTradeField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ɽ + TSecurityFtdcTradeIDType TradeID; + /// + TSecurityFtdcDirectionType Direction; + /// + TSecurityFtdcOrderSysIDType OrderSysID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///׽ɫ + TSecurityFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TSecurityFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TSecurityFtdcHedgeFlagType HedgeFlag; + ///۸ + TSecurityFtdcStockPriceType Price; + /// + TSecurityFtdcVolumeType Volume; + ///ɽʱ + TSecurityFtdcDateType TradeDate; + ///ɽʱ + TSecurityFtdcTimeType TradeTime; + ///ɽ + TSecurityFtdcTradeTypeType TradeType; + ///ɽԴ + TSecurityFtdcPriceSourceType PriceSource; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա + TSecurityFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcSequenceNoType SequenceNo; + ///ɽԴ + TSecurityFtdcTradeSourceType TradeSource; + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcSequenceNoType BrokerOrderSeq; + ///ɽ + TSecurityFtdcMoneyType TradeAmount; + ///ɽ + TSecurityFtdcTradeIndexType TradeIndex; +}; + +///Ͷֲ߳ +struct CSecurityFtdcInvestorPositionField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///ֲֶշ + TSecurityFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TSecurityFtdcHedgeFlagType HedgeFlag; + ///ֲ + TSecurityFtdcPositionDateType PositionDate; + ///ճֲ + TSecurityFtdcVolumeType YdPosition; + ///ճֲ + TSecurityFtdcVolumeType Position; + ///ͷ + TSecurityFtdcVolumeType LongFrozen; + ///ͷ + TSecurityFtdcVolumeType ShortFrozen; + ///ֶ + TSecurityFtdcMoneyType LongFrozenAmount; + ///ֶ + TSecurityFtdcMoneyType ShortFrozenAmount; + /// + TSecurityFtdcVolumeType OpenVolume; + ///ƽ + TSecurityFtdcVolumeType CloseVolume; + ///ֽ + TSecurityFtdcMoneyType OpenAmount; + ///ƽֽ + TSecurityFtdcMoneyType CloseAmount; + ///ֲֳɱ + TSecurityFtdcMoneyType PositionCost; + ///ʽ + TSecurityFtdcMoneyType FrozenCash; + ///ʽ + TSecurityFtdcMoneyType CashIn; + /// + TSecurityFtdcMoneyType Commission; + ///ϴν + TSecurityFtdcPriceType PreSettlementPrice; + ///ν + TSecurityFtdcPriceType SettlementPrice; + /// + TSecurityFtdcDateType TradingDay; + ///ֳɱ + TSecurityFtdcMoneyType OpenCost; + ///֤ + TSecurityFtdcMoneyType ExchangeMargin; + ///ճֲ + TSecurityFtdcVolumeType TodayPosition; + /// + TSecurityFtdcMoneyType TransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType StampTax; + ///깺 + TSecurityFtdcVolumeType TodayPurRedVolume; + /// + TSecurityFtdcRatioType ConversionRate; + /// + TSecurityFtdcMoneyType ConversionAmount; + ///֤ȯֵ + TSecurityFtdcMoneyType StockValue; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///AccountID + TSecurityFtdcAccountIDType AccountID; + ///Ѻ + TSecurityFtdcVolumeType PledgeInPosition; + ///عʹõı׼ȯ + TSecurityFtdcVolumeType RepurchasePosition; + ///ETFͷ + TSecurityFtdcVolumeType PurRedShortFrozen; + /// + TSecurityFtdcVolumeType MarginTradeVolume; + /// + TSecurityFtdcMoneyType MarginTradeAmount; + ///붳 + TSecurityFtdcVolumeType MarginTradeFrozenVolume; + ///붳 + TSecurityFtdcMoneyType MarginTradeFrozenAmount; + ///ӯ + TSecurityFtdcMoneyType MarginTradeConversionProfit; + ///ȯ + TSecurityFtdcVolumeType ShortSellVolume; + ///ȯ + TSecurityFtdcMoneyType ShortSellAmount; + ///ȯ + TSecurityFtdcVolumeType ShortSellFrozenVolume; + ///ȯ + TSecurityFtdcMoneyType ShortSellFrozenAmount; + ///ȯӯ + TSecurityFtdcMoneyType ShortSellConversionProfit; + ///ȯֵ + TSecurityFtdcMoneyType SSStockValue; + ///ʳֲ + TSecurityFtdcVolumeType TodayMTPosition; + ///ȯֲ + TSecurityFtdcVolumeType TodaySSPosition; + ///ʷֲֳֿɱ + TSecurityFtdcMoneyType YdOpenCost; + ///λ + TSecurityFtdcVolumeType LockPosition; + ///Ҳλ + TSecurityFtdcVolumeType CoverPosition; + ///λ + TSecurityFtdcVolumeType LockFrozenPosition; + ///λ + TSecurityFtdcVolumeType UnlockFrozenPosition; + ///Ҷλ + TSecurityFtdcVolumeType CoverFrozenPosition; + ///Ȩλ + TSecurityFtdcVolumeType ExecFrozenPosition; +}; + +///ͬ +struct CSecurityFtdcSyncDepositField +{ + ///ˮ + TSecurityFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcMoneyType Deposit; + ///Ƿǿƽ + TSecurityFtdcBoolType IsForce; + ///˻ + TSecurityFtdcAccountIDType AccountID; +}; + +///ѯ +struct CSecurityFtdcQryExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CSecurityFtdcQryProductField +{ + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; +}; + +///ѯԼ +struct CSecurityFtdcQryInstrumentField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; +}; + +///ѯ͹˾ +struct CSecurityFtdcQryBrokerField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; +}; + +///ѯ͹˾Ա +struct CSecurityFtdcQryPartBrokerField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; +}; + +///ѯͶ +struct CSecurityFtdcQryInvestorField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CSecurityFtdcQryTradingCodeField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ͻ + TSecurityFtdcClientIDType ClientID; +}; + +///ѯû +struct CSecurityFtdcQrySuperUserField +{ + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯûȨ +struct CSecurityFtdcQrySuperUserFunctionField +{ + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ͹˾û +struct CSecurityFtdcQryBrokerUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CSecurityFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯʽ˻ +struct CSecurityFtdcQryTradingAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯֹ¼û +struct CSecurityFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ +struct CSecurityFtdcQryDepthMarketDataField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯԼȨ +struct CSecurityFtdcQryInstrumentTradingRightField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶֲ߳ϸ +struct CSecurityFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯծȯϢ +struct CSecurityFtdcQryBondInterestField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯֵϢ +struct CSecurityFtdcQryMarketRationInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ѯԼ +struct CSecurityFtdcQryInstrumentCommissionRateField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcDirectionType Direction; + ///ƽ־ + TSecurityFtdcOffsetFlagType OffsetFlag; +}; + +///ѯȯϢ +struct CSecurityFtdcQryExcessStockInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶʻϵ +struct CSecurityFtdcQryInvestorAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯETFԼ +struct CSecurityFtdcQryETFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; +}; + +///ѯETFƱ +struct CSecurityFtdcQryETFBasketField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; +}; + +///ѯOFԼ +struct CSecurityFtdcQryOFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType OFInstrumentID; +}; + +///ѯSFԼ +struct CSecurityFtdcQrySFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType SFInstrumentID; +}; + +///ѯԱ̻ +struct CSecurityFtdcQryTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; +}; + +///ѯ鱨̻ +struct CSecurityFtdcQryMDTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; +}; + +///ѯǰ״̬ +struct CSecurityFtdcQryFrontStatusField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; +}; + +///ѯûỰ +struct CSecurityFtdcQryUserSessionField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ +struct CSecurityFtdcQryOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TSecurityFtdcTimeType InsertTimeStart; + ///ʱ + TSecurityFtdcTimeType InsertTimeEnd; +}; + +///ѯ +struct CSecurityFtdcQryOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ѯ󱨵 +struct CSecurityFtdcQryErrOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CSecurityFtdcQryErrOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯɽ +struct CSecurityFtdcQryTradeField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ɽ + TSecurityFtdcTradeIDType TradeID; + ///ʼʱ + TSecurityFtdcTimeType TradeTimeStart; + ///ʱ + TSecurityFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CSecurityFtdcQryInvestorPositionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯˮ +struct CSecurityFtdcQrySyncDepositField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///ˮ + TSecurityFtdcDepositSeqNoType DepositSeqNo; +}; + +///û +struct CSecurityFtdcUserPasswordUpdateField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///ԭĿ + TSecurityFtdcPasswordType OldPassword; + ///µĿ + TSecurityFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CSecurityFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + ///ԭĿ + TSecurityFtdcPasswordType OldPassword; + ///µĿ + TSecurityFtdcPasswordType NewPassword; +}; + +///ֹͬû̬ +struct CSecurityFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///̬ + TSecurityFtdcOTPTypeType OTPType; + ///һ̬ + TSecurityFtdcPasswordType FirstOTP; + ///ڶ̬ + TSecurityFtdcPasswordType SecondOTP; +}; + +///͹˾û +struct CSecurityFtdcBrokerUserPasswordField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcPasswordType Password; +}; + +///ʽ˻ +struct CSecurityFtdcTradingAccountPasswordField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + /// + TSecurityFtdcPasswordType Password; +}; + +///ûȨ +struct CSecurityFtdcUserRightField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///ͻȨ + TSecurityFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TSecurityFtdcBoolType IsForbidden; +}; + +///Ͷ˻ +struct CSecurityFtdcInvestorAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + ///Ƿ˻ + TSecurityFtdcBoolType IsDefault; + ///˻ + TSecurityFtdcAccountTypeType AccountType; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///Ͻ׵Ԫ + TSecurityFtdcTraderIDType SHBranchPBU; + ///׵Ԫ + TSecurityFtdcTraderIDType SZBranchPBU; +}; + +///ûIP +struct CSecurityFtdcUserIPField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///IPַ + TSecurityFtdcIPAddressType IPAddress; + ///IPַ + TSecurityFtdcIPAddressType IPMask; + ///Macַ + TSecurityFtdcMacAddressType MacAddress; +}; + +///û̬Ʋ +struct CSecurityFtdcBrokerUserOTPParamField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///̬ṩ + TSecurityFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TSecurityFtdcSerialNumberType SerialNumber; + ///Կ + TSecurityFtdcAuthKeyType AuthKey; + ///Ưֵ + TSecurityFtdcLastDriftType LastDrift; + ///ɹֵ + TSecurityFtdcLastSuccessType LastSuccess; + ///̬ + TSecurityFtdcOTPTypeType OTPType; +}; + +///û¼ +struct CSecurityFtdcReqUserLoginField +{ + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcPasswordType Password; + ///û˲ƷϢ + TSecurityFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSecurityFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSecurityFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TSecurityFtdcMacAddressType MacAddress; + ///̬ + TSecurityFtdcPasswordType OneTimePassword; + ///նIPַ + TSecurityFtdcIPAddressType ClientIPAddress; + ///ͻ֤ + TSecurityFtdcAuthCodeType AuthCode; +}; + +///û¼Ӧ +struct CSecurityFtdcRspUserLoginField +{ + /// + TSecurityFtdcDateType TradingDay; + ///¼ɹʱ + TSecurityFtdcTimeType LoginTime; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///ϵͳ + TSecurityFtdcSystemNameType SystemName; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///󱨵 + TSecurityFtdcOrderRefType MaxOrderRef; +}; + +///ûdz +struct CSecurityFtdcUserLogoutField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ȫdzϢ +struct CSecurityFtdcLogoutAllField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///ϵͳ + TSecurityFtdcSystemNameType SystemName; +}; + +///ǿƽԱ˳ +struct CSecurityFtdcForceUserLogoutField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///͹˾û +struct CSecurityFtdcActivateBrokerUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///뱨 +struct CSecurityFtdcInputOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///۸ + TSecurityFtdcOrderPriceTypeType OrderPriceType; + /// + TSecurityFtdcDirectionType Direction; + ///Ͽƽ־ + TSecurityFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSecurityFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSecurityFtdcStockPriceType LimitPrice; + /// + TSecurityFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSecurityFtdcTimeConditionType TimeCondition; + ///GTD + TSecurityFtdcDateType GTDDate; + ///ɽ + TSecurityFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSecurityFtdcVolumeType MinVolume; + /// + TSecurityFtdcContingentConditionType ContingentCondition; + ///ֹ + TSecurityFtdcPriceType StopPrice; + ///ǿƽԭ + TSecurityFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSecurityFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcRequestIDType RequestID; + ///ûǿ־ + TSecurityFtdcBoolType UserForceClose; +}; + +///뱨 +struct CSecurityFtdcInputOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcOrderActionRefType OrderActionRef; + /// + TSecurityFtdcOrderRefType OrderRef; + /// + TSecurityFtdcRequestIDType RequestID; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///־ + TSecurityFtdcActionFlagType ActionFlag; + ///۸ + TSecurityFtdcPriceType LimitPrice; + ///仯 + TSecurityFtdcVolumeType VolumeChange; + ///û + TSecurityFtdcUserIDType UserID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; +}; + +///ָĺԼ +struct CSecurityFtdcSpecificInstrumentField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ָĽ +struct CSecurityFtdcSpecificExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +/// +struct CSecurityFtdcMarketDataBaseField +{ + /// + TSecurityFtdcDateType TradingDay; + ///ϴν + TSecurityFtdcPriceType PreSettlementPrice; + /// + TSecurityFtdcPriceType PreClosePrice; + ///ֲ + TSecurityFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TSecurityFtdcRatioType PreDelta; +}; + +///龲̬ +struct CSecurityFtdcMarketDataStaticField +{ + /// + TSecurityFtdcPriceType OpenPrice; + ///߼ + TSecurityFtdcPriceType HighestPrice; + ///ͼ + TSecurityFtdcPriceType LowestPrice; + /// + TSecurityFtdcPriceType ClosePrice; + ///ͣ + TSecurityFtdcPriceType UpperLimitPrice; + ///ͣ + TSecurityFtdcPriceType LowerLimitPrice; + ///ν + TSecurityFtdcPriceType SettlementPrice; + ///ʵ + TSecurityFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CSecurityFtdcMarketDataLastMatchField +{ + ///¼ + TSecurityFtdcPriceType LastPrice; + /// + TSecurityFtdcVolumeType Volume; + ///ɽ + TSecurityFtdcMoneyType Turnover; + ///ֲ + TSecurityFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CSecurityFtdcMarketDataBestPriceField +{ + ///һ + TSecurityFtdcPriceType BidPrice1; + ///һ + TSecurityFtdcVolumeType BidVolume1; + ///һ + TSecurityFtdcPriceType AskPrice1; + ///һ + TSecurityFtdcVolumeType AskVolume1; +}; + +/// +struct CSecurityFtdcMarketDataBid23Field +{ + ///۶ + TSecurityFtdcPriceType BidPrice2; + /// + TSecurityFtdcVolumeType BidVolume2; + /// + TSecurityFtdcPriceType BidPrice3; + /// + TSecurityFtdcVolumeType BidVolume3; +}; + +/// +struct CSecurityFtdcMarketDataAsk23Field +{ + ///۶ + TSecurityFtdcPriceType AskPrice2; + /// + TSecurityFtdcVolumeType AskVolume2; + /// + TSecurityFtdcPriceType AskPrice3; + /// + TSecurityFtdcVolumeType AskVolume3; +}; + +///ġ +struct CSecurityFtdcMarketDataBid45Field +{ + /// + TSecurityFtdcPriceType BidPrice4; + /// + TSecurityFtdcVolumeType BidVolume4; + /// + TSecurityFtdcPriceType BidPrice5; + /// + TSecurityFtdcVolumeType BidVolume5; +}; + +///ġ +struct CSecurityFtdcMarketDataAsk45Field +{ + /// + TSecurityFtdcPriceType AskPrice4; + /// + TSecurityFtdcVolumeType AskVolume4; + /// + TSecurityFtdcPriceType AskPrice5; + /// + TSecurityFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CSecurityFtdcMarketDataUpdateTimeField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TSecurityFtdcTimeType UpdateTime; + ///޸ĺ + TSecurityFtdcMillisecType UpdateMillisec; + ///ҵ + TSecurityFtdcDateType ActionDay; +}; + +///ɽ +struct CSecurityFtdcMarketDataAveragePriceField +{ + ///վ + TSecurityFtdcPriceType AveragePrice; +}; + +///齻 +struct CSecurityFtdcMarketDataExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///Ϣַ +struct CSecurityFtdcDisseminationField +{ + ///ϵк + TSecurityFtdcSequenceSeriesType SequenceSeries; + ///к + TSecurityFtdcSequenceNoType SequenceNo; +}; + +///ʽת +struct CSecurityFtdcInputFundTransferField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷʽʺ + TSecurityFtdcAccountIDType AccountID; + ///ʽʻ + TSecurityFtdcPasswordType Password; + ///û + TSecurityFtdcUserIDType UserID; + ///׽ + TSecurityFtdcTradeAmountType TradeAmount; + ///ժҪ + TSecurityFtdcDigestType Digest; + ///˻ + TSecurityFtdcAccountTypeType AccountType; +}; + +///ʽת +struct CSecurityFtdcFundTransferField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷʽʺ + TSecurityFtdcAccountIDType AccountID; + ///ʽʻ + TSecurityFtdcPasswordType Password; + ///û + TSecurityFtdcUserIDType UserID; + ///׽ + TSecurityFtdcTradeAmountType TradeAmount; + ///ժҪ + TSecurityFtdcDigestType Digest; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///Liberˮ + TSecurityFtdcLiberSerialType LiberSerial; + ///תƽ̨ˮ + TSecurityFtdcPlateSerialType PlateSerial; + ///ˮ + TSecurityFtdcBankSerialType TransferSerial; + /// + TSecurityFtdcDateType TradingDay; + ///תʱ + TSecurityFtdcTimeType TradeTime; + /// + TSecurityFtdcFundDirectionType FundDirection; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +///ʽת˲ѯ +struct CSecurityFtdcQryFundTransferSerialField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʽʺ + TSecurityFtdcAccountIDType AccountID; + ///˻ + TSecurityFtdcAccountTypeType AccountType; +}; + +///ʽת +struct CSecurityFtdcFundInterTransferField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///û + TSecurityFtdcUserIDType UserID; + ///ʽ˻ + TSecurityFtdcAccountIDType AccountID; + ///ʽ˻ + TSecurityFtdcPasswordType Password; + /// + TSecurityFtdcTradeAmountType TradeAmount; + ///ת + TSecurityFtdcFundInterTransferTypeType TransferType; + ///ʽת + TSecurityFtdcLiberSerialType SerialID; +}; + +///ʽתˮ +struct CSecurityFtdcFundInterTransferSerialField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///û + TSecurityFtdcUserIDType UserID; + ///ʽ˻ + TSecurityFtdcAccountIDType AccountID; + ///ʽ˻ + TSecurityFtdcPasswordType Password; + /// + TSecurityFtdcTradeAmountType TradeAmount; + ///ת + TSecurityFtdcFundInterTransferTypeType TransferType; + ///ʽת + TSecurityFtdcLiberSerialType SerialID; + ///תʱ + TSecurityFtdcTimeType TransferTime; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +///ʽתˮѯ +struct CSecurityFtdcQryFundInterTransferSerialField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ȡݿϢ +struct CSecurityFtdcFetchDBInfoField +{ + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcPasswordType Password; + ///ݿ + TSecurityFtdcUserNameType DBIndex; + ///ݿIPַ + TSecurityFtdcIPAddressType IPAddress; + ///ݿIP˿ + TSecurityFtdcIPPortType IPPort; + ///ݿ + TSecurityFtdcUserNameType DBName; + ///ݿû + TSecurityFtdcUserIDType DBUserID; + ///ݿ + TSecurityFtdcPasswordType DBPassword; +}; + +///MDûϢ +struct CSecurityFtdcMDUserInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///û + TSecurityFtdcUserNameType UserName; + /// + TSecurityFtdcPasswordType Password; + ///ϵͳ + TSecurityFtdcSequenceNoType MDSysID; +}; + + +#endif diff --git a/vn.lts/ltsapi/securitymduserapi.dll b/vn.lts/ltsapi/securitymduserapi.dll new file mode 100644 index 00000000..3ad8abd3 Binary files /dev/null and b/vn.lts/ltsapi/securitymduserapi.dll differ diff --git a/vn.lts/ltsapi/securitymduserapi.lib b/vn.lts/ltsapi/securitymduserapi.lib new file mode 100644 index 00000000..f98f0d1d Binary files /dev/null and b/vn.lts/ltsapi/securitymduserapi.lib differ diff --git a/vn.lts/ltsapi/securitymduserapi.so b/vn.lts/ltsapi/securitymduserapi.so new file mode 100644 index 00000000..fd877d06 Binary files /dev/null and b/vn.lts/ltsapi/securitymduserapi.so differ diff --git a/vn.lts/ltsapi/securitytraderapi.dll b/vn.lts/ltsapi/securitytraderapi.dll new file mode 100644 index 00000000..347bd863 Binary files /dev/null and b/vn.lts/ltsapi/securitytraderapi.dll differ diff --git a/vn.lts/ltsapi/securitytraderapi.lib b/vn.lts/ltsapi/securitytraderapi.lib new file mode 100644 index 00000000..e3882f42 Binary files /dev/null and b/vn.lts/ltsapi/securitytraderapi.lib differ diff --git a/vn.lts/ltsapi/securitytraderapi.so b/vn.lts/ltsapi/securitytraderapi.so new file mode 100644 index 00000000..541e2032 Binary files /dev/null and b/vn.lts/ltsapi/securitytraderapi.so differ diff --git a/vn.lts/pyscript/SecurityFtdcMdApi.h b/vn.lts/pyscript/SecurityFtdcMdApi.h new file mode 100644 index 00000000..377485b8 --- /dev/null +++ b/vn.lts/pyscript/SecurityFtdcMdApi.h @@ -0,0 +1,135 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcMdApi.h +///@brief ͻ˽ӿ +///////////////////////////////////////////////////////////////////////// + +#if !defined(SECURITY_FTDCMDAPI_H) +#define SECURITY_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SecurityFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_MD_API_EXPORT +#define MD_API_EXPORT __declspec(dllexport) +#else +#define MD_API_EXPORT __declspec(dllimport) +#endif +#else +#define MD_API_EXPORT +#endif + +class CSecurityFtdcMdSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + + ///Ӧ + virtual void OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData) {}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility push(default) + #endif +#endif + +class MD_API_EXPORT CSecurityFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CSecurityFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = ""); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CSecurityFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount, char* pExchageID) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount, char* pExchageID) = 0; + + ///û¼ + virtual int ReqUserLogin(CSecurityFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CSecurityFtdcMdApi(){}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility pop + #endif +#endif + +#endif diff --git a/vn.lts/pyscript/SecurityFtdcTraderApi.h b/vn.lts/pyscript/SecurityFtdcTraderApi.h new file mode 100644 index 00000000..594eaa31 --- /dev/null +++ b/vn.lts/pyscript/SecurityFtdcTraderApi.h @@ -0,0 +1,299 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcTraderApi.h +///@brief ͻ˽ӿ +///////////////////////////////////////////////////////////////////////// + +#if !defined(SECURITY_FTDCTRADERAPI_H) +#define SECURITY_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SecurityFtdcUserApiStruct.h" + +#if defined(ISLIB) && defined(WIN32) +#ifdef LIB_TRADER_API_EXPORT +#define TRADER_API_EXPORT __declspec(dllexport) +#else +#define TRADER_API_EXPORT __declspec(dllimport) +#endif +#else +#define TRADER_API_EXPORT +#endif + +class CSecurityFtdcTraderSpi +{ +public: + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(){}; + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason){}; + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse){}; + + ///Ӧ + virtual void OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CSecurityFtdcExchangeField *pExchange, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CSecurityFtdcTradingCodeField *pTradingCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯծȯϢӦ + virtual void OnRspQryBondInterest(CSecurityFtdcBondInterestField *pBondInterest, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵϢӦ + virtual void OnRspQryMarketRationInfo(CSecurityFtdcMarketRationInfoField *pMarketRationInfo, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CSecurityFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯETFԼӦ + virtual void OnRspQryETFInstrument(CSecurityFtdcETFInstrumentField *pETFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯETFƱӦ + virtual void OnRspQryETFBasket(CSecurityFtdcETFBasketField *pETFBasket, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯOFԼӦ + virtual void OnRspQryOFInstrument(CSecurityFtdcOFInstrumentField *pOFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯSFԼӦ + virtual void OnRspQrySFInstrument(CSecurityFtdcSFInstrumentField *pSFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CSecurityFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CSecurityFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo) {}; + + ///LiberӦ + virtual void OnRspFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Liber֪ͨ + virtual void OnRtnFundOutByLiber(CSecurityFtdcFundTransferField *pFundTransfer) {}; + + ///Liberر + virtual void OnErrRtnFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo) {}; + + ///з֪ͨ + virtual void OnRtnFundInByBank(CSecurityFtdcFundTransferField *pFundTransfer) {}; + + ///ʽת˲ѯӦ + virtual void OnRspQryFundTransferSerial(CSecurityFtdcFundTransferField *pFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽתӦ + virtual void OnRspFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽתˮѯӦ + virtual void OnRspQryFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽתˮ֪ͨ + virtual void OnRtnFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial) {}; + + ///ʽתر + virtual void OnErrRtnFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo) {}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility push(default) + #endif +#endif + +class TRADER_API_EXPORT CSecurityFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CSecurityFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ɾӿڶ + ///@remark ʹñӿڶʱ,øúɾӿڶ + virtual void Release() = 0; + + ///ʼ + ///@remark ʼл,ֻеú,ӿڲſʼ + virtual void Init() = 0; + + ///ȴӿ߳̽ + ///@return ߳˳ + virtual int Join() = 0; + + ///ȡǰ + ///@retrun ȡĽ + ///@remark ֻе¼ɹ,ܵõȷĽ + virtual const char *GetTradingDay() = 0; + + ///עǰûַ + ///@param pszFrontAddressǰûַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:17001 + ///@remark tcpЭ飬127.0.0.1ַ17001˿ںš + virtual void RegisterFront(char *pszFrontAddress) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CSecurityFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// SECURITY_TERT_RESTART:ӱտʼش + /// SECURITY_TERT_RESUME:ϴյ + /// SECURITY_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(SECURITY_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// SECURITY_TERT_RESTART:ӱտʼش + /// SECURITY_TERT_RESUME:ϴյ + /// SECURITY_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(SECURITY_TE_RESUME_TYPE nResumeType) = 0; + + ///û¼ + virtual int ReqUserLogin(CSecurityFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CSecurityFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CSecurityFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CSecurityFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CSecurityFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CSecurityFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CSecurityFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯծȯϢ + virtual int ReqQryBondInterest(CSecurityFtdcQryBondInterestField *pQryBondInterest, int nRequestID) = 0; + + ///ѯֵϢ + virtual int ReqQryMarketRationInfo(CSecurityFtdcQryMarketRationInfoField *pQryMarketRationInfo, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CSecurityFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯETFԼ + virtual int ReqQryETFInstrument(CSecurityFtdcQryETFInstrumentField *pQryETFInstrument, int nRequestID) = 0; + + ///ѯETFƱ + virtual int ReqQryETFBasket(CSecurityFtdcQryETFBasketField *pQryETFBasket, int nRequestID) = 0; + + ///ѯOFԼ + virtual int ReqQryOFInstrument(CSecurityFtdcQryOFInstrumentField *pQryOFInstrument, int nRequestID) = 0; + + ///ѯSFԼ + virtual int ReqQrySFInstrument(CSecurityFtdcQrySFInstrumentField *pQrySFInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CSecurityFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CSecurityFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CSecurityFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///Liber + virtual int ReqFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, int nRequestID) = 0; + + ///ʽת˲ѯ + virtual int ReqQryFundTransferSerial(CSecurityFtdcQryFundTransferSerialField *pQryFundTransferSerial, int nRequestID) = 0; + + ///ʽת + virtual int ReqFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, int nRequestID) = 0; + + ///ʽתˮѯ + virtual int ReqQryFundInterTransferSerial(CSecurityFtdcQryFundInterTransferSerialField *pQryFundInterTransferSerial, int nRequestID) = 0; +protected: + ~CSecurityFtdcTraderApi(){}; +}; + +#ifndef WINDOWS + #if __GNUC__ >= 4 + #pragma GCC visibility pop + #endif +#endif + +#endif diff --git a/vn.lts/pyscript/SecurityFtdcUserApiDataType.h b/vn.lts/pyscript/SecurityFtdcUserApiDataType.h new file mode 100644 index 00000000..0e398b8d --- /dev/null +++ b/vn.lts/pyscript/SecurityFtdcUserApiDataType.h @@ -0,0 +1,2080 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcUserApiDataType.h +///@brief ҵ +///////////////////////////////////////////////////////////////////////// + +#ifndef SECURITY_FTDCDATATYPE_H +#define SECURITY_FTDCDATATYPE_H + +enum SECURITY_TE_RESUME_TYPE +{ + SECURITY_TERT_RESTART = 0, + SECURITY_TERT_RESUME, + SECURITY_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcExchangeNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_EXP_Normal '0' +///ݳɽɱ +#define SECURITY_FTDC_EXP_GenOrderByTrade '1' + +typedef char TSecurityFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define SECURITY_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define SECURITY_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define SECURITY_FTDC_ECS_GotInformation '9' + +typedef char TSecurityFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInstrumentIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define SECURITY_FTDC_PC_Futures '1' +///Ȩ +#define SECURITY_FTDC_PC_Options '2' +/// +#define SECURITY_FTDC_PC_Combination '3' +/// +#define SECURITY_FTDC_PC_Spot '4' +///ת +#define SECURITY_FTDC_PC_EFP '5' +///֤ȯA +#define SECURITY_FTDC_PC_StockA '6' +///֤ȯB +#define SECURITY_FTDC_PC_StockB '7' +///ETF +#define SECURITY_FTDC_PC_ETF '8' +///ETF +#define SECURITY_FTDC_PC_ETFPurRed '9' + +typedef char TSecurityFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define SECURITY_FTDC_PT_Net '1' +///ۺϳֲ +#define SECURITY_FTDC_PT_Gross '2' + +typedef char TSecurityFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define SECURITY_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define SECURITY_FTDC_PDT_NoUseHistory '2' + +typedef char TSecurityFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define SECURITY_FTDC_IP_NotStart '0' +/// +#define SECURITY_FTDC_IP_Started '1' +///ͣ +#define SECURITY_FTDC_IP_Pause '2' +/// +#define SECURITY_FTDC_IP_Expired '3' + +typedef char TSecurityFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightModelIDTypeһƱȨģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRightModelIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightModelNameTypeһƱȨģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRightModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosTradeTypeTypeһֲֽ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define SECURITY_FTDC_PTT_CanSelTodayPos '1' +///ֲֲ +#define SECURITY_FTDC_PTT_CannotSellTodayPos '2' + +typedef char TSecurityFtdcPosTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInvestorIDType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define SECURITY_FTDC_ICT_EID '0' +///֤ +#define SECURITY_FTDC_ICT_IDCard '1' +///֤ +#define SECURITY_FTDC_ICT_OfficerIDCard '2' +///֤ +#define SECURITY_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define SECURITY_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define SECURITY_FTDC_ICT_HouseholdRegister '5' +/// +#define SECURITY_FTDC_ICT_Passport '6' +///̨֤ +#define SECURITY_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define SECURITY_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define SECURITY_FTDC_ICT_LicenseNo '9' +///˰ǼǺ +#define SECURITY_FTDC_ICT_TaxNo 'A' +///֤ +#define SECURITY_FTDC_ICT_OtherCard 'x' + +typedef char TSecurityFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcClientIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAccountIDType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ͨ +#define SECURITY_FTDC_CLT_Normal '1' +///ý +#define SECURITY_FTDC_CLT_Credit '2' +///Ʒ˻ +#define SECURITY_FTDC_CLT_Derive '3' +/// +#define SECURITY_FTDC_CLT_Other '4' + +typedef char TSecurityFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define SECURITY_FTDC_FC_ForceUserLogout '2' +///û +#define SECURITY_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define SECURITY_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define SECURITY_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define SECURITY_FTDC_FC_OrderInsert '6' +/// +#define SECURITY_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define SECURITY_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define SECURITY_FTDC_FC_SyncBrokerData '9' +///ѯ +#define SECURITY_FTDC_FC_SuperQuery 'B' +/// +#define SECURITY_FTDC_FC_ParkedOrderInsert 'C' +/// +#define SECURITY_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define SECURITY_FTDC_FC_SyncOTP 'E' +///δ֪ +#define SECURITY_FTDC_FC_UnkownOrderAction 'F' +///תй +#define SECURITY_FTDC_FC_DepositoryTransfer 'G' +///ȯת +#define SECURITY_FTDC_FC_ExcessStockTransfer 'H' + +typedef char TSecurityFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define SECURITY_FTDC_UT_Investor '0' +///Ա +#define SECURITY_FTDC_UT_Operator '1' +///Ա +#define SECURITY_FTDC_UT_SuperUser '2' + +typedef char TSecurityFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define SECURITY_FTDC_BFC_ForceUserLogout '1' +///û +#define SECURITY_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define SECURITY_FTDC_BFC_SyncBrokerData '3' +/// +#define SECURITY_FTDC_BFC_OrderInsert '5' +/// +#define SECURITY_FTDC_BFC_OrderAction '6' +///ȫѯ +#define SECURITY_FTDC_BFC_AllQuery '7' +///δ֪ +#define SECURITY_FTDC_BFC_UnkownOrderAction '8' +///תй +#define SECURITY_FTDC_BFC_DepositoryTransfer '9' +///ȯת +#define SECURITY_FTDC_BFC_ExcessStockTransfer 'A' +///ʽת +#define SECURITY_FTDC_BFC_FundInterTransfer 'B' +///ϵͳܣ/dz/޸ +#define SECURITY_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define SECURITY_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define SECURITY_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define SECURITY_FTDC_BFC_Trade 'd' +///ת +#define SECURITY_FTDC_BFC_Virement 'e' +///ѯ/ѯỰ˵ +#define SECURITY_FTDC_BFC_Session 'g' +///̬ͬ +#define SECURITY_FTDC_BFC_SyncOTP 'E' + +typedef char TSecurityFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ͨ˻ +#define SECURITY_FTDC_AcT_Normal '1' +///˻ +#define SECURITY_FTDC_AcT_Credit '2' +///Ʒ˻ +#define SECURITY_FTDC_AcT_Derive '3' +/// +#define SECURITY_FTDC_AcT_Other '4' + +typedef char TSecurityFtdcAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_DR_All '1' +///ܹ֯ +#define SECURITY_FTDC_DR_Group '2' +///һͶ +#define SECURITY_FTDC_DR_Single '3' + +typedef char TSecurityFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define SECURITY_FTDC_URT_Logon '1' +///ת +#define SECURITY_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define SECURITY_FTDC_URT_EMail '3' +///㵥 +#define SECURITY_FTDC_URT_Fax '4' +/// +#define SECURITY_FTDC_URT_ConditionOrder '5' + +typedef char TSecurityFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define SECURITY_FTDC_HF_Speculation '1' +///ױ +#define SECURITY_FTDC_HF_Hedge '3' + +typedef char TSecurityFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_D_Buy '0' +/// +#define SECURITY_FTDC_D_Sell '1' +///ETF깺 +#define SECURITY_FTDC_D_ETFPur '2' +///ETF +#define SECURITY_FTDC_D_ETFRed '3' +///ֻֽر +#define SECURITY_FTDC_D_CashIn '4' +///ծȯ +#define SECURITY_FTDC_D_PledgeBondIn '5' +///ծȯ +#define SECURITY_FTDC_D_PledgeBondOut '6' +/// +#define SECURITY_FTDC_D_Rationed '7' +///תй +#define SECURITY_FTDC_D_DepositoryTransfer '8' +///˻ +#define SECURITY_FTDC_D_CreditRationed '9' +///Ʒ +#define SECURITY_FTDC_D_BuyCollateral 'A' +///Ʒ +#define SECURITY_FTDC_D_SellCollateral 'B' +///Ʒת +#define SECURITY_FTDC_D_CollateralTransferIn 'C' +///Ʒת +#define SECURITY_FTDC_D_CollateralTransferOut 'D' +/// +#define SECURITY_FTDC_D_MarginTrade 'E' +///ȯ +#define SECURITY_FTDC_D_ShortSell 'F' +///ȯ +#define SECURITY_FTDC_D_RepayMargin 'G' +///ȯȯ +#define SECURITY_FTDC_D_RepayStock 'H' +///ֱӻ +#define SECURITY_FTDC_D_DirectRepayMargin 'I' +///ֱӻȯ +#define SECURITY_FTDC_D_DirectRepayStock 'J' +///ȯת +#define SECURITY_FTDC_D_ExcessStockTransfer 'K' +///OF깺 +#define SECURITY_FTDC_D_OFPur 'L' +///OF +#define SECURITY_FTDC_D_OFRed 'M' +///SF +#define SECURITY_FTDC_D_SFSplit 'N' +///SFϲ +#define SECURITY_FTDC_D_SFMerge 'O' +/// +#define SECURITY_FTDC_D_Covered 'P' +///֤ȯ()/ⶳ(ƽ) +#define SECURITY_FTDC_D_Freeze 'Q' +///Ȩ +#define SECURITY_FTDC_D_Execute 'R' + +typedef char TSecurityFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ͨɽ +#define SECURITY_FTDC_TRDT_Common '0' +///Ȩִ +#define SECURITY_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define SECURITY_FTDC_TRDT_OTC '2' +///תɽ +#define SECURITY_FTDC_TRDT_EFPDerived '3' +///ɽ +#define SECURITY_FTDC_TRDT_CombinationDerived '4' +///ETF깺 +#define SECURITY_FTDC_TRDT_EFTPurchase '5' +///ETF +#define SECURITY_FTDC_TRDT_EFTRedem '6' + +typedef char TSecurityFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCreationredemptionStatusTypeһ깺״̬ +///////////////////////////////////////////////////////////////////////// +///깺 +#define SECURITY_FTDC_CDS_Forbidden '0' +///ʾ깺 +#define SECURITY_FTDC_CDS_Allow '1' +///깺 +#define SECURITY_FTDC_CDS_OnlyPurchase '2' +///깺 +#define SECURITY_FTDC_CDS_OnlyRedeem '3' + +typedef char TSecurityFtdcCreationredemptionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcETFCurrenceReplaceStatusTypeһETFֽ־ +///////////////////////////////////////////////////////////////////////// +///ֹֽ +#define SECURITY_FTDC_ETFCRS_Forbidden '0' +///ֽ +#define SECURITY_FTDC_ETFCRS_Allow '1' +///ֽ +#define SECURITY_FTDC_ETFCRS_Force '2' + +typedef char TSecurityFtdcETFCurrenceReplaceStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInterestTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcInterestType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepurchaseMaxTimesTypeһعŴ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcRepurchaseMaxTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalStockTypeTypeһɱ +///////////////////////////////////////////////////////////////////////// +///ͨɱ +#define SECURITY_FTDC_CPTSTOCK_TOTALSTOCK '1' +///ͨɱ +#define SECURITY_FTDC_CPTSTOCK_CIRCULATION '2' + +typedef char TSecurityFtdcCapitalStockTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define SECURITY_FTDC_MPT_SettlementPrice '2' +///ɽ +#define SECURITY_FTDC_MPT_AveragePrice '3' +///ּ +#define SECURITY_FTDC_MPT_OpenPrice '4' + +typedef char TSecurityFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define SECURITY_FTDC_AG_All '1' +///ӯƣ +#define SECURITY_FTDC_AG_OnlyLost '2' +///ӯƣ +#define SECURITY_FTDC_AG_OnlyGain '3' +///ӯ +#define SECURITY_FTDC_AG_None '4' + +typedef char TSecurityFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define SECURITY_FTDC_ICP_Include '0' +///ƽӯ +#define SECURITY_FTDC_ICP_NotInclude '2' + +typedef char TSecurityFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///ܿ +#define SECURITY_FTDC_AWT_Enable '0' +///ܿ +#define SECURITY_FTDC_AWT_Disable '2' +///޲ֲܿ +#define SECURITY_FTDC_AWT_NoHoldEnable '3' + +typedef char TSecurityFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_HPA_Base '1' +///ǽ +#define SECURITY_FTDC_HPA_NoneTrade '4' +///֤ȯ +#define SECURITY_FTDC_HPA_Stock '5' + +typedef char TSecurityFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define SECURITY_FTDC_TPID_EncryptionStandard 'E' +///ûỰ +#define SECURITY_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define SECURITY_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define SECURITY_FTDC_TPID_IsAuthForce 'A' +///Ƿû¼ +#define SECURITY_FTDC_TPID_GenUserEvent 'G' +///ʼر +#define SECURITY_FTDC_TPID_StartOrderLocalID 'O' +///ȯȯȯ㷨 +#define SECURITY_FTDC_TPID_RepayStockAlgo 'R' +///Ʒ˻ʽȡ +#define SECURITY_FTDC_TPID_DeriveWithdrawRatio 'D' + +typedef char TSecurityFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_IR_All '1' +///Ͷ +#define SECURITY_FTDC_IR_Group '2' +///һͶ +#define SECURITY_FTDC_IR_Single '3' + +typedef char TSecurityFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define SECURITY_FTDC_DS_Asynchronous '1' +///ͬ +#define SECURITY_FTDC_DS_Synchronizing '2' +///ͬ +#define SECURITY_FTDC_DS_Synchronized '3' + +typedef char TSecurityFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define SECURITY_FTDC_TCS_NotConnected '1' +///Ѿ +#define SECURITY_FTDC_TCS_Connected '2' +///ѾԼѯ +#define SECURITY_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define SECURITY_FTDC_TCS_SubPrivateFlow '4' + +typedef char TSecurityFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define SECURITY_FTDC_OAS_Submitted 'a' +///Ѿ +#define SECURITY_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define SECURITY_FTDC_OAS_Rejected 'c' + +typedef char TSecurityFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define SECURITY_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define SECURITY_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define SECURITY_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define SECURITY_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define SECURITY_FTDC_OST_NoTradeNotQueueing '4' +/// +#define SECURITY_FTDC_OST_Canceled '5' +///δ֪ +#define SECURITY_FTDC_OST_Unknown 'a' +///δ +#define SECURITY_FTDC_OST_NotTouched 'b' +///Ѵ +#define SECURITY_FTDC_OST_Touched 'c' + +typedef char TSecurityFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define SECURITY_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define SECURITY_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define SECURITY_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define SECURITY_FTDC_OSS_Accepted '3' +///Ѿܾ +#define SECURITY_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define SECURITY_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define SECURITY_FTDC_OSS_ModifyRejected '6' + +typedef char TSecurityFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define SECURITY_FTDC_PSD_Today '1' +///ʷֲ +#define SECURITY_FTDC_PSD_History '2' + +typedef char TSecurityFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_ER_Broker '1' +///Ӫ +#define SECURITY_FTDC_ER_Host '2' +/// +#define SECURITY_FTDC_ER_Maker '3' + +typedef char TSecurityFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_PD_Net '1' +///ͷ +#define SECURITY_FTDC_PD_Long '2' +///ͷ +#define SECURITY_FTDC_PD_Short '3' +/// +#define SECURITY_FTDC_PD_Covered '4' + +typedef char TSecurityFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +///ʱɽʣ೷м۵ +#define SECURITY_FTDC_OPT_AnyPrice '1' +///޼ +#define SECURITY_FTDC_OPT_LimitPrice '2' +///嵵ʱɽʣ೷м۵ +#define SECURITY_FTDC_OPT_BestPrice '3' +///嵵ʱɽʣת޼м۵ +#define SECURITY_FTDC_OPT_BestLimitPrice '4' +///ȫɽм۵ +#define SECURITY_FTDC_OPT_AllPrice '5' +///ż۸м۵ +#define SECURITY_FTDC_OPT_ForwardBestPrice '6' +///Էż۸м۵ +#define SECURITY_FTDC_OPT_ReverseBestPrice '7' +///ʱɽʣת޼м۵ +#define SECURITY_FTDC_OPT_Any2LimitPrice '8' +///ȫɽ޼۵ +#define SECURITY_FTDC_OPT_AllLimitPrice '9' +///A +#define SECURITY_FTDC_OPT_ActiveANetPassSvrCode 'G' +///עA +#define SECURITY_FTDC_OPT_InactiveANetPassSvrCode 'H' +///B +#define SECURITY_FTDC_OPT_ActiveBNetPassSvrCode 'I' +///עB +#define SECURITY_FTDC_OPT_InactiveBNetPassSvrCode 'J' +///عע +#define SECURITY_FTDC_OPT_Repurchase 'K' +///ָ +#define SECURITY_FTDC_OPT_DesignatedCancel 'L' +///ָǼ +#define SECURITY_FTDC_OPT_Designated 'M' +///֤ȯ깺 +#define SECURITY_FTDC_OPT_SubscribingShares 'N' +///֤ȯ +#define SECURITY_FTDC_OPT_Split 'O' +///ҪԼչǼ +#define SECURITY_FTDC_OPT_TenderOffer 'P' +///ҪԼչ +#define SECURITY_FTDC_OPT_TenderOfferCancel 'Q' +///֤ȯͶƱ +#define SECURITY_FTDC_OPT_Ballot 'R' +///תծתǼ +#define SECURITY_FTDC_OPT_ConvertibleBondsConvet 'S' +///תծ۵Ǽ +#define SECURITY_FTDC_OPT_ConvertibleBondsRepurchase 'T' +///Ȩ֤Ȩ +#define SECURITY_FTDC_OPT_Exercise 'U' +///ʽ깺 +#define SECURITY_FTDC_OPT_PurchasingFunds 'V' +///ʽ +#define SECURITY_FTDC_OPT_RedemingFunds 'W' +///ʽϹ +#define SECURITY_FTDC_OPT_SubscribingFunds 'X' +///ʽתйת +#define SECURITY_FTDC_OPT_LOFIssue 'Y' +///ʽ÷ֺ췽ʽ +#define SECURITY_FTDC_OPT_LOFSetBonusType 'Z' +///ʽתΪ +#define SECURITY_FTDC_OPT_LOFConvert 'a' +///ծȯ +#define SECURITY_FTDC_OPT_DebentureStockIn 'b' +///ծȯ +#define SECURITY_FTDC_OPT_DebentureStockOut 'c' +///ETF깺 +#define SECURITY_FTDC_OPT_PurchasesETF 'd' +///ETF +#define SECURITY_FTDC_OPT_RedeemETF 'e' + +typedef char TSecurityFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_OF_Open '0' +///ƽ +#define SECURITY_FTDC_OF_Close '1' +///ǿƽ +#define SECURITY_FTDC_OF_ForceClose '2' +///ƽ +#define SECURITY_FTDC_OF_CloseToday '3' +///ƽ +#define SECURITY_FTDC_OF_CloseYesterday '4' +///ǿ +#define SECURITY_FTDC_OF_ForceOff '5' +///ǿƽ +#define SECURITY_FTDC_OF_LocalForceClose '6' + +typedef char TSecurityFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define SECURITY_FTDC_FCC_NotForceClose '0' +///ʽ +#define SECURITY_FTDC_FCC_LackDeposit '1' +///ͻ +#define SECURITY_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define SECURITY_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define SECURITY_FTDC_FCC_NotMultiple '4' +///Υ +#define SECURITY_FTDC_FCC_Violation '5' +/// +#define SECURITY_FTDC_FCC_Other '6' +///Ȼٽ +#define SECURITY_FTDC_FCC_PersonDeliv '7' + +typedef char TSecurityFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_ORDT_Normal '0' +/// +#define SECURITY_FTDC_ORDT_DeriveFromQuote '1' +/// +#define SECURITY_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define SECURITY_FTDC_ORDT_Combination '3' +/// +#define SECURITY_FTDC_ORDT_ConditionalOrder '4' +/// +#define SECURITY_FTDC_ORDT_Swap '5' + +typedef char TSecurityFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define SECURITY_FTDC_TC_IOC '1' +///Ч +#define SECURITY_FTDC_TC_GFS '2' +///Ч +#define SECURITY_FTDC_TC_GFD '3' +///ָǰЧ +#define SECURITY_FTDC_TC_GTD '4' +///ǰЧ +#define SECURITY_FTDC_TC_GTC '5' +///ϾЧ +#define SECURITY_FTDC_TC_GFA '6' + +typedef char TSecurityFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define SECURITY_FTDC_VC_AV '1' +///С +#define SECURITY_FTDC_VC_MV '2' +///ȫ +#define SECURITY_FTDC_VC_CV '3' + +typedef char TSecurityFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_CC_Immediately '1' +///ֹ +#define SECURITY_FTDC_CC_Touch '2' +///ֹӮ +#define SECURITY_FTDC_CC_TouchProfit '3' +///Ԥ +#define SECURITY_FTDC_CC_ParkedOrder '4' +///¼۴ +#define SECURITY_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define SECURITY_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define SECURITY_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define SECURITY_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define SECURITY_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define SECURITY_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define SECURITY_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define SECURITY_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define SECURITY_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define SECURITY_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define SECURITY_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define SECURITY_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TSecurityFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define SECURITY_FTDC_AF_Delete '0' +///޸ +#define SECURITY_FTDC_AF_Modify '3' + +typedef char TSecurityFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define SECURITY_FTDC_TR_Allow '0' +///ܽ +#define SECURITY_FTDC_TR_Forbidden '2' + +typedef char TSecurityFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define SECURITY_FTDC_OSRC_Participant '0' +///ԹԱ +#define SECURITY_FTDC_OSRC_Administrator '1' + +typedef char TSecurityFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define SECURITY_FTDC_PSRC_LastPrice '0' +///ίм +#define SECURITY_FTDC_PSRC_Buy '1' +///ίм +#define SECURITY_FTDC_PSRC_Sell '2' + +typedef char TSecurityFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TSecurityFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TSecurityFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define SECURITY_FTDC_UET_Login '1' +///dz +#define SECURITY_FTDC_UET_Logout '2' +///׳ɹ +#define SECURITY_FTDC_UET_Trading '3' +///ʧ +#define SECURITY_FTDC_UET_TradingError '4' +///޸ +#define SECURITY_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define SECURITY_FTDC_UET_Authenticate '6' +/// +#define SECURITY_FTDC_UET_Other '9' + +typedef char TSecurityFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define SECURITY_FTDC_OTP_NONE '0' +///ʱ +#define SECURITY_FTDC_OTP_TOTP '1' + +typedef char TSecurityFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define SECURITY_FTDC_TSRC_NORMAL '0' +///Բѯ +#define SECURITY_FTDC_TSRC_QUERY '1' + +typedef char TSecurityFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchIDTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBranchIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockPriceTypeһ֤ȯ׼۸ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcStockPriceType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightModelIDTypeһƱȨģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRightModelIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentRangeTypeһƱȨ޷ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_INR_All '1' +///Ʒ +#define SECURITY_FTDC_INR_Product '2' +///ƱȨģ +#define SECURITY_FTDC_INR_Model '3' +///Ʊ +#define SECURITY_FTDC_INR_Stock '4' +///г +#define SECURITY_FTDC_INR_Market '5' + +typedef char TSecurityFtdcInstrumentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserSessionHashTypeһûỰHashֵ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcUserSessionHashType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockTradeTypeTypeһ֤ȯ +///////////////////////////////////////////////////////////////////////// +///ɽ֤ȯ +#define SECURITY_FTDC_STT_Stock '0' +/// +#define SECURITY_FTDC_STT_BuyNetService '1' +///عע +#define SECURITY_FTDC_STT_CancelRepurchase '2' +///ָ +#define SECURITY_FTDC_STT_CancelRegister '3' +///ָǼ +#define SECURITY_FTDC_STT_Register '4' +///뷢깺 +#define SECURITY_FTDC_STT_PurchaseIssue '5' +/// +#define SECURITY_FTDC_STT_Allotment '6' +///ҪԼչ +#define SECURITY_FTDC_STT_SellTender '7' +///ҪԼչ +#define SECURITY_FTDC_STT_BuyTender '8' +///ͶƱ +#define SECURITY_FTDC_STT_NetVote '9' +///תծ +#define SECURITY_FTDC_STT_SellConvertibleBonds 'a' +///Ȩ֤Ȩ +#define SECURITY_FTDC_STT_OptionExecute 'b' +///ʽ깺 +#define SECURITY_FTDC_STT_PurchaseOF 'c' +///ʽ +#define SECURITY_FTDC_STT_RedeemOF 'd' +///ʽϹ +#define SECURITY_FTDC_STT_SubscribeOF 'e' +///ʽתйת +#define SECURITY_FTDC_STT_OFCustodianTranfer 'f' +///ʽֺ +#define SECURITY_FTDC_STT_OFDividendConfig 'g' +///ʽת +#define SECURITY_FTDC_STT_OFTransfer 'h' +///ծȯ +#define SECURITY_FTDC_STT_BondsIn 'i' +///ծȯ +#define SECURITY_FTDC_STT_BondsOut 'j' +///EFT깺 +#define SECURITY_FTDC_STT_PurchaseETF 'k' +///EFT +#define SECURITY_FTDC_STT_RedeemETF 'l' +///תծ۵Ǽ +#define SECURITY_FTDC_STT_ConvertibleRegister 'm' + +typedef char TSecurityFtdcStockTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_HTAA_Base '1' + +typedef char TSecurityFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockWthTypeһƱʹˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcStockWthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockSeqTypeһƱʹˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcStockSeqType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWTFSTypeһίзʽ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcWTFSType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWTLBTypeһί +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcWTLBType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWTRQTypeһί +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcWTRQType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINTEGERTypeһһ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINTEGERType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINT3Typeһλ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINT3Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINT6Typeһλ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINT6Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcINT12Typeһʮλ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcINT12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR1TypeһһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR1Type[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR2TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR2Type[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR3TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR3Type[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR4TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR4Type[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR5TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR5Type[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR6TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR6Type[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR8TypeһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR8Type[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR10TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR10Type[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR11TypeһʮһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR11Type[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR12TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR12Type[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR13TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR13Type[14]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR14TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR14Type[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR16TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR16Type[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR19TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR19Type[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR20TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR20Type[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR21TypeһʮһֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR21Type[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR23TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR23Type[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR30TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR30Type[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR32TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR32Type[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR50TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR50Type[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR64TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR64Type[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCHAR65TypeһʮֽCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCHAR65Type[66]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR4TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR4Type[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR6TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR6Type[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR8TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR8Type[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR10TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR10Type[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR12TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR12Type[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR16TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR16Type[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR20TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR20Type[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR30TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR30Type[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR50TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR50Type[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR60TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR60Type[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR65TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR65Type[66]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR80TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR80Type[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR84TypeһʮֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR84Type[85]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR255TypeһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR255Type[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVCHAR1024TypeһһֽVCHAR +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcVCHAR1024Type[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL8P3Typeһ˵ʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL8P3Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL9P3Typeһŵʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL9P3Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL9P6Typeһŵʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL9P6Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL10P4Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL10P4Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL16P2Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL16P2Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL16P8Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL16P8Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcREAL22P2Typeһʮʵ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcREAL22P2Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLiberSerialTypeһLiberϵͳˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcLiberSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_FIOT_FundIO '1' +///ת +#define SECURITY_FTDC_FIOT_Transfer '2' + +typedef char TSecurityFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define SECURITY_FTDC_FT_Deposite '1' +///ʽ +#define SECURITY_FTDC_FT_ItemFund '2' +///˾ +#define SECURITY_FTDC_FT_Company '3' + +typedef char TSecurityFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_FD_In '1' +/// +#define SECURITY_FTDC_FD_Out '2' + +typedef char TSecurityFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_BF_ICBC '1' +///ũҵ +#define SECURITY_FTDC_BF_ABC '2' +///й +#define SECURITY_FTDC_BF_BC '3' +/// +#define SECURITY_FTDC_BF_CBC '4' +///ͨ +#define SECURITY_FTDC_BF_BOC '5' +/// +#define SECURITY_FTDC_BF_Other 'Z' + +typedef char TSecurityFtdcBankFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define SECURITY_FTDC_FS_Record '1' +///Ѹ +#define SECURITY_FTDC_FS_Check '2' +///ѳ +#define SECURITY_FTDC_FS_Charge '3' + +typedef char TSecurityFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerBranchIDTypeһ͹˾֧ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBrokerBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define SECURITY_FTDC_LF_Yes '0' +///Ƭ +#define SECURITY_FTDC_LF_No '1' + +typedef char TSecurityFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define SECURITY_FTDC_CUSTT_Person '0' +/// +#define SECURITY_FTDC_CUSTT_Institution '1' + +typedef char TSecurityFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_YNI_Yes '0' +/// +#define SECURITY_FTDC_YNI_No '1' + +typedef char TSecurityFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFeeTypeһӦվ͹˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TSecurityFtdcBrokerFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define SECURITY_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define SECURITY_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define SECURITY_FTDC_FPF_SHA '2' + +typedef char TSecurityFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define SECURITY_FTDC_BAT_BankBook '1' +/// +#define SECURITY_FTDC_BAT_SavingCard '2' +///ÿ +#define SECURITY_FTDC_BAT_CreditCard '3' + +typedef char TSecurityFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define SECURITY_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define SECURITY_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define SECURITY_FTDC_BPWDF_EncryptCheck '2' + +typedef char TSecurityFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForBrokerTypeһжԾ͹˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcBankCodingForBrokerType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define SECURITY_FTDC_TRFS_Normal '0' +/// +#define SECURITY_FTDC_TRFS_Repealed '1' + +typedef char TSecurityFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define SECURITY_FTDC_AVAF_Invalid '0' +///Ч +#define SECURITY_FTDC_AVAF_Valid '1' +/// +#define SECURITY_FTDC_AVAF_Repeal '2' + +typedef char TSecurityFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepayStockAlgoTypeһȯȯ㷨 +///////////////////////////////////////////////////////////////////////// +///Ĭ㷨 +#define SECURITY_FTDC_RSA_Original '0' +///ȯ +#define SECURITY_FTDC_RSA_Ratio '1' +///Min[1,2] +#define SECURITY_FTDC_RSA_Min '2' + +typedef char TSecurityFtdcRepayStockAlgoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +///ͨҵ +#define SECURITY_FTDC_TS_Common '1' +///Ȩ +#define SECURITY_FTDC_TS_Options '2' + +typedef char TSecurityFtdcTradeSpanType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleSystemTypeTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define SECURITY_FTDC_SST_Aboss '1' +///ϵͳ +#define SECURITY_FTDC_SST_HS '2' + +typedef char TSecurityFtdcSettleSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TSecurityFtdcTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIndexTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TSecurityFtdcTradeIndexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSplitMergeStatusTypeһֺϲ״̬ +///////////////////////////////////////////////////////////////////////// +///ʾֺͺϲ +#define SECURITY_FTDC_SMS_Allow '0' +///֡ϲ +#define SECURITY_FTDC_SMS_OnlySplit '1' +///֡ϲ +#define SECURITY_FTDC_SMS_OnlyMerge '2' +///ֺͺϲ +#define SECURITY_FTDC_SMS_Forbidden '3' + +typedef char TSecurityFtdcSplitMergeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundInterTransferTypeTypeһʽת +///////////////////////////////////////////////////////////////////////// +///ת +#define SECURITY_FTDC_FITT_TransferIn '0' +///ת +#define SECURITY_FTDC_FITT_TransferOut '1' + +typedef char TSecurityFtdcFundInterTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentTypeTypeһԼ +///////////////////////////////////////////////////////////////////////// +///ͨ +#define SECURITY_FTDC_IT_Normal '0' +///Ȩ +#define SECURITY_FTDC_IT_CallOptions '1' +///Ȩ +#define SECURITY_FTDC_IT_PutOptions '2' + +typedef char TSecurityFtdcInstrumentTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorLevelTypeһͶȨ׵ȼ +///////////////////////////////////////////////////////////////////////// +///һ +#define SECURITY_FTDC_IL_Level_1 '0' +/// +#define SECURITY_FTDC_IL_Level_2 '1' +/// +#define SECURITY_FTDC_IL_Level_3 '2' + +typedef char TSecurityFtdcInvestorLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDirectionTypeһƽַ +///////////////////////////////////////////////////////////////////////// +///ƽ +#define SECURITY_FTDC_CD_CloseBuy '!' +///ƽ +#define SECURITY_FTDC_CD_CloseSell '@' +///ƽ +#define SECURITY_FTDC_CD_CloseCover '#' + +typedef char TSecurityFtdcCloseDirectionType; + +#endif diff --git a/vn.lts/pyscript/SecurityFtdcUserApiStruct.h b/vn.lts/pyscript/SecurityFtdcUserApiStruct.h new file mode 100644 index 00000000..2c91e1c4 --- /dev/null +++ b/vn.lts/pyscript/SecurityFtdcUserApiStruct.h @@ -0,0 +1,2312 @@ +///////////////////////////////////////////////////////////////////////// +///@company shanghai liber information Technology Co.,Ltd +///@file SecurityFtdcUserApiStruct.h +///@brief ҵݽṹ +///////////////////////////////////////////////////////////////////////// + +#if !defined(SECURITY_FTDCSTRUCT_H) +#define SECURITY_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "SecurityFtdcUserApiDataType.h" + +///ӦϢ +struct CSecurityFtdcRspInfoField +{ + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CSecurityFtdcExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcExchangeNameType ExchangeName; + /// + TSecurityFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CSecurityFtdcProductField +{ + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; + ///Ʒ + TSecurityFtdcProductNameType ProductName; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ʒ + TSecurityFtdcProductClassType ProductClass; + ///Լ + TSecurityFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TSecurityFtdcPriceType PriceTick; + ///м۵µ + TSecurityFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TSecurityFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TSecurityFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TSecurityFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TSecurityFtdcPositionTypeType PositionType; + ///ֲ + TSecurityFtdcPositionDateTypeType PositionDateType; + ///ETFС׵λ + TSecurityFtdcVolumeType EFTMinTradeVolume; +}; + +///Լ +struct CSecurityFtdcInstrumentField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; + ///Ʒ + TSecurityFtdcProductClassType ProductClass; + /// + TSecurityFtdcYearType DeliveryYear; + /// + TSecurityFtdcMonthType DeliveryMonth; + ///м۵µ + TSecurityFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TSecurityFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TSecurityFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TSecurityFtdcVolumeType MinLimitOrderVolume; + ///Լ + TSecurityFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TSecurityFtdcPriceType PriceTick; + /// + TSecurityFtdcDateType CreateDate; + /// + TSecurityFtdcDateType OpenDate; + /// + TSecurityFtdcDateType ExpireDate; + ///ʼ + TSecurityFtdcDateType StartDelivDate; + /// + TSecurityFtdcDateType EndDelivDate; + ///Լ״̬ + TSecurityFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TSecurityFtdcBoolType IsTrading; + ///ֲ + TSecurityFtdcPositionTypeType PositionType; + ///ܷ񳷵 + TSecurityFtdcBoolType OrderCanBeWithdraw; + ///Сµλ + TSecurityFtdcVolumeType MinBuyVolume; + ///Сµλ + TSecurityFtdcVolumeType MinSellVolume; + ///ƱȨģ + TSecurityFtdcRightModelIDType RightModelID; + ///ֲֽ + TSecurityFtdcPosTradeTypeType PosTradeType; + ///г + TSecurityFtdcInstrumentIDType MarketID; + ///Ȩִм۸ + TSecurityFtdcPriceType ExecPrice; + ///Ȩֱ֤ + TSecurityFtdcMoneyType UnitMargin; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; + ///Ȩ֤1 + TSecurityFtdcRatioType OptionsMarginParam1; + ///Ȩ֤2 + TSecurityFtdcRatioType OptionsMarginParam2; +}; + +///͹˾ +struct CSecurityFtdcBrokerField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///͹˾ + TSecurityFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TSecurityFtdcBrokerNameType BrokerName; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///Ա;͹˾ձ +struct CSecurityFtdcPartBrokerField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///Ͷ +struct CSecurityFtdcInvestorField +{ + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TSecurityFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TSecurityFtdcPartyNameType InvestorName; + ///֤ + TSecurityFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TSecurityFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///ϺӪҵ + TSecurityFtdcTraderIDType SHBranchID; + ///Ӫҵ + TSecurityFtdcTraderIDType SZBranchID; + ///ϵͳ + TSecurityFtdcSettleSystemTypeType SettleSystemType; + ///ͶȨ׵ȼ + TSecurityFtdcInvestorLevelType InvestorLevel; +}; + +///ױ +struct CSecurityFtdcTradingCodeField +{ + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///AccountID + TSecurityFtdcAccountIDType AccountID; + ///׵Ԫ + TSecurityFtdcTraderIDType PBU; + ///ClientType + TSecurityFtdcClientTypeType ClientType; +}; + +///û +struct CSecurityFtdcSuperUserField +{ + ///û + TSecurityFtdcUserIDType UserID; + ///û + TSecurityFtdcUserNameType UserName; + /// + TSecurityFtdcPasswordType Password; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///ûȨ +struct CSecurityFtdcSuperUserFunctionField +{ + ///û + TSecurityFtdcUserIDType UserID; + ///ܴ + TSecurityFtdcFunctionCodeType FunctionCode; +}; + +///͹˾û +struct CSecurityFtdcBrokerUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///û + TSecurityFtdcUserNameType UserName; + ///û + TSecurityFtdcUserTypeType UserType; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///Ƿʹ + TSecurityFtdcBoolType IsUsingOTP; +}; + +///͹˾ûȨ +struct CSecurityFtdcBrokerUserFunctionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///͹˾ܴ + TSecurityFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///ʽ˻ +struct CSecurityFtdcTradingAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + ///ϴѺ + TSecurityFtdcMoneyType PreMortgage; + ///ϴö + TSecurityFtdcMoneyType PreCredit; + ///ϴδ + TSecurityFtdcMoneyType PreDeposit; + ///ϴν׼ + TSecurityFtdcMoneyType PreBalance; + ///ϴռõı֤ + TSecurityFtdcMoneyType PreMargin; + ///Ϣ + TSecurityFtdcMoneyType InterestBase; + ///Ϣ + TSecurityFtdcMoneyType Interest; + /// + TSecurityFtdcMoneyType Deposit; + /// + TSecurityFtdcMoneyType Withdraw; + ///ı֤ + TSecurityFtdcMoneyType FrozenMargin; + ///ʽ + TSecurityFtdcMoneyType FrozenCash; + /// + TSecurityFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TSecurityFtdcMoneyType CurrMargin; + ///ʽ + TSecurityFtdcMoneyType CashIn; + /// + TSecurityFtdcMoneyType Commission; + ///׼ + TSecurityFtdcMoneyType Balance; + ///ֽ + TSecurityFtdcMoneyType Available; + ///ȡʽ + TSecurityFtdcMoneyType WithdrawQuota; + ///׼ + TSecurityFtdcMoneyType Reserve; + /// + TSecurityFtdcDateType TradingDay; + ///֤ + TSecurityFtdcMoneyType Credit; + ///Ѻ + TSecurityFtdcMoneyType Mortgage; + ///֤ + TSecurityFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TSecurityFtdcMoneyType DeliveryMargin; + ///֤ + TSecurityFtdcMoneyType ExchangeDeliveryMargin; + ///Ĺ + TSecurityFtdcMoneyType FrozenTransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType FrozenStampTax; + /// + TSecurityFtdcMoneyType TransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType StampTax; + /// + TSecurityFtdcMoneyType ConversionAmount; + ///Ŷ + TSecurityFtdcMoneyType CreditAmount; + ///֤ȯֵܼ + TSecurityFtdcMoneyType StockValue; + ///ծعռʽ + TSecurityFtdcMoneyType BondRepurchaseAmount; + ///ծعռʽ + TSecurityFtdcMoneyType ReverseRepurchaseAmount; + /// + TSecurityFtdcCurrencyCodeType CurrencyCode; + ///˻ + TSecurityFtdcAccountTypeType AccountType; + /// + TSecurityFtdcMoneyType MarginTradeAmount; + ///ȯ + TSecurityFtdcMoneyType ShortSellAmount; + ///ʳֲӯ + TSecurityFtdcMoneyType MarginTradeProfit; + ///ȯֲӯ + TSecurityFtdcMoneyType ShortSellProfit; + ///ȯֵ + TSecurityFtdcMoneyType SSStockValue; + ///άֵ + TSecurityFtdcRatioType CreditRatio; + ///Ȩʽ + TSecurityFtdcMoneyType FrozenExecCash; +}; + +///ֹ¼û +struct CSecurityFtdcLoginForbiddenUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +/// +struct CSecurityFtdcDepthMarketDataField +{ + /// + TSecurityFtdcDateType TradingDay; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TSecurityFtdcPriceType LastPrice; + ///ϴν + TSecurityFtdcPriceType PreSettlementPrice; + /// + TSecurityFtdcPriceType PreClosePrice; + ///ֲ + TSecurityFtdcLargeVolumeType PreOpenInterest; + /// + TSecurityFtdcPriceType OpenPrice; + ///߼ + TSecurityFtdcPriceType HighestPrice; + ///ͼ + TSecurityFtdcPriceType LowestPrice; + /// + TSecurityFtdcVolumeType Volume; + ///ɽ + TSecurityFtdcMoneyType Turnover; + ///ֲ + TSecurityFtdcLargeVolumeType OpenInterest; + /// + TSecurityFtdcPriceType ClosePrice; + ///ν + TSecurityFtdcPriceType SettlementPrice; + ///ͣ + TSecurityFtdcPriceType UpperLimitPrice; + ///ͣ + TSecurityFtdcPriceType LowerLimitPrice; + ///ʵ + TSecurityFtdcRatioType PreDelta; + ///ʵ + TSecurityFtdcRatioType CurrDelta; + ///޸ʱ + TSecurityFtdcTimeType UpdateTime; + ///޸ĺ + TSecurityFtdcMillisecType UpdateMillisec; + ///һ + TSecurityFtdcPriceType BidPrice1; + ///һ + TSecurityFtdcVolumeType BidVolume1; + ///һ + TSecurityFtdcPriceType AskPrice1; + ///һ + TSecurityFtdcVolumeType AskVolume1; + ///۶ + TSecurityFtdcPriceType BidPrice2; + /// + TSecurityFtdcVolumeType BidVolume2; + ///۶ + TSecurityFtdcPriceType AskPrice2; + /// + TSecurityFtdcVolumeType AskVolume2; + /// + TSecurityFtdcPriceType BidPrice3; + /// + TSecurityFtdcVolumeType BidVolume3; + /// + TSecurityFtdcPriceType AskPrice3; + /// + TSecurityFtdcVolumeType AskVolume3; + /// + TSecurityFtdcPriceType BidPrice4; + /// + TSecurityFtdcVolumeType BidVolume4; + /// + TSecurityFtdcPriceType AskPrice4; + /// + TSecurityFtdcVolumeType AskVolume4; + /// + TSecurityFtdcPriceType BidPrice5; + /// + TSecurityFtdcVolumeType BidVolume5; + /// + TSecurityFtdcPriceType AskPrice5; + /// + TSecurityFtdcVolumeType AskVolume5; + ///վ + TSecurityFtdcPriceType AveragePrice; + ///ҵ + TSecurityFtdcDateType ActionDay; +}; + +///ͶߺԼȨ +struct CSecurityFtdcInstrumentTradingRightField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSecurityFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcDirectionType Direction; + ///Ȩ + TSecurityFtdcTradingRightType TradingRight; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ƱȨ޷ + TSecurityFtdcInstrumentRangeType InstrumentRange; +}; + +///Ͷֲ߳ϸ +struct CSecurityFtdcInvestorPositionDetailField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TSecurityFtdcHedgeFlagType HedgeFlag; + /// + TSecurityFtdcDirectionType Direction; + /// + TSecurityFtdcDateType OpenDate; + ///ɽ + TSecurityFtdcTradeIDType TradeID; + /// + TSecurityFtdcVolumeType Volume; + ///ּ + TSecurityFtdcPriceType OpenPrice; + /// + TSecurityFtdcDateType TradingDay; + ///ɽ + TSecurityFtdcTradeTypeType TradeType; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ͷ֤߱ + TSecurityFtdcMoneyType Margin; + ///֤ + TSecurityFtdcMoneyType ExchMargin; + /// + TSecurityFtdcPriceType LastSettlementPrice; + /// + TSecurityFtdcPriceType SettlementPrice; + ///ƽ + TSecurityFtdcVolumeType CloseVolume; + ///ƽֽ + TSecurityFtdcMoneyType CloseAmount; + /// + TSecurityFtdcMoneyType TransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType StampTax; + /// + TSecurityFtdcMoneyType Commission; + ///AccountID + TSecurityFtdcAccountIDType AccountID; + ///Ѻ + TSecurityFtdcVolumeType PledgeInPosition; + ///Ѻⶳ + TSecurityFtdcVolumeType PledgeInFrozenPosition; + ///عʹõı׼ȯ + TSecurityFtdcVolumeType RepurchasePosition; + ///ȯ + TSecurityFtdcMoneyType Amount; + ///ĺԼ + TSecurityFtdcInstrumentIDType UnderlyingInstrumentID; +}; + +///ծȯϢ +struct CSecurityFtdcBondInterestField +{ + /// + TSecurityFtdcDateType TradingDay; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ϣ + TSecurityFtdcInterestType Interest; +}; + +///ֵϢ +struct CSecurityFtdcMarketRationInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcVolumeType RationVolume; +}; + +///Լ +struct CSecurityFtdcInstrumentCommissionRateField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TSecurityFtdcInvestorRangeType InvestorRange; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcDirectionType Direction; + ///ӡ˰ + TSecurityFtdcRatioType StampTaxRateByMoney; + ///ӡ˰() + TSecurityFtdcRatioType StampTaxRateByVolume; + /// + TSecurityFtdcRatioType TransferFeeRateByMoney; + ///() + TSecurityFtdcRatioType TransferFeeRateByVolume; + ///׷ + TSecurityFtdcRatioType TradeFeeByMoney; + ///׷() + TSecurityFtdcRatioType TradeFeeByVolume; + ///׸ӷ + TSecurityFtdcRatioType MarginByMoney; + ///С׷ + TSecurityFtdcPriceType MinTradeFee; +}; + +///ȯϢ +struct CSecurityFtdcExcessStockInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///ȯ + TSecurityFtdcVolumeType ExcessVolume; + ///ȯ + TSecurityFtdcVolumeType ExcessFrozenVolume; +}; + +///ETFԼ +struct CSecurityFtdcETFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; + ///ETFӦ + TSecurityFtdcInstrumentIDType ETFPurRedInstrumentID; + ///С깺صλӦETF + TSecurityFtdcVolumeType CreationRedemptionUnit; + ///ֽ + TSecurityFtdcRatioType Maxcashratio; + ///깺״̬ + TSecurityFtdcCreationredemptionStatusType Creationredemption; + ///Ԥ + TSecurityFtdcMoneyType EstimateCashComponent; +}; + +///ETFƱ +struct CSecurityFtdcETFBasketField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; + ///Ʊ֤ȯ + TSecurityFtdcInstrumentIDType StockInstrumentID; + ///Ʊ֤ȯ + TSecurityFtdcInstrumentNameType StockInstrumentName; + ///Ʊ + TSecurityFtdcVolumeType Volume; + ///־ + TSecurityFtdcETFCurrenceReplaceStatusType CurrenceReplaceStatus; + ///۱ + TSecurityFtdcRatioType Premium; + ///ܽ + TSecurityFtdcMoneyType Amount; +}; + +///OFԼ +struct CSecurityFtdcOFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///OF + TSecurityFtdcInstrumentIDType InstrumentID; + ///깺״̬ + TSecurityFtdcCreationredemptionStatusType Creationredemption; + ///ֵ + TSecurityFtdcPriceType NetPrice; +}; + +///ETFԼ +struct CSecurityFtdcSFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcInstrumentIDType InstrumentID; + ///SF + TSecurityFtdcInstrumentIDType SFInstrumentID; + ///ֺϲ״̬ + TSecurityFtdcSplitMergeStatusType SplitMergeStatus; + ///С + TSecurityFtdcVolumeType MinSplitVolume; + ///Сϲ + TSecurityFtdcVolumeType MinMergeVolume; + ////ϲ + TSecurityFtdcVolumeType VolumeRatio; + ///ֵ + TSecurityFtdcPriceType NetPrice; +}; + +///Ա̻ +struct CSecurityFtdcTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + /// + TSecurityFtdcPasswordType Password; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TSecurityFtdcTraderConnectStatusType TraderConnectStatus; + /// + TSecurityFtdcDateType ConnectRequestDate; + ///ʱ + TSecurityFtdcTimeType ConnectRequestTime; + ///ϴα + TSecurityFtdcDateType LastReportDate; + ///ϴαʱ + TSecurityFtdcTimeType LastReportTime; + /// + TSecurityFtdcDateType ConnectDate; + ///ʱ + TSecurityFtdcTimeType ConnectTime; + /// + TSecurityFtdcDateType StartDate; + ///ʱ + TSecurityFtdcTimeType StartTime; + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; +}; + +///鱨̻ +struct CSecurityFtdcMDTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + /// + TSecurityFtdcPasswordType Password; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TSecurityFtdcTraderConnectStatusType TraderConnectStatus; + /// + TSecurityFtdcDateType ConnectRequestDate; + ///ʱ + TSecurityFtdcTimeType ConnectRequestTime; + ///ϴα + TSecurityFtdcDateType LastReportDate; + ///ϴαʱ + TSecurityFtdcTimeType LastReportTime; + /// + TSecurityFtdcDateType ConnectDate; + ///ʱ + TSecurityFtdcTimeType ConnectTime; + /// + TSecurityFtdcDateType StartDate; + ///ʱ + TSecurityFtdcTimeType StartTime; + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; +}; + +///ǰ״̬ +struct CSecurityFtdcFrontStatusField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///ϴα + TSecurityFtdcDateType LastReportDate; + ///ϴαʱ + TSecurityFtdcTimeType LastReportTime; + ///ǷԾ + TSecurityFtdcBoolType IsActive; +}; + +///ûỰ +struct CSecurityFtdcUserSessionField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///¼ + TSecurityFtdcDateType LoginDate; + ///¼ʱ + TSecurityFtdcTimeType LoginTime; + ///IPַ + TSecurityFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TSecurityFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSecurityFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSecurityFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TSecurityFtdcMacAddressType MacAddress; +}; + +/// +struct CSecurityFtdcOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///۸ + TSecurityFtdcOrderPriceTypeType OrderPriceType; + /// + TSecurityFtdcDirectionType Direction; + ///Ͽƽ־ + TSecurityFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSecurityFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSecurityFtdcStockPriceType LimitPrice; + /// + TSecurityFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSecurityFtdcTimeConditionType TimeCondition; + ///GTD + TSecurityFtdcDateType GTDDate; + ///ɽ + TSecurityFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSecurityFtdcVolumeType MinVolume; + /// + TSecurityFtdcContingentConditionType ContingentCondition; + ///ֹ + TSecurityFtdcPriceType StopPrice; + ///ǿƽԭ + TSecurityFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSecurityFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcRequestIDType RequestID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ύ״̬ + TSecurityFtdcOrderSubmitStatusType OrderSubmitStatus; + ///˻ + TSecurityFtdcAccountIDType AccountID; + ///ʾ + TSecurityFtdcSequenceNoType NotifySequence; + /// + TSecurityFtdcDateType TradingDay; + /// + TSecurityFtdcOrderSysIDType OrderSysID; + ///Դ + TSecurityFtdcOrderSourceType OrderSource; + ///״̬ + TSecurityFtdcOrderStatusType OrderStatus; + /// + TSecurityFtdcOrderTypeType OrderType; + ///ɽ + TSecurityFtdcVolumeType VolumeTraded; + ///ʣ + TSecurityFtdcVolumeType VolumeTotal; + /// + TSecurityFtdcDateType InsertDate; + ///ίʱ + TSecurityFtdcTimeType InsertTime; + ///ʱ + TSecurityFtdcTimeType ActiveTime; + ///ʱ + TSecurityFtdcTimeType SuspendTime; + ///޸ʱ + TSecurityFtdcTimeType UpdateTime; + ///ʱ + TSecurityFtdcTimeType CancelTime; + ///޸ĽԱ + TSecurityFtdcTraderIDType ActiveTraderID; + ///Ա + TSecurityFtdcParticipantIDType ClearingPartID; + /// + TSecurityFtdcSequenceNoType SequenceNo; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///û˲ƷϢ + TSecurityFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TSecurityFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TSecurityFtdcBoolType UserForceClose; + ///û + TSecurityFtdcUserIDType ActiveUserID; + ///͹˾ + TSecurityFtdcSequenceNoType BrokerOrderSeq; + ///ر + TSecurityFtdcOrderSysIDType RelativeOrderSysID; + ///Ӫҵ + TSecurityFtdcBranchIDType BranchID; + ///ɽ + TSecurityFtdcMoneyType TradeAmount; + ///ǷETF + TSecurityFtdcBoolType IsETF; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; +}; + +/// +struct CSecurityFtdcOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcOrderActionRefType OrderActionRef; + /// + TSecurityFtdcOrderRefType OrderRef; + /// + TSecurityFtdcRequestIDType RequestID; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///־ + TSecurityFtdcActionFlagType ActionFlag; + ///۸ + TSecurityFtdcPriceType LimitPrice; + ///仯 + TSecurityFtdcVolumeType VolumeChange; + /// + TSecurityFtdcDateType ActionDate; + ///ʱ + TSecurityFtdcTimeType ActionTime; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///ر + TSecurityFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSecurityFtdcOrderActionStatusType OrderActionStatus; + ///û + TSecurityFtdcUserIDType UserID; + ///Ӫҵ + TSecurityFtdcBranchIDType BranchID; + ///״̬Ϣ + TSecurityFtdcErrorMsgType StatusMsg; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; +}; + +///󱨵 +struct CSecurityFtdcErrOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///۸ + TSecurityFtdcOrderPriceTypeType OrderPriceType; + /// + TSecurityFtdcDirectionType Direction; + ///Ͽƽ־ + TSecurityFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSecurityFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSecurityFtdcStockPriceType LimitPrice; + /// + TSecurityFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSecurityFtdcTimeConditionType TimeCondition; + ///GTD + TSecurityFtdcDateType GTDDate; + ///ɽ + TSecurityFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSecurityFtdcVolumeType MinVolume; + /// + TSecurityFtdcContingentConditionType ContingentCondition; + ///ֹ + TSecurityFtdcPriceType StopPrice; + ///ǿƽԭ + TSecurityFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSecurityFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcRequestIDType RequestID; + ///ûǿ־ + TSecurityFtdcBoolType UserForceClose; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +///󱨵 +struct CSecurityFtdcErrOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcOrderActionRefType OrderActionRef; + /// + TSecurityFtdcOrderRefType OrderRef; + /// + TSecurityFtdcRequestIDType RequestID; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///־ + TSecurityFtdcActionFlagType ActionFlag; + ///۸ + TSecurityFtdcPriceType LimitPrice; + ///仯 + TSecurityFtdcVolumeType VolumeChange; + /// + TSecurityFtdcDateType ActionDate; + ///ʱ + TSecurityFtdcTimeType ActionTime; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///װ + TSecurityFtdcInstallIDType InstallID; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///ر + TSecurityFtdcOrderLocalIDType ActionLocalID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + ///״̬ + TSecurityFtdcOrderActionStatusType OrderActionStatus; + ///û + TSecurityFtdcUserIDType UserID; + ///Ӫҵ + TSecurityFtdcBranchIDType BranchID; + ///״̬Ϣ + TSecurityFtdcErrorMsgType StatusMsg; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; + ///Լ + TSecurityFtdcInstrumentTypeType InstrumentType; +}; + +///ɽ +struct CSecurityFtdcTradeField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ɽ + TSecurityFtdcTradeIDType TradeID; + /// + TSecurityFtdcDirectionType Direction; + /// + TSecurityFtdcOrderSysIDType OrderSysID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///ͻ + TSecurityFtdcClientIDType ClientID; + ///׽ɫ + TSecurityFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TSecurityFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TSecurityFtdcHedgeFlagType HedgeFlag; + ///۸ + TSecurityFtdcStockPriceType Price; + /// + TSecurityFtdcVolumeType Volume; + ///ɽʱ + TSecurityFtdcDateType TradeDate; + ///ɽʱ + TSecurityFtdcTimeType TradeTime; + ///ɽ + TSecurityFtdcTradeTypeType TradeType; + ///ɽԴ + TSecurityFtdcPriceSourceType PriceSource; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; + ///Ա + TSecurityFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcSequenceNoType SequenceNo; + ///ɽԴ + TSecurityFtdcTradeSourceType TradeSource; + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcSequenceNoType BrokerOrderSeq; + ///ɽ + TSecurityFtdcMoneyType TradeAmount; + ///ɽ + TSecurityFtdcTradeIndexType TradeIndex; +}; + +///Ͷֲ߳ +struct CSecurityFtdcInvestorPositionField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///ֲֶշ + TSecurityFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TSecurityFtdcHedgeFlagType HedgeFlag; + ///ֲ + TSecurityFtdcPositionDateType PositionDate; + ///ճֲ + TSecurityFtdcVolumeType YdPosition; + ///ճֲ + TSecurityFtdcVolumeType Position; + ///ͷ + TSecurityFtdcVolumeType LongFrozen; + ///ͷ + TSecurityFtdcVolumeType ShortFrozen; + ///ֶ + TSecurityFtdcMoneyType LongFrozenAmount; + ///ֶ + TSecurityFtdcMoneyType ShortFrozenAmount; + /// + TSecurityFtdcVolumeType OpenVolume; + ///ƽ + TSecurityFtdcVolumeType CloseVolume; + ///ֽ + TSecurityFtdcMoneyType OpenAmount; + ///ƽֽ + TSecurityFtdcMoneyType CloseAmount; + ///ֲֳɱ + TSecurityFtdcMoneyType PositionCost; + ///ʽ + TSecurityFtdcMoneyType FrozenCash; + ///ʽ + TSecurityFtdcMoneyType CashIn; + /// + TSecurityFtdcMoneyType Commission; + ///ϴν + TSecurityFtdcPriceType PreSettlementPrice; + ///ν + TSecurityFtdcPriceType SettlementPrice; + /// + TSecurityFtdcDateType TradingDay; + ///ֳɱ + TSecurityFtdcMoneyType OpenCost; + ///֤ + TSecurityFtdcMoneyType ExchangeMargin; + ///ճֲ + TSecurityFtdcVolumeType TodayPosition; + /// + TSecurityFtdcMoneyType TransferFee; + ///ӡ˰ + TSecurityFtdcMoneyType StampTax; + ///깺 + TSecurityFtdcVolumeType TodayPurRedVolume; + /// + TSecurityFtdcRatioType ConversionRate; + /// + TSecurityFtdcMoneyType ConversionAmount; + ///֤ȯֵ + TSecurityFtdcMoneyType StockValue; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///AccountID + TSecurityFtdcAccountIDType AccountID; + ///Ѻ + TSecurityFtdcVolumeType PledgeInPosition; + ///عʹõı׼ȯ + TSecurityFtdcVolumeType RepurchasePosition; + ///ETFͷ + TSecurityFtdcVolumeType PurRedShortFrozen; + /// + TSecurityFtdcVolumeType MarginTradeVolume; + /// + TSecurityFtdcMoneyType MarginTradeAmount; + ///붳 + TSecurityFtdcVolumeType MarginTradeFrozenVolume; + ///붳 + TSecurityFtdcMoneyType MarginTradeFrozenAmount; + ///ӯ + TSecurityFtdcMoneyType MarginTradeConversionProfit; + ///ȯ + TSecurityFtdcVolumeType ShortSellVolume; + ///ȯ + TSecurityFtdcMoneyType ShortSellAmount; + ///ȯ + TSecurityFtdcVolumeType ShortSellFrozenVolume; + ///ȯ + TSecurityFtdcMoneyType ShortSellFrozenAmount; + ///ȯӯ + TSecurityFtdcMoneyType ShortSellConversionProfit; + ///ȯֵ + TSecurityFtdcMoneyType SSStockValue; + ///ʳֲ + TSecurityFtdcVolumeType TodayMTPosition; + ///ȯֲ + TSecurityFtdcVolumeType TodaySSPosition; + ///ʷֲֳֿɱ + TSecurityFtdcMoneyType YdOpenCost; + ///λ + TSecurityFtdcVolumeType LockPosition; + ///Ҳλ + TSecurityFtdcVolumeType CoverPosition; + ///λ + TSecurityFtdcVolumeType LockFrozenPosition; + ///λ + TSecurityFtdcVolumeType UnlockFrozenPosition; + ///Ҷλ + TSecurityFtdcVolumeType CoverFrozenPosition; + ///Ȩλ + TSecurityFtdcVolumeType ExecFrozenPosition; +}; + +///ͬ +struct CSecurityFtdcSyncDepositField +{ + ///ˮ + TSecurityFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcMoneyType Deposit; + ///Ƿǿƽ + TSecurityFtdcBoolType IsForce; + ///˻ + TSecurityFtdcAccountIDType AccountID; +}; + +///ѯ +struct CSecurityFtdcQryExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CSecurityFtdcQryProductField +{ + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; +}; + +///ѯԼ +struct CSecurityFtdcQryInstrumentField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TSecurityFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TSecurityFtdcInstrumentIDType ProductID; +}; + +///ѯ͹˾ +struct CSecurityFtdcQryBrokerField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; +}; + +///ѯ͹˾Ա +struct CSecurityFtdcQryPartBrokerField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; +}; + +///ѯͶ +struct CSecurityFtdcQryInvestorField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CSecurityFtdcQryTradingCodeField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ͻ + TSecurityFtdcClientIDType ClientID; +}; + +///ѯû +struct CSecurityFtdcQrySuperUserField +{ + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯûȨ +struct CSecurityFtdcQrySuperUserFunctionField +{ + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ͹˾û +struct CSecurityFtdcQryBrokerUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CSecurityFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯʽ˻ +struct CSecurityFtdcQryTradingAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯֹ¼û +struct CSecurityFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ +struct CSecurityFtdcQryDepthMarketDataField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯԼȨ +struct CSecurityFtdcQryInstrumentTradingRightField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶֲ߳ϸ +struct CSecurityFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯծȯϢ +struct CSecurityFtdcQryBondInterestField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯֵϢ +struct CSecurityFtdcQryMarketRationInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ѯԼ +struct CSecurityFtdcQryInstrumentCommissionRateField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcDirectionType Direction; + ///ƽ־ + TSecurityFtdcOffsetFlagType OffsetFlag; +}; + +///ѯȯϢ +struct CSecurityFtdcQryExcessStockInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶʻϵ +struct CSecurityFtdcQryInvestorAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯETFԼ +struct CSecurityFtdcQryETFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; +}; + +///ѯETFƱ +struct CSecurityFtdcQryETFBasketField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType ETFInstrumentID; +}; + +///ѯOFԼ +struct CSecurityFtdcQryOFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType OFInstrumentID; +}; + +///ѯSFԼ +struct CSecurityFtdcQrySFInstrumentField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ETF֤ȯ + TSecurityFtdcInstrumentIDType SFInstrumentID; +}; + +///ѯԱ̻ +struct CSecurityFtdcQryTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; +}; + +///ѯ鱨̻ +struct CSecurityFtdcQryMDTraderOfferField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///Ա + TSecurityFtdcParticipantIDType ParticipantID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; +}; + +///ѯǰ״̬ +struct CSecurityFtdcQryFrontStatusField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; +}; + +///ѯûỰ +struct CSecurityFtdcQryUserSessionField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ѯ +struct CSecurityFtdcQryOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + /// + TSecurityFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TSecurityFtdcTimeType InsertTimeStart; + ///ʱ + TSecurityFtdcTimeType InsertTimeEnd; +}; + +///ѯ +struct CSecurityFtdcQryOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ѯ󱨵 +struct CSecurityFtdcQryErrOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CSecurityFtdcQryErrOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ѯɽ +struct CSecurityFtdcQryTradeField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///ɽ + TSecurityFtdcTradeIDType TradeID; + ///ʼʱ + TSecurityFtdcTimeType TradeTimeStart; + ///ʱ + TSecurityFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CSecurityFtdcQryInvestorPositionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; +}; + +///ѯˮ +struct CSecurityFtdcQrySyncDepositField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///ˮ + TSecurityFtdcDepositSeqNoType DepositSeqNo; +}; + +///û +struct CSecurityFtdcUserPasswordUpdateField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///ԭĿ + TSecurityFtdcPasswordType OldPassword; + ///µĿ + TSecurityFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CSecurityFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + ///ԭĿ + TSecurityFtdcPasswordType OldPassword; + ///µĿ + TSecurityFtdcPasswordType NewPassword; +}; + +///ֹͬû̬ +struct CSecurityFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///̬ + TSecurityFtdcOTPTypeType OTPType; + ///һ̬ + TSecurityFtdcPasswordType FirstOTP; + ///ڶ̬ + TSecurityFtdcPasswordType SecondOTP; +}; + +///͹˾û +struct CSecurityFtdcBrokerUserPasswordField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcPasswordType Password; +}; + +///ʽ˻ +struct CSecurityFtdcTradingAccountPasswordField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + /// + TSecurityFtdcPasswordType Password; +}; + +///ûȨ +struct CSecurityFtdcUserRightField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///ͻȨ + TSecurityFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TSecurityFtdcBoolType IsForbidden; +}; + +///Ͷ˻ +struct CSecurityFtdcInvestorAccountField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷʺ + TSecurityFtdcAccountIDType AccountID; + ///Ƿ˻ + TSecurityFtdcBoolType IsDefault; + ///˻ + TSecurityFtdcAccountTypeType AccountType; + ///ǷԾ + TSecurityFtdcBoolType IsActive; + ///Ͻ׵Ԫ + TSecurityFtdcTraderIDType SHBranchPBU; + ///׵Ԫ + TSecurityFtdcTraderIDType SZBranchPBU; +}; + +///ûIP +struct CSecurityFtdcUserIPField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///IPַ + TSecurityFtdcIPAddressType IPAddress; + ///IPַ + TSecurityFtdcIPAddressType IPMask; + ///Macַ + TSecurityFtdcMacAddressType MacAddress; +}; + +///û̬Ʋ +struct CSecurityFtdcBrokerUserOTPParamField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///̬ṩ + TSecurityFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TSecurityFtdcSerialNumberType SerialNumber; + ///Կ + TSecurityFtdcAuthKeyType AuthKey; + ///Ưֵ + TSecurityFtdcLastDriftType LastDrift; + ///ɹֵ + TSecurityFtdcLastSuccessType LastSuccess; + ///̬ + TSecurityFtdcOTPTypeType OTPType; +}; + +///û¼ +struct CSecurityFtdcReqUserLoginField +{ + /// + TSecurityFtdcDateType TradingDay; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcPasswordType Password; + ///û˲ƷϢ + TSecurityFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TSecurityFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TSecurityFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TSecurityFtdcMacAddressType MacAddress; + ///̬ + TSecurityFtdcPasswordType OneTimePassword; + ///նIPַ + TSecurityFtdcIPAddressType ClientIPAddress; + ///ͻ֤ + TSecurityFtdcAuthCodeType AuthCode; +}; + +///û¼Ӧ +struct CSecurityFtdcRspUserLoginField +{ + /// + TSecurityFtdcDateType TradingDay; + ///¼ɹʱ + TSecurityFtdcTimeType LoginTime; + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///ϵͳ + TSecurityFtdcSystemNameType SystemName; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///󱨵 + TSecurityFtdcOrderRefType MaxOrderRef; +}; + +///ûdz +struct CSecurityFtdcUserLogoutField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///ȫdzϢ +struct CSecurityFtdcLogoutAllField +{ + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///ϵͳ + TSecurityFtdcSystemNameType SystemName; +}; + +///ǿƽԱ˳ +struct CSecurityFtdcForceUserLogoutField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///͹˾û +struct CSecurityFtdcActivateBrokerUserField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; +}; + +///뱨 +struct CSecurityFtdcInputOrderField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcOrderRefType OrderRef; + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///۸ + TSecurityFtdcOrderPriceTypeType OrderPriceType; + /// + TSecurityFtdcDirectionType Direction; + ///Ͽƽ־ + TSecurityFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TSecurityFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TSecurityFtdcStockPriceType LimitPrice; + /// + TSecurityFtdcVolumeType VolumeTotalOriginal; + ///Ч + TSecurityFtdcTimeConditionType TimeCondition; + ///GTD + TSecurityFtdcDateType GTDDate; + ///ɽ + TSecurityFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TSecurityFtdcVolumeType MinVolume; + /// + TSecurityFtdcContingentConditionType ContingentCondition; + ///ֹ + TSecurityFtdcPriceType StopPrice; + ///ǿƽԭ + TSecurityFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TSecurityFtdcBoolType IsAutoSuspend; + ///ҵԪ + TSecurityFtdcBusinessUnitType BusinessUnit; + /// + TSecurityFtdcRequestIDType RequestID; + ///ûǿ־ + TSecurityFtdcBoolType UserForceClose; +}; + +///뱨 +struct CSecurityFtdcInputOrderActionField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + /// + TSecurityFtdcOrderActionRefType OrderActionRef; + /// + TSecurityFtdcOrderRefType OrderRef; + /// + TSecurityFtdcRequestIDType RequestID; + ///ǰñ + TSecurityFtdcFrontIDType FrontID; + ///Ự + TSecurityFtdcSessionIDType SessionID; + /// + TSecurityFtdcExchangeIDType ExchangeID; + ///־ + TSecurityFtdcActionFlagType ActionFlag; + ///۸ + TSecurityFtdcPriceType LimitPrice; + ///仯 + TSecurityFtdcVolumeType VolumeChange; + ///û + TSecurityFtdcUserIDType UserID; + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///Ա + TSecurityFtdcTraderIDType BranchPBU; + ///ر + TSecurityFtdcOrderLocalIDType OrderLocalID; +}; + +///ָĺԼ +struct CSecurityFtdcSpecificInstrumentField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///ָĽ +struct CSecurityFtdcSpecificExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +/// +struct CSecurityFtdcMarketDataBaseField +{ + /// + TSecurityFtdcDateType TradingDay; + ///ϴν + TSecurityFtdcPriceType PreSettlementPrice; + /// + TSecurityFtdcPriceType PreClosePrice; + ///ֲ + TSecurityFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TSecurityFtdcRatioType PreDelta; +}; + +///龲̬ +struct CSecurityFtdcMarketDataStaticField +{ + /// + TSecurityFtdcPriceType OpenPrice; + ///߼ + TSecurityFtdcPriceType HighestPrice; + ///ͼ + TSecurityFtdcPriceType LowestPrice; + /// + TSecurityFtdcPriceType ClosePrice; + ///ͣ + TSecurityFtdcPriceType UpperLimitPrice; + ///ͣ + TSecurityFtdcPriceType LowerLimitPrice; + ///ν + TSecurityFtdcPriceType SettlementPrice; + ///ʵ + TSecurityFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CSecurityFtdcMarketDataLastMatchField +{ + ///¼ + TSecurityFtdcPriceType LastPrice; + /// + TSecurityFtdcVolumeType Volume; + ///ɽ + TSecurityFtdcMoneyType Turnover; + ///ֲ + TSecurityFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CSecurityFtdcMarketDataBestPriceField +{ + ///һ + TSecurityFtdcPriceType BidPrice1; + ///һ + TSecurityFtdcVolumeType BidVolume1; + ///һ + TSecurityFtdcPriceType AskPrice1; + ///һ + TSecurityFtdcVolumeType AskVolume1; +}; + +/// +struct CSecurityFtdcMarketDataBid23Field +{ + ///۶ + TSecurityFtdcPriceType BidPrice2; + /// + TSecurityFtdcVolumeType BidVolume2; + /// + TSecurityFtdcPriceType BidPrice3; + /// + TSecurityFtdcVolumeType BidVolume3; +}; + +/// +struct CSecurityFtdcMarketDataAsk23Field +{ + ///۶ + TSecurityFtdcPriceType AskPrice2; + /// + TSecurityFtdcVolumeType AskVolume2; + /// + TSecurityFtdcPriceType AskPrice3; + /// + TSecurityFtdcVolumeType AskVolume3; +}; + +///ġ +struct CSecurityFtdcMarketDataBid45Field +{ + /// + TSecurityFtdcPriceType BidPrice4; + /// + TSecurityFtdcVolumeType BidVolume4; + /// + TSecurityFtdcPriceType BidPrice5; + /// + TSecurityFtdcVolumeType BidVolume5; +}; + +///ġ +struct CSecurityFtdcMarketDataAsk45Field +{ + /// + TSecurityFtdcPriceType AskPrice4; + /// + TSecurityFtdcVolumeType AskVolume4; + /// + TSecurityFtdcPriceType AskPrice5; + /// + TSecurityFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CSecurityFtdcMarketDataUpdateTimeField +{ + ///Լ + TSecurityFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TSecurityFtdcTimeType UpdateTime; + ///޸ĺ + TSecurityFtdcMillisecType UpdateMillisec; + ///ҵ + TSecurityFtdcDateType ActionDay; +}; + +///ɽ +struct CSecurityFtdcMarketDataAveragePriceField +{ + ///վ + TSecurityFtdcPriceType AveragePrice; +}; + +///齻 +struct CSecurityFtdcMarketDataExchangeField +{ + /// + TSecurityFtdcExchangeIDType ExchangeID; +}; + +///Ϣַ +struct CSecurityFtdcDisseminationField +{ + ///ϵк + TSecurityFtdcSequenceSeriesType SequenceSeries; + ///к + TSecurityFtdcSequenceNoType SequenceNo; +}; + +///ʽת +struct CSecurityFtdcInputFundTransferField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷʽʺ + TSecurityFtdcAccountIDType AccountID; + ///ʽʻ + TSecurityFtdcPasswordType Password; + ///û + TSecurityFtdcUserIDType UserID; + ///׽ + TSecurityFtdcTradeAmountType TradeAmount; + ///ժҪ + TSecurityFtdcDigestType Digest; + ///˻ + TSecurityFtdcAccountTypeType AccountType; +}; + +///ʽת +struct CSecurityFtdcFundTransferField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///Ͷʽʺ + TSecurityFtdcAccountIDType AccountID; + ///ʽʻ + TSecurityFtdcPasswordType Password; + ///û + TSecurityFtdcUserIDType UserID; + ///׽ + TSecurityFtdcTradeAmountType TradeAmount; + ///ժҪ + TSecurityFtdcDigestType Digest; + ///Ự + TSecurityFtdcSessionIDType SessionID; + ///Liberˮ + TSecurityFtdcLiberSerialType LiberSerial; + ///תƽ̨ˮ + TSecurityFtdcPlateSerialType PlateSerial; + ///ˮ + TSecurityFtdcBankSerialType TransferSerial; + /// + TSecurityFtdcDateType TradingDay; + ///תʱ + TSecurityFtdcTimeType TradeTime; + /// + TSecurityFtdcFundDirectionType FundDirection; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +///ʽת˲ѯ +struct CSecurityFtdcQryFundTransferSerialField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷʽʺ + TSecurityFtdcAccountIDType AccountID; + ///˻ + TSecurityFtdcAccountTypeType AccountType; +}; + +///ʽת +struct CSecurityFtdcFundInterTransferField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///û + TSecurityFtdcUserIDType UserID; + ///ʽ˻ + TSecurityFtdcAccountIDType AccountID; + ///ʽ˻ + TSecurityFtdcPasswordType Password; + /// + TSecurityFtdcTradeAmountType TradeAmount; + ///ת + TSecurityFtdcFundInterTransferTypeType TransferType; + ///ʽת + TSecurityFtdcLiberSerialType SerialID; +}; + +///ʽתˮ +struct CSecurityFtdcFundInterTransferSerialField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; + ///û + TSecurityFtdcUserIDType UserID; + ///ʽ˻ + TSecurityFtdcAccountIDType AccountID; + ///ʽ˻ + TSecurityFtdcPasswordType Password; + /// + TSecurityFtdcTradeAmountType TradeAmount; + ///ת + TSecurityFtdcFundInterTransferTypeType TransferType; + ///ʽת + TSecurityFtdcLiberSerialType SerialID; + ///תʱ + TSecurityFtdcTimeType TransferTime; + /// + TSecurityFtdcErrorIDType ErrorID; + ///Ϣ + TSecurityFtdcErrorMsgType ErrorMsg; +}; + +///ʽתˮѯ +struct CSecurityFtdcQryFundInterTransferSerialField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///Ͷߴ + TSecurityFtdcInvestorIDType InvestorID; +}; + +///ȡݿϢ +struct CSecurityFtdcFetchDBInfoField +{ + ///û + TSecurityFtdcUserIDType UserID; + /// + TSecurityFtdcPasswordType Password; + ///ݿ + TSecurityFtdcUserNameType DBIndex; + ///ݿIPַ + TSecurityFtdcIPAddressType IPAddress; + ///ݿIP˿ + TSecurityFtdcIPPortType IPPort; + ///ݿ + TSecurityFtdcUserNameType DBName; + ///ݿû + TSecurityFtdcUserIDType DBUserID; + ///ݿ + TSecurityFtdcPasswordType DBPassword; +}; + +///MDûϢ +struct CSecurityFtdcMDUserInfoField +{ + ///͹˾ + TSecurityFtdcBrokerIDType BrokerID; + ///û + TSecurityFtdcUserIDType UserID; + ///û + TSecurityFtdcUserNameType UserName; + /// + TSecurityFtdcPasswordType Password; + ///ϵͳ + TSecurityFtdcSequenceNoType MDSysID; +}; + + +#endif diff --git a/vn.lts/pyscript/generate_data_type.py b/vn.lts/pyscript/generate_data_type.py new file mode 100644 index 00000000..79a88eb0 --- /dev/null +++ b/vn.lts/pyscript/generate_data_type.py @@ -0,0 +1,98 @@ +# encoding: UTF-8 + +__author__ = 'CHENXY' + +# C++和python类型的映射字典 +type_dict = { + 'int': 'int', + 'char': 'string', + 'double': 'float', + 'short': 'int' +} + + +def process_line(line): + """处理每行""" + if '///' in line: # 注释 + py_line = process_comment(line) + elif 'typedef' in line: # 类型申明 + py_line = process_typedef(line) + elif '#define' in line: # 定义常量 + py_line = process_define(line) + elif line == '\n': # 空行 + py_line = line + else: + py_line = '' + + return py_line + + +def process_comment(line): + """处理注释""" + # if line[3] == '/': + # py_line = '' + # else: + # py_line = '#' + line[3:] + py_line = '#' + line[3:] + return py_line + + +def process_typedef(line): + """处理类型申明""" + content = line.split(' ') + type_ = type_dict[content[1]] + + keyword = content[2] + if '[' in keyword: + i = keyword.index('[') + keyword = keyword[:i] + else: + keyword = keyword.replace(';\n', '') # 删除行末分号 + + py_line = 'typedefDict["%s"] = "%s"\n' % (keyword, type_) + + return py_line + + +def process_define(line): + """处理定义常量""" + content = line.split(' ') + constant = content[1] + + if len(content)>2: + value = content[-1] + py_line = 'defineDict["%s"] = %s' % (constant, value) + else: + py_line = '' + + return py_line + + +def main(): + """主函数""" + try: + fcpp = open('SecurityFtdcUserApiDataType.h','r') + fpy = open('lts_data_type.py', 'w') + + fpy.write('# encoding: UTF-8\n') + fpy.write('\n') + fpy.write('defineDict = {}\n') + fpy.write('typedefDict = {}\n') + fpy.write('\n') + + for line in fcpp: + py_line = process_line(line) + if py_line: + fpy.write(py_line.decode('gbk').encode('utf-8')) + + fcpp.close() + fpy.close() + + print u'data_type.py生成过程完成' + except: + print u'data_type.py生成过程出错' + + +if __name__ == '__main__': + main() + diff --git a/vn.lts/pyscript/generate_md_functions.py b/vn.lts/pyscript/generate_md_functions.py new file mode 100644 index 00000000..788a8d19 --- /dev/null +++ b/vn.lts/pyscript/generate_md_functions.py @@ -0,0 +1,207 @@ +# encoding: UTF-8 + +__author__ = 'CHENXY' + +from string import join +from lts_struct import structDict + + + +def processCallBack(line): + orignalLine = line + line = line.replace('\tvirtual void ', '') # 删除行首的无效内容 + line = line.replace('{};\n', '') # 删除行尾的无效内容 + + content = line.split('(') + cbName = content[0] # 回调函数名称 + + cbArgs = content[1] # 回调函数参数 + if cbArgs[-1] == ' ': + cbArgs = cbArgs.replace(') ', '') + else: + cbArgs = cbArgs.replace(')', '') + + cbArgsList = cbArgs.split(', ') # 将每个参数转化为列表 + + cbArgsTypeList = [] + cbArgsValueList = [] + + for arg in cbArgsList: # 开始处理参数 + content = arg.split(' ') + if len(content) > 1: + cbArgsTypeList.append(content[0]) # 参数类型列表 + cbArgsValueList.append(content[1]) # 参数数据列表 + + createTask(cbName, cbArgsTypeList, cbArgsValueList, orignalLine) + createProcess(cbName, cbArgsTypeList, cbArgsValueList) + + +def createTask(cbName, cbArgsTypeList, cbArgsValueList, orignalLine): + # 从回调函数生成任务对象,并放入队列 + funcline = orignalLine.replace('\tvirtual void ', 'void ' + apiName + '::') + funcline = funcline.replace('{};', '') + + ftask.write(funcline) + ftask.write('{\n') + ftask.write("\tTask task = Task();\n") + + ftask.write("\ttask.task_name = " + cbName.upper() + ";\n") + + # define常量 + global define_count + fdefine.write("#define " + cbName.upper() + ' ' + str(define_count) + '\n') + define_count = define_count + 1 + + # switch段代码 + fswitch.write("case " + cbName.upper() + ':\n') + fswitch.write("{\n") + fswitch.write("\tthis->" + cbName.replace('On', 'process') + '(task);\n') + fswitch.write("\tbreak;\n") + fswitch.write("}\n") + fswitch.write("\n") + + for i, type_ in enumerate(cbArgsTypeList): + if type_ == 'int': + ftask.write("\ttask.task_id = " + cbArgsValueList[i] + ";\n") + elif type_ == 'bool': + ftask.write("\ttask.task_last = " + cbArgsValueList[i] + ";\n") + elif 'RspInfoField' in type_: + ftask.write("\tif (pRspInfo)\n") + ftask.write("\t{\n") + ftask.write("\t\ttask.task_error = " + cbArgsValueList[i] + ";\n") + ftask.write("\t}\n") + ftask.write("\telse\n") + ftask.write("\t{\n") + ftask.write("\t\tCSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();\n") + ftask.write("\t\tmemset(&empty_error, 0, sizeof(empty_error));\n") + ftask.write("\t\ttask.task_error = empty_error;\n") + ftask.write("\t}\n") + else: + ftask.write("\ttask.task_data = " + cbArgsValueList[i] + ";\n") + + ftask.write("\tthis->task_queue.push(task);\n") + ftask.write("};\n") + ftask.write("\n") + + +def createProcess(cbName, cbArgsTypeList, cbArgsValueList): + # 从队列中提取任务,并转化为python字典 + fprocess.write("void " + apiName + '::' + cbName.replace('On', 'process') + '(Task task)' + "\n") + fprocess.write("{\n") + + onArgsList = [] + + for i, type_ in enumerate(cbArgsTypeList): + if 'RspInfoField' in type_: + fprocess.write("\t"+ type_ + ' task_error = any_cast<' + type_ + '>(task.task_error);\n') + fprocess.write("\t"+ "dict error;\n") + + struct = structDict[type_] + for key in struct.keys(): + fprocess.write("\t"+ 'error["' + key + '"] = task_error.' + key + ';\n') + + fprocess.write("\n") + + onArgsList.append('error') + + elif type_ in structDict: + fprocess.write("\t"+ type_ + ' task_data = any_cast<' + type_ + '>(task.task_data);\n') + fprocess.write("\t"+ "dict data;\n") + + struct = structDict[type_] + for key in struct.keys(): + fprocess.write("\t"+ 'data["' + key + '"] = task_data.' + key + ';\n') + + fprocess.write("\n") + + onArgsList.append('data') + + elif type_ == 'bool': + onArgsList.append('task.task_last') + + elif type_ == 'int': + onArgsList.append('task.task_id') + + onArgs = join(onArgsList, ', ') + fprocess.write('\tthis->' + cbName.replace('On', 'on') + '(' + onArgs +');\n') + + fprocess.write("};\n") + fprocess.write("\n") + + +def processFunction(line): + line = line.replace('\tvirtual int ', '') # 删除行首的无效内容 + line = line.replace(') = 0;\n', '') # 删除行尾的无效内容 + + content = line.split('(') + fcName = content[0] # 回调函数名称 + + fcArgs = content[1] # 回调函数参数 + fcArgs = fcArgs.replace(')', '') + + fcArgsList = fcArgs.split(', ') # 将每个参数转化为列表 + + fcArgsTypeList = [] + fcArgsValueList = [] + + for arg in fcArgsList: # 开始处理参数 + content = arg.split(' ') + if len(content) > 1: + fcArgsTypeList.append(content[0]) # 参数类型列表 + fcArgsValueList.append(content[1]) # 参数数据列表 + + if len(fcArgsTypeList)>0 and fcArgsTypeList[0] in structDict: + createFunction(fcName, fcArgsTypeList, fcArgsValueList) + + +def createFunction(fcName, fcArgsTypeList, fcArgsValueList): + type_ = fcArgsTypeList[0] + struct = structDict[type_] + + ffunction.write(fcName + '\n') + ffunction.write('{\n') + ffunction.write('\t' + type_ +' myreq = ' + type_ + '();\n') + ffunction.write('\tmemset(&myreq, 0, sizeof(myreq));\n') + + for key, value in struct.items(): + if value == 'string': + line = '\tgetChar(req, "' + key + '", myreq.' + key + ');\n' + elif value == 'int': + line = '\tgetInt(req, "' + key + '", &myreq.' + key + ');\n' + elif value == 'double': + line = '\tgetDouble(req, "' + key + '", &myreq.' + key + ');\n' + ffunction.write(line) + + ffunction.write('\tint i = this->api->' + fcName + '(&myreq, nRequestID);\n') + ffunction.write('\treturn i;\n') + + ffunction.write('};\n') + ffunction.write('\n') + + + + +######################################################### +apiName = 'MdApi' + +fcpp = open('SecurityFtdcMdApi.h', 'r') +ftask = open('lts_md_task.cpp', 'w') +fprocess = open('lts_md_process.cpp', 'w') +ffunction = open('lts_md_function.cpp', 'w') +fdefine = open('lts_md_define.cpp', 'w') +fswitch = open('lts_md_switch.cpp', 'w') + +define_count = 1 + +for line in fcpp: + if "\tvirtual void On" in line: + processCallBack(line) + elif "\tvirtual int" in line: + processFunction(line) + +fcpp.close() +ftask.close() +fprocess.close() +ffunction.close() +fswitch.close() +fdefine.close() \ No newline at end of file diff --git a/vn.lts/pyscript/generate_struct.py b/vn.lts/pyscript/generate_struct.py new file mode 100644 index 00000000..56c25836 --- /dev/null +++ b/vn.lts/pyscript/generate_struct.py @@ -0,0 +1,56 @@ +# encoding: UTF-8 + +__author__ = 'CHENXY' + +from lts_data_type import * + +def main(): + """主函数""" + fcpp = open('SecurityFtdcUserApiStruct.h', 'r') + fpy = open('lts_struct.py', 'w') + + fpy.write('# encoding: UTF-8\n') + fpy.write('\n') + fpy.write('structDict = {}\n') + fpy.write('\n') + + for line in fcpp: + # 结构体申明注释 + if '///' in line and '\t' not in line: + py_line = '#' + line[3:] + + # 结构体变量注释 + elif '\t///' in line: + py_line = '#' + line[4:] + + # 结构体申明 + elif 'struct' in line: + content = line.split(' ') + name = content[1].replace('\n','') + py_line = '%s = {}\n' % name + + # 结构体变量 + elif '\t' in line: + content = line.split('\t') + typedef = content[1] + type_ = typedefDict[typedef] + variable = content[2].replace(';\n', "") + py_line = '%s["%s"] = "%s"\n' % (name, variable, type_) + + # 结构体结束 + elif '}' in line: + py_line = "structDict['%s'] = %s\n\n" % (name, name) + + # 结构体开始 + elif '{' in line: + py_line = '' + + # 其他 + else: + py_line = '\n' + + fpy.write(py_line.decode('gbk').encode('utf-8')) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/vn.lts/pyscript/generate_td_functions.py b/vn.lts/pyscript/generate_td_functions.py new file mode 100644 index 00000000..b9e43cc2 --- /dev/null +++ b/vn.lts/pyscript/generate_td_functions.py @@ -0,0 +1,207 @@ +# encoding: UTF-8 + +__author__ = 'CHENXY' + +from string import join +from lts_struct import structDict + + + +def processCallBack(line): + orignalLine = line + line = line.replace('\tvirtual void ', '') # 删除行首的无效内容 + line = line.replace('{};\n', '') # 删除行尾的无效内容 + + content = line.split('(') + cbName = content[0] # 回调函数名称 + + cbArgs = content[1] # 回调函数参数 + if cbArgs[-1] == ' ': + cbArgs = cbArgs.replace(') ', '') + else: + cbArgs = cbArgs.replace(')', '') + + cbArgsList = cbArgs.split(', ') # 将每个参数转化为列表 + + cbArgsTypeList = [] + cbArgsValueList = [] + + for arg in cbArgsList: # 开始处理参数 + content = arg.split(' ') + if len(content) > 1: + cbArgsTypeList.append(content[0]) # 参数类型列表 + cbArgsValueList.append(content[1]) # 参数数据列表 + + createTask(cbName, cbArgsTypeList, cbArgsValueList, orignalLine) + createProcess(cbName, cbArgsTypeList, cbArgsValueList) + + +def createTask(cbName, cbArgsTypeList, cbArgsValueList, orignalLine): + # 从回调函数生成任务对象,并放入队列 + funcline = orignalLine.replace('\tvirtual void ', 'void ' + apiName + '::') + funcline = funcline.replace('{};', '') + + ftask.write(funcline) + ftask.write('{\n') + ftask.write("\tTask task = Task();\n") + + ftask.write("\ttask.task_name = " + cbName.upper() + ";\n") + + # define常量 + global define_count + fdefine.write("#define " + cbName.upper() + ' ' + str(define_count) + '\n') + define_count = define_count + 1 + + # switch段代码 + fswitch.write("case " + cbName.upper() + ':\n') + fswitch.write("{\n") + fswitch.write("\tthis->" + cbName.replace('On', 'process') + '(task);\n') + fswitch.write("\tbreak;\n") + fswitch.write("}\n") + fswitch.write("\n") + + for i, type_ in enumerate(cbArgsTypeList): + if type_ == 'int': + ftask.write("\ttask.task_id = " + cbArgsValueList[i] + ";\n") + elif type_ == 'bool': + ftask.write("\ttask.task_last = " + cbArgsValueList[i] + ";\n") + elif 'RspInfoField' in type_: + ftask.write("\tif (pRspInfo)\n") + ftask.write("\t{\n") + ftask.write("\t\ttask.task_error = " + cbArgsValueList[i] + ";\n") + ftask.write("\t}\n") + ftask.write("\telse\n") + ftask.write("\t{\n") + ftask.write("\t\tCSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField();\n") + ftask.write("\t\tmemset(&empty_error, 0, sizeof(empty_error));\n") + ftask.write("\t\ttask.task_error = empty_error;\n") + ftask.write("\t}\n") + else: + ftask.write("\ttask.task_data = " + cbArgsValueList[i] + ";\n") + + ftask.write("\tthis->task_queue.push(task);\n") + ftask.write("};\n") + ftask.write("\n") + + +def createProcess(cbName, cbArgsTypeList, cbArgsValueList): + # 从队列中提取任务,并转化为python字典 + fprocess.write("void " + apiName + '::' + cbName.replace('On', 'process') + '(Task task)' + "\n") + fprocess.write("{\n") + + onArgsList = [] + + for i, type_ in enumerate(cbArgsTypeList): + if 'RspInfoField' in type_: + fprocess.write("\t"+ type_ + ' task_error = any_cast<' + type_ + '>(task.task_error);\n') + fprocess.write("\t"+ "dict error;\n") + + struct = structDict[type_] + for key in struct.keys(): + fprocess.write("\t"+ 'error["' + key + '"] = task_error.' + key + ';\n') + + fprocess.write("\n") + + onArgsList.append('error') + + elif type_ in structDict: + fprocess.write("\t"+ type_ + ' task_data = any_cast<' + type_ + '>(task.task_data);\n') + fprocess.write("\t"+ "dict data;\n") + + struct = structDict[type_] + for key in struct.keys(): + fprocess.write("\t"+ 'data["' + key + '"] = task_data.' + key + ';\n') + + fprocess.write("\n") + + onArgsList.append('data') + + elif type_ == 'bool': + onArgsList.append('task.task_last') + + elif type_ == 'int': + onArgsList.append('task.task_id') + + onArgs = join(onArgsList, ', ') + fprocess.write('\tthis->' + cbName.replace('On', 'on') + '(' + onArgs +');\n') + + fprocess.write("};\n") + fprocess.write("\n") + + +def processFunction(line): + line = line.replace('\tvirtual int ', '') # 删除行首的无效内容 + line = line.replace(') = 0;\n', '') # 删除行尾的无效内容 + + content = line.split('(') + fcName = content[0] # 回调函数名称 + + fcArgs = content[1] # 回调函数参数 + fcArgs = fcArgs.replace(')', '') + + fcArgsList = fcArgs.split(', ') # 将每个参数转化为列表 + + fcArgsTypeList = [] + fcArgsValueList = [] + + for arg in fcArgsList: # 开始处理参数 + content = arg.split(' ') + if len(content) > 1: + fcArgsTypeList.append(content[0]) # 参数类型列表 + fcArgsValueList.append(content[1]) # 参数数据列表 + + if len(fcArgsTypeList)>0 and fcArgsTypeList[0] in structDict: + createFunction(fcName, fcArgsTypeList, fcArgsValueList) + + +def createFunction(fcName, fcArgsTypeList, fcArgsValueList): + type_ = fcArgsTypeList[0] + struct = structDict[type_] + + ffunction.write(fcName + '\n') + ffunction.write('{\n') + ffunction.write('\t' + type_ +' myreq = ' + type_ + '();\n') + ffunction.write('\tmemset(&myreq, 0, sizeof(myreq));\n') + + for key, value in struct.items(): + if value == 'string': + line = '\tgetChar(req, "' + key + '", myreq.' + key + ');\n' + elif value == 'int': + line = '\tgetInt(req, "' + key + '", &myreq.' + key + ');\n' + elif value == 'double': + line = '\tgetDouble(req, "' + key + '", &myreq.' + key + ');\n' + ffunction.write(line) + + ffunction.write('\tint i = this->api->' + fcName + '(&myreq, nRequestID);\n') + ffunction.write('\treturn i;\n') + + ffunction.write('};\n') + ffunction.write('\n') + + + + +######################################################### +apiName = 'TdApi' + +fcpp = open('SecurityFtdcTraderApi.h', 'r') +ftask = open('lts_td_task.cpp', 'w') +fprocess = open('lts_td_process.cpp', 'w') +ffunction = open('lts_td_function.cpp', 'w') +fdefine = open('lts_td_define.cpp', 'w') +fswitch = open('lts_td_switch.cpp', 'w') + +define_count = 1 + +for line in fcpp: + if "\tvirtual void On" in line: + processCallBack(line) + elif "\tvirtual int" in line: + processFunction(line) + +fcpp.close() +ftask.close() +fprocess.close() +ffunction.close() +fswitch.close() +fdefine.close() \ No newline at end of file diff --git a/vn.lts/pyscript/lts_data_type.py b/vn.lts/pyscript/lts_data_type.py new file mode 100644 index 00000000..70b07365 --- /dev/null +++ b/vn.lts/pyscript/lts_data_type.py @@ -0,0 +1,2076 @@ +# encoding: UTF-8 + +defineDict = {} +typedefDict = {} + +#////////////////////////////////////////////////////////////////////// +#@company shanghai liber information Technology Co.,Ltd +#@file SecurityFtdcUserApiDataType.h +#@brief 定义业务数据类型 +#////////////////////////////////////////////////////////////////////// + + + +#////////////////////////////////////////////////////////////////////// +#TFtdcErrorIDType是一个错误代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcErrorIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcErrorMsgType是一个错误信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcErrorMsgType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeIDType是一个交易所代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcExchangeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeNameType是一个交易所名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcExchangeNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangePropertyType是一个交易所属性类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["SECURITY_FTDC_EXP_Normal"] = '0' +#根据成交生成报单 +defineDict["SECURITY_FTDC_EXP_GenOrderByTrade"] = '1' + +typedefDict["TSecurityFtdcExchangePropertyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeConnectStatusType是一个交易所连接状态类型 +#////////////////////////////////////////////////////////////////////// +#没有任何连接 +defineDict["SECURITY_FTDC_ECS_NoConnection"] = '1' +#已经发出合约查询请求 +defineDict["SECURITY_FTDC_ECS_QryInstrumentSent"] = '2' +#已经获取信息 +defineDict["SECURITY_FTDC_ECS_GotInformation"] = '9' + +typedefDict["TSecurityFtdcExchangeConnectStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDateType是一个日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTimeType是一个时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentIDType是一个合约代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcInstrumentIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductNameType是一个产品名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcProductNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductClassType是一个产品类型类型 +#////////////////////////////////////////////////////////////////////// +#期货 +defineDict["SECURITY_FTDC_PC_Futures"] = '1' +#期权 +defineDict["SECURITY_FTDC_PC_Options"] = '2' +#组合 +defineDict["SECURITY_FTDC_PC_Combination"] = '3' +#即期 +defineDict["SECURITY_FTDC_PC_Spot"] = '4' +#期转现 +defineDict["SECURITY_FTDC_PC_EFP"] = '5' +#证券A股 +defineDict["SECURITY_FTDC_PC_StockA"] = '6' +#证券B股 +defineDict["SECURITY_FTDC_PC_StockB"] = '7' +#ETF +defineDict["SECURITY_FTDC_PC_ETF"] = '8' +#ETF申赎 +defineDict["SECURITY_FTDC_PC_ETFPurRed"] = '9' + +typedefDict["TSecurityFtdcProductClassType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVolumeMultipleType是一个合约数量乘数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVolumeMultipleType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriceType是一个价格类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcPriceType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVolumeType是一个数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVolumeType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionTypeType是一个持仓类型类型 +#////////////////////////////////////////////////////////////////////// +#净持仓 +defineDict["SECURITY_FTDC_PT_Net"] = '1' +#综合持仓 +defineDict["SECURITY_FTDC_PT_Gross"] = '2' + +typedefDict["TSecurityFtdcPositionTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionDateTypeType是一个持仓日期类型类型 +#////////////////////////////////////////////////////////////////////// +#使用历史持仓 +defineDict["SECURITY_FTDC_PDT_UseHistory"] = '1' +#不使用历史持仓 +defineDict["SECURITY_FTDC_PDT_NoUseHistory"] = '2' + +typedefDict["TSecurityFtdcPositionDateTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeInstIDType是一个合约在交易所的代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcExchangeInstIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcYearType是一个年份类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcYearType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMonthType是一个月份类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcMonthType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstLifePhaseType是一个合约生命周期状态类型 +#////////////////////////////////////////////////////////////////////// +#未上市 +defineDict["SECURITY_FTDC_IP_NotStart"] = '0' +#上市 +defineDict["SECURITY_FTDC_IP_Started"] = '1' +#停牌 +defineDict["SECURITY_FTDC_IP_Pause"] = '2' +#到期 +defineDict["SECURITY_FTDC_IP_Expired"] = '3' + +typedefDict["TSecurityFtdcInstLifePhaseType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBoolType是一个布尔型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBoolType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRightModelIDType是一个股票权限模版代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRightModelIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRightModelNameType是一个股票权限模版名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRightModelNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPosTradeTypeType是一个持仓交易类型类型 +#////////////////////////////////////////////////////////////////////// +#今日新增持仓能卖出 +defineDict["SECURITY_FTDC_PTT_CanSelTodayPos"] = '1' +#今日新增持仓不能卖出 +defineDict["SECURITY_FTDC_PTT_CannotSellTodayPos"] = '2' + +typedefDict["TSecurityFtdcPosTradeTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTraderIDType是一个交易所交易员代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTraderIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParticipantIDType是一个会员代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcParticipantIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPasswordType是一个密码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcPasswordType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerIDType是一个经纪公司代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBrokerIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderLocalIDType是一个本地报单编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOrderLocalIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerAbbrType是一个经纪公司简称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBrokerAbbrType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerNameType是一个经纪公司名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBrokerNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorIDType是一个投资者代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcInvestorIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPartyNameType是一个参与人名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcPartyNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIdCardTypeType是一个证件类型类型 +#////////////////////////////////////////////////////////////////////// +#组织机构代码 +defineDict["SECURITY_FTDC_ICT_EID"] = '0' +#身份证 +defineDict["SECURITY_FTDC_ICT_IDCard"] = '1' +#军官证 +defineDict["SECURITY_FTDC_ICT_OfficerIDCard"] = '2' +#警官证 +defineDict["SECURITY_FTDC_ICT_PoliceIDCard"] = '3' +#士兵证 +defineDict["SECURITY_FTDC_ICT_SoldierIDCard"] = '4' +#户口簿 +defineDict["SECURITY_FTDC_ICT_HouseholdRegister"] = '5' +#护照 +defineDict["SECURITY_FTDC_ICT_Passport"] = '6' +#台胞证 +defineDict["SECURITY_FTDC_ICT_TaiwanCompatriotIDCard"] = '7' +#回乡证 +defineDict["SECURITY_FTDC_ICT_HomeComingCard"] = '8' +#营业执照号 +defineDict["SECURITY_FTDC_ICT_LicenseNo"] = '9' +#税务登记号 +defineDict["SECURITY_FTDC_ICT_TaxNo"] = 'A' +#其他证件 +defineDict["SECURITY_FTDC_ICT_OtherCard"] = 'x' + +typedefDict["TSecurityFtdcIdCardTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIdentifiedCardNoType是一个证件号码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcIdentifiedCardNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientIDType是一个交易编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcClientIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAccountIDType是一个投资者帐号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcAccountIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientTypeType是一个交易编码类型类型 +#////////////////////////////////////////////////////////////////////// +#普通 +defineDict["SECURITY_FTDC_CLT_Normal"] = '1' +#信用交易 +defineDict["SECURITY_FTDC_CLT_Credit"] = '2' +#衍生品账户 +defineDict["SECURITY_FTDC_CLT_Derive"] = '3' +#其他类型 +defineDict["SECURITY_FTDC_CLT_Other"] = '4' + +typedefDict["TSecurityFtdcClientTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorGroupNameType是一个投资者分组名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcInvestorGroupNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserIDType是一个用户代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcUserIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserNameType是一个用户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcUserNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionCodeType是一个功能代码类型 +#////////////////////////////////////////////////////////////////////// +#强制用户登出 +defineDict["SECURITY_FTDC_FC_ForceUserLogout"] = '2' +#变更管理用户口令 +defineDict["SECURITY_FTDC_FC_UserPasswordUpdate"] = '3' +#变更经纪公司口令 +defineDict["SECURITY_FTDC_FC_BrokerPasswordUpdate"] = '4' +#变更投资者口令 +defineDict["SECURITY_FTDC_FC_InvestorPasswordUpdate"] = '5' +#报单插入 +defineDict["SECURITY_FTDC_FC_OrderInsert"] = '6' +#报单操作 +defineDict["SECURITY_FTDC_FC_OrderAction"] = '7' +#同步系统数据 +defineDict["SECURITY_FTDC_FC_SyncSystemData"] = '8' +#同步经纪公司数据 +defineDict["SECURITY_FTDC_FC_SyncBrokerData"] = '9' +#超级查询 +defineDict["SECURITY_FTDC_FC_SuperQuery"] = 'B' +#报单插入 +defineDict["SECURITY_FTDC_FC_ParkedOrderInsert"] = 'C' +#报单操作 +defineDict["SECURITY_FTDC_FC_ParkedOrderAction"] = 'D' +#同步动态令牌 +defineDict["SECURITY_FTDC_FC_SyncOTP"] = 'E' +#未知单操作 +defineDict["SECURITY_FTDC_FC_UnkownOrderAction"] = 'F' +#转托管 +defineDict["SECURITY_FTDC_FC_DepositoryTransfer"] = 'G' +#余券划转 +defineDict["SECURITY_FTDC_FC_ExcessStockTransfer"] = 'H' + +typedefDict["TSecurityFtdcFunctionCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserTypeType是一个用户类型类型 +#////////////////////////////////////////////////////////////////////// +#投资者 +defineDict["SECURITY_FTDC_UT_Investor"] = '0' +#操作员 +defineDict["SECURITY_FTDC_UT_Operator"] = '1' +#管理员 +defineDict["SECURITY_FTDC_UT_SuperUser"] = '2' + +typedefDict["TSecurityFtdcUserTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerFunctionCodeType是一个经纪公司功能代码类型 +#////////////////////////////////////////////////////////////////////// +#强制用户登出 +defineDict["SECURITY_FTDC_BFC_ForceUserLogout"] = '1' +#变更用户口令 +defineDict["SECURITY_FTDC_BFC_UserPasswordUpdate"] = '2' +#同步经纪公司数据 +defineDict["SECURITY_FTDC_BFC_SyncBrokerData"] = '3' +#报单插入 +defineDict["SECURITY_FTDC_BFC_OrderInsert"] = '5' +#报单操作 +defineDict["SECURITY_FTDC_BFC_OrderAction"] = '6' +#全部查询 +defineDict["SECURITY_FTDC_BFC_AllQuery"] = '7' +#未知单操作 +defineDict["SECURITY_FTDC_BFC_UnkownOrderAction"] = '8' +#转托管 +defineDict["SECURITY_FTDC_BFC_DepositoryTransfer"] = '9' +#余券划转 +defineDict["SECURITY_FTDC_BFC_ExcessStockTransfer"] = 'A' +#资金内转 +defineDict["SECURITY_FTDC_BFC_FundInterTransfer"] = 'B' +#系统功能:登入/登出/修改密码等 +defineDict["SECURITY_FTDC_BFC_log"] = 'a' +#基本查询:查询基础数据,如合约,交易所等常量 +defineDict["SECURITY_FTDC_BFC_BaseQry"] = 'b' +#交易查询:如查成交,委托 +defineDict["SECURITY_FTDC_BFC_TradeQry"] = 'c' +#交易功能:报单,撤单 +defineDict["SECURITY_FTDC_BFC_Trade"] = 'd' +#转账 +defineDict["SECURITY_FTDC_BFC_Virement"] = 'e' +#查询/管理:查询会话,踢人等 +defineDict["SECURITY_FTDC_BFC_Session"] = 'g' +#同步动态令牌 +defineDict["SECURITY_FTDC_BFC_SyncOTP"] = 'E' + +typedefDict["TSecurityFtdcBrokerFunctionCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencyCodeType是一个币种类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCurrencyCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMoneyType是一个资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcMoneyType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRatioType是一个比率类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRatioType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAccountTypeType是一个账户类型类型 +#////////////////////////////////////////////////////////////////////// +#普通账户 +defineDict["SECURITY_FTDC_AcT_Normal"] = '1' +#信用账户 +defineDict["SECURITY_FTDC_AcT_Credit"] = '2' +#衍生品账户 +defineDict["SECURITY_FTDC_AcT_Derive"] = '3' +#其他类型 +defineDict["SECURITY_FTDC_AcT_Other"] = '4' + +typedefDict["TSecurityFtdcAccountTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDepartmentRangeType是一个投资者范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["SECURITY_FTDC_DR_All"] = '1' +#组织架构 +defineDict["SECURITY_FTDC_DR_Group"] = '2' +#单一投资者 +defineDict["SECURITY_FTDC_DR_Single"] = '3' + +typedefDict["TSecurityFtdcDepartmentRangeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserRightTypeType是一个客户权限类型类型 +#////////////////////////////////////////////////////////////////////// +#登录 +defineDict["SECURITY_FTDC_URT_Logon"] = '1' +#银期转帐 +defineDict["SECURITY_FTDC_URT_Transfer"] = '2' +#邮寄结算单 +defineDict["SECURITY_FTDC_URT_EMail"] = '3' +#传真结算单 +defineDict["SECURITY_FTDC_URT_Fax"] = '4' +#条件单 +defineDict["SECURITY_FTDC_URT_ConditionOrder"] = '5' + +typedefDict["TSecurityFtdcUserRightTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductInfoType是一个产品信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcProductInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAuthCodeType是一个客户端认证码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcAuthCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLargeVolumeType是一个大额数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcLargeVolumeType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMillisecType是一个时间(毫秒)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcMillisecType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHedgeFlagType是一个投机套保标志类型 +#////////////////////////////////////////////////////////////////////// +#投机 +defineDict["SECURITY_FTDC_HF_Speculation"] = '1' +#套保 +defineDict["SECURITY_FTDC_HF_Hedge"] = '3' + +typedefDict["TSecurityFtdcHedgeFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDirectionType是一个买卖方向类型 +#////////////////////////////////////////////////////////////////////// +#买 +defineDict["SECURITY_FTDC_D_Buy"] = '0' +#卖 +defineDict["SECURITY_FTDC_D_Sell"] = '1' +#ETF申购 +defineDict["SECURITY_FTDC_D_ETFPur"] = '2' +#ETF赎回 +defineDict["SECURITY_FTDC_D_ETFRed"] = '3' +#现金替代,只用作回报 +defineDict["SECURITY_FTDC_D_CashIn"] = '4' +#债券入库 +defineDict["SECURITY_FTDC_D_PledgeBondIn"] = '5' +#债券出库 +defineDict["SECURITY_FTDC_D_PledgeBondOut"] = '6' +#配股 +defineDict["SECURITY_FTDC_D_Rationed"] = '7' +#转托管 +defineDict["SECURITY_FTDC_D_DepositoryTransfer"] = '8' +#信用账户配股 +defineDict["SECURITY_FTDC_D_CreditRationed"] = '9' +#担保品买入 +defineDict["SECURITY_FTDC_D_BuyCollateral"] = 'A' +#担保品卖出 +defineDict["SECURITY_FTDC_D_SellCollateral"] = 'B' +#担保品转入 +defineDict["SECURITY_FTDC_D_CollateralTransferIn"] = 'C' +#担保品转出 +defineDict["SECURITY_FTDC_D_CollateralTransferOut"] = 'D' +#融资买入 +defineDict["SECURITY_FTDC_D_MarginTrade"] = 'E' +#融券卖出 +defineDict["SECURITY_FTDC_D_ShortSell"] = 'F' +#卖券还款 +defineDict["SECURITY_FTDC_D_RepayMargin"] = 'G' +#买券还券 +defineDict["SECURITY_FTDC_D_RepayStock"] = 'H' +#直接还款 +defineDict["SECURITY_FTDC_D_DirectRepayMargin"] = 'I' +#直接还券 +defineDict["SECURITY_FTDC_D_DirectRepayStock"] = 'J' +#余券划转 +defineDict["SECURITY_FTDC_D_ExcessStockTransfer"] = 'K' +#OF申购 +defineDict["SECURITY_FTDC_D_OFPur"] = 'L' +#OF赎回 +defineDict["SECURITY_FTDC_D_OFRed"] = 'M' +#SF拆分 +defineDict["SECURITY_FTDC_D_SFSplit"] = 'N' +#SF合并 +defineDict["SECURITY_FTDC_D_SFMerge"] = 'O' +#备兑 +defineDict["SECURITY_FTDC_D_Covered"] = 'P' +#证券冻结(开)/解冻(平) +defineDict["SECURITY_FTDC_D_Freeze"] = 'Q' +#行权 +defineDict["SECURITY_FTDC_D_Execute"] = 'R' + +typedefDict["TSecurityFtdcDirectionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeIDType是一个成交编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTradeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeTypeType是一个成交类型类型 +#////////////////////////////////////////////////////////////////////// +#普通成交 +defineDict["SECURITY_FTDC_TRDT_Common"] = '0' +#期权执行 +defineDict["SECURITY_FTDC_TRDT_OptionsExecution"] = '1' +#OTC成交 +defineDict["SECURITY_FTDC_TRDT_OTC"] = '2' +#期转现衍生成交 +defineDict["SECURITY_FTDC_TRDT_EFPDerived"] = '3' +#组合衍生成交 +defineDict["SECURITY_FTDC_TRDT_CombinationDerived"] = '4' +#ETF申购 +defineDict["SECURITY_FTDC_TRDT_EFTPurchase"] = '5' +#ETF赎回 +defineDict["SECURITY_FTDC_TRDT_EFTRedem"] = '6' + +typedefDict["TSecurityFtdcTradeTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCreationredemptionStatusType是一个基金当天申购赎回状态类型 +#////////////////////////////////////////////////////////////////////// +#不允许申购赎回 +defineDict["SECURITY_FTDC_CDS_Forbidden"] = '0' +#表示允许申购和赎回 +defineDict["SECURITY_FTDC_CDS_Allow"] = '1' +#允许申购、不允许赎回 +defineDict["SECURITY_FTDC_CDS_OnlyPurchase"] = '2' +#不允许申购、允许赎回 +defineDict["SECURITY_FTDC_CDS_OnlyRedeem"] = '3' + +typedefDict["TSecurityFtdcCreationredemptionStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcETFCurrenceReplaceStatusType是一个ETF现金替代标志类型 +#////////////////////////////////////////////////////////////////////// +#禁止现金替代 +defineDict["SECURITY_FTDC_ETFCRS_Forbidden"] = '0' +#可以现金替代 +defineDict["SECURITY_FTDC_ETFCRS_Allow"] = '1' +#必须现金替代 +defineDict["SECURITY_FTDC_ETFCRS_Force"] = '2' + +typedefDict["TSecurityFtdcETFCurrenceReplaceStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInterestType是一个利息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcInterestType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRepurchaseMaxTimesType是一个正回购放大倍数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRepurchaseMaxTimesType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCapitalStockTypeType是一个股本类型类型 +#////////////////////////////////////////////////////////////////////// +#总通股本 +defineDict["SECURITY_FTDC_CPTSTOCK_TOTALSTOCK"] = '1' +#流通股本 +defineDict["SECURITY_FTDC_CPTSTOCK_CIRCULATION"] = '2' + +typedefDict["TSecurityFtdcCapitalStockTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMarginPriceTypeType是一个保证金价格类型类型 +#////////////////////////////////////////////////////////////////////// +#昨结算价 +defineDict["SECURITY_FTDC_MPT_PreSettlementPrice"] = '1' +#最新价 +defineDict["SECURITY_FTDC_MPT_SettlementPrice"] = '2' +#成交均价 +defineDict["SECURITY_FTDC_MPT_AveragePrice"] = '3' +#开仓价 +defineDict["SECURITY_FTDC_MPT_OpenPrice"] = '4' + +typedefDict["TSecurityFtdcMarginPriceTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAlgorithmType是一个盈亏算法类型 +#////////////////////////////////////////////////////////////////////// +#浮盈浮亏都计算 +defineDict["SECURITY_FTDC_AG_All"] = '1' +#浮盈不计,浮亏计 +defineDict["SECURITY_FTDC_AG_OnlyLost"] = '2' +#浮盈计,浮亏不计 +defineDict["SECURITY_FTDC_AG_OnlyGain"] = '3' +#浮盈浮亏都不计算 +defineDict["SECURITY_FTDC_AG_None"] = '4' + +typedefDict["TSecurityFtdcAlgorithmType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIncludeCloseProfitType是一个是否包含平仓盈利类型 +#////////////////////////////////////////////////////////////////////// +#包含平仓盈利 +defineDict["SECURITY_FTDC_ICP_Include"] = '0' +#不包含平仓盈利 +defineDict["SECURITY_FTDC_ICP_NotInclude"] = '2' + +typedefDict["TSecurityFtdcIncludeCloseProfitType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAllWithoutTradeType是一个是否受可提比例限制类型 +#////////////////////////////////////////////////////////////////////// +#不受可提比例限制 +defineDict["SECURITY_FTDC_AWT_Enable"] = '0' +#受可提比例限制 +defineDict["SECURITY_FTDC_AWT_Disable"] = '2' +#无仓不受可提比例限制 +defineDict["SECURITY_FTDC_AWT_NoHoldEnable"] = '3' + +typedefDict["TSecurityFtdcAllWithoutTradeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHandlePositionAlgoIDType是一个持仓处理算法编号类型 +#////////////////////////////////////////////////////////////////////// +#基本 +defineDict["SECURITY_FTDC_HPA_Base"] = '1' +#非交易 +defineDict["SECURITY_FTDC_HPA_NoneTrade"] = '4' +#证券 +defineDict["SECURITY_FTDC_HPA_Stock"] = '5' + +typedefDict["TSecurityFtdcHandlePositionAlgoIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeParamIDType是一个交易系统参数代码类型 +#////////////////////////////////////////////////////////////////////// +#系统加密算法 +defineDict["SECURITY_FTDC_TPID_EncryptionStandard"] = 'E' +#用户最大会话数 +defineDict["SECURITY_FTDC_TPID_SingleUserSessionMaxNum"] = 'S' +#最大连续登录失败数 +defineDict["SECURITY_FTDC_TPID_LoginFailMaxNum"] = 'L' +#是否强制认证 +defineDict["SECURITY_FTDC_TPID_IsAuthForce"] = 'A' +#是否生成用户事件 +defineDict["SECURITY_FTDC_TPID_GenUserEvent"] = 'G' +#起始报单本地编号 +defineDict["SECURITY_FTDC_TPID_StartOrderLocalID"] = 'O' +#融资融券买券还券算法 +defineDict["SECURITY_FTDC_TPID_RepayStockAlgo"] = 'R' +#衍生品账户资金提取线 +defineDict["SECURITY_FTDC_TPID_DeriveWithdrawRatio"] = 'D' + +typedefDict["TSecurityFtdcTradeParamIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementParamValueType是一个参数代码值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSettlementParamValueType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMemoType是一个备注类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriorityType是一个优先级类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcPriorityType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderRefType是一个报单引用类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOrderRefType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMarketIDType是一个市场代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcMarketIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMacAddressType是一个Mac地址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcMacAddressType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentNameType是一个合约名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcInstrumentNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderSysIDType是一个报单编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOrderSysIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIPAddressType是一个IP地址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcIPAddressType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIPPortType是一个IP端口类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcIPPortType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProtocolInfoType是一个协议信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcProtocolInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDepositSeqNoType是一个出入金流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcDepositSeqNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSystemNameType是一个系统名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSystemNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorRangeType是一个投资者范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["SECURITY_FTDC_IR_All"] = '1' +#投资者组 +defineDict["SECURITY_FTDC_IR_Group"] = '2' +#单一投资者 +defineDict["SECURITY_FTDC_IR_Single"] = '3' + +typedefDict["TSecurityFtdcInvestorRangeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDataSyncStatusType是一个数据同步状态类型 +#////////////////////////////////////////////////////////////////////// +#未同步 +defineDict["SECURITY_FTDC_DS_Asynchronous"] = '1' +#同步中 +defineDict["SECURITY_FTDC_DS_Synchronizing"] = '2' +#已同步 +defineDict["SECURITY_FTDC_DS_Synchronized"] = '3' + +typedefDict["TSecurityFtdcDataSyncStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTraderConnectStatusType是一个交易所交易员连接状态类型 +#////////////////////////////////////////////////////////////////////// +#没有任何连接 +defineDict["SECURITY_FTDC_TCS_NotConnected"] = '1' +#已经连接 +defineDict["SECURITY_FTDC_TCS_Connected"] = '2' +#已经发出合约查询请求 +defineDict["SECURITY_FTDC_TCS_QryInstrumentSent"] = '3' +#订阅私有流 +defineDict["SECURITY_FTDC_TCS_SubPrivateFlow"] = '4' + +typedefDict["TSecurityFtdcTraderConnectStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderActionStatusType是一个报单操作状态类型 +#////////////////////////////////////////////////////////////////////// +#已经提交 +defineDict["SECURITY_FTDC_OAS_Submitted"] = 'a' +#已经接受 +defineDict["SECURITY_FTDC_OAS_Accepted"] = 'b' +#已经被拒绝 +defineDict["SECURITY_FTDC_OAS_Rejected"] = 'c' + +typedefDict["TSecurityFtdcOrderActionStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderStatusType是一个报单状态类型 +#////////////////////////////////////////////////////////////////////// +#全部成交 +defineDict["SECURITY_FTDC_OST_AllTraded"] = '0' +#部分成交还在队列中 +defineDict["SECURITY_FTDC_OST_PartTradedQueueing"] = '1' +#部分成交不在队列中 +defineDict["SECURITY_FTDC_OST_PartTradedNotQueueing"] = '2' +#未成交还在队列中 +defineDict["SECURITY_FTDC_OST_NoTradeQueueing"] = '3' +#未成交不在队列中 +defineDict["SECURITY_FTDC_OST_NoTradeNotQueueing"] = '4' +#撤单 +defineDict["SECURITY_FTDC_OST_Canceled"] = '5' +#未知 +defineDict["SECURITY_FTDC_OST_Unknown"] = 'a' +#尚未触发 +defineDict["SECURITY_FTDC_OST_NotTouched"] = 'b' +#已触发 +defineDict["SECURITY_FTDC_OST_Touched"] = 'c' + +typedefDict["TSecurityFtdcOrderStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderSubmitStatusType是一个报单提交状态类型 +#////////////////////////////////////////////////////////////////////// +#已经提交 +defineDict["SECURITY_FTDC_OSS_InsertSubmitted"] = '0' +#撤单已经提交 +defineDict["SECURITY_FTDC_OSS_CancelSubmitted"] = '1' +#修改已经提交 +defineDict["SECURITY_FTDC_OSS_ModifySubmitted"] = '2' +#已经接受 +defineDict["SECURITY_FTDC_OSS_Accepted"] = '3' +#报单已经被拒绝 +defineDict["SECURITY_FTDC_OSS_InsertRejected"] = '4' +#撤单已经被拒绝 +defineDict["SECURITY_FTDC_OSS_CancelRejected"] = '5' +#改单已经被拒绝 +defineDict["SECURITY_FTDC_OSS_ModifyRejected"] = '6' + +typedefDict["TSecurityFtdcOrderSubmitStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionDateType是一个持仓日期类型 +#////////////////////////////////////////////////////////////////////// +#今日持仓 +defineDict["SECURITY_FTDC_PSD_Today"] = '1' +#历史持仓 +defineDict["SECURITY_FTDC_PSD_History"] = '2' + +typedefDict["TSecurityFtdcPositionDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradingRoleType是一个交易角色类型 +#////////////////////////////////////////////////////////////////////// +#代理 +defineDict["SECURITY_FTDC_ER_Broker"] = '1' +#自营 +defineDict["SECURITY_FTDC_ER_Host"] = '2' +#做市商 +defineDict["SECURITY_FTDC_ER_Maker"] = '3' + +typedefDict["TSecurityFtdcTradingRoleType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPosiDirectionType是一个持仓多空方向类型 +#////////////////////////////////////////////////////////////////////// +#净 +defineDict["SECURITY_FTDC_PD_Net"] = '1' +#多头 +defineDict["SECURITY_FTDC_PD_Long"] = '2' +#空头 +defineDict["SECURITY_FTDC_PD_Short"] = '3' +#备兑 +defineDict["SECURITY_FTDC_PD_Covered"] = '4' + +typedefDict["TSecurityFtdcPosiDirectionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderPriceTypeType是一个报单价格条件类型 +#////////////////////////////////////////////////////////////////////// +#即时成交剩余撤销市价单 +defineDict["SECURITY_FTDC_OPT_AnyPrice"] = '1' +#限价 +defineDict["SECURITY_FTDC_OPT_LimitPrice"] = '2' +#最优五档即时成交剩余撤销市价单 +defineDict["SECURITY_FTDC_OPT_BestPrice"] = '3' +#最优五档即时成交剩余转限价市价单 +defineDict["SECURITY_FTDC_OPT_BestLimitPrice"] = '4' +#全部成交或撤销市价单 +defineDict["SECURITY_FTDC_OPT_AllPrice"] = '5' +#本方最优价格市价单 +defineDict["SECURITY_FTDC_OPT_ForwardBestPrice"] = '6' +#对方最优价格市价单 +defineDict["SECURITY_FTDC_OPT_ReverseBestPrice"] = '7' +#即时成交剩余转限价市价单 +defineDict["SECURITY_FTDC_OPT_Any2LimitPrice"] = '8' +#全部成交或撤销限价单 +defineDict["SECURITY_FTDC_OPT_AllLimitPrice"] = '9' +#激活A股网络密码服务代码 +defineDict["SECURITY_FTDC_OPT_ActiveANetPassSvrCode"] = 'G' +#注销A股网络密码服务代码 +defineDict["SECURITY_FTDC_OPT_InactiveANetPassSvrCode"] = 'H' +#激活B股网络密码服务代码 +defineDict["SECURITY_FTDC_OPT_ActiveBNetPassSvrCode"] = 'I' +#注销B股网络密码服务代码 +defineDict["SECURITY_FTDC_OPT_InactiveBNetPassSvrCode"] = 'J' +#回购注销 +defineDict["SECURITY_FTDC_OPT_Repurchase"] = 'K' +#指定撤销 +defineDict["SECURITY_FTDC_OPT_DesignatedCancel"] = 'L' +#指定登记 +defineDict["SECURITY_FTDC_OPT_Designated"] = 'M' +#证券参与申购 +defineDict["SECURITY_FTDC_OPT_SubscribingShares"] = 'N' +#证券参与配股 +defineDict["SECURITY_FTDC_OPT_Split"] = 'O' +#要约收购登记 +defineDict["SECURITY_FTDC_OPT_TenderOffer"] = 'P' +#要约收购撤销 +defineDict["SECURITY_FTDC_OPT_TenderOfferCancel"] = 'Q' +#证券投票 +defineDict["SECURITY_FTDC_OPT_Ballot"] = 'R' +#可转债转换登记 +defineDict["SECURITY_FTDC_OPT_ConvertibleBondsConvet"] = 'S' +#可转债回售登记 +defineDict["SECURITY_FTDC_OPT_ConvertibleBondsRepurchase"] = 'T' +#权证行权 +defineDict["SECURITY_FTDC_OPT_Exercise"] = 'U' +#开放式基金申购 +defineDict["SECURITY_FTDC_OPT_PurchasingFunds"] = 'V' +#开放式基金赎回 +defineDict["SECURITY_FTDC_OPT_RedemingFunds"] = 'W' +#开放式基金认购 +defineDict["SECURITY_FTDC_OPT_SubscribingFunds"] = 'X' +#开放式基金转托管转出 +defineDict["SECURITY_FTDC_OPT_LOFIssue"] = 'Y' +#开放式基金设置分红方式 +defineDict["SECURITY_FTDC_OPT_LOFSetBonusType"] = 'Z' +#开放式基金转换为其他基金 +defineDict["SECURITY_FTDC_OPT_LOFConvert"] = 'a' +#债券入库 +defineDict["SECURITY_FTDC_OPT_DebentureStockIn"] = 'b' +#债券出库 +defineDict["SECURITY_FTDC_OPT_DebentureStockOut"] = 'c' +#ETF申购 +defineDict["SECURITY_FTDC_OPT_PurchasesETF"] = 'd' +#ETF赎回 +defineDict["SECURITY_FTDC_OPT_RedeemETF"] = 'e' + +typedefDict["TSecurityFtdcOrderPriceTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOffsetFlagType是一个开平标志类型 +#////////////////////////////////////////////////////////////////////// +#开仓 +defineDict["SECURITY_FTDC_OF_Open"] = '0' +#平仓 +defineDict["SECURITY_FTDC_OF_Close"] = '1' +#强平 +defineDict["SECURITY_FTDC_OF_ForceClose"] = '2' +#平今 +defineDict["SECURITY_FTDC_OF_CloseToday"] = '3' +#平昨 +defineDict["SECURITY_FTDC_OF_CloseYesterday"] = '4' +#强减 +defineDict["SECURITY_FTDC_OF_ForceOff"] = '5' +#本地强平 +defineDict["SECURITY_FTDC_OF_LocalForceClose"] = '6' + +typedefDict["TSecurityFtdcOffsetFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcForceCloseReasonType是一个强平原因类型 +#////////////////////////////////////////////////////////////////////// +#非强平 +defineDict["SECURITY_FTDC_FCC_NotForceClose"] = '0' +#资金不足 +defineDict["SECURITY_FTDC_FCC_LackDeposit"] = '1' +#客户超仓 +defineDict["SECURITY_FTDC_FCC_ClientOverPositionLimit"] = '2' +#会员超仓 +defineDict["SECURITY_FTDC_FCC_MemberOverPositionLimit"] = '3' +#持仓非整数倍 +defineDict["SECURITY_FTDC_FCC_NotMultiple"] = '4' +#违规 +defineDict["SECURITY_FTDC_FCC_Violation"] = '5' +#其它 +defineDict["SECURITY_FTDC_FCC_Other"] = '6' +#自然人临近交割 +defineDict["SECURITY_FTDC_FCC_PersonDeliv"] = '7' + +typedefDict["TSecurityFtdcForceCloseReasonType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderTypeType是一个报单类型类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["SECURITY_FTDC_ORDT_Normal"] = '0' +#报价衍生 +defineDict["SECURITY_FTDC_ORDT_DeriveFromQuote"] = '1' +#组合衍生 +defineDict["SECURITY_FTDC_ORDT_DeriveFromCombination"] = '2' +#组合报单 +defineDict["SECURITY_FTDC_ORDT_Combination"] = '3' +#条件单 +defineDict["SECURITY_FTDC_ORDT_ConditionalOrder"] = '4' +#互换单 +defineDict["SECURITY_FTDC_ORDT_Swap"] = '5' + +typedefDict["TSecurityFtdcOrderTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTimeConditionType是一个有效期类型类型 +#////////////////////////////////////////////////////////////////////// +#立即完成,否则撤销 +defineDict["SECURITY_FTDC_TC_IOC"] = '1' +#本节有效 +defineDict["SECURITY_FTDC_TC_GFS"] = '2' +#当日有效 +defineDict["SECURITY_FTDC_TC_GFD"] = '3' +#指定日期前有效 +defineDict["SECURITY_FTDC_TC_GTD"] = '4' +#撤销前有效 +defineDict["SECURITY_FTDC_TC_GTC"] = '5' +#集合竞价有效 +defineDict["SECURITY_FTDC_TC_GFA"] = '6' + +typedefDict["TSecurityFtdcTimeConditionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVolumeConditionType是一个成交量类型类型 +#////////////////////////////////////////////////////////////////////// +#任何数量 +defineDict["SECURITY_FTDC_VC_AV"] = '1' +#最小数量 +defineDict["SECURITY_FTDC_VC_MV"] = '2' +#全部数量 +defineDict["SECURITY_FTDC_VC_CV"] = '3' + +typedefDict["TSecurityFtdcVolumeConditionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcContingentConditionType是一个触发条件类型 +#////////////////////////////////////////////////////////////////////// +#立即 +defineDict["SECURITY_FTDC_CC_Immediately"] = '1' +#止损 +defineDict["SECURITY_FTDC_CC_Touch"] = '2' +#止赢 +defineDict["SECURITY_FTDC_CC_TouchProfit"] = '3' +#预埋单 +defineDict["SECURITY_FTDC_CC_ParkedOrder"] = '4' +#最新价大于条件价 +defineDict["SECURITY_FTDC_CC_LastPriceGreaterThanStopPrice"] = '5' +#最新价大于等于条件价 +defineDict["SECURITY_FTDC_CC_LastPriceGreaterEqualStopPrice"] = '6' +#最新价小于条件价 +defineDict["SECURITY_FTDC_CC_LastPriceLesserThanStopPrice"] = '7' +#最新价小于等于条件价 +defineDict["SECURITY_FTDC_CC_LastPriceLesserEqualStopPrice"] = '8' +#卖一价大于条件价 +defineDict["SECURITY_FTDC_CC_AskPriceGreaterThanStopPrice"] = '9' +#卖一价大于等于条件价 +defineDict["SECURITY_FTDC_CC_AskPriceGreaterEqualStopPrice"] = 'A' +#卖一价小于条件价 +defineDict["SECURITY_FTDC_CC_AskPriceLesserThanStopPrice"] = 'B' +#卖一价小于等于条件价 +defineDict["SECURITY_FTDC_CC_AskPriceLesserEqualStopPrice"] = 'C' +#买一价大于条件价 +defineDict["SECURITY_FTDC_CC_BidPriceGreaterThanStopPrice"] = 'D' +#买一价大于等于条件价 +defineDict["SECURITY_FTDC_CC_BidPriceGreaterEqualStopPrice"] = 'E' +#买一价小于条件价 +defineDict["SECURITY_FTDC_CC_BidPriceLesserThanStopPrice"] = 'F' +#买一价小于等于条件价 +defineDict["SECURITY_FTDC_CC_BidPriceLesserEqualStopPrice"] = 'H' + +typedefDict["TSecurityFtdcContingentConditionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcActionFlagType是一个操作标志类型 +#////////////////////////////////////////////////////////////////////// +#删除 +defineDict["SECURITY_FTDC_AF_Delete"] = '0' +#修改 +defineDict["SECURITY_FTDC_AF_Modify"] = '3' + +typedefDict["TSecurityFtdcActionFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradingRightType是一个交易权限类型 +#////////////////////////////////////////////////////////////////////// +#可以交易 +defineDict["SECURITY_FTDC_TR_Allow"] = '0' +#不能交易 +defineDict["SECURITY_FTDC_TR_Forbidden"] = '2' + +typedefDict["TSecurityFtdcTradingRightType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderSourceType是一个报单来源类型 +#////////////////////////////////////////////////////////////////////// +#来自参与者 +defineDict["SECURITY_FTDC_OSRC_Participant"] = '0' +#来自管理员 +defineDict["SECURITY_FTDC_OSRC_Administrator"] = '1' + +typedefDict["TSecurityFtdcOrderSourceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriceSourceType是一个成交价来源类型 +#////////////////////////////////////////////////////////////////////// +#前成交价 +defineDict["SECURITY_FTDC_PSRC_LastPrice"] = '0' +#买委托价 +defineDict["SECURITY_FTDC_PSRC_Buy"] = '1' +#卖委托价 +defineDict["SECURITY_FTDC_PSRC_Sell"] = '2' + +typedefDict["TSecurityFtdcPriceSourceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderActionRefType是一个报单操作引用类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOrderActionRefType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFrontIDType是一个前置编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcFrontIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSessionIDType是一个会话编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSessionIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstallIDType是一个安装编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcInstallIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSequenceNoType是一个序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSequenceNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRequestIDType是一个请求编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRequestIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombOffsetFlagType是一个组合开平标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCombOffsetFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombHedgeFlagType是一个组合投机套保标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCombHedgeFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSequenceSeriesType是一个序列系列号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSequenceSeriesType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommPhaseNoType是一个通讯时段编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCommPhaseNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserEventTypeType是一个用户事件类型类型 +#////////////////////////////////////////////////////////////////////// +#登录 +defineDict["SECURITY_FTDC_UET_Login"] = '1' +#登出 +defineDict["SECURITY_FTDC_UET_Logout"] = '2' +#交易成功 +defineDict["SECURITY_FTDC_UET_Trading"] = '3' +#交易失败 +defineDict["SECURITY_FTDC_UET_TradingError"] = '4' +#修改密码 +defineDict["SECURITY_FTDC_UET_UpdatePassword"] = '5' +#客户端认证 +defineDict["SECURITY_FTDC_UET_Authenticate"] = '6' +#其他 +defineDict["SECURITY_FTDC_UET_Other"] = '9' + +typedefDict["TSecurityFtdcUserEventTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserEventInfoType是一个用户事件信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcUserEventInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOTPTypeType是一个动态令牌类型类型 +#////////////////////////////////////////////////////////////////////// +#无动态令牌 +defineDict["SECURITY_FTDC_OTP_NONE"] = '0' +#时间令牌 +defineDict["SECURITY_FTDC_OTP_TOTP"] = '1' + +typedefDict["TSecurityFtdcOTPTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSourceType是一个成交来源类型 +#////////////////////////////////////////////////////////////////////// +#来自交易所普通回报 +defineDict["SECURITY_FTDC_TSRC_NORMAL"] = '0' +#来自查询 +defineDict["SECURITY_FTDC_TSRC_QUERY"] = '1' + +typedefDict["TSecurityFtdcTradeSourceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBranchIDType是一个营业部编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockPriceType是一个证券交易价格类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcStockPriceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRightModelIDType是一个股票权限模版代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRightModelIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSerialNumberType是一个序列号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSerialNumberType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentRangeType是一个股票权限分类类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["SECURITY_FTDC_INR_All"] = '1' +#产品 +defineDict["SECURITY_FTDC_INR_Product"] = '2' +#股票权限模版 +defineDict["SECURITY_FTDC_INR_Model"] = '3' +#股票 +defineDict["SECURITY_FTDC_INR_Stock"] = '4' +#市场 +defineDict["SECURITY_FTDC_INR_Market"] = '5' + +typedefDict["TSecurityFtdcInstrumentRangeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBusinessUnitType是一个业务单元类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBusinessUnitType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOTPVendorsIDType是一个动态令牌提供商类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOTPVendorsIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLastDriftType是一个上次OTP漂移值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcLastDriftType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLastSuccessType是一个上次OTP成功值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcLastSuccessType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAuthKeyType是一个令牌密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcAuthKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserSessionHashType是一个用户会话Hash值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcUserSessionHashType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockTradeTypeType是一个证券交易类型类型 +#////////////////////////////////////////////////////////////////////// +#可交易证券 +defineDict["SECURITY_FTDC_STT_Stock"] = '0' +#买入网络密码服务 +defineDict["SECURITY_FTDC_STT_BuyNetService"] = '1' +#回购注销 +defineDict["SECURITY_FTDC_STT_CancelRepurchase"] = '2' +#指定撤销 +defineDict["SECURITY_FTDC_STT_CancelRegister"] = '3' +#指定登记 +defineDict["SECURITY_FTDC_STT_Register"] = '4' +#买入发行申购 +defineDict["SECURITY_FTDC_STT_PurchaseIssue"] = '5' +#卖出配股 +defineDict["SECURITY_FTDC_STT_Allotment"] = '6' +#卖出要约收购 +defineDict["SECURITY_FTDC_STT_SellTender"] = '7' +#买入要约收购 +defineDict["SECURITY_FTDC_STT_BuyTender"] = '8' +#网上投票 +defineDict["SECURITY_FTDC_STT_NetVote"] = '9' +#卖出可转债回售 +defineDict["SECURITY_FTDC_STT_SellConvertibleBonds"] = 'a' +#权证行权代码 +defineDict["SECURITY_FTDC_STT_OptionExecute"] = 'b' +#开放式基金申购 +defineDict["SECURITY_FTDC_STT_PurchaseOF"] = 'c' +#开放式基金赎回 +defineDict["SECURITY_FTDC_STT_RedeemOF"] = 'd' +#开放式基金认购 +defineDict["SECURITY_FTDC_STT_SubscribeOF"] = 'e' +#开放式基金转托管转出 +defineDict["SECURITY_FTDC_STT_OFCustodianTranfer"] = 'f' +#开放式基金分红设置 +defineDict["SECURITY_FTDC_STT_OFDividendConfig"] = 'g' +#开放式基金转成其他基金 +defineDict["SECURITY_FTDC_STT_OFTransfer"] = 'h' +#债券入库 +defineDict["SECURITY_FTDC_STT_BondsIn"] = 'i' +#债券出库 +defineDict["SECURITY_FTDC_STT_BondsOut"] = 'j' +#EFT申购 +defineDict["SECURITY_FTDC_STT_PurchaseETF"] = 'k' +#EFT赎回 +defineDict["SECURITY_FTDC_STT_RedeemETF"] = 'l' +#可转债回售登记 +defineDict["SECURITY_FTDC_STT_ConvertibleRegister"] = 'm' + +typedefDict["TSecurityFtdcStockTradeTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHandleTradingAccountAlgoIDType是一个资金处理算法编号类型 +#////////////////////////////////////////////////////////////////////// +#基本 +defineDict["SECURITY_FTDC_HTAA_Base"] = '1' + +typedefDict["TSecurityFtdcHandleTradingAccountAlgoIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockWthType是一个股票使用流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcStockWthType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockSeqType是一个股票使用流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcStockSeqType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWTFSType是一个委托方式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcWTFSType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWTLBType是一个委托类别类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcWTLBType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWTRQType是一个委托日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcWTRQType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcINTEGERType是一个一般整型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcINTEGERType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcINT3Type是一个三位数整型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcINT3Type"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcINT6Type是一个六位数整型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcINT6Type"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcINT12Type是一个十二位数整型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcINT12Type"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR1Type是一个一字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR1Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR2Type是一个二字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR2Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR3Type是一个三字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR3Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR4Type是一个四字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR4Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR5Type是一个五字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR5Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR6Type是一个六字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR6Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR8Type是一个八字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR8Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR10Type是一个十字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR10Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR11Type是一个十一字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR11Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR12Type是一个十二字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR12Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR13Type是一个十三字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR13Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR14Type是一个十四字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR14Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR16Type是一个十六字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR16Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR19Type是一个十九字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR19Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR20Type是一个二十字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR20Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR21Type是一个二十一字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR21Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR23Type是一个二十三字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR23Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR30Type是一个三十字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR30Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR32Type是一个三十二字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR32Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR50Type是一个五十字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR50Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR64Type是一个六十四字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR64Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCHAR65Type是一个六十五字节CHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCHAR65Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR4Type是一个四字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR4Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR6Type是一个六字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR6Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR8Type是一个八字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR8Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR10Type是一个十字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR10Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR12Type是一个十二字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR12Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR16Type是一个十六字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR16Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR20Type是一个二十字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR20Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR30Type是一个三十字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR30Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR50Type是一个五十字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR50Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR60Type是一个六十字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR60Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR65Type是一个六十五字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR65Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR80Type是一个八十字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR80Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR84Type是一个八十四字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR84Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR255Type是一个二五五字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR255Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVCHAR1024Type是一个一零二四字节VCHAR类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcVCHAR1024Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL8P3Type是一个八点三实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL8P3Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL9P3Type是一个九点三实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL9P3Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL9P6Type是一个九点六实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL9P6Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL10P4Type是一个十点四实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL10P4Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL16P2Type是一个十六点二实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL16P2Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL16P8Type是一个十六点八实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL16P8Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcREAL22P2Type是一个二十二点二实型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcREAL22P2Type"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommandNoType是一个DB命令序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCommandNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommandTypeType是一个DB命令类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCommandTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementGroupIDType是一个结算组代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSettlementGroupIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFieldNameType是一个字段名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcFieldNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFieldContentType是一个字段内容类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcFieldContentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankIDType是一个银行代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBankIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankNameType是一个银行名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBankNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankBrchIDType是一个银行分中心代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBankBrchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLiberSerialType是一个Liber系统流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcLiberSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRoleIDType是一个角色编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRoleIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRoleNameType是一个角色名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcRoleNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDescriptionType是一个描述类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcDescriptionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionIDType是一个功能代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcFunctionIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBillNoType是一个票据号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBillNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundIOTypeType是一个出入金类型类型 +#////////////////////////////////////////////////////////////////////// +#出入金 +defineDict["SECURITY_FTDC_FIOT_FundIO"] = '1' +#银期转帐 +defineDict["SECURITY_FTDC_FIOT_Transfer"] = '2' + +typedefDict["TSecurityFtdcFundIOTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundTypeType是一个资金类型类型 +#////////////////////////////////////////////////////////////////////// +#银行存款 +defineDict["SECURITY_FTDC_FT_Deposite"] = '1' +#分项资金 +defineDict["SECURITY_FTDC_FT_ItemFund"] = '2' +#公司调整 +defineDict["SECURITY_FTDC_FT_Company"] = '3' + +typedefDict["TSecurityFtdcFundTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundDirectionType是一个出入金方向类型 +#////////////////////////////////////////////////////////////////////// +#入金 +defineDict["SECURITY_FTDC_FD_In"] = '1' +#出金 +defineDict["SECURITY_FTDC_FD_Out"] = '2' + +typedefDict["TSecurityFtdcFundDirectionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankFlagType是一个银行统一标识类型类型 +#////////////////////////////////////////////////////////////////////// +#工商银行 +defineDict["SECURITY_FTDC_BF_ICBC"] = '1' +#农业银行 +defineDict["SECURITY_FTDC_BF_ABC"] = '2' +#中国银行 +defineDict["SECURITY_FTDC_BF_BC"] = '3' +#建设银行 +defineDict["SECURITY_FTDC_BF_CBC"] = '4' +#交通银行 +defineDict["SECURITY_FTDC_BF_BOC"] = '5' +#其他银行 +defineDict["SECURITY_FTDC_BF_Other"] = 'Z' + +typedefDict["TSecurityFtdcBankFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperationMemoType是一个操作摘要类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOperationMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundStatusType是一个资金状态类型 +#////////////////////////////////////////////////////////////////////// +#已录入 +defineDict["SECURITY_FTDC_FS_Record"] = '1' +#已复核 +defineDict["SECURITY_FTDC_FS_Check"] = '2' +#已冲销 +defineDict["SECURITY_FTDC_FS_Charge"] = '3' + +typedefDict["TSecurityFtdcFundStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundProjectIDType是一个资金项目编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcFundProjectIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperatorIDType是一个操作员代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOperatorIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCounterIDType是一个计数器代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCounterIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionNameType是一个功能名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcFunctionNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeCodeType是一个交易代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTradeCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerBranchIDType是一个经纪公司分支机构代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBrokerBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeDateType是一个交易日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTradeDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeTimeType是一个交易时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTradeTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankSerialType是一个银行流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBankSerialType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSerialType是一个流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLastFragmentType是一个最后分片标志类型 +#////////////////////////////////////////////////////////////////////// +#是最后分片 +defineDict["SECURITY_FTDC_LF_Yes"] = '0' +#不是最后分片 +defineDict["SECURITY_FTDC_LF_No"] = '1' + +typedefDict["TSecurityFtdcLastFragmentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIndividualNameType是一个个人姓名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcIndividualNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCustTypeType是一个客户类型类型 +#////////////////////////////////////////////////////////////////////// +#自然人 +defineDict["SECURITY_FTDC_CUSTT_Person"] = '0' +#机构户 +defineDict["SECURITY_FTDC_CUSTT_Institution"] = '1' + +typedefDict["TSecurityFtdcCustTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccountType是一个银行账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBankAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcYesNoIndicatorType是一个是或否标识类型 +#////////////////////////////////////////////////////////////////////// +#是 +defineDict["SECURITY_FTDC_YNI_Yes"] = '0' +#否 +defineDict["SECURITY_FTDC_YNI_No"] = '1' + +typedefDict["TSecurityFtdcYesNoIndicatorType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeAmountType是一个交易金额(元)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTradeAmountType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCustFeeType是一个应收客户费用(元)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcCustFeeType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerFeeType是一个应收经纪公司费用(元)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBrokerFeeType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFeePayFlagType是一个费用支付标志类型 +#////////////////////////////////////////////////////////////////////// +#由受益方支付费用 +defineDict["SECURITY_FTDC_FPF_BEN"] = '0' +#由发送方支付费用 +defineDict["SECURITY_FTDC_FPF_OUR"] = '1' +#由发送方支付发起的费用,受益方支付接受的费用 +defineDict["SECURITY_FTDC_FPF_SHA"] = '2' + +typedefDict["TSecurityFtdcFeePayFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAddInfoType是一个附加信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcAddInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDigestType是一个摘要类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcDigestType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccTypeType是一个银行帐号类型类型 +#////////////////////////////////////////////////////////////////////// +#银行存折 +defineDict["SECURITY_FTDC_BAT_BankBook"] = '1' +#储蓄卡 +defineDict["SECURITY_FTDC_BAT_SavingCard"] = '2' +#信用卡 +defineDict["SECURITY_FTDC_BAT_CreditCard"] = '3' + +typedefDict["TSecurityFtdcBankAccTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDeviceIDType是一个渠道标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcDeviceIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPwdFlagType是一个密码核对标志类型 +#////////////////////////////////////////////////////////////////////// +#不核对 +defineDict["SECURITY_FTDC_BPWDF_NoCheck"] = '0' +#明文核对 +defineDict["SECURITY_FTDC_BPWDF_BlankCheck"] = '1' +#密文核对 +defineDict["SECURITY_FTDC_BPWDF_EncryptCheck"] = '2' + +typedefDict["TSecurityFtdcPwdFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankCodingForBrokerType是一个银行对经纪公司的编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcBankCodingForBrokerType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperNoType是一个交易柜员类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOperNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTIDType是一个交易ID类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTransferStatusType是一个转账交易状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["SECURITY_FTDC_TRFS_Normal"] = '0' +#被冲正 +defineDict["SECURITY_FTDC_TRFS_Repealed"] = '1' + +typedefDict["TSecurityFtdcTransferStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPlateSerialType是一个平台流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcPlateSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAvailabilityFlagType是一个有效标志类型 +#////////////////////////////////////////////////////////////////////// +#未确认 +defineDict["SECURITY_FTDC_AVAF_Invalid"] = '0' +#有效 +defineDict["SECURITY_FTDC_AVAF_Valid"] = '1' +#冲正 +defineDict["SECURITY_FTDC_AVAF_Repeal"] = '2' + +typedefDict["TSecurityFtdcAvailabilityFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperatorCodeType是一个操作员类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcOperatorCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRepayStockAlgoType是一个买券还券算法类型 +#////////////////////////////////////////////////////////////////////// +#默认算法 +defineDict["SECURITY_FTDC_RSA_Original"] = '0' +#按还券比例计算 +defineDict["SECURITY_FTDC_RSA_Ratio"] = '1' +#Min[1,2] +defineDict["SECURITY_FTDC_RSA_Min"] = '2' + +typedefDict["TSecurityFtdcRepayStockAlgoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSpanType是一个交易时间段类型类型 +#////////////////////////////////////////////////////////////////////// +#普通业务 +defineDict["SECURITY_FTDC_TS_Common"] = '1' +#个股期权 +defineDict["SECURITY_FTDC_TS_Options"] = '2' + +typedefDict["TSecurityFtdcTradeSpanType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettleSystemTypeType是一个所属结算系统类型类型 +#////////////////////////////////////////////////////////////////////// +#顶点系统 +defineDict["SECURITY_FTDC_SST_Aboss"] = '1' +#恒生系统 +defineDict["SECURITY_FTDC_SST_HS"] = '2' + +typedefDict["TSecurityFtdcSettleSystemTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLogLevelType是一个日志级别类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcLogLevelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProcessNameType是一个存储过程名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcProcessNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTemplateIDType是一个模板代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTemplateIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeIndexType是一个成交序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TSecurityFtdcTradeIndexType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSplitMergeStatusType是一个基金当天拆分合并状态类型 +#////////////////////////////////////////////////////////////////////// +#表示允许拆分和合并 +defineDict["SECURITY_FTDC_SMS_Allow"] = '0' +#允许拆分、不允许合并 +defineDict["SECURITY_FTDC_SMS_OnlySplit"] = '1' +#不允许拆分、允许合并 +defineDict["SECURITY_FTDC_SMS_OnlyMerge"] = '2' +#不允许拆分和合并 +defineDict["SECURITY_FTDC_SMS_Forbidden"] = '3' + +typedefDict["TSecurityFtdcSplitMergeStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundInterTransferTypeType是一个资金内转类型类型 +#////////////////////////////////////////////////////////////////////// +#转入 +defineDict["SECURITY_FTDC_FITT_TransferIn"] = '0' +#转出 +defineDict["SECURITY_FTDC_FITT_TransferOut"] = '1' + +typedefDict["TSecurityFtdcFundInterTransferTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentTypeType是一个合约类型类型 +#////////////////////////////////////////////////////////////////////// +#普通 +defineDict["SECURITY_FTDC_IT_Normal"] = '0' +#看涨期权 +defineDict["SECURITY_FTDC_IT_CallOptions"] = '1' +#看跌期权 +defineDict["SECURITY_FTDC_IT_PutOptions"] = '2' + +typedefDict["TSecurityFtdcInstrumentTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorLevelType是一个投资者期权交易等级类型 +#////////////////////////////////////////////////////////////////////// +#一级 +defineDict["SECURITY_FTDC_IL_Level_1"] = '0' +#二级 +defineDict["SECURITY_FTDC_IL_Level_2"] = '1' +#三级 +defineDict["SECURITY_FTDC_IL_Level_3"] = '2' + +typedefDict["TSecurityFtdcInvestorLevelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCloseDirectionType是一个平仓方向类型 +#////////////////////////////////////////////////////////////////////// +#买平仓 +defineDict["SECURITY_FTDC_CD_CloseBuy"] = '!' +#卖平仓 +defineDict["SECURITY_FTDC_CD_CloseSell"] = '@' +#备兑平仓 +defineDict["SECURITY_FTDC_CD_CloseCover"] = '#' + +typedefDict["TSecurityFtdcCloseDirectionType"] = "string" + diff --git a/vn.lts/pyscript/lts_md_define.cpp b/vn.lts/pyscript/lts_md_define.cpp new file mode 100644 index 00000000..341b30f1 --- /dev/null +++ b/vn.lts/pyscript/lts_md_define.cpp @@ -0,0 +1,9 @@ +#define ONFRONTCONNECTED 1 +#define ONFRONTDISCONNECTED 2 +#define ONHEARTBEATWARNING 3 +#define ONRSPERROR 4 +#define ONRSPUSERLOGIN 5 +#define ONRSPUSERLOGOUT 6 +#define ONRSPSUBMARKETDATA 7 +#define ONRSPUNSUBMARKETDATA 8 +#define ONRTNDEPTHMARKETDATA 9 diff --git a/vn.lts/pyscript/lts_md_function.cpp b/vn.lts/pyscript/lts_md_function.cpp new file mode 100644 index 00000000..69702d20 --- /dev/null +++ b/vn.lts/pyscript/lts_md_function.cpp @@ -0,0 +1,29 @@ +ReqUserLogin +{ + CSecurityFtdcReqUserLoginField myreq = CSecurityFtdcReqUserLoginField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "MacAddress", myreq.MacAddress); + 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); + int i = this->api->ReqUserLogin(&myreq, nRequestID); + return i; +}; + +ReqUserLogout +{ + 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; +}; + diff --git a/vn.lts/pyscript/lts_md_process.cpp b/vn.lts/pyscript/lts_md_process.cpp new file mode 100644 index 00000000..659940a1 --- /dev/null +++ b/vn.lts/pyscript/lts_md_process.cpp @@ -0,0 +1,143 @@ +void MdApi::processFrontConnected(Task task) +{ + this->onFrontConnected(); +}; + +void MdApi::processFrontDisconnected(Task task) +{ + this->onFrontDisconnected(task.task_id); +}; + +void MdApi::processHeartBeatWarning(Task task) +{ + this->onHeartBeatWarning(task.task_id); +}; + +void MdApi::processRspError(Task task) +{ + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspError(error, task.task_id, task.task_last); +}; + +void MdApi::processRspUserLogin(Task task) +{ + CSecurityFtdcRspUserLoginField task_data = any_cast(task.task_data); + dict data; + data["MaxOrderRef"] = task_data.MaxOrderRef; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["SessionID"] = task_data.SessionID; + data["SystemName"] = task_data.SystemName; + data["FrontID"] = task_data.FrontID; + data["BrokerID"] = task_data.BrokerID; + data["LoginTime"] = task_data.LoginTime; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogin(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspUserLogout(Task task) +{ + CSecurityFtdcUserLogoutField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogout(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspSubMarketData(Task task) +{ + CSecurityFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspSubMarketData(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspUnSubMarketData(Task task) +{ + CSecurityFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUnSubMarketData(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRtnDepthMarketData(Task task) +{ + CSecurityFtdcDepthMarketDataField task_data = any_cast(task.task_data); + dict data; + data["HighestPrice"] = task_data.HighestPrice; + data["BidPrice5"] = task_data.BidPrice5; + data["BidPrice4"] = task_data.BidPrice4; + data["BidPrice1"] = task_data.BidPrice1; + data["BidPrice3"] = task_data.BidPrice3; + data["BidPrice2"] = task_data.BidPrice2; + data["LowerLimitPrice"] = task_data.LowerLimitPrice; + data["OpenPrice"] = task_data.OpenPrice; + data["AskPrice5"] = task_data.AskPrice5; + data["AskPrice4"] = task_data.AskPrice4; + data["AskPrice3"] = task_data.AskPrice3; + data["PreClosePrice"] = task_data.PreClosePrice; + data["AskPrice1"] = task_data.AskPrice1; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["AskVolume1"] = task_data.AskVolume1; + data["UpdateTime"] = task_data.UpdateTime; + data["UpdateMillisec"] = task_data.UpdateMillisec; + data["AveragePrice"] = task_data.AveragePrice; + data["BidVolume5"] = task_data.BidVolume5; + data["BidVolume4"] = task_data.BidVolume4; + data["BidVolume3"] = task_data.BidVolume3; + data["BidVolume2"] = task_data.BidVolume2; + data["PreOpenInterest"] = task_data.PreOpenInterest; + data["AskPrice2"] = task_data.AskPrice2; + data["Volume"] = task_data.Volume; + data["AskVolume3"] = task_data.AskVolume3; + data["AskVolume2"] = task_data.AskVolume2; + data["AskVolume5"] = task_data.AskVolume5; + data["AskVolume4"] = task_data.AskVolume4; + data["UpperLimitPrice"] = task_data.UpperLimitPrice; + data["BidVolume1"] = task_data.BidVolume1; + data["InstrumentID"] = task_data.InstrumentID; + data["ClosePrice"] = task_data.ClosePrice; + data["ExchangeID"] = task_data.ExchangeID; + data["TradingDay"] = task_data.TradingDay; + data["PreDelta"] = task_data.PreDelta; + data["OpenInterest"] = task_data.OpenInterest; + data["CurrDelta"] = task_data.CurrDelta; + data["Turnover"] = task_data.Turnover; + data["LastPrice"] = task_data.LastPrice; + data["SettlementPrice"] = task_data.SettlementPrice; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["LowestPrice"] = task_data.LowestPrice; + data["ActionDay"] = task_data.ActionDay; + + this->onRtnDepthMarketData(data); +}; + diff --git a/vn.lts/pyscript/lts_md_switch.cpp b/vn.lts/pyscript/lts_md_switch.cpp new file mode 100644 index 00000000..a062b195 --- /dev/null +++ b/vn.lts/pyscript/lts_md_switch.cpp @@ -0,0 +1,54 @@ +case ONFRONTCONNECTED: +{ + this->processFrontConnected(task); + break; +} + +case ONFRONTDISCONNECTED: +{ + this->processFrontDisconnected(task); + break; +} + +case ONHEARTBEATWARNING: +{ + this->processHeartBeatWarning(task); + break; +} + +case ONRSPERROR: +{ + this->processRspError(task); + break; +} + +case ONRSPUSERLOGIN: +{ + this->processRspUserLogin(task); + break; +} + +case ONRSPUSERLOGOUT: +{ + this->processRspUserLogout(task); + break; +} + +case ONRSPSUBMARKETDATA: +{ + this->processRspSubMarketData(task); + break; +} + +case ONRSPUNSUBMARKETDATA: +{ + this->processRspUnSubMarketData(task); + break; +} + +case ONRTNDEPTHMARKETDATA: +{ + this->processRtnDepthMarketData(task); + break; +} + diff --git a/vn.lts/pyscript/lts_md_task.cpp b/vn.lts/pyscript/lts_md_task.cpp new file mode 100644 index 00000000..8a07ce36 --- /dev/null +++ b/vn.lts/pyscript/lts_md_task.cpp @@ -0,0 +1,130 @@ +void MdApi::OnFrontConnected() +{ + Task task = Task(); + task.task_name = ONFRONTCONNECTED; + this->task_queue.push(task); +}; + +void MdApi::OnFrontDisconnected(int nReason) +{ + Task task = Task(); + task.task_name = ONFRONTDISCONNECTED; + task.task_id = nReason; + this->task_queue.push(task); +}; + +void MdApi::OnHeartBeatWarning(int nTimeLapse) +{ + Task task = Task(); + task.task_name = ONHEARTBEATWARNING; + task.task_id = nTimeLapse; + this->task_queue.push(task); +}; + +void MdApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPERROR; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGIN; + task.task_data = *pRspUserLogin; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGOUT; + task.task_data = *pUserLogout; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPSUBMARKETDATA; + task.task_data = *pSpecificInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspUnSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUNSUBMARKETDATA; + task.task_data = *pSpecificInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData) +{ + Task task = Task(); + task.task_name = ONRTNDEPTHMARKETDATA; + task.task_data = *pDepthMarketData; + this->task_queue.push(task); +}; + diff --git a/vn.lts/pyscript/lts_struct.py b/vn.lts/pyscript/lts_struct.py new file mode 100644 index 00000000..1e4c0874 --- /dev/null +++ b/vn.lts/pyscript/lts_struct.py @@ -0,0 +1,2316 @@ +# encoding: UTF-8 + +structDict = {} + +#////////////////////////////////////////////////////////////////////// +#@company shanghai liber information Technology Co.,Ltd +#@file SecurityFtdcUserApiStruct.h +#@brief 定义业务数据结构 +#////////////////////////////////////////////////////////////////////// + + + + + + + + + + +#响应信息 +CSecurityFtdcRspInfoField = {} +#错误代码 +CSecurityFtdcRspInfoField["ErrorID"] = "int" +#错误信息 +CSecurityFtdcRspInfoField["ErrorMsg"] = "string" +structDict['CSecurityFtdcRspInfoField'] = CSecurityFtdcRspInfoField + + +#交易所 +CSecurityFtdcExchangeField = {} +#交易所代码 +CSecurityFtdcExchangeField["ExchangeID"] = "string" +#交易所名称 +CSecurityFtdcExchangeField["ExchangeName"] = "string" +#交易所属性 +CSecurityFtdcExchangeField["ExchangeProperty"] = "string" +structDict['CSecurityFtdcExchangeField'] = CSecurityFtdcExchangeField + + +#产品 +CSecurityFtdcProductField = {} +#产品代码 +CSecurityFtdcProductField["ProductID"] = "string" +#产品名称 +CSecurityFtdcProductField["ProductName"] = "string" +#交易所代码 +CSecurityFtdcProductField["ExchangeID"] = "string" +#产品类型 +CSecurityFtdcProductField["ProductClass"] = "string" +#合约数量乘数 +CSecurityFtdcProductField["VolumeMultiple"] = "int" +#最小变动价位 +CSecurityFtdcProductField["PriceTick"] = "float" +#市价单最大下单量 +CSecurityFtdcProductField["MaxMarketOrderVolume"] = "int" +#市价单最小下单量 +CSecurityFtdcProductField["MinMarketOrderVolume"] = "int" +#限价单最大下单量 +CSecurityFtdcProductField["MaxLimitOrderVolume"] = "int" +#限价单最小下单量 +CSecurityFtdcProductField["MinLimitOrderVolume"] = "int" +#持仓类型 +CSecurityFtdcProductField["PositionType"] = "string" +#持仓日期类型 +CSecurityFtdcProductField["PositionDateType"] = "string" +#ETF最小交易单位 +CSecurityFtdcProductField["EFTMinTradeVolume"] = "int" +structDict['CSecurityFtdcProductField'] = CSecurityFtdcProductField + + +#合约 +CSecurityFtdcInstrumentField = {} +#合约代码 +CSecurityFtdcInstrumentField["InstrumentID"] = "string" +#交易所代码 +CSecurityFtdcInstrumentField["ExchangeID"] = "string" +#合约名称 +CSecurityFtdcInstrumentField["InstrumentName"] = "string" +#合约在交易所的代码 +CSecurityFtdcInstrumentField["ExchangeInstID"] = "string" +#产品代码 +CSecurityFtdcInstrumentField["ProductID"] = "string" +#产品类型 +CSecurityFtdcInstrumentField["ProductClass"] = "string" +#交割年份 +CSecurityFtdcInstrumentField["DeliveryYear"] = "int" +#交割月 +CSecurityFtdcInstrumentField["DeliveryMonth"] = "int" +#市价单最大下单量 +CSecurityFtdcInstrumentField["MaxMarketOrderVolume"] = "int" +#市价单最小下单量 +CSecurityFtdcInstrumentField["MinMarketOrderVolume"] = "int" +#限价单最大下单量 +CSecurityFtdcInstrumentField["MaxLimitOrderVolume"] = "int" +#限价单最小下单量 +CSecurityFtdcInstrumentField["MinLimitOrderVolume"] = "int" +#合约数量乘数 +CSecurityFtdcInstrumentField["VolumeMultiple"] = "int" +#最小变动价位 +CSecurityFtdcInstrumentField["PriceTick"] = "float" +#创建日 +CSecurityFtdcInstrumentField["CreateDate"] = "string" +#上市日 +CSecurityFtdcInstrumentField["OpenDate"] = "string" +#到期日 +CSecurityFtdcInstrumentField["ExpireDate"] = "string" +#开始交割日 +CSecurityFtdcInstrumentField["StartDelivDate"] = "string" +#结束交割日 +CSecurityFtdcInstrumentField["EndDelivDate"] = "string" +#合约生命周期状态 +CSecurityFtdcInstrumentField["InstLifePhase"] = "string" +#当前是否交易 +CSecurityFtdcInstrumentField["IsTrading"] = "int" +#持仓类型 +CSecurityFtdcInstrumentField["PositionType"] = "string" +#报单能否撤单 +CSecurityFtdcInstrumentField["OrderCanBeWithdraw"] = "int" +#最小买下单单位 +CSecurityFtdcInstrumentField["MinBuyVolume"] = "int" +#最小卖下单单位 +CSecurityFtdcInstrumentField["MinSellVolume"] = "int" +#股票权限模版代码 +CSecurityFtdcInstrumentField["RightModelID"] = "string" +#持仓交易类型 +CSecurityFtdcInstrumentField["PosTradeType"] = "string" +#市场代码 +CSecurityFtdcInstrumentField["MarketID"] = "string" +#期权执行价格 +CSecurityFtdcInstrumentField["ExecPrice"] = "float" +#期权单手保证金 +CSecurityFtdcInstrumentField["UnitMargin"] = "float" +#合约类型 +CSecurityFtdcInstrumentField["InstrumentType"] = "string" +#期权保证金参数1 +CSecurityFtdcInstrumentField["OptionsMarginParam1"] = "float" +#期权保证金参数2 +CSecurityFtdcInstrumentField["OptionsMarginParam2"] = "float" +structDict['CSecurityFtdcInstrumentField'] = CSecurityFtdcInstrumentField + + +#经纪公司 +CSecurityFtdcBrokerField = {} +#经纪公司代码 +CSecurityFtdcBrokerField["BrokerID"] = "string" +#经纪公司简称 +CSecurityFtdcBrokerField["BrokerAbbr"] = "string" +#经纪公司名称 +CSecurityFtdcBrokerField["BrokerName"] = "string" +#是否活跃 +CSecurityFtdcBrokerField["IsActive"] = "int" +structDict['CSecurityFtdcBrokerField'] = CSecurityFtdcBrokerField + + +#会员编码和经纪公司编码对照表 +CSecurityFtdcPartBrokerField = {} +#经纪公司代码 +CSecurityFtdcPartBrokerField["BrokerID"] = "string" +#交易所代码 +CSecurityFtdcPartBrokerField["ExchangeID"] = "string" +#会员代码 +CSecurityFtdcPartBrokerField["ParticipantID"] = "string" +#是否活跃 +CSecurityFtdcPartBrokerField["IsActive"] = "int" +structDict['CSecurityFtdcPartBrokerField'] = CSecurityFtdcPartBrokerField + + +#投资者 +CSecurityFtdcInvestorField = {} +#投资者代码 +CSecurityFtdcInvestorField["InvestorID"] = "string" +#经纪公司代码 +CSecurityFtdcInvestorField["BrokerID"] = "string" +#投资者分组代码 +CSecurityFtdcInvestorField["InvestorGroupID"] = "string" +#投资者名称 +CSecurityFtdcInvestorField["InvestorName"] = "string" +#证件类型 +CSecurityFtdcInvestorField["IdentifiedCardType"] = "string" +#证件号码 +CSecurityFtdcInvestorField["IdentifiedCardNo"] = "string" +#是否活跃 +CSecurityFtdcInvestorField["IsActive"] = "int" +#上海营业部编号 +CSecurityFtdcInvestorField["SHBranchID"] = "string" +#深圳营业部编号 +CSecurityFtdcInvestorField["SZBranchID"] = "string" +#所属结算系统类型 +CSecurityFtdcInvestorField["SettleSystemType"] = "string" +#投资者期权交易等级 +CSecurityFtdcInvestorField["InvestorLevel"] = "string" +structDict['CSecurityFtdcInvestorField'] = CSecurityFtdcInvestorField + + +#交易编码 +CSecurityFtdcTradingCodeField = {} +#投资者代码 +CSecurityFtdcTradingCodeField["InvestorID"] = "string" +#经纪公司代码 +CSecurityFtdcTradingCodeField["BrokerID"] = "string" +#交易所代码 +CSecurityFtdcTradingCodeField["ExchangeID"] = "string" +#客户代码 +CSecurityFtdcTradingCodeField["ClientID"] = "string" +#是否活跃 +CSecurityFtdcTradingCodeField["IsActive"] = "int" +#AccountID +CSecurityFtdcTradingCodeField["AccountID"] = "string" +#交易单元号 +CSecurityFtdcTradingCodeField["PBU"] = "string" +#ClientType +CSecurityFtdcTradingCodeField["ClientType"] = "string" +structDict['CSecurityFtdcTradingCodeField'] = CSecurityFtdcTradingCodeField + + +#管理用户 +CSecurityFtdcSuperUserField = {} +#用户代码 +CSecurityFtdcSuperUserField["UserID"] = "string" +#用户名称 +CSecurityFtdcSuperUserField["UserName"] = "string" +#密码 +CSecurityFtdcSuperUserField["Password"] = "string" +#是否活跃 +CSecurityFtdcSuperUserField["IsActive"] = "int" +structDict['CSecurityFtdcSuperUserField'] = CSecurityFtdcSuperUserField + + +#管理用户功能权限 +CSecurityFtdcSuperUserFunctionField = {} +#用户代码 +CSecurityFtdcSuperUserFunctionField["UserID"] = "string" +#功能代码 +CSecurityFtdcSuperUserFunctionField["FunctionCode"] = "string" +structDict['CSecurityFtdcSuperUserFunctionField'] = CSecurityFtdcSuperUserFunctionField + + +#经纪公司用户 +CSecurityFtdcBrokerUserField = {} +#经纪公司代码 +CSecurityFtdcBrokerUserField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcBrokerUserField["UserID"] = "string" +#用户名称 +CSecurityFtdcBrokerUserField["UserName"] = "string" +#用户类型 +CSecurityFtdcBrokerUserField["UserType"] = "string" +#是否活跃 +CSecurityFtdcBrokerUserField["IsActive"] = "int" +#是否使用令牌 +CSecurityFtdcBrokerUserField["IsUsingOTP"] = "int" +structDict['CSecurityFtdcBrokerUserField'] = CSecurityFtdcBrokerUserField + + +#经纪公司用户功能权限 +CSecurityFtdcBrokerUserFunctionField = {} +#经纪公司代码 +CSecurityFtdcBrokerUserFunctionField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcBrokerUserFunctionField["UserID"] = "string" +#经纪公司功能代码 +CSecurityFtdcBrokerUserFunctionField["BrokerFunctionCode"] = "string" +structDict['CSecurityFtdcBrokerUserFunctionField'] = CSecurityFtdcBrokerUserFunctionField + + +#资金账户 +CSecurityFtdcTradingAccountField = {} +#经纪公司代码 +CSecurityFtdcTradingAccountField["BrokerID"] = "string" +#投资者帐号 +CSecurityFtdcTradingAccountField["AccountID"] = "string" +#上次质押金额 +CSecurityFtdcTradingAccountField["PreMortgage"] = "float" +#上次信用额度 +CSecurityFtdcTradingAccountField["PreCredit"] = "float" +#上次存款额 +CSecurityFtdcTradingAccountField["PreDeposit"] = "float" +#上次结算准备金 +CSecurityFtdcTradingAccountField["PreBalance"] = "float" +#上次占用的保证金 +CSecurityFtdcTradingAccountField["PreMargin"] = "float" +#利息基数 +CSecurityFtdcTradingAccountField["InterestBase"] = "float" +#利息收入 +CSecurityFtdcTradingAccountField["Interest"] = "float" +#入金金额 +CSecurityFtdcTradingAccountField["Deposit"] = "float" +#出金金额 +CSecurityFtdcTradingAccountField["Withdraw"] = "float" +#冻结的保证金 +CSecurityFtdcTradingAccountField["FrozenMargin"] = "float" +#冻结的资金 +CSecurityFtdcTradingAccountField["FrozenCash"] = "float" +#冻结的手续费 +CSecurityFtdcTradingAccountField["FrozenCommission"] = "float" +#当前保证金总额 +CSecurityFtdcTradingAccountField["CurrMargin"] = "float" +#资金差额 +CSecurityFtdcTradingAccountField["CashIn"] = "float" +#手续费 +CSecurityFtdcTradingAccountField["Commission"] = "float" +#结算准备金 +CSecurityFtdcTradingAccountField["Balance"] = "float" +#现金 +CSecurityFtdcTradingAccountField["Available"] = "float" +#可取资金 +CSecurityFtdcTradingAccountField["WithdrawQuota"] = "float" +#基本准备金 +CSecurityFtdcTradingAccountField["Reserve"] = "float" +#交易日 +CSecurityFtdcTradingAccountField["TradingDay"] = "string" +#保证金可用余额 +CSecurityFtdcTradingAccountField["Credit"] = "float" +#质押金额 +CSecurityFtdcTradingAccountField["Mortgage"] = "float" +#交易所保证金 +CSecurityFtdcTradingAccountField["ExchangeMargin"] = "float" +#投资者交割保证金 +CSecurityFtdcTradingAccountField["DeliveryMargin"] = "float" +#交易所交割保证金 +CSecurityFtdcTradingAccountField["ExchangeDeliveryMargin"] = "float" +#冻结的过户费 +CSecurityFtdcTradingAccountField["FrozenTransferFee"] = "float" +#冻结的印花税 +CSecurityFtdcTradingAccountField["FrozenStampTax"] = "float" +#过户费 +CSecurityFtdcTradingAccountField["TransferFee"] = "float" +#印花税 +CSecurityFtdcTradingAccountField["StampTax"] = "float" +#折算金额 +CSecurityFtdcTradingAccountField["ConversionAmount"] = "float" +#授信额度 +CSecurityFtdcTradingAccountField["CreditAmount"] = "float" +#证券总价值 +CSecurityFtdcTradingAccountField["StockValue"] = "float" +#国债回购占用资金 +CSecurityFtdcTradingAccountField["BondRepurchaseAmount"] = "float" +#国债逆回购占用资金 +CSecurityFtdcTradingAccountField["ReverseRepurchaseAmount"] = "float" +#币种 +CSecurityFtdcTradingAccountField["CurrencyCode"] = "string" +#账户类型 +CSecurityFtdcTradingAccountField["AccountType"] = "string" +#融资买入金额 +CSecurityFtdcTradingAccountField["MarginTradeAmount"] = "float" +#融券卖出金额 +CSecurityFtdcTradingAccountField["ShortSellAmount"] = "float" +#融资持仓盈亏 +CSecurityFtdcTradingAccountField["MarginTradeProfit"] = "float" +#融券持仓盈亏 +CSecurityFtdcTradingAccountField["ShortSellProfit"] = "float" +#融券总市值 +CSecurityFtdcTradingAccountField["SSStockValue"] = "float" +#维持担保比例 +CSecurityFtdcTradingAccountField["CreditRatio"] = "float" +#行权冻结资金 +CSecurityFtdcTradingAccountField["FrozenExecCash"] = "float" +structDict['CSecurityFtdcTradingAccountField'] = CSecurityFtdcTradingAccountField + + +#禁止登录用户 +CSecurityFtdcLoginForbiddenUserField = {} +#经纪公司代码 +CSecurityFtdcLoginForbiddenUserField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcLoginForbiddenUserField["UserID"] = "string" +structDict['CSecurityFtdcLoginForbiddenUserField'] = CSecurityFtdcLoginForbiddenUserField + + +#深度行情 +CSecurityFtdcDepthMarketDataField = {} +#交易日 +CSecurityFtdcDepthMarketDataField["TradingDay"] = "string" +#合约代码 +CSecurityFtdcDepthMarketDataField["InstrumentID"] = "string" +#交易所代码 +CSecurityFtdcDepthMarketDataField["ExchangeID"] = "string" +#合约在交易所的代码 +CSecurityFtdcDepthMarketDataField["ExchangeInstID"] = "string" +#最新价 +CSecurityFtdcDepthMarketDataField["LastPrice"] = "float" +#上次结算价 +CSecurityFtdcDepthMarketDataField["PreSettlementPrice"] = "float" +#昨收盘 +CSecurityFtdcDepthMarketDataField["PreClosePrice"] = "float" +#昨持仓量 +CSecurityFtdcDepthMarketDataField["PreOpenInterest"] = "float" +#今开盘 +CSecurityFtdcDepthMarketDataField["OpenPrice"] = "float" +#最高价 +CSecurityFtdcDepthMarketDataField["HighestPrice"] = "float" +#最低价 +CSecurityFtdcDepthMarketDataField["LowestPrice"] = "float" +#数量 +CSecurityFtdcDepthMarketDataField["Volume"] = "int" +#成交金额 +CSecurityFtdcDepthMarketDataField["Turnover"] = "float" +#持仓量 +CSecurityFtdcDepthMarketDataField["OpenInterest"] = "float" +#今收盘 +CSecurityFtdcDepthMarketDataField["ClosePrice"] = "float" +#本次结算价 +CSecurityFtdcDepthMarketDataField["SettlementPrice"] = "float" +#涨停板价 +CSecurityFtdcDepthMarketDataField["UpperLimitPrice"] = "float" +#跌停板价 +CSecurityFtdcDepthMarketDataField["LowerLimitPrice"] = "float" +#昨虚实度 +CSecurityFtdcDepthMarketDataField["PreDelta"] = "float" +#今虚实度 +CSecurityFtdcDepthMarketDataField["CurrDelta"] = "float" +#最后修改时间 +CSecurityFtdcDepthMarketDataField["UpdateTime"] = "string" +#最后修改毫秒 +CSecurityFtdcDepthMarketDataField["UpdateMillisec"] = "int" +#申买价一 +CSecurityFtdcDepthMarketDataField["BidPrice1"] = "float" +#申买量一 +CSecurityFtdcDepthMarketDataField["BidVolume1"] = "int" +#申卖价一 +CSecurityFtdcDepthMarketDataField["AskPrice1"] = "float" +#申卖量一 +CSecurityFtdcDepthMarketDataField["AskVolume1"] = "int" +#申买价二 +CSecurityFtdcDepthMarketDataField["BidPrice2"] = "float" +#申买量二 +CSecurityFtdcDepthMarketDataField["BidVolume2"] = "int" +#申卖价二 +CSecurityFtdcDepthMarketDataField["AskPrice2"] = "float" +#申卖量二 +CSecurityFtdcDepthMarketDataField["AskVolume2"] = "int" +#申买价三 +CSecurityFtdcDepthMarketDataField["BidPrice3"] = "float" +#申买量三 +CSecurityFtdcDepthMarketDataField["BidVolume3"] = "int" +#申卖价三 +CSecurityFtdcDepthMarketDataField["AskPrice3"] = "float" +#申卖量三 +CSecurityFtdcDepthMarketDataField["AskVolume3"] = "int" +#申买价四 +CSecurityFtdcDepthMarketDataField["BidPrice4"] = "float" +#申买量四 +CSecurityFtdcDepthMarketDataField["BidVolume4"] = "int" +#申卖价四 +CSecurityFtdcDepthMarketDataField["AskPrice4"] = "float" +#申卖量四 +CSecurityFtdcDepthMarketDataField["AskVolume4"] = "int" +#申买价五 +CSecurityFtdcDepthMarketDataField["BidPrice5"] = "float" +#申买量五 +CSecurityFtdcDepthMarketDataField["BidVolume5"] = "int" +#申卖价五 +CSecurityFtdcDepthMarketDataField["AskPrice5"] = "float" +#申卖量五 +CSecurityFtdcDepthMarketDataField["AskVolume5"] = "int" +#当日均价 +CSecurityFtdcDepthMarketDataField["AveragePrice"] = "float" +#业务日期 +CSecurityFtdcDepthMarketDataField["ActionDay"] = "string" +structDict['CSecurityFtdcDepthMarketDataField'] = CSecurityFtdcDepthMarketDataField + + +#投资者合约交易权限 +CSecurityFtdcInstrumentTradingRightField = {} +#合约代码 +CSecurityFtdcInstrumentTradingRightField["InstrumentID"] = "string" +#投资者范围 +CSecurityFtdcInstrumentTradingRightField["InvestorRange"] = "string" +#经纪公司代码 +CSecurityFtdcInstrumentTradingRightField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInstrumentTradingRightField["InvestorID"] = "string" +#买卖 +CSecurityFtdcInstrumentTradingRightField["Direction"] = "string" +#交易权限 +CSecurityFtdcInstrumentTradingRightField["TradingRight"] = "string" +#交易所代码 +CSecurityFtdcInstrumentTradingRightField["ExchangeID"] = "string" +#股票权限分类 +CSecurityFtdcInstrumentTradingRightField["InstrumentRange"] = "string" +structDict['CSecurityFtdcInstrumentTradingRightField'] = CSecurityFtdcInstrumentTradingRightField + + +#投资者持仓明细 +CSecurityFtdcInvestorPositionDetailField = {} +#合约代码 +CSecurityFtdcInvestorPositionDetailField["InstrumentID"] = "string" +#经纪公司代码 +CSecurityFtdcInvestorPositionDetailField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInvestorPositionDetailField["InvestorID"] = "string" +#投机套保标志 +CSecurityFtdcInvestorPositionDetailField["HedgeFlag"] = "string" +#买卖 +CSecurityFtdcInvestorPositionDetailField["Direction"] = "string" +#开仓日期 +CSecurityFtdcInvestorPositionDetailField["OpenDate"] = "string" +#成交编号 +CSecurityFtdcInvestorPositionDetailField["TradeID"] = "string" +#数量 +CSecurityFtdcInvestorPositionDetailField["Volume"] = "int" +#开仓价 +CSecurityFtdcInvestorPositionDetailField["OpenPrice"] = "float" +#交易日 +CSecurityFtdcInvestorPositionDetailField["TradingDay"] = "string" +#成交类型 +CSecurityFtdcInvestorPositionDetailField["TradeType"] = "string" +#交易所代码 +CSecurityFtdcInvestorPositionDetailField["ExchangeID"] = "string" +#投资者保证金 +CSecurityFtdcInvestorPositionDetailField["Margin"] = "float" +#交易所保证金 +CSecurityFtdcInvestorPositionDetailField["ExchMargin"] = "float" +#昨结算价 +CSecurityFtdcInvestorPositionDetailField["LastSettlementPrice"] = "float" +#结算价 +CSecurityFtdcInvestorPositionDetailField["SettlementPrice"] = "float" +#平仓量 +CSecurityFtdcInvestorPositionDetailField["CloseVolume"] = "int" +#平仓金额 +CSecurityFtdcInvestorPositionDetailField["CloseAmount"] = "float" +#过户费 +CSecurityFtdcInvestorPositionDetailField["TransferFee"] = "float" +#印花税 +CSecurityFtdcInvestorPositionDetailField["StampTax"] = "float" +#手续费 +CSecurityFtdcInvestorPositionDetailField["Commission"] = "float" +#AccountID +CSecurityFtdcInvestorPositionDetailField["AccountID"] = "string" +#质押入库数量 +CSecurityFtdcInvestorPositionDetailField["PledgeInPosition"] = "int" +#质押入库冻结数量 +CSecurityFtdcInvestorPositionDetailField["PledgeInFrozenPosition"] = "int" +#正回购使用的标准券数量 +CSecurityFtdcInvestorPositionDetailField["RepurchasePosition"] = "int" +#融资融券金额 +CSecurityFtdcInvestorPositionDetailField["Amount"] = "float" +#标的合约代码 +CSecurityFtdcInvestorPositionDetailField["UnderlyingInstrumentID"] = "string" +structDict['CSecurityFtdcInvestorPositionDetailField'] = CSecurityFtdcInvestorPositionDetailField + + +#债券利息 +CSecurityFtdcBondInterestField = {} +#交易日 +CSecurityFtdcBondInterestField["TradingDay"] = "string" +#交易所代码 +CSecurityFtdcBondInterestField["ExchangeID"] = "string" +#合约代码 +CSecurityFtdcBondInterestField["InstrumentID"] = "string" +#利息 +CSecurityFtdcBondInterestField["Interest"] = "float" +structDict['CSecurityFtdcBondInterestField'] = CSecurityFtdcBondInterestField + + +#市值配售信息 +CSecurityFtdcMarketRationInfoField = {} +#经纪公司代码 +CSecurityFtdcMarketRationInfoField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcMarketRationInfoField["InvestorID"] = "string" +#交易所代码 +CSecurityFtdcMarketRationInfoField["ExchangeID"] = "string" +#可配售手数 +CSecurityFtdcMarketRationInfoField["RationVolume"] = "int" +structDict['CSecurityFtdcMarketRationInfoField'] = CSecurityFtdcMarketRationInfoField + + +#合约手续费率 +CSecurityFtdcInstrumentCommissionRateField = {} +#交易所代码 +CSecurityFtdcInstrumentCommissionRateField["ExchangeID"] = "string" +#合约代码 +CSecurityFtdcInstrumentCommissionRateField["InstrumentID"] = "string" +#投资者范围 +CSecurityFtdcInstrumentCommissionRateField["InvestorRange"] = "string" +#经纪公司代码 +CSecurityFtdcInstrumentCommissionRateField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInstrumentCommissionRateField["InvestorID"] = "string" +#买卖方向 +CSecurityFtdcInstrumentCommissionRateField["Direction"] = "string" +#印花税率 +CSecurityFtdcInstrumentCommissionRateField["StampTaxRateByMoney"] = "float" +#印花税率(按手数) +CSecurityFtdcInstrumentCommissionRateField["StampTaxRateByVolume"] = "float" +#过户费率 +CSecurityFtdcInstrumentCommissionRateField["TransferFeeRateByMoney"] = "float" +#过户费率(按手数) +CSecurityFtdcInstrumentCommissionRateField["TransferFeeRateByVolume"] = "float" +#交易费 +CSecurityFtdcInstrumentCommissionRateField["TradeFeeByMoney"] = "float" +#交易费(按手数) +CSecurityFtdcInstrumentCommissionRateField["TradeFeeByVolume"] = "float" +#交易附加费率 +CSecurityFtdcInstrumentCommissionRateField["MarginByMoney"] = "float" +#最小交易费 +CSecurityFtdcInstrumentCommissionRateField["MinTradeFee"] = "float" +structDict['CSecurityFtdcInstrumentCommissionRateField'] = CSecurityFtdcInstrumentCommissionRateField + + +#余券信息 +CSecurityFtdcExcessStockInfoField = {} +#经纪公司代码 +CSecurityFtdcExcessStockInfoField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcExcessStockInfoField["InvestorID"] = "string" +#交易所代码 +CSecurityFtdcExcessStockInfoField["ExchangeID"] = "string" +#合约代码 +CSecurityFtdcExcessStockInfoField["InstrumentID"] = "string" +#余券数量 +CSecurityFtdcExcessStockInfoField["ExcessVolume"] = "int" +#余券冻结数量 +CSecurityFtdcExcessStockInfoField["ExcessFrozenVolume"] = "int" +structDict['CSecurityFtdcExcessStockInfoField'] = CSecurityFtdcExcessStockInfoField + + +#ETF合约 +CSecurityFtdcETFInstrumentField = {} +#交易所代码 +CSecurityFtdcETFInstrumentField["ExchangeID"] = "string" +#ETF证券代码 +CSecurityFtdcETFInstrumentField["ETFInstrumentID"] = "string" +#ETF对应申赎代码 +CSecurityFtdcETFInstrumentField["ETFPurRedInstrumentID"] = "string" +#最小申购赎回单位对应的ETF份数 +CSecurityFtdcETFInstrumentField["CreationRedemptionUnit"] = "int" +#最大现金替代比例 +CSecurityFtdcETFInstrumentField["Maxcashratio"] = "float" +#基金当天申购赎回状态 +CSecurityFtdcETFInstrumentField["Creationredemption"] = "string" +#预估金额 +CSecurityFtdcETFInstrumentField["EstimateCashComponent"] = "float" +structDict['CSecurityFtdcETFInstrumentField'] = CSecurityFtdcETFInstrumentField + + +#ETF股票篮 +CSecurityFtdcETFBasketField = {} +#交易所代码 +CSecurityFtdcETFBasketField["ExchangeID"] = "string" +#ETF证券代码 +CSecurityFtdcETFBasketField["ETFInstrumentID"] = "string" +#股票证券代码 +CSecurityFtdcETFBasketField["StockInstrumentID"] = "string" +#股票证券名称 +CSecurityFtdcETFBasketField["StockInstrumentName"] = "string" +#股票数量 +CSecurityFtdcETFBasketField["Volume"] = "int" +#替代标志 +CSecurityFtdcETFBasketField["CurrenceReplaceStatus"] = "string" +#溢价比例 +CSecurityFtdcETFBasketField["Premium"] = "float" +#总金额 +CSecurityFtdcETFBasketField["Amount"] = "float" +structDict['CSecurityFtdcETFBasketField'] = CSecurityFtdcETFBasketField + + +#OF合约 +CSecurityFtdcOFInstrumentField = {} +#交易所代码 +CSecurityFtdcOFInstrumentField["ExchangeID"] = "string" +#OF基金代码 +CSecurityFtdcOFInstrumentField["InstrumentID"] = "string" +#基金当天申购赎回状态 +CSecurityFtdcOFInstrumentField["Creationredemption"] = "string" +#基金净值 +CSecurityFtdcOFInstrumentField["NetPrice"] = "float" +structDict['CSecurityFtdcOFInstrumentField'] = CSecurityFtdcOFInstrumentField + + +#ETF合约 +CSecurityFtdcSFInstrumentField = {} +#交易所代码 +CSecurityFtdcSFInstrumentField["ExchangeID"] = "string" +#基金代码 +CSecurityFtdcSFInstrumentField["InstrumentID"] = "string" +#SF基金代码 +CSecurityFtdcSFInstrumentField["SFInstrumentID"] = "string" +#基金当天拆分合并状态 +CSecurityFtdcSFInstrumentField["SplitMergeStatus"] = "string" +#最小拆分数量 +CSecurityFtdcSFInstrumentField["MinSplitVolume"] = "int" +#最小合并数量 +CSecurityFtdcSFInstrumentField["MinMergeVolume"] = "int" +#拆分/合并比例 +CSecurityFtdcSFInstrumentField["VolumeRatio"] = "int" +#基金净值 +CSecurityFtdcSFInstrumentField["NetPrice"] = "float" +structDict['CSecurityFtdcSFInstrumentField'] = CSecurityFtdcSFInstrumentField + + +#交易所交易员报盘机 +CSecurityFtdcTraderOfferField = {} +#交易所代码 +CSecurityFtdcTraderOfferField["ExchangeID"] = "string" +#交易所交易员代码 +CSecurityFtdcTraderOfferField["BranchPBU"] = "string" +#会员代码 +CSecurityFtdcTraderOfferField["ParticipantID"] = "string" +#密码 +CSecurityFtdcTraderOfferField["Password"] = "string" +#安装编号 +CSecurityFtdcTraderOfferField["InstallID"] = "int" +#本地报单编号 +CSecurityFtdcTraderOfferField["OrderLocalID"] = "string" +#交易所交易员连接状态 +CSecurityFtdcTraderOfferField["TraderConnectStatus"] = "string" +#发出连接请求的日期 +CSecurityFtdcTraderOfferField["ConnectRequestDate"] = "string" +#发出连接请求的时间 +CSecurityFtdcTraderOfferField["ConnectRequestTime"] = "string" +#上次报告日期 +CSecurityFtdcTraderOfferField["LastReportDate"] = "string" +#上次报告时间 +CSecurityFtdcTraderOfferField["LastReportTime"] = "string" +#完成连接日期 +CSecurityFtdcTraderOfferField["ConnectDate"] = "string" +#完成连接时间 +CSecurityFtdcTraderOfferField["ConnectTime"] = "string" +#启动日期 +CSecurityFtdcTraderOfferField["StartDate"] = "string" +#启动时间 +CSecurityFtdcTraderOfferField["StartTime"] = "string" +#交易日 +CSecurityFtdcTraderOfferField["TradingDay"] = "string" +#经纪公司代码 +CSecurityFtdcTraderOfferField["BrokerID"] = "string" +structDict['CSecurityFtdcTraderOfferField'] = CSecurityFtdcTraderOfferField + + +#交易所行情报盘机 +CSecurityFtdcMDTraderOfferField = {} +#交易所代码 +CSecurityFtdcMDTraderOfferField["ExchangeID"] = "string" +#交易所交易员代码 +CSecurityFtdcMDTraderOfferField["BranchPBU"] = "string" +#会员代码 +CSecurityFtdcMDTraderOfferField["ParticipantID"] = "string" +#密码 +CSecurityFtdcMDTraderOfferField["Password"] = "string" +#安装编号 +CSecurityFtdcMDTraderOfferField["InstallID"] = "int" +#本地报单编号 +CSecurityFtdcMDTraderOfferField["OrderLocalID"] = "string" +#交易所交易员连接状态 +CSecurityFtdcMDTraderOfferField["TraderConnectStatus"] = "string" +#发出连接请求的日期 +CSecurityFtdcMDTraderOfferField["ConnectRequestDate"] = "string" +#发出连接请求的时间 +CSecurityFtdcMDTraderOfferField["ConnectRequestTime"] = "string" +#上次报告日期 +CSecurityFtdcMDTraderOfferField["LastReportDate"] = "string" +#上次报告时间 +CSecurityFtdcMDTraderOfferField["LastReportTime"] = "string" +#完成连接日期 +CSecurityFtdcMDTraderOfferField["ConnectDate"] = "string" +#完成连接时间 +CSecurityFtdcMDTraderOfferField["ConnectTime"] = "string" +#启动日期 +CSecurityFtdcMDTraderOfferField["StartDate"] = "string" +#启动时间 +CSecurityFtdcMDTraderOfferField["StartTime"] = "string" +#交易日 +CSecurityFtdcMDTraderOfferField["TradingDay"] = "string" +#经纪公司代码 +CSecurityFtdcMDTraderOfferField["BrokerID"] = "string" +structDict['CSecurityFtdcMDTraderOfferField'] = CSecurityFtdcMDTraderOfferField + + +#前置状态 +CSecurityFtdcFrontStatusField = {} +#前置编号 +CSecurityFtdcFrontStatusField["FrontID"] = "int" +#上次报告日期 +CSecurityFtdcFrontStatusField["LastReportDate"] = "string" +#上次报告时间 +CSecurityFtdcFrontStatusField["LastReportTime"] = "string" +#是否活跃 +CSecurityFtdcFrontStatusField["IsActive"] = "int" +structDict['CSecurityFtdcFrontStatusField'] = CSecurityFtdcFrontStatusField + + +#用户会话 +CSecurityFtdcUserSessionField = {} +#前置编号 +CSecurityFtdcUserSessionField["FrontID"] = "int" +#会话编号 +CSecurityFtdcUserSessionField["SessionID"] = "int" +#经纪公司代码 +CSecurityFtdcUserSessionField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcUserSessionField["UserID"] = "string" +#登录日期 +CSecurityFtdcUserSessionField["LoginDate"] = "string" +#登录时间 +CSecurityFtdcUserSessionField["LoginTime"] = "string" +#IP地址 +CSecurityFtdcUserSessionField["IPAddress"] = "string" +#用户端产品信息 +CSecurityFtdcUserSessionField["UserProductInfo"] = "string" +#接口端产品信息 +CSecurityFtdcUserSessionField["InterfaceProductInfo"] = "string" +#协议信息 +CSecurityFtdcUserSessionField["ProtocolInfo"] = "string" +#Mac地址 +CSecurityFtdcUserSessionField["MacAddress"] = "string" +structDict['CSecurityFtdcUserSessionField'] = CSecurityFtdcUserSessionField + + +#报单 +CSecurityFtdcOrderField = {} +#经纪公司代码 +CSecurityFtdcOrderField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcOrderField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcOrderField["InstrumentID"] = "string" +#报单引用 +CSecurityFtdcOrderField["OrderRef"] = "string" +#用户代码 +CSecurityFtdcOrderField["UserID"] = "string" +#交易所代码 +CSecurityFtdcOrderField["ExchangeID"] = "string" +#报单价格条件 +CSecurityFtdcOrderField["OrderPriceType"] = "string" +#买卖方向 +CSecurityFtdcOrderField["Direction"] = "string" +#组合开平标志 +CSecurityFtdcOrderField["CombOffsetFlag"] = "string" +#组合投机套保标志 +CSecurityFtdcOrderField["CombHedgeFlag"] = "string" +#价格 +CSecurityFtdcOrderField["LimitPrice"] = "string" +#数量 +CSecurityFtdcOrderField["VolumeTotalOriginal"] = "int" +#有效期类型 +CSecurityFtdcOrderField["TimeCondition"] = "string" +#GTD日期 +CSecurityFtdcOrderField["GTDDate"] = "string" +#成交量类型 +CSecurityFtdcOrderField["VolumeCondition"] = "string" +#最小成交量 +CSecurityFtdcOrderField["MinVolume"] = "int" +#触发条件 +CSecurityFtdcOrderField["ContingentCondition"] = "string" +#止损价 +CSecurityFtdcOrderField["StopPrice"] = "float" +#强平原因 +CSecurityFtdcOrderField["ForceCloseReason"] = "string" +#自动挂起标志 +CSecurityFtdcOrderField["IsAutoSuspend"] = "int" +#业务单元 +CSecurityFtdcOrderField["BusinessUnit"] = "string" +#请求编号 +CSecurityFtdcOrderField["RequestID"] = "int" +#本地报单编号 +CSecurityFtdcOrderField["OrderLocalID"] = "string" +#会员代码 +CSecurityFtdcOrderField["ParticipantID"] = "string" +#客户代码 +CSecurityFtdcOrderField["ClientID"] = "string" +#合约在交易所的代码 +CSecurityFtdcOrderField["ExchangeInstID"] = "string" +#交易所交易员代码 +CSecurityFtdcOrderField["BranchPBU"] = "string" +#安装编号 +CSecurityFtdcOrderField["InstallID"] = "int" +#报单提交状态 +CSecurityFtdcOrderField["OrderSubmitStatus"] = "string" +#账户代码 +CSecurityFtdcOrderField["AccountID"] = "string" +#报单提示序号 +CSecurityFtdcOrderField["NotifySequence"] = "int" +#交易日 +CSecurityFtdcOrderField["TradingDay"] = "string" +#报单编号 +CSecurityFtdcOrderField["OrderSysID"] = "string" +#报单来源 +CSecurityFtdcOrderField["OrderSource"] = "string" +#报单状态 +CSecurityFtdcOrderField["OrderStatus"] = "string" +#报单类型 +CSecurityFtdcOrderField["OrderType"] = "string" +#今成交数量 +CSecurityFtdcOrderField["VolumeTraded"] = "int" +#剩余数量 +CSecurityFtdcOrderField["VolumeTotal"] = "int" +#报单日期 +CSecurityFtdcOrderField["InsertDate"] = "string" +#委托时间 +CSecurityFtdcOrderField["InsertTime"] = "string" +#激活时间 +CSecurityFtdcOrderField["ActiveTime"] = "string" +#挂起时间 +CSecurityFtdcOrderField["SuspendTime"] = "string" +#最后修改时间 +CSecurityFtdcOrderField["UpdateTime"] = "string" +#撤销时间 +CSecurityFtdcOrderField["CancelTime"] = "string" +#最后修改交易所交易员代码 +CSecurityFtdcOrderField["ActiveTraderID"] = "string" +#结算会员编号 +CSecurityFtdcOrderField["ClearingPartID"] = "string" +#序号 +CSecurityFtdcOrderField["SequenceNo"] = "int" +#前置编号 +CSecurityFtdcOrderField["FrontID"] = "int" +#会话编号 +CSecurityFtdcOrderField["SessionID"] = "int" +#用户端产品信息 +CSecurityFtdcOrderField["UserProductInfo"] = "string" +#状态信息 +CSecurityFtdcOrderField["StatusMsg"] = "string" +#用户强评标志 +CSecurityFtdcOrderField["UserForceClose"] = "int" +#操作用户代码 +CSecurityFtdcOrderField["ActiveUserID"] = "string" +#经纪公司报单编号 +CSecurityFtdcOrderField["BrokerOrderSeq"] = "int" +#相关报单 +CSecurityFtdcOrderField["RelativeOrderSysID"] = "string" +#营业部编号 +CSecurityFtdcOrderField["BranchID"] = "string" +#成交数量 +CSecurityFtdcOrderField["TradeAmount"] = "float" +#是否ETF +CSecurityFtdcOrderField["IsETF"] = "int" +#合约类型 +CSecurityFtdcOrderField["InstrumentType"] = "string" +structDict['CSecurityFtdcOrderField'] = CSecurityFtdcOrderField + + +#报单操作 +CSecurityFtdcOrderActionField = {} +#经纪公司代码 +CSecurityFtdcOrderActionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcOrderActionField["InvestorID"] = "string" +#报单操作引用 +CSecurityFtdcOrderActionField["OrderActionRef"] = "int" +#报单引用 +CSecurityFtdcOrderActionField["OrderRef"] = "string" +#请求编号 +CSecurityFtdcOrderActionField["RequestID"] = "int" +#前置编号 +CSecurityFtdcOrderActionField["FrontID"] = "int" +#会话编号 +CSecurityFtdcOrderActionField["SessionID"] = "int" +#交易所代码 +CSecurityFtdcOrderActionField["ExchangeID"] = "string" +#操作标志 +CSecurityFtdcOrderActionField["ActionFlag"] = "string" +#价格 +CSecurityFtdcOrderActionField["LimitPrice"] = "float" +#数量变化 +CSecurityFtdcOrderActionField["VolumeChange"] = "int" +#操作日期 +CSecurityFtdcOrderActionField["ActionDate"] = "string" +#操作时间 +CSecurityFtdcOrderActionField["ActionTime"] = "string" +#交易所交易员代码 +CSecurityFtdcOrderActionField["BranchPBU"] = "string" +#安装编号 +CSecurityFtdcOrderActionField["InstallID"] = "int" +#本地报单编号 +CSecurityFtdcOrderActionField["OrderLocalID"] = "string" +#操作本地编号 +CSecurityFtdcOrderActionField["ActionLocalID"] = "string" +#会员代码 +CSecurityFtdcOrderActionField["ParticipantID"] = "string" +#客户代码 +CSecurityFtdcOrderActionField["ClientID"] = "string" +#业务单元 +CSecurityFtdcOrderActionField["BusinessUnit"] = "string" +#报单操作状态 +CSecurityFtdcOrderActionField["OrderActionStatus"] = "string" +#用户代码 +CSecurityFtdcOrderActionField["UserID"] = "string" +#营业部编号 +CSecurityFtdcOrderActionField["BranchID"] = "string" +#状态信息 +CSecurityFtdcOrderActionField["StatusMsg"] = "string" +#合约代码 +CSecurityFtdcOrderActionField["InstrumentID"] = "string" +#合约类型 +CSecurityFtdcOrderActionField["InstrumentType"] = "string" +structDict['CSecurityFtdcOrderActionField'] = CSecurityFtdcOrderActionField + + +#错误报单 +CSecurityFtdcErrOrderField = {} +#经纪公司代码 +CSecurityFtdcErrOrderField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcErrOrderField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcErrOrderField["InstrumentID"] = "string" +#报单引用 +CSecurityFtdcErrOrderField["OrderRef"] = "string" +#用户代码 +CSecurityFtdcErrOrderField["UserID"] = "string" +#交易所代码 +CSecurityFtdcErrOrderField["ExchangeID"] = "string" +#报单价格条件 +CSecurityFtdcErrOrderField["OrderPriceType"] = "string" +#买卖方向 +CSecurityFtdcErrOrderField["Direction"] = "string" +#组合开平标志 +CSecurityFtdcErrOrderField["CombOffsetFlag"] = "string" +#组合投机套保标志 +CSecurityFtdcErrOrderField["CombHedgeFlag"] = "string" +#价格 +CSecurityFtdcErrOrderField["LimitPrice"] = "string" +#数量 +CSecurityFtdcErrOrderField["VolumeTotalOriginal"] = "int" +#有效期类型 +CSecurityFtdcErrOrderField["TimeCondition"] = "string" +#GTD日期 +CSecurityFtdcErrOrderField["GTDDate"] = "string" +#成交量类型 +CSecurityFtdcErrOrderField["VolumeCondition"] = "string" +#最小成交量 +CSecurityFtdcErrOrderField["MinVolume"] = "int" +#触发条件 +CSecurityFtdcErrOrderField["ContingentCondition"] = "string" +#止损价 +CSecurityFtdcErrOrderField["StopPrice"] = "float" +#强平原因 +CSecurityFtdcErrOrderField["ForceCloseReason"] = "string" +#自动挂起标志 +CSecurityFtdcErrOrderField["IsAutoSuspend"] = "int" +#业务单元 +CSecurityFtdcErrOrderField["BusinessUnit"] = "string" +#请求编号 +CSecurityFtdcErrOrderField["RequestID"] = "int" +#用户强评标志 +CSecurityFtdcErrOrderField["UserForceClose"] = "int" +#错误代码 +CSecurityFtdcErrOrderField["ErrorID"] = "int" +#错误信息 +CSecurityFtdcErrOrderField["ErrorMsg"] = "string" +structDict['CSecurityFtdcErrOrderField'] = CSecurityFtdcErrOrderField + + +#错误报单操作 +CSecurityFtdcErrOrderActionField = {} +#经纪公司代码 +CSecurityFtdcErrOrderActionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcErrOrderActionField["InvestorID"] = "string" +#报单操作引用 +CSecurityFtdcErrOrderActionField["OrderActionRef"] = "int" +#报单引用 +CSecurityFtdcErrOrderActionField["OrderRef"] = "string" +#请求编号 +CSecurityFtdcErrOrderActionField["RequestID"] = "int" +#前置编号 +CSecurityFtdcErrOrderActionField["FrontID"] = "int" +#会话编号 +CSecurityFtdcErrOrderActionField["SessionID"] = "int" +#交易所代码 +CSecurityFtdcErrOrderActionField["ExchangeID"] = "string" +#操作标志 +CSecurityFtdcErrOrderActionField["ActionFlag"] = "string" +#价格 +CSecurityFtdcErrOrderActionField["LimitPrice"] = "float" +#数量变化 +CSecurityFtdcErrOrderActionField["VolumeChange"] = "int" +#操作日期 +CSecurityFtdcErrOrderActionField["ActionDate"] = "string" +#操作时间 +CSecurityFtdcErrOrderActionField["ActionTime"] = "string" +#交易所交易员代码 +CSecurityFtdcErrOrderActionField["BranchPBU"] = "string" +#安装编号 +CSecurityFtdcErrOrderActionField["InstallID"] = "int" +#本地报单编号 +CSecurityFtdcErrOrderActionField["OrderLocalID"] = "string" +#操作本地编号 +CSecurityFtdcErrOrderActionField["ActionLocalID"] = "string" +#会员代码 +CSecurityFtdcErrOrderActionField["ParticipantID"] = "string" +#客户代码 +CSecurityFtdcErrOrderActionField["ClientID"] = "string" +#业务单元 +CSecurityFtdcErrOrderActionField["BusinessUnit"] = "string" +#报单操作状态 +CSecurityFtdcErrOrderActionField["OrderActionStatus"] = "string" +#用户代码 +CSecurityFtdcErrOrderActionField["UserID"] = "string" +#营业部编号 +CSecurityFtdcErrOrderActionField["BranchID"] = "string" +#状态信息 +CSecurityFtdcErrOrderActionField["StatusMsg"] = "string" +#合约代码 +CSecurityFtdcErrOrderActionField["InstrumentID"] = "string" +#错误代码 +CSecurityFtdcErrOrderActionField["ErrorID"] = "int" +#错误信息 +CSecurityFtdcErrOrderActionField["ErrorMsg"] = "string" +#合约类型 +CSecurityFtdcErrOrderActionField["InstrumentType"] = "string" +structDict['CSecurityFtdcErrOrderActionField'] = CSecurityFtdcErrOrderActionField + + +#成交 +CSecurityFtdcTradeField = {} +#经纪公司代码 +CSecurityFtdcTradeField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcTradeField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcTradeField["InstrumentID"] = "string" +#报单引用 +CSecurityFtdcTradeField["OrderRef"] = "string" +#用户代码 +CSecurityFtdcTradeField["UserID"] = "string" +#交易所代码 +CSecurityFtdcTradeField["ExchangeID"] = "string" +#成交编号 +CSecurityFtdcTradeField["TradeID"] = "string" +#买卖方向 +CSecurityFtdcTradeField["Direction"] = "string" +#报单编号 +CSecurityFtdcTradeField["OrderSysID"] = "string" +#会员代码 +CSecurityFtdcTradeField["ParticipantID"] = "string" +#客户代码 +CSecurityFtdcTradeField["ClientID"] = "string" +#交易角色 +CSecurityFtdcTradeField["TradingRole"] = "string" +#合约在交易所的代码 +CSecurityFtdcTradeField["ExchangeInstID"] = "string" +#开平标志 +CSecurityFtdcTradeField["OffsetFlag"] = "string" +#投机套保标志 +CSecurityFtdcTradeField["HedgeFlag"] = "string" +#价格 +CSecurityFtdcTradeField["Price"] = "string" +#数量 +CSecurityFtdcTradeField["Volume"] = "int" +#成交时期 +CSecurityFtdcTradeField["TradeDate"] = "string" +#成交时间 +CSecurityFtdcTradeField["TradeTime"] = "string" +#成交类型 +CSecurityFtdcTradeField["TradeType"] = "string" +#成交价来源 +CSecurityFtdcTradeField["PriceSource"] = "string" +#交易所交易员代码 +CSecurityFtdcTradeField["BranchPBU"] = "string" +#本地报单编号 +CSecurityFtdcTradeField["OrderLocalID"] = "string" +#结算会员编号 +CSecurityFtdcTradeField["ClearingPartID"] = "string" +#业务单元 +CSecurityFtdcTradeField["BusinessUnit"] = "string" +#序号 +CSecurityFtdcTradeField["SequenceNo"] = "int" +#成交来源 +CSecurityFtdcTradeField["TradeSource"] = "string" +#交易日 +CSecurityFtdcTradeField["TradingDay"] = "string" +#经纪公司报单编号 +CSecurityFtdcTradeField["BrokerOrderSeq"] = "int" +#成交金额 +CSecurityFtdcTradeField["TradeAmount"] = "float" +#成交序号 +CSecurityFtdcTradeField["TradeIndex"] = "int" +structDict['CSecurityFtdcTradeField'] = CSecurityFtdcTradeField + + +#投资者持仓 +CSecurityFtdcInvestorPositionField = {} +#合约代码 +CSecurityFtdcInvestorPositionField["InstrumentID"] = "string" +#经纪公司代码 +CSecurityFtdcInvestorPositionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInvestorPositionField["InvestorID"] = "string" +#持仓多空方向 +CSecurityFtdcInvestorPositionField["PosiDirection"] = "string" +#投机套保标志 +CSecurityFtdcInvestorPositionField["HedgeFlag"] = "string" +#持仓日期 +CSecurityFtdcInvestorPositionField["PositionDate"] = "string" +#上日持仓 +CSecurityFtdcInvestorPositionField["YdPosition"] = "int" +#今日持仓 +CSecurityFtdcInvestorPositionField["Position"] = "int" +#多头冻结 +CSecurityFtdcInvestorPositionField["LongFrozen"] = "int" +#空头冻结 +CSecurityFtdcInvestorPositionField["ShortFrozen"] = "int" +#开仓冻结金额 +CSecurityFtdcInvestorPositionField["LongFrozenAmount"] = "float" +#开仓冻结金额 +CSecurityFtdcInvestorPositionField["ShortFrozenAmount"] = "float" +#开仓量 +CSecurityFtdcInvestorPositionField["OpenVolume"] = "int" +#平仓量 +CSecurityFtdcInvestorPositionField["CloseVolume"] = "int" +#开仓金额 +CSecurityFtdcInvestorPositionField["OpenAmount"] = "float" +#平仓金额 +CSecurityFtdcInvestorPositionField["CloseAmount"] = "float" +#持仓成本 +CSecurityFtdcInvestorPositionField["PositionCost"] = "float" +#冻结的资金 +CSecurityFtdcInvestorPositionField["FrozenCash"] = "float" +#资金差额 +CSecurityFtdcInvestorPositionField["CashIn"] = "float" +#手续费 +CSecurityFtdcInvestorPositionField["Commission"] = "float" +#上次结算价 +CSecurityFtdcInvestorPositionField["PreSettlementPrice"] = "float" +#本次结算价 +CSecurityFtdcInvestorPositionField["SettlementPrice"] = "float" +#交易日 +CSecurityFtdcInvestorPositionField["TradingDay"] = "string" +#开仓成本 +CSecurityFtdcInvestorPositionField["OpenCost"] = "float" +#交易所保证金 +CSecurityFtdcInvestorPositionField["ExchangeMargin"] = "float" +#今日持仓 +CSecurityFtdcInvestorPositionField["TodayPosition"] = "int" +#过户费 +CSecurityFtdcInvestorPositionField["TransferFee"] = "float" +#印花税 +CSecurityFtdcInvestorPositionField["StampTax"] = "float" +#今日申购赎回数量 +CSecurityFtdcInvestorPositionField["TodayPurRedVolume"] = "int" +#折算率 +CSecurityFtdcInvestorPositionField["ConversionRate"] = "float" +#折算金额 +CSecurityFtdcInvestorPositionField["ConversionAmount"] = "float" +#证券价值 +CSecurityFtdcInvestorPositionField["StockValue"] = "float" +#交易所代码 +CSecurityFtdcInvestorPositionField["ExchangeID"] = "string" +#AccountID +CSecurityFtdcInvestorPositionField["AccountID"] = "string" +#质押入库数量 +CSecurityFtdcInvestorPositionField["PledgeInPosition"] = "int" +#正回购使用的标准券数量 +CSecurityFtdcInvestorPositionField["RepurchasePosition"] = "int" +#ETF申赎空头冻结 +CSecurityFtdcInvestorPositionField["PurRedShortFrozen"] = "int" +#融资买入数量 +CSecurityFtdcInvestorPositionField["MarginTradeVolume"] = "int" +#融资买入金额 +CSecurityFtdcInvestorPositionField["MarginTradeAmount"] = "float" +#融资买入冻结数量 +CSecurityFtdcInvestorPositionField["MarginTradeFrozenVolume"] = "int" +#融资买入冻结金额 +CSecurityFtdcInvestorPositionField["MarginTradeFrozenAmount"] = "float" +#融资买入盈亏 +CSecurityFtdcInvestorPositionField["MarginTradeConversionProfit"] = "float" +#融券卖出数量 +CSecurityFtdcInvestorPositionField["ShortSellVolume"] = "int" +#融券卖出金额 +CSecurityFtdcInvestorPositionField["ShortSellAmount"] = "float" +#融券卖出冻结数量 +CSecurityFtdcInvestorPositionField["ShortSellFrozenVolume"] = "int" +#融券卖出冻结金额 +CSecurityFtdcInvestorPositionField["ShortSellFrozenAmount"] = "float" +#融券卖出盈亏 +CSecurityFtdcInvestorPositionField["ShortSellConversionProfit"] = "float" +#融券总市值 +CSecurityFtdcInvestorPositionField["SSStockValue"] = "float" +#今日融资持仓 +CSecurityFtdcInvestorPositionField["TodayMTPosition"] = "int" +#今日融券持仓 +CSecurityFtdcInvestorPositionField["TodaySSPosition"] = "int" +#历史持仓开仓成本 +CSecurityFtdcInvestorPositionField["YdOpenCost"] = "float" +#锁定仓位 +CSecurityFtdcInvestorPositionField["LockPosition"] = "int" +#备兑仓位 +CSecurityFtdcInvestorPositionField["CoverPosition"] = "int" +#锁定冻结仓位 +CSecurityFtdcInvestorPositionField["LockFrozenPosition"] = "int" +#解锁冻结仓位 +CSecurityFtdcInvestorPositionField["UnlockFrozenPosition"] = "int" +#备兑冻结仓位 +CSecurityFtdcInvestorPositionField["CoverFrozenPosition"] = "int" +#行权冻结仓位 +CSecurityFtdcInvestorPositionField["ExecFrozenPosition"] = "int" +structDict['CSecurityFtdcInvestorPositionField'] = CSecurityFtdcInvestorPositionField + + +#出入金同步 +CSecurityFtdcSyncDepositField = {} +#出入金流水号 +CSecurityFtdcSyncDepositField["DepositSeqNo"] = "string" +#经纪公司代码 +CSecurityFtdcSyncDepositField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcSyncDepositField["InvestorID"] = "string" +#入金金额 +CSecurityFtdcSyncDepositField["Deposit"] = "float" +#是否强制进行 +CSecurityFtdcSyncDepositField["IsForce"] = "int" +#账户代 +CSecurityFtdcSyncDepositField["AccountID"] = "string" +structDict['CSecurityFtdcSyncDepositField'] = CSecurityFtdcSyncDepositField + + +#查询交易所 +CSecurityFtdcQryExchangeField = {} +#交易所代码 +CSecurityFtdcQryExchangeField["ExchangeID"] = "string" +structDict['CSecurityFtdcQryExchangeField'] = CSecurityFtdcQryExchangeField + + +#查询产品 +CSecurityFtdcQryProductField = {} +#产品代码 +CSecurityFtdcQryProductField["ProductID"] = "string" +structDict['CSecurityFtdcQryProductField'] = CSecurityFtdcQryProductField + + +#查询合约 +CSecurityFtdcQryInstrumentField = {} +#合约代码 +CSecurityFtdcQryInstrumentField["InstrumentID"] = "string" +#交易所代码 +CSecurityFtdcQryInstrumentField["ExchangeID"] = "string" +#合约在交易所的代码 +CSecurityFtdcQryInstrumentField["ExchangeInstID"] = "string" +#产品代码 +CSecurityFtdcQryInstrumentField["ProductID"] = "string" +structDict['CSecurityFtdcQryInstrumentField'] = CSecurityFtdcQryInstrumentField + + +#查询经纪公司 +CSecurityFtdcQryBrokerField = {} +#经纪公司代码 +CSecurityFtdcQryBrokerField["BrokerID"] = "string" +structDict['CSecurityFtdcQryBrokerField'] = CSecurityFtdcQryBrokerField + + +#查询经纪公司会员代码 +CSecurityFtdcQryPartBrokerField = {} +#交易所代码 +CSecurityFtdcQryPartBrokerField["ExchangeID"] = "string" +#经纪公司代码 +CSecurityFtdcQryPartBrokerField["BrokerID"] = "string" +#会员代码 +CSecurityFtdcQryPartBrokerField["ParticipantID"] = "string" +structDict['CSecurityFtdcQryPartBrokerField'] = CSecurityFtdcQryPartBrokerField + + +#查询投资者 +CSecurityFtdcQryInvestorField = {} +#经纪公司代码 +CSecurityFtdcQryInvestorField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryInvestorField["InvestorID"] = "string" +structDict['CSecurityFtdcQryInvestorField'] = CSecurityFtdcQryInvestorField + + +#查询交易编码 +CSecurityFtdcQryTradingCodeField = {} +#经纪公司代码 +CSecurityFtdcQryTradingCodeField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryTradingCodeField["InvestorID"] = "string" +#交易所代码 +CSecurityFtdcQryTradingCodeField["ExchangeID"] = "string" +#客户代码 +CSecurityFtdcQryTradingCodeField["ClientID"] = "string" +structDict['CSecurityFtdcQryTradingCodeField'] = CSecurityFtdcQryTradingCodeField + + +#查询管理用户 +CSecurityFtdcQrySuperUserField = {} +#用户代码 +CSecurityFtdcQrySuperUserField["UserID"] = "string" +structDict['CSecurityFtdcQrySuperUserField'] = CSecurityFtdcQrySuperUserField + + +#查询管理用户功能权限 +CSecurityFtdcQrySuperUserFunctionField = {} +#用户代码 +CSecurityFtdcQrySuperUserFunctionField["UserID"] = "string" +structDict['CSecurityFtdcQrySuperUserFunctionField'] = CSecurityFtdcQrySuperUserFunctionField + + +#查询经纪公司用户 +CSecurityFtdcQryBrokerUserField = {} +#经纪公司代码 +CSecurityFtdcQryBrokerUserField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcQryBrokerUserField["UserID"] = "string" +structDict['CSecurityFtdcQryBrokerUserField'] = CSecurityFtdcQryBrokerUserField + + +#查询经纪公司用户权限 +CSecurityFtdcQryBrokerUserFunctionField = {} +#经纪公司代码 +CSecurityFtdcQryBrokerUserFunctionField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcQryBrokerUserFunctionField["UserID"] = "string" +structDict['CSecurityFtdcQryBrokerUserFunctionField'] = CSecurityFtdcQryBrokerUserFunctionField + + +#查询资金账户 +CSecurityFtdcQryTradingAccountField = {} +#经纪公司代码 +CSecurityFtdcQryTradingAccountField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryTradingAccountField["InvestorID"] = "string" +structDict['CSecurityFtdcQryTradingAccountField'] = CSecurityFtdcQryTradingAccountField + + +#查询禁止登录用户 +CSecurityFtdcQryLoginForbiddenUserField = {} +#经纪公司代码 +CSecurityFtdcQryLoginForbiddenUserField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcQryLoginForbiddenUserField["UserID"] = "string" +structDict['CSecurityFtdcQryLoginForbiddenUserField'] = CSecurityFtdcQryLoginForbiddenUserField + + +#查询行情 +CSecurityFtdcQryDepthMarketDataField = {} +#合约代码 +CSecurityFtdcQryDepthMarketDataField["InstrumentID"] = "string" +structDict['CSecurityFtdcQryDepthMarketDataField'] = CSecurityFtdcQryDepthMarketDataField + + +#查询合约交易权限 +CSecurityFtdcQryInstrumentTradingRightField = {} +#交易所代码 +CSecurityFtdcQryInstrumentTradingRightField["ExchangeID"] = "string" +#经纪公司代码 +CSecurityFtdcQryInstrumentTradingRightField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryInstrumentTradingRightField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcQryInstrumentTradingRightField["InstrumentID"] = "string" +structDict['CSecurityFtdcQryInstrumentTradingRightField'] = CSecurityFtdcQryInstrumentTradingRightField + + +#查询投资者持仓明细 +CSecurityFtdcQryInvestorPositionDetailField = {} +#经纪公司代码 +CSecurityFtdcQryInvestorPositionDetailField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryInvestorPositionDetailField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcQryInvestorPositionDetailField["InstrumentID"] = "string" +structDict['CSecurityFtdcQryInvestorPositionDetailField'] = CSecurityFtdcQryInvestorPositionDetailField + + +#查询债券利息 +CSecurityFtdcQryBondInterestField = {} +#交易所代码 +CSecurityFtdcQryBondInterestField["ExchangeID"] = "string" +#合约代码 +CSecurityFtdcQryBondInterestField["InstrumentID"] = "string" +structDict['CSecurityFtdcQryBondInterestField'] = CSecurityFtdcQryBondInterestField + + +#查询市值配售信息 +CSecurityFtdcQryMarketRationInfoField = {} +#经纪公司代码 +CSecurityFtdcQryMarketRationInfoField["BrokerID"] = "string" +#投资者帐号 +CSecurityFtdcQryMarketRationInfoField["InvestorID"] = "string" +#交易所代码 +CSecurityFtdcQryMarketRationInfoField["ExchangeID"] = "string" +structDict['CSecurityFtdcQryMarketRationInfoField'] = CSecurityFtdcQryMarketRationInfoField + + +#查询合约手续费率 +CSecurityFtdcQryInstrumentCommissionRateField = {} +#交易所代码 +CSecurityFtdcQryInstrumentCommissionRateField["ExchangeID"] = "string" +#经纪公司代码 +CSecurityFtdcQryInstrumentCommissionRateField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryInstrumentCommissionRateField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcQryInstrumentCommissionRateField["InstrumentID"] = "string" +#买卖方向 +CSecurityFtdcQryInstrumentCommissionRateField["Direction"] = "string" +#开平标志 +CSecurityFtdcQryInstrumentCommissionRateField["OffsetFlag"] = "string" +structDict['CSecurityFtdcQryInstrumentCommissionRateField'] = CSecurityFtdcQryInstrumentCommissionRateField + + +#查询余券信息 +CSecurityFtdcQryExcessStockInfoField = {} +#经纪公司代码 +CSecurityFtdcQryExcessStockInfoField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryExcessStockInfoField["InvestorID"] = "string" +#交易所代码 +CSecurityFtdcQryExcessStockInfoField["ExchangeID"] = "string" +#合约代码 +CSecurityFtdcQryExcessStockInfoField["InstrumentID"] = "string" +structDict['CSecurityFtdcQryExcessStockInfoField'] = CSecurityFtdcQryExcessStockInfoField + + +#查询投资者帐户关系 +CSecurityFtdcQryInvestorAccountField = {} +#经纪公司代码 +CSecurityFtdcQryInvestorAccountField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryInvestorAccountField["InvestorID"] = "string" +structDict['CSecurityFtdcQryInvestorAccountField'] = CSecurityFtdcQryInvestorAccountField + + +#查询ETF合约 +CSecurityFtdcQryETFInstrumentField = {} +#交易所代码 +CSecurityFtdcQryETFInstrumentField["ExchangeID"] = "string" +#ETF证券代码 +CSecurityFtdcQryETFInstrumentField["ETFInstrumentID"] = "string" +structDict['CSecurityFtdcQryETFInstrumentField'] = CSecurityFtdcQryETFInstrumentField + + +#查询ETF股票篮 +CSecurityFtdcQryETFBasketField = {} +#交易所代码 +CSecurityFtdcQryETFBasketField["ExchangeID"] = "string" +#ETF证券代码 +CSecurityFtdcQryETFBasketField["ETFInstrumentID"] = "string" +structDict['CSecurityFtdcQryETFBasketField'] = CSecurityFtdcQryETFBasketField + + +#查询OF合约 +CSecurityFtdcQryOFInstrumentField = {} +#交易所代码 +CSecurityFtdcQryOFInstrumentField["ExchangeID"] = "string" +#ETF证券代码 +CSecurityFtdcQryOFInstrumentField["OFInstrumentID"] = "string" +structDict['CSecurityFtdcQryOFInstrumentField'] = CSecurityFtdcQryOFInstrumentField + + +#查询SF合约 +CSecurityFtdcQrySFInstrumentField = {} +#交易所代码 +CSecurityFtdcQrySFInstrumentField["ExchangeID"] = "string" +#ETF证券代码 +CSecurityFtdcQrySFInstrumentField["SFInstrumentID"] = "string" +structDict['CSecurityFtdcQrySFInstrumentField'] = CSecurityFtdcQrySFInstrumentField + + +#查询交易员报盘机 +CSecurityFtdcQryTraderOfferField = {} +#交易所代码 +CSecurityFtdcQryTraderOfferField["ExchangeID"] = "string" +#会员代码 +CSecurityFtdcQryTraderOfferField["ParticipantID"] = "string" +#交易所交易员代码 +CSecurityFtdcQryTraderOfferField["BranchPBU"] = "string" +structDict['CSecurityFtdcQryTraderOfferField'] = CSecurityFtdcQryTraderOfferField + + +#查询行情报盘机 +CSecurityFtdcQryMDTraderOfferField = {} +#交易所代码 +CSecurityFtdcQryMDTraderOfferField["ExchangeID"] = "string" +#会员代码 +CSecurityFtdcQryMDTraderOfferField["ParticipantID"] = "string" +#交易所交易员代码 +CSecurityFtdcQryMDTraderOfferField["BranchPBU"] = "string" +structDict['CSecurityFtdcQryMDTraderOfferField'] = CSecurityFtdcQryMDTraderOfferField + + +#查询前置状态 +CSecurityFtdcQryFrontStatusField = {} +#前置编号 +CSecurityFtdcQryFrontStatusField["FrontID"] = "int" +structDict['CSecurityFtdcQryFrontStatusField'] = CSecurityFtdcQryFrontStatusField + + +#查询用户会话 +CSecurityFtdcQryUserSessionField = {} +#前置编号 +CSecurityFtdcQryUserSessionField["FrontID"] = "int" +#会话编号 +CSecurityFtdcQryUserSessionField["SessionID"] = "int" +#经纪公司代码 +CSecurityFtdcQryUserSessionField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcQryUserSessionField["UserID"] = "string" +structDict['CSecurityFtdcQryUserSessionField'] = CSecurityFtdcQryUserSessionField + + +#查询报单 +CSecurityFtdcQryOrderField = {} +#经纪公司代码 +CSecurityFtdcQryOrderField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryOrderField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcQryOrderField["InstrumentID"] = "string" +#交易所代码 +CSecurityFtdcQryOrderField["ExchangeID"] = "string" +#报单编号 +CSecurityFtdcQryOrderField["OrderSysID"] = "string" +#开始时间 +CSecurityFtdcQryOrderField["InsertTimeStart"] = "string" +#结束时间 +CSecurityFtdcQryOrderField["InsertTimeEnd"] = "string" +structDict['CSecurityFtdcQryOrderField'] = CSecurityFtdcQryOrderField + + +#查询报单操作 +CSecurityFtdcQryOrderActionField = {} +#经纪公司代码 +CSecurityFtdcQryOrderActionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryOrderActionField["InvestorID"] = "string" +#交易所代码 +CSecurityFtdcQryOrderActionField["ExchangeID"] = "string" +structDict['CSecurityFtdcQryOrderActionField'] = CSecurityFtdcQryOrderActionField + + +#查询错误报单 +CSecurityFtdcQryErrOrderField = {} +#经纪公司代码 +CSecurityFtdcQryErrOrderField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryErrOrderField["InvestorID"] = "string" +structDict['CSecurityFtdcQryErrOrderField'] = CSecurityFtdcQryErrOrderField + + +#查询错误报单操作 +CSecurityFtdcQryErrOrderActionField = {} +#经纪公司代码 +CSecurityFtdcQryErrOrderActionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryErrOrderActionField["InvestorID"] = "string" +structDict['CSecurityFtdcQryErrOrderActionField'] = CSecurityFtdcQryErrOrderActionField + + +#查询成交 +CSecurityFtdcQryTradeField = {} +#经纪公司代码 +CSecurityFtdcQryTradeField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryTradeField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcQryTradeField["InstrumentID"] = "string" +#交易所代码 +CSecurityFtdcQryTradeField["ExchangeID"] = "string" +#成交编号 +CSecurityFtdcQryTradeField["TradeID"] = "string" +#开始时间 +CSecurityFtdcQryTradeField["TradeTimeStart"] = "string" +#结束时间 +CSecurityFtdcQryTradeField["TradeTimeEnd"] = "string" +structDict['CSecurityFtdcQryTradeField'] = CSecurityFtdcQryTradeField + + +#查询投资者持仓 +CSecurityFtdcQryInvestorPositionField = {} +#经纪公司代码 +CSecurityFtdcQryInvestorPositionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryInvestorPositionField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcQryInvestorPositionField["InstrumentID"] = "string" +structDict['CSecurityFtdcQryInvestorPositionField'] = CSecurityFtdcQryInvestorPositionField + + +#查询出入金流水 +CSecurityFtdcQrySyncDepositField = {} +#经纪公司代码 +CSecurityFtdcQrySyncDepositField["BrokerID"] = "string" +#出入金流水号 +CSecurityFtdcQrySyncDepositField["DepositSeqNo"] = "string" +structDict['CSecurityFtdcQrySyncDepositField'] = CSecurityFtdcQrySyncDepositField + + +#用户口令变更 +CSecurityFtdcUserPasswordUpdateField = {} +#经纪公司代码 +CSecurityFtdcUserPasswordUpdateField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcUserPasswordUpdateField["UserID"] = "string" +#原来的口令 +CSecurityFtdcUserPasswordUpdateField["OldPassword"] = "string" +#新的口令 +CSecurityFtdcUserPasswordUpdateField["NewPassword"] = "string" +structDict['CSecurityFtdcUserPasswordUpdateField'] = CSecurityFtdcUserPasswordUpdateField + + +#资金账户口令变更域 +CSecurityFtdcTradingAccountPasswordUpdateField = {} +#经纪公司代码 +CSecurityFtdcTradingAccountPasswordUpdateField["BrokerID"] = "string" +#投资者帐号 +CSecurityFtdcTradingAccountPasswordUpdateField["AccountID"] = "string" +#原来的口令 +CSecurityFtdcTradingAccountPasswordUpdateField["OldPassword"] = "string" +#新的口令 +CSecurityFtdcTradingAccountPasswordUpdateField["NewPassword"] = "string" +structDict['CSecurityFtdcTradingAccountPasswordUpdateField'] = CSecurityFtdcTradingAccountPasswordUpdateField + + +#手工同步用户动态令牌 +CSecurityFtdcManualSyncBrokerUserOTPField = {} +#经纪公司代码 +CSecurityFtdcManualSyncBrokerUserOTPField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcManualSyncBrokerUserOTPField["UserID"] = "string" +#动态令牌类型 +CSecurityFtdcManualSyncBrokerUserOTPField["OTPType"] = "string" +#第一个动态密码 +CSecurityFtdcManualSyncBrokerUserOTPField["FirstOTP"] = "string" +#第二个动态密码 +CSecurityFtdcManualSyncBrokerUserOTPField["SecondOTP"] = "string" +structDict['CSecurityFtdcManualSyncBrokerUserOTPField'] = CSecurityFtdcManualSyncBrokerUserOTPField + + +#经纪公司用户口令 +CSecurityFtdcBrokerUserPasswordField = {} +#经纪公司代码 +CSecurityFtdcBrokerUserPasswordField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcBrokerUserPasswordField["UserID"] = "string" +#密码 +CSecurityFtdcBrokerUserPasswordField["Password"] = "string" +structDict['CSecurityFtdcBrokerUserPasswordField'] = CSecurityFtdcBrokerUserPasswordField + + +#资金账户口令域 +CSecurityFtdcTradingAccountPasswordField = {} +#经纪公司代码 +CSecurityFtdcTradingAccountPasswordField["BrokerID"] = "string" +#投资者帐号 +CSecurityFtdcTradingAccountPasswordField["AccountID"] = "string" +#密码 +CSecurityFtdcTradingAccountPasswordField["Password"] = "string" +structDict['CSecurityFtdcTradingAccountPasswordField'] = CSecurityFtdcTradingAccountPasswordField + + +#用户权限 +CSecurityFtdcUserRightField = {} +#经纪公司代码 +CSecurityFtdcUserRightField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcUserRightField["UserID"] = "string" +#客户权限类型 +CSecurityFtdcUserRightField["UserRightType"] = "string" +#是否禁止 +CSecurityFtdcUserRightField["IsForbidden"] = "int" +structDict['CSecurityFtdcUserRightField'] = CSecurityFtdcUserRightField + + +#投资者账户 +CSecurityFtdcInvestorAccountField = {} +#经纪公司代码 +CSecurityFtdcInvestorAccountField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInvestorAccountField["InvestorID"] = "string" +#投资者帐号 +CSecurityFtdcInvestorAccountField["AccountID"] = "string" +#是否主账户 +CSecurityFtdcInvestorAccountField["IsDefault"] = "int" +#账户类型 +CSecurityFtdcInvestorAccountField["AccountType"] = "string" +#是否活跃 +CSecurityFtdcInvestorAccountField["IsActive"] = "int" +#上交所交易单元号 +CSecurityFtdcInvestorAccountField["SHBranchPBU"] = "string" +#深交所交易单元号 +CSecurityFtdcInvestorAccountField["SZBranchPBU"] = "string" +structDict['CSecurityFtdcInvestorAccountField'] = CSecurityFtdcInvestorAccountField + + +#用户IP +CSecurityFtdcUserIPField = {} +#经纪公司代码 +CSecurityFtdcUserIPField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcUserIPField["UserID"] = "string" +#IP地址 +CSecurityFtdcUserIPField["IPAddress"] = "string" +#IP地址掩码 +CSecurityFtdcUserIPField["IPMask"] = "string" +#Mac地址 +CSecurityFtdcUserIPField["MacAddress"] = "string" +structDict['CSecurityFtdcUserIPField'] = CSecurityFtdcUserIPField + + +#用户动态令牌参数 +CSecurityFtdcBrokerUserOTPParamField = {} +#经纪公司代码 +CSecurityFtdcBrokerUserOTPParamField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcBrokerUserOTPParamField["UserID"] = "string" +#动态令牌提供商 +CSecurityFtdcBrokerUserOTPParamField["OTPVendorsID"] = "string" +#动态令牌序列号 +CSecurityFtdcBrokerUserOTPParamField["SerialNumber"] = "string" +#令牌密钥 +CSecurityFtdcBrokerUserOTPParamField["AuthKey"] = "string" +#漂移值 +CSecurityFtdcBrokerUserOTPParamField["LastDrift"] = "int" +#成功值 +CSecurityFtdcBrokerUserOTPParamField["LastSuccess"] = "int" +#动态令牌类型 +CSecurityFtdcBrokerUserOTPParamField["OTPType"] = "string" +structDict['CSecurityFtdcBrokerUserOTPParamField'] = CSecurityFtdcBrokerUserOTPParamField + + +#用户登录请求 +CSecurityFtdcReqUserLoginField = {} +#交易日 +CSecurityFtdcReqUserLoginField["TradingDay"] = "string" +#经纪公司代码 +CSecurityFtdcReqUserLoginField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcReqUserLoginField["UserID"] = "string" +#密码 +CSecurityFtdcReqUserLoginField["Password"] = "string" +#用户端产品信息 +CSecurityFtdcReqUserLoginField["UserProductInfo"] = "string" +#接口端产品信息 +CSecurityFtdcReqUserLoginField["InterfaceProductInfo"] = "string" +#协议信息 +CSecurityFtdcReqUserLoginField["ProtocolInfo"] = "string" +#Mac地址 +CSecurityFtdcReqUserLoginField["MacAddress"] = "string" +#动态密码 +CSecurityFtdcReqUserLoginField["OneTimePassword"] = "string" +#终端IP地址 +CSecurityFtdcReqUserLoginField["ClientIPAddress"] = "string" +#客户端认证码 +CSecurityFtdcReqUserLoginField["AuthCode"] = "string" +structDict['CSecurityFtdcReqUserLoginField'] = CSecurityFtdcReqUserLoginField + + +#用户登录应答 +CSecurityFtdcRspUserLoginField = {} +#交易日 +CSecurityFtdcRspUserLoginField["TradingDay"] = "string" +#登录成功时间 +CSecurityFtdcRspUserLoginField["LoginTime"] = "string" +#经纪公司代码 +CSecurityFtdcRspUserLoginField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcRspUserLoginField["UserID"] = "string" +#交易系统名称 +CSecurityFtdcRspUserLoginField["SystemName"] = "string" +#前置编号 +CSecurityFtdcRspUserLoginField["FrontID"] = "int" +#会话编号 +CSecurityFtdcRspUserLoginField["SessionID"] = "int" +#最大报单引用 +CSecurityFtdcRspUserLoginField["MaxOrderRef"] = "string" +structDict['CSecurityFtdcRspUserLoginField'] = CSecurityFtdcRspUserLoginField + + +#用户登出请求 +CSecurityFtdcUserLogoutField = {} +#经纪公司代码 +CSecurityFtdcUserLogoutField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcUserLogoutField["UserID"] = "string" +structDict['CSecurityFtdcUserLogoutField'] = CSecurityFtdcUserLogoutField + + +#全部登出信息 +CSecurityFtdcLogoutAllField = {} +#前置编号 +CSecurityFtdcLogoutAllField["FrontID"] = "int" +#会话编号 +CSecurityFtdcLogoutAllField["SessionID"] = "int" +#系统名称 +CSecurityFtdcLogoutAllField["SystemName"] = "string" +structDict['CSecurityFtdcLogoutAllField'] = CSecurityFtdcLogoutAllField + + +#强制交易员退出 +CSecurityFtdcForceUserLogoutField = {} +#经纪公司代码 +CSecurityFtdcForceUserLogoutField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcForceUserLogoutField["UserID"] = "string" +structDict['CSecurityFtdcForceUserLogoutField'] = CSecurityFtdcForceUserLogoutField + + +#经纪公司用户激活 +CSecurityFtdcActivateBrokerUserField = {} +#经纪公司代码 +CSecurityFtdcActivateBrokerUserField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcActivateBrokerUserField["UserID"] = "string" +structDict['CSecurityFtdcActivateBrokerUserField'] = CSecurityFtdcActivateBrokerUserField + + +#输入报单 +CSecurityFtdcInputOrderField = {} +#经纪公司代码 +CSecurityFtdcInputOrderField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInputOrderField["InvestorID"] = "string" +#合约代码 +CSecurityFtdcInputOrderField["InstrumentID"] = "string" +#报单引用 +CSecurityFtdcInputOrderField["OrderRef"] = "string" +#用户代码 +CSecurityFtdcInputOrderField["UserID"] = "string" +#交易所代码 +CSecurityFtdcInputOrderField["ExchangeID"] = "string" +#报单价格条件 +CSecurityFtdcInputOrderField["OrderPriceType"] = "string" +#买卖方向 +CSecurityFtdcInputOrderField["Direction"] = "string" +#组合开平标志 +CSecurityFtdcInputOrderField["CombOffsetFlag"] = "string" +#组合投机套保标志 +CSecurityFtdcInputOrderField["CombHedgeFlag"] = "string" +#价格 +CSecurityFtdcInputOrderField["LimitPrice"] = "string" +#数量 +CSecurityFtdcInputOrderField["VolumeTotalOriginal"] = "int" +#有效期类型 +CSecurityFtdcInputOrderField["TimeCondition"] = "string" +#GTD日期 +CSecurityFtdcInputOrderField["GTDDate"] = "string" +#成交量类型 +CSecurityFtdcInputOrderField["VolumeCondition"] = "string" +#最小成交量 +CSecurityFtdcInputOrderField["MinVolume"] = "int" +#触发条件 +CSecurityFtdcInputOrderField["ContingentCondition"] = "string" +#止损价 +CSecurityFtdcInputOrderField["StopPrice"] = "float" +#强平原因 +CSecurityFtdcInputOrderField["ForceCloseReason"] = "string" +#自动挂起标志 +CSecurityFtdcInputOrderField["IsAutoSuspend"] = "int" +#业务单元 +CSecurityFtdcInputOrderField["BusinessUnit"] = "string" +#请求编号 +CSecurityFtdcInputOrderField["RequestID"] = "int" +#用户强评标志 +CSecurityFtdcInputOrderField["UserForceClose"] = "int" +structDict['CSecurityFtdcInputOrderField'] = CSecurityFtdcInputOrderField + + +#输入报单操作 +CSecurityFtdcInputOrderActionField = {} +#经纪公司代码 +CSecurityFtdcInputOrderActionField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInputOrderActionField["InvestorID"] = "string" +#报单操作引用 +CSecurityFtdcInputOrderActionField["OrderActionRef"] = "int" +#报单引用 +CSecurityFtdcInputOrderActionField["OrderRef"] = "string" +#请求编号 +CSecurityFtdcInputOrderActionField["RequestID"] = "int" +#前置编号 +CSecurityFtdcInputOrderActionField["FrontID"] = "int" +#会话编号 +CSecurityFtdcInputOrderActionField["SessionID"] = "int" +#交易所代码 +CSecurityFtdcInputOrderActionField["ExchangeID"] = "string" +#操作标志 +CSecurityFtdcInputOrderActionField["ActionFlag"] = "string" +#价格 +CSecurityFtdcInputOrderActionField["LimitPrice"] = "float" +#数量变化 +CSecurityFtdcInputOrderActionField["VolumeChange"] = "int" +#用户代码 +CSecurityFtdcInputOrderActionField["UserID"] = "string" +#合约代码 +CSecurityFtdcInputOrderActionField["InstrumentID"] = "string" +#交易所交易员代码 +CSecurityFtdcInputOrderActionField["BranchPBU"] = "string" +#本地报单编号 +CSecurityFtdcInputOrderActionField["OrderLocalID"] = "string" +structDict['CSecurityFtdcInputOrderActionField'] = CSecurityFtdcInputOrderActionField + + +#指定的合约 +CSecurityFtdcSpecificInstrumentField = {} +#合约代码 +CSecurityFtdcSpecificInstrumentField["InstrumentID"] = "string" +#交易所代码 +CSecurityFtdcSpecificInstrumentField["ExchangeID"] = "string" +structDict['CSecurityFtdcSpecificInstrumentField'] = CSecurityFtdcSpecificInstrumentField + + +#指定的交易所 +CSecurityFtdcSpecificExchangeField = {} +#交易所代码 +CSecurityFtdcSpecificExchangeField["ExchangeID"] = "string" +structDict['CSecurityFtdcSpecificExchangeField'] = CSecurityFtdcSpecificExchangeField + + +#行情基础属性 +CSecurityFtdcMarketDataBaseField = {} +#交易日 +CSecurityFtdcMarketDataBaseField["TradingDay"] = "string" +#上次结算价 +CSecurityFtdcMarketDataBaseField["PreSettlementPrice"] = "float" +#昨收盘 +CSecurityFtdcMarketDataBaseField["PreClosePrice"] = "float" +#昨持仓量 +CSecurityFtdcMarketDataBaseField["PreOpenInterest"] = "float" +#昨虚实度 +CSecurityFtdcMarketDataBaseField["PreDelta"] = "float" +structDict['CSecurityFtdcMarketDataBaseField'] = CSecurityFtdcMarketDataBaseField + + +#行情静态属性 +CSecurityFtdcMarketDataStaticField = {} +#今开盘 +CSecurityFtdcMarketDataStaticField["OpenPrice"] = "float" +#最高价 +CSecurityFtdcMarketDataStaticField["HighestPrice"] = "float" +#最低价 +CSecurityFtdcMarketDataStaticField["LowestPrice"] = "float" +#今收盘 +CSecurityFtdcMarketDataStaticField["ClosePrice"] = "float" +#涨停板价 +CSecurityFtdcMarketDataStaticField["UpperLimitPrice"] = "float" +#跌停板价 +CSecurityFtdcMarketDataStaticField["LowerLimitPrice"] = "float" +#本次结算价 +CSecurityFtdcMarketDataStaticField["SettlementPrice"] = "float" +#今虚实度 +CSecurityFtdcMarketDataStaticField["CurrDelta"] = "float" +structDict['CSecurityFtdcMarketDataStaticField'] = CSecurityFtdcMarketDataStaticField + + +#行情最新成交属性 +CSecurityFtdcMarketDataLastMatchField = {} +#最新价 +CSecurityFtdcMarketDataLastMatchField["LastPrice"] = "float" +#数量 +CSecurityFtdcMarketDataLastMatchField["Volume"] = "int" +#成交金额 +CSecurityFtdcMarketDataLastMatchField["Turnover"] = "float" +#持仓量 +CSecurityFtdcMarketDataLastMatchField["OpenInterest"] = "float" +structDict['CSecurityFtdcMarketDataLastMatchField'] = CSecurityFtdcMarketDataLastMatchField + + +#行情最优价属性 +CSecurityFtdcMarketDataBestPriceField = {} +#申买价一 +CSecurityFtdcMarketDataBestPriceField["BidPrice1"] = "float" +#申买量一 +CSecurityFtdcMarketDataBestPriceField["BidVolume1"] = "int" +#申卖价一 +CSecurityFtdcMarketDataBestPriceField["AskPrice1"] = "float" +#申卖量一 +CSecurityFtdcMarketDataBestPriceField["AskVolume1"] = "int" +structDict['CSecurityFtdcMarketDataBestPriceField'] = CSecurityFtdcMarketDataBestPriceField + + +#行情申买二、三属性 +CSecurityFtdcMarketDataBid23Field = {} +#申买价二 +CSecurityFtdcMarketDataBid23Field["BidPrice2"] = "float" +#申买量二 +CSecurityFtdcMarketDataBid23Field["BidVolume2"] = "int" +#申买价三 +CSecurityFtdcMarketDataBid23Field["BidPrice3"] = "float" +#申买量三 +CSecurityFtdcMarketDataBid23Field["BidVolume3"] = "int" +structDict['CSecurityFtdcMarketDataBid23Field'] = CSecurityFtdcMarketDataBid23Field + + +#行情申卖二、三属性 +CSecurityFtdcMarketDataAsk23Field = {} +#申卖价二 +CSecurityFtdcMarketDataAsk23Field["AskPrice2"] = "float" +#申卖量二 +CSecurityFtdcMarketDataAsk23Field["AskVolume2"] = "int" +#申卖价三 +CSecurityFtdcMarketDataAsk23Field["AskPrice3"] = "float" +#申卖量三 +CSecurityFtdcMarketDataAsk23Field["AskVolume3"] = "int" +structDict['CSecurityFtdcMarketDataAsk23Field'] = CSecurityFtdcMarketDataAsk23Field + + +#行情申买四、五属性 +CSecurityFtdcMarketDataBid45Field = {} +#申买价四 +CSecurityFtdcMarketDataBid45Field["BidPrice4"] = "float" +#申买量四 +CSecurityFtdcMarketDataBid45Field["BidVolume4"] = "int" +#申买价五 +CSecurityFtdcMarketDataBid45Field["BidPrice5"] = "float" +#申买量五 +CSecurityFtdcMarketDataBid45Field["BidVolume5"] = "int" +structDict['CSecurityFtdcMarketDataBid45Field'] = CSecurityFtdcMarketDataBid45Field + + +#行情申卖四、五属性 +CSecurityFtdcMarketDataAsk45Field = {} +#申卖价四 +CSecurityFtdcMarketDataAsk45Field["AskPrice4"] = "float" +#申卖量四 +CSecurityFtdcMarketDataAsk45Field["AskVolume4"] = "int" +#申卖价五 +CSecurityFtdcMarketDataAsk45Field["AskPrice5"] = "float" +#申卖量五 +CSecurityFtdcMarketDataAsk45Field["AskVolume5"] = "int" +structDict['CSecurityFtdcMarketDataAsk45Field'] = CSecurityFtdcMarketDataAsk45Field + + +#行情更新时间属性 +CSecurityFtdcMarketDataUpdateTimeField = {} +#合约代码 +CSecurityFtdcMarketDataUpdateTimeField["InstrumentID"] = "string" +#最后修改时间 +CSecurityFtdcMarketDataUpdateTimeField["UpdateTime"] = "string" +#最后修改毫秒 +CSecurityFtdcMarketDataUpdateTimeField["UpdateMillisec"] = "int" +#业务日期 +CSecurityFtdcMarketDataUpdateTimeField["ActionDay"] = "string" +structDict['CSecurityFtdcMarketDataUpdateTimeField'] = CSecurityFtdcMarketDataUpdateTimeField + + +#成交均价 +CSecurityFtdcMarketDataAveragePriceField = {} +#当日均价 +CSecurityFtdcMarketDataAveragePriceField["AveragePrice"] = "float" +structDict['CSecurityFtdcMarketDataAveragePriceField'] = CSecurityFtdcMarketDataAveragePriceField + + +#行情交易所代码属性 +CSecurityFtdcMarketDataExchangeField = {} +#交易所代码 +CSecurityFtdcMarketDataExchangeField["ExchangeID"] = "string" +structDict['CSecurityFtdcMarketDataExchangeField'] = CSecurityFtdcMarketDataExchangeField + + +#信息分发 +CSecurityFtdcDisseminationField = {} +#序列系列号 +CSecurityFtdcDisseminationField["SequenceSeries"] = "int" +#序列号 +CSecurityFtdcDisseminationField["SequenceNo"] = "int" +structDict['CSecurityFtdcDisseminationField'] = CSecurityFtdcDisseminationField + + +#资金转账输入 +CSecurityFtdcInputFundTransferField = {} +#经纪公司代码 +CSecurityFtdcInputFundTransferField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcInputFundTransferField["InvestorID"] = "string" +#投资者资金帐号 +CSecurityFtdcInputFundTransferField["AccountID"] = "string" +#资金帐户密码 +CSecurityFtdcInputFundTransferField["Password"] = "string" +#用户代码 +CSecurityFtdcInputFundTransferField["UserID"] = "string" +#交易金额 +CSecurityFtdcInputFundTransferField["TradeAmount"] = "float" +#摘要 +CSecurityFtdcInputFundTransferField["Digest"] = "string" +#账户类型 +CSecurityFtdcInputFundTransferField["AccountType"] = "string" +structDict['CSecurityFtdcInputFundTransferField'] = CSecurityFtdcInputFundTransferField + + +#资金转账 +CSecurityFtdcFundTransferField = {} +#经纪公司代码 +CSecurityFtdcFundTransferField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcFundTransferField["InvestorID"] = "string" +#投资者资金帐号 +CSecurityFtdcFundTransferField["AccountID"] = "string" +#资金帐户密码 +CSecurityFtdcFundTransferField["Password"] = "string" +#用户代码 +CSecurityFtdcFundTransferField["UserID"] = "string" +#交易金额 +CSecurityFtdcFundTransferField["TradeAmount"] = "float" +#摘要 +CSecurityFtdcFundTransferField["Digest"] = "string" +#会话编号 +CSecurityFtdcFundTransferField["SessionID"] = "int" +#Liber核心流水号 +CSecurityFtdcFundTransferField["LiberSerial"] = "int" +#转账平台流水号 +CSecurityFtdcFundTransferField["PlateSerial"] = "int" +#第三方流水号 +CSecurityFtdcFundTransferField["TransferSerial"] = "string" +#交易日 +CSecurityFtdcFundTransferField["TradingDay"] = "string" +#转账时间 +CSecurityFtdcFundTransferField["TradeTime"] = "string" +#出入金方向 +CSecurityFtdcFundTransferField["FundDirection"] = "string" +#错误代码 +CSecurityFtdcFundTransferField["ErrorID"] = "int" +#错误信息 +CSecurityFtdcFundTransferField["ErrorMsg"] = "string" +structDict['CSecurityFtdcFundTransferField'] = CSecurityFtdcFundTransferField + + +#资金转账查询请求 +CSecurityFtdcQryFundTransferSerialField = {} +#经纪公司代码 +CSecurityFtdcQryFundTransferSerialField["BrokerID"] = "string" +#投资者资金帐号 +CSecurityFtdcQryFundTransferSerialField["AccountID"] = "string" +#账户类型 +CSecurityFtdcQryFundTransferSerialField["AccountType"] = "string" +structDict['CSecurityFtdcQryFundTransferSerialField'] = CSecurityFtdcQryFundTransferSerialField + + +#资金内转 +CSecurityFtdcFundInterTransferField = {} +#经纪公司代码 +CSecurityFtdcFundInterTransferField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcFundInterTransferField["InvestorID"] = "string" +#用户代码 +CSecurityFtdcFundInterTransferField["UserID"] = "string" +#资金账户代码 +CSecurityFtdcFundInterTransferField["AccountID"] = "string" +#资金账户密码 +CSecurityFtdcFundInterTransferField["Password"] = "string" +#金额 +CSecurityFtdcFundInterTransferField["TradeAmount"] = "float" +#内转类型 +CSecurityFtdcFundInterTransferField["TransferType"] = "string" +#资金内转编号 +CSecurityFtdcFundInterTransferField["SerialID"] = "int" +structDict['CSecurityFtdcFundInterTransferField'] = CSecurityFtdcFundInterTransferField + + +#资金内转流水 +CSecurityFtdcFundInterTransferSerialField = {} +#经纪公司代码 +CSecurityFtdcFundInterTransferSerialField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcFundInterTransferSerialField["InvestorID"] = "string" +#用户代码 +CSecurityFtdcFundInterTransferSerialField["UserID"] = "string" +#资金账户代码 +CSecurityFtdcFundInterTransferSerialField["AccountID"] = "string" +#资金账户密码 +CSecurityFtdcFundInterTransferSerialField["Password"] = "string" +#金额 +CSecurityFtdcFundInterTransferSerialField["TradeAmount"] = "float" +#内转类型 +CSecurityFtdcFundInterTransferSerialField["TransferType"] = "string" +#资金内转编号 +CSecurityFtdcFundInterTransferSerialField["SerialID"] = "int" +#转账时间 +CSecurityFtdcFundInterTransferSerialField["TransferTime"] = "string" +#错误代码 +CSecurityFtdcFundInterTransferSerialField["ErrorID"] = "int" +#错误信息 +CSecurityFtdcFundInterTransferSerialField["ErrorMsg"] = "string" +structDict['CSecurityFtdcFundInterTransferSerialField'] = CSecurityFtdcFundInterTransferSerialField + + +#资金内转流水查询请求 +CSecurityFtdcQryFundInterTransferSerialField = {} +#经纪公司代码 +CSecurityFtdcQryFundInterTransferSerialField["BrokerID"] = "string" +#投资者代码 +CSecurityFtdcQryFundInterTransferSerialField["InvestorID"] = "string" +structDict['CSecurityFtdcQryFundInterTransferSerialField'] = CSecurityFtdcQryFundInterTransferSerialField + + +#获取数据库信息 +CSecurityFtdcFetchDBInfoField = {} +#用户代码 +CSecurityFtdcFetchDBInfoField["UserID"] = "string" +#密码 +CSecurityFtdcFetchDBInfoField["Password"] = "string" +#数据库索引 +CSecurityFtdcFetchDBInfoField["DBIndex"] = "string" +#数据库IP地址 +CSecurityFtdcFetchDBInfoField["IPAddress"] = "string" +#数据库IP端口 +CSecurityFtdcFetchDBInfoField["IPPort"] = "int" +#数据库名称 +CSecurityFtdcFetchDBInfoField["DBName"] = "string" +#数据库用户名 +CSecurityFtdcFetchDBInfoField["DBUserID"] = "string" +#数据库密码 +CSecurityFtdcFetchDBInfoField["DBPassword"] = "string" +structDict['CSecurityFtdcFetchDBInfoField'] = CSecurityFtdcFetchDBInfoField + + +#MD用户信息 +CSecurityFtdcMDUserInfoField = {} +#经纪公司代码 +CSecurityFtdcMDUserInfoField["BrokerID"] = "string" +#用户代码 +CSecurityFtdcMDUserInfoField["UserID"] = "string" +#用户名称 +CSecurityFtdcMDUserInfoField["UserName"] = "string" +#密码 +CSecurityFtdcMDUserInfoField["Password"] = "string" +#行情系统编号 +CSecurityFtdcMDUserInfoField["MDSysID"] = "int" +structDict['CSecurityFtdcMDUserInfoField'] = CSecurityFtdcMDUserInfoField + + + + diff --git a/vn.lts/pyscript/lts_td_define.cpp b/vn.lts/pyscript/lts_td_define.cpp new file mode 100644 index 00000000..98cfda7c --- /dev/null +++ b/vn.lts/pyscript/lts_td_define.cpp @@ -0,0 +1,39 @@ +#define ONFRONTCONNECTED 1 +#define ONFRONTDISCONNECTED 2 +#define ONHEARTBEATWARNING 3 +#define ONRSPERROR 4 +#define ONRSPUSERLOGIN 5 +#define ONRSPUSERLOGOUT 6 +#define ONRSPORDERINSERT 7 +#define ONRSPORDERACTION 8 +#define ONRSPUSERPASSWORDUPDATE 9 +#define ONRSPTRADINGACCOUNTPASSWORDUPDATE 10 +#define ONRSPQRYEXCHANGE 11 +#define ONRSPQRYINSTRUMENT 12 +#define ONRSPQRYINVESTOR 13 +#define ONRSPQRYTRADINGCODE 14 +#define ONRSPQRYTRADINGACCOUNT 15 +#define ONRSPQRYDEPTHMARKETDATA 16 +#define ONRSPQRYBONDINTEREST 17 +#define ONRSPQRYMARKETRATIONINFO 18 +#define ONRSPQRYINSTRUMENTCOMMISSIONRATE 19 +#define ONRSPQRYETFINSTRUMENT 20 +#define ONRSPQRYETFBASKET 21 +#define ONRSPQRYOFINSTRUMENT 22 +#define ONRSPQRYSFINSTRUMENT 23 +#define ONRSPQRYORDER 24 +#define ONRSPQRYTRADE 25 +#define ONRSPQRYINVESTORPOSITION 26 +#define ONRTNORDER 27 +#define ONRTNTRADE 28 +#define ONERRRTNORDERINSERT 29 +#define ONERRRTNORDERACTION 30 +#define ONRSPFUNDOUTBYLIBER 31 +#define ONRTNFUNDOUTBYLIBER 32 +#define ONERRRTNFUNDOUTBYLIBER 33 +#define ONRTNFUNDINBYBANK 34 +#define ONRSPQRYFUNDTRANSFERSERIAL 35 +#define ONRSPFUNDINTERTRANSFER 36 +#define ONRSPQRYFUNDINTERTRANSFERSERIAL 37 +#define ONRTNFUNDINTERTRANSFERSERIAL 38 +#define ONERRRTNFUNDINTERTRANSFER 39 diff --git a/vn.lts/pyscript/lts_td_function.cpp b/vn.lts/pyscript/lts_td_function.cpp new file mode 100644 index 00000000..665fcd11 --- /dev/null +++ b/vn.lts/pyscript/lts_td_function.cpp @@ -0,0 +1,338 @@ +ReqUserLogin +{ + CSecurityFtdcReqUserLoginField myreq = CSecurityFtdcReqUserLoginField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "MacAddress", myreq.MacAddress); + 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); + int i = this->api->ReqUserLogin(&myreq, nRequestID); + return i; +}; + +ReqUserLogout +{ + 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; +}; + +ReqOrderInsert +{ + CSecurityFtdcInputOrderField myreq = CSecurityFtdcInputOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "ContingentCondition", myreq.ContingentCondition); + getChar(req, "CombOffsetFlag", myreq.CombOffsetFlag); + getChar(req, "UserID", myreq.UserID); + getChar(req, "LimitPrice", myreq.LimitPrice); + getInt(req, "UserForceClose", &myreq.UserForceClose); + getChar(req, "Direction", myreq.Direction); + getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal); + getChar(req, "OrderPriceType", myreq.OrderPriceType); + getChar(req, "TimeCondition", myreq.TimeCondition); + getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); + getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); + getChar(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "ExchangeID", myreq.ExchangeID); + getInt(req, "MinVolume", &myreq.MinVolume); + getChar(req, "ForceCloseReason", myreq.ForceCloseReason); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "CombHedgeFlag", myreq.CombHedgeFlag); + getChar(req, "GTDDate", myreq.GTDDate); + getChar(req, "BusinessUnit", myreq.BusinessUnit); + getChar(req, "OrderRef", myreq.OrderRef); + getChar(req, "InvestorID", myreq.InvestorID); + getChar(req, "VolumeCondition", myreq.VolumeCondition); + getInt(req, "RequestID", &myreq.RequestID); + int i = this->api->ReqOrderInsert(&myreq, nRequestID); + return i; +}; + +ReqOrderAction +{ + CSecurityFtdcInputOrderActionField myreq = CSecurityFtdcInputOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "OrderLocalID", myreq.OrderLocalID); + getInt(req, "OrderActionRef", &myreq.OrderActionRef); + getChar(req, "UserID", myreq.UserID); + getChar(req, "UserID", myreq.UserID); + getChar(req, "OrderRef", myreq.OrderRef); + getChar(req, "InvestorID", myreq.InvestorID); + getInt(req, "SessionID", &myreq.SessionID); + getInt(req, "VolumeChange", &myreq.VolumeChange); + getChar(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "ActionFlag", myreq.ActionFlag); + getInt(req, "FrontID", &myreq.FrontID); + getChar(req, "BranchPBU", myreq.BranchPBU); + int i = this->api->ReqOrderAction(&myreq, nRequestID); + return i; +}; + +ReqUserPasswordUpdate +{ + CSecurityFtdcUserPasswordUpdateField myreq = CSecurityFtdcUserPasswordUpdateField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "UserID", myreq.UserID); + getChar(req, "NewPassword", myreq.NewPassword); + getChar(req, "OldPassword", myreq.OldPassword); + getChar(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqUserPasswordUpdate(&myreq, nRequestID); + return i; +}; + +ReqTradingAccountPasswordUpdate +{ + CSecurityFtdcTradingAccountPasswordUpdateField myreq = CSecurityFtdcTradingAccountPasswordUpdateField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "NewPassword", myreq.NewPassword); + getChar(req, "OldPassword", myreq.OldPassword); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "AccountID", myreq.AccountID); + int i = this->api->ReqTradingAccountPasswordUpdate(&myreq, nRequestID); + return i; +}; + +ReqQryExchange +{ + CSecurityFtdcQryExchangeField myreq = CSecurityFtdcQryExchangeField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "ExchangeID", myreq.ExchangeID); + int i = this->api->ReqQryExchange(&myreq, nRequestID); + return i; +}; + +ReqQryInstrument +{ + 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; +}; + +ReqQryInvestor +{ + 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; +}; + +ReqQryTradingCode +{ + 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; +}; + +ReqQryTradingAccount +{ + 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; +}; + +ReqQryDepthMarketData +{ + CSecurityFtdcQryDepthMarketDataField myreq = CSecurityFtdcQryDepthMarketDataField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "InstrumentID", myreq.InstrumentID); + int i = this->api->ReqQryDepthMarketData(&myreq, nRequestID); + return i; +}; + +ReqQryBondInterest +{ + 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; +}; + +ReqQryMarketRationInfo +{ + 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; +}; + +ReqQryInstrumentCommissionRate +{ + 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; +}; + +ReqQryETFInstrument +{ + 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; +}; + +ReqQryETFBasket +{ + 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; +}; + +ReqQryOFInstrument +{ + 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; +}; + +ReqQrySFInstrument +{ + 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; +}; + +ReqQryOrder +{ + 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; +}; + +ReqQryTrade +{ + 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; +}; + +ReqQryInvestorPosition +{ + 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; +}; + +ReqFundOutByLiber +{ + CSecurityFtdcInputFundTransferField myreq = CSecurityFtdcInputFundTransferField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "UserID", myreq.UserID); + getChar(req, "InvestorID", myreq.InvestorID); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "AccountType", myreq.AccountType); + getChar(req, "Password", myreq.Password); + getChar(req, "Password", myreq.Password); + getChar(req, "Digest", myreq.Digest); + getChar(req, "AccountID", myreq.AccountID); + int i = this->api->ReqFundOutByLiber(&myreq, nRequestID); + return i; +}; + +ReqQryFundTransferSerial +{ + 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; +}; + +ReqFundInterTransfer +{ + CSecurityFtdcFundInterTransferField myreq = CSecurityFtdcFundInterTransferField(); + memset(&myreq, 0, sizeof(myreq)); + getInt(req, "SerialID", &myreq.SerialID); + getChar(req, "TransferType", myreq.TransferType); + getChar(req, "UserID", myreq.UserID); + getChar(req, "InvestorID", myreq.InvestorID); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "Password", myreq.Password); + getChar(req, "Password", myreq.Password); + getChar(req, "AccountID", myreq.AccountID); + int i = this->api->ReqFundInterTransfer(&myreq, nRequestID); + return i; +}; + +ReqQryFundInterTransferSerial +{ + 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; +}; + diff --git a/vn.lts/pyscript/lts_td_process.cpp b/vn.lts/pyscript/lts_td_process.cpp new file mode 100644 index 00000000..5475e37d --- /dev/null +++ b/vn.lts/pyscript/lts_td_process.cpp @@ -0,0 +1,1092 @@ +void TdApi::processFrontConnected(Task task) +{ + this->onFrontConnected(); +}; + +void TdApi::processFrontDisconnected(Task task) +{ + this->onFrontDisconnected(task.task_id); +}; + +void TdApi::processHeartBeatWarning(Task task) +{ + this->onHeartBeatWarning(task.task_id); +}; + +void TdApi::processRspError(Task task) +{ + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspError(error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserLogin(Task task) +{ + CSecurityFtdcRspUserLoginField task_data = any_cast(task.task_data); + dict data; + data["MaxOrderRef"] = task_data.MaxOrderRef; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["SessionID"] = task_data.SessionID; + data["SystemName"] = task_data.SystemName; + data["FrontID"] = task_data.FrontID; + data["BrokerID"] = task_data.BrokerID; + data["LoginTime"] = task_data.LoginTime; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogin(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserLogout(Task task) +{ + CSecurityFtdcUserLogoutField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogout(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspOrderInsert(Task task) +{ + CSecurityFtdcInputOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["Direction"] = task_data.Direction; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["TimeCondition"] = task_data.TimeCondition; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["BrokerID"] = task_data.BrokerID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["GTDDate"] = task_data.GTDDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspOrderInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspOrderAction(Task task) +{ + CSecurityFtdcInputOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["OrderLocalID"] = task_data.OrderLocalID; + data["OrderActionRef"] = task_data.OrderActionRef; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["VolumeChange"] = task_data.VolumeChange; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ActionFlag"] = task_data.ActionFlag; + data["FrontID"] = task_data.FrontID; + data["BranchPBU"] = task_data.BranchPBU; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspOrderAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserPasswordUpdate(Task task) +{ + CSecurityFtdcUserPasswordUpdateField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["NewPassword"] = task_data.NewPassword; + data["OldPassword"] = task_data.OldPassword; + data["BrokerID"] = task_data.BrokerID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserPasswordUpdate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspTradingAccountPasswordUpdate(Task task) +{ + CSecurityFtdcTradingAccountPasswordUpdateField task_data = any_cast(task.task_data); + dict data; + data["NewPassword"] = task_data.NewPassword; + data["OldPassword"] = task_data.OldPassword; + data["BrokerID"] = task_data.BrokerID; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspTradingAccountPasswordUpdate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExchange(Task task) +{ + CSecurityFtdcExchangeField task_data = any_cast(task.task_data); + dict data; + data["ExchangeProperty"] = task_data.ExchangeProperty; + data["ExchangeID"] = task_data.ExchangeID; + data["ExchangeName"] = task_data.ExchangeName; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExchange(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInstrument(Task task) +{ + CSecurityFtdcInstrumentField task_data = any_cast(task.task_data); + dict data; + data["IsTrading"] = task_data.IsTrading; + data["ExpireDate"] = task_data.ExpireDate; + data["UnitMargin"] = task_data.UnitMargin; + data["OrderCanBeWithdraw"] = task_data.OrderCanBeWithdraw; + data["PositionType"] = task_data.PositionType; + data["ProductClass"] = task_data.ProductClass; + data["MinSellVolume"] = task_data.MinSellVolume; + data["InstrumentName"] = task_data.InstrumentName; + data["ExecPrice"] = task_data.ExecPrice; + data["RightModelID"] = task_data.RightModelID; + data["VolumeMultiple"] = task_data.VolumeMultiple; + data["DeliveryYear"] = task_data.DeliveryYear; + data["OptionsMarginParam2"] = task_data.OptionsMarginParam2; + data["OptionsMarginParam1"] = task_data.OptionsMarginParam1; + data["PosTradeType"] = task_data.PosTradeType; + data["CreateDate"] = task_data.CreateDate; + data["InstrumentID"] = task_data.InstrumentID; + data["MaxLimitOrderVolume"] = task_data.MaxLimitOrderVolume; + data["ExchangeID"] = task_data.ExchangeID; + data["MinLimitOrderVolume"] = task_data.MinLimitOrderVolume; + data["MaxMarketOrderVolume"] = task_data.MaxMarketOrderVolume; + data["StartDelivDate"] = task_data.StartDelivDate; + data["InstrumentType"] = task_data.InstrumentType; + data["DeliveryMonth"] = task_data.DeliveryMonth; + data["MinBuyVolume"] = task_data.MinBuyVolume; + data["PriceTick"] = task_data.PriceTick; + data["InstLifePhase"] = task_data.InstLifePhase; + data["MarketID"] = task_data.MarketID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["MinMarketOrderVolume"] = task_data.MinMarketOrderVolume; + data["EndDelivDate"] = task_data.EndDelivDate; + data["OpenDate"] = task_data.OpenDate; + data["ProductID"] = task_data.ProductID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestor(Task task) +{ + CSecurityFtdcInvestorField task_data = any_cast(task.task_data); + dict data; + data["SZBranchID"] = task_data.SZBranchID; + data["InvestorName"] = task_data.InvestorName; + data["SHBranchID"] = task_data.SHBranchID; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["InvestorGroupID"] = task_data.InvestorGroupID; + data["SettleSystemType"] = task_data.SettleSystemType; + data["InvestorLevel"] = task_data.InvestorLevel; + data["IsActive"] = task_data.IsActive; + data["IdentifiedCardType"] = task_data.IdentifiedCardType; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestor(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTradingCode(Task task) +{ + CSecurityFtdcTradingCodeField task_data = any_cast(task.task_data); + dict data; + data["PBU"] = task_data.PBU; + data["ExchangeID"] = task_data.ExchangeID; + data["ClientType"] = task_data.ClientType; + data["ClientID"] = task_data.ClientID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["IsActive"] = task_data.IsActive; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTradingCode(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTradingAccount(Task task) +{ + CSecurityFtdcTradingAccountField task_data = any_cast(task.task_data); + dict data; + data["MarginTradeAmount"] = task_data.MarginTradeAmount; + data["FrozenTransferFee"] = task_data.FrozenTransferFee; + data["Mortgage"] = task_data.Mortgage; + data["ExchangeDeliveryMargin"] = task_data.ExchangeDeliveryMargin; + data["FrozenMargin"] = task_data.FrozenMargin; + data["WithdrawQuota"] = task_data.WithdrawQuota; + data["TransferFee"] = task_data.TransferFee; + data["Commission"] = task_data.Commission; + data["Interest"] = task_data.Interest; + data["ShortSellProfit"] = task_data.ShortSellProfit; + data["FrozenExecCash"] = task_data.FrozenExecCash; + data["CashIn"] = task_data.CashIn; + data["AccountID"] = task_data.AccountID; + data["Available"] = task_data.Available; + data["PreCredit"] = task_data.PreCredit; + data["PreMortgage"] = task_data.PreMortgage; + data["CreditRatio"] = task_data.CreditRatio; + data["CreditAmount"] = task_data.CreditAmount; + data["InterestBase"] = task_data.InterestBase; + data["ExchangeMargin"] = task_data.ExchangeMargin; + data["ConversionAmount"] = task_data.ConversionAmount; + data["SSStockValue"] = task_data.SSStockValue; + data["ShortSellAmount"] = task_data.ShortSellAmount; + data["PreMargin"] = task_data.PreMargin; + data["CurrencyCode"] = task_data.CurrencyCode; + data["DeliveryMargin"] = task_data.DeliveryMargin; + data["BondRepurchaseAmount"] = task_data.BondRepurchaseAmount; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["FrozenCash"] = task_data.FrozenCash; + data["Withdraw"] = task_data.Withdraw; + data["ReverseRepurchaseAmount"] = task_data.ReverseRepurchaseAmount; + data["StampTax"] = task_data.StampTax; + data["Balance"] = task_data.Balance; + data["FrozenStampTax"] = task_data.FrozenStampTax; + data["Reserve"] = task_data.Reserve; + data["PreDeposit"] = task_data.PreDeposit; + data["MarginTradeProfit"] = task_data.MarginTradeProfit; + data["Credit"] = task_data.Credit; + data["PreBalance"] = task_data.PreBalance; + data["CurrMargin"] = task_data.CurrMargin; + data["FrozenCommission"] = task_data.FrozenCommission; + data["AccountType"] = task_data.AccountType; + data["StockValue"] = task_data.StockValue; + data["Deposit"] = task_data.Deposit; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTradingAccount(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryDepthMarketData(Task task) +{ + CSecurityFtdcDepthMarketDataField task_data = any_cast(task.task_data); + dict data; + data["HighestPrice"] = task_data.HighestPrice; + data["BidPrice5"] = task_data.BidPrice5; + data["BidPrice4"] = task_data.BidPrice4; + data["BidPrice1"] = task_data.BidPrice1; + data["BidPrice3"] = task_data.BidPrice3; + data["BidPrice2"] = task_data.BidPrice2; + data["LowerLimitPrice"] = task_data.LowerLimitPrice; + data["OpenPrice"] = task_data.OpenPrice; + data["AskPrice5"] = task_data.AskPrice5; + data["AskPrice4"] = task_data.AskPrice4; + data["AskPrice3"] = task_data.AskPrice3; + data["PreClosePrice"] = task_data.PreClosePrice; + data["AskPrice1"] = task_data.AskPrice1; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["AskVolume1"] = task_data.AskVolume1; + data["UpdateTime"] = task_data.UpdateTime; + data["UpdateMillisec"] = task_data.UpdateMillisec; + data["AveragePrice"] = task_data.AveragePrice; + data["BidVolume5"] = task_data.BidVolume5; + data["BidVolume4"] = task_data.BidVolume4; + data["BidVolume3"] = task_data.BidVolume3; + data["BidVolume2"] = task_data.BidVolume2; + data["PreOpenInterest"] = task_data.PreOpenInterest; + data["AskPrice2"] = task_data.AskPrice2; + data["Volume"] = task_data.Volume; + data["AskVolume3"] = task_data.AskVolume3; + data["AskVolume2"] = task_data.AskVolume2; + data["AskVolume5"] = task_data.AskVolume5; + data["AskVolume4"] = task_data.AskVolume4; + data["UpperLimitPrice"] = task_data.UpperLimitPrice; + data["BidVolume1"] = task_data.BidVolume1; + data["InstrumentID"] = task_data.InstrumentID; + data["ClosePrice"] = task_data.ClosePrice; + data["ExchangeID"] = task_data.ExchangeID; + data["TradingDay"] = task_data.TradingDay; + data["PreDelta"] = task_data.PreDelta; + data["OpenInterest"] = task_data.OpenInterest; + data["CurrDelta"] = task_data.CurrDelta; + data["Turnover"] = task_data.Turnover; + data["LastPrice"] = task_data.LastPrice; + data["SettlementPrice"] = task_data.SettlementPrice; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["LowestPrice"] = task_data.LowestPrice; + data["ActionDay"] = task_data.ActionDay; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryDepthMarketData(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryBondInterest(Task task) +{ + CSecurityFtdcBondInterestField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["TradingDay"] = task_data.TradingDay; + data["ExchangeID"] = task_data.ExchangeID; + data["Interest"] = task_data.Interest; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryBondInterest(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryMarketRationInfo(Task task) +{ + CSecurityFtdcMarketRationInfoField task_data = any_cast(task.task_data); + dict data; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeID"] = task_data.ExchangeID; + data["BrokerID"] = task_data.BrokerID; + data["RationVolume"] = task_data.RationVolume; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryMarketRationInfo(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInstrumentCommissionRate(Task task) +{ + CSecurityFtdcInstrumentCommissionRateField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["TradeFeeByMoney"] = task_data.TradeFeeByMoney; + data["Direction"] = task_data.Direction; + data["MinTradeFee"] = task_data.MinTradeFee; + data["StampTaxRateByMoney"] = task_data.StampTaxRateByMoney; + data["InvestorID"] = task_data.InvestorID; + data["MarginByMoney"] = task_data.MarginByMoney; + data["StampTaxRateByVolume"] = task_data.StampTaxRateByVolume; + data["BrokerID"] = task_data.BrokerID; + data["InvestorRange"] = task_data.InvestorRange; + data["TransferFeeRateByVolume"] = task_data.TransferFeeRateByVolume; + data["TransferFeeRateByMoney"] = task_data.TransferFeeRateByMoney; + data["TradeFeeByVolume"] = task_data.TradeFeeByVolume; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInstrumentCommissionRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryETFInstrument(Task task) +{ + CSecurityFtdcETFInstrumentField task_data = any_cast(task.task_data); + dict data; + data["ETFInstrumentID"] = task_data.ETFInstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["ETFPurRedInstrumentID"] = task_data.ETFPurRedInstrumentID; + data["EstimateCashComponent"] = task_data.EstimateCashComponent; + data["CreationRedemptionUnit"] = task_data.CreationRedemptionUnit; + data["Maxcashratio"] = task_data.Maxcashratio; + data["Creationredemption"] = task_data.Creationredemption; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryETFInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryETFBasket(Task task) +{ + CSecurityFtdcETFBasketField task_data = any_cast(task.task_data); + dict data; + data["ETFInstrumentID"] = task_data.ETFInstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["Premium"] = task_data.Premium; + data["StockInstrumentName"] = task_data.StockInstrumentName; + data["CurrenceReplaceStatus"] = task_data.CurrenceReplaceStatus; + data["Volume"] = task_data.Volume; + data["Amount"] = task_data.Amount; + data["StockInstrumentID"] = task_data.StockInstrumentID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryETFBasket(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOFInstrument(Task task) +{ + CSecurityFtdcOFInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["NetPrice"] = task_data.NetPrice; + data["Creationredemption"] = task_data.Creationredemption; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryOFInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQrySFInstrument(Task task) +{ + CSecurityFtdcSFInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["NetPrice"] = task_data.NetPrice; + data["MinMergeVolume"] = task_data.MinMergeVolume; + data["SFInstrumentID"] = task_data.SFInstrumentID; + data["MinSplitVolume"] = task_data.MinSplitVolume; + data["VolumeRatio"] = task_data.VolumeRatio; + data["SplitMergeStatus"] = task_data.SplitMergeStatus; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQrySFInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOrder(Task task) +{ + CSecurityFtdcOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["NotifySequence"] = task_data.NotifySequence; + data["ActiveUserID"] = task_data.ActiveUserID; + data["VolumeTraded"] = task_data.VolumeTraded; + data["UserProductInfo"] = task_data.UserProductInfo; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["AccountID"] = task_data.AccountID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["ClientID"] = task_data.ClientID; + data["VolumeTotal"] = task_data.VolumeTotal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["SessionID"] = task_data.SessionID; + data["TimeCondition"] = task_data.TimeCondition; + data["OrderStatus"] = task_data.OrderStatus; + data["OrderSysID"] = task_data.OrderSysID; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["IsETF"] = task_data.IsETF; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["StatusMsg"] = task_data.StatusMsg; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["OrderType"] = task_data.OrderType; + data["UpdateTime"] = task_data.UpdateTime; + data["TradingDay"] = task_data.TradingDay; + data["ActiveTime"] = task_data.ActiveTime; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["FrontID"] = task_data.FrontID; + data["SuspendTime"] = task_data.SuspendTime; + data["InstrumentType"] = task_data.InstrumentType; + data["ClearingPartID"] = task_data.ClearingPartID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["CancelTime"] = task_data.CancelTime; + data["GTDDate"] = task_data.GTDDate; + data["OrderLocalID"] = task_data.OrderLocalID; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + data["OrderSource"] = task_data.OrderSource; + data["BranchPBU"] = task_data.BranchPBU; + data["TradeAmount"] = task_data.TradeAmount; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryOrder(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTrade(Task task) +{ + CSecurityFtdcTradeField task_data = any_cast(task.task_data); + dict data; + data["TradeType"] = task_data.TradeType; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TradeTime"] = task_data.TradeTime; + data["Direction"] = task_data.Direction; + data["ParticipantID"] = task_data.ParticipantID; + data["Price"] = task_data.Price; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["OrderSysID"] = task_data.OrderSysID; + data["ClearingPartID"] = task_data.ClearingPartID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["TradeIndex"] = task_data.TradeIndex; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["TradeSource"] = task_data.TradeSource; + data["OffsetFlag"] = task_data.OffsetFlag; + data["OrderLocalID"] = task_data.OrderLocalID; + data["TradeID"] = task_data.TradeID; + data["TradeDate"] = task_data.TradeDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["BranchPBU"] = task_data.BranchPBU; + data["PriceSource"] = task_data.PriceSource; + data["TradingRole"] = task_data.TradingRole; + data["TradeAmount"] = task_data.TradeAmount; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTrade(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestorPosition(Task task) +{ + CSecurityFtdcInvestorPositionField task_data = any_cast(task.task_data); + dict data; + data["LockPosition"] = task_data.LockPosition; + data["MarginTradeAmount"] = task_data.MarginTradeAmount; + data["ShortFrozenAmount"] = task_data.ShortFrozenAmount; + data["ShortSellAmount"] = task_data.ShortSellAmount; + data["TodaySSPosition"] = task_data.TodaySSPosition; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TransferFee"] = task_data.TransferFee; + data["Commission"] = task_data.Commission; + data["ShortSellVolume"] = task_data.ShortSellVolume; + data["CoverFrozenPosition"] = task_data.CoverFrozenPosition; + data["TodayPurRedVolume"] = task_data.TodayPurRedVolume; + data["PurRedShortFrozen"] = task_data.PurRedShortFrozen; + data["CashIn"] = task_data.CashIn; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["ShortSellFrozenAmount"] = task_data.ShortSellFrozenAmount; + data["CloseAmount"] = task_data.CloseAmount; + data["PosiDirection"] = task_data.PosiDirection; + data["LockFrozenPosition"] = task_data.LockFrozenPosition; + data["RepurchasePosition"] = task_data.RepurchasePosition; + data["MarginTradeVolume"] = task_data.MarginTradeVolume; + data["YdPosition"] = task_data.YdPosition; + data["MarginTradeFrozenVolume"] = task_data.MarginTradeFrozenVolume; + data["ConversionRate"] = task_data.ConversionRate; + data["ShortSellFrozenVolume"] = task_data.ShortSellFrozenVolume; + data["OpenVolume"] = task_data.OpenVolume; + data["TodayMTPosition"] = task_data.TodayMTPosition; + data["CoverPosition"] = task_data.CoverPosition; + data["CloseVolume"] = task_data.CloseVolume; + data["AccountID"] = task_data.AccountID; + data["ConversionAmount"] = task_data.ConversionAmount; + data["ShortSellConversionProfit"] = task_data.ShortSellConversionProfit; + data["InstrumentID"] = task_data.InstrumentID; + data["PositionDate"] = task_data.PositionDate; + data["ExchangeID"] = task_data.ExchangeID; + data["MarginTradeFrozenAmount"] = task_data.MarginTradeFrozenAmount; + data["ShortFrozen"] = task_data.ShortFrozen; + data["LongFrozen"] = task_data.LongFrozen; + data["TodayPosition"] = task_data.TodayPosition; + data["TradingDay"] = task_data.TradingDay; + data["PositionCost"] = task_data.PositionCost; + data["BrokerID"] = task_data.BrokerID; + data["FrozenCash"] = task_data.FrozenCash; + data["OpenAmount"] = task_data.OpenAmount; + data["OpenCost"] = task_data.OpenCost; + data["StampTax"] = task_data.StampTax; + data["Position"] = task_data.Position; + data["ExecFrozenPosition"] = task_data.ExecFrozenPosition; + data["ExchangeMargin"] = task_data.ExchangeMargin; + data["PledgeInPosition"] = task_data.PledgeInPosition; + data["SettlementPrice"] = task_data.SettlementPrice; + data["LongFrozenAmount"] = task_data.LongFrozenAmount; + data["InvestorID"] = task_data.InvestorID; + data["UnlockFrozenPosition"] = task_data.UnlockFrozenPosition; + data["YdOpenCost"] = task_data.YdOpenCost; + data["MarginTradeConversionProfit"] = task_data.MarginTradeConversionProfit; + data["SSStockValue"] = task_data.SSStockValue; + data["StockValue"] = task_data.StockValue; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestorPosition(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnOrder(Task task) +{ + CSecurityFtdcOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["NotifySequence"] = task_data.NotifySequence; + data["ActiveUserID"] = task_data.ActiveUserID; + data["VolumeTraded"] = task_data.VolumeTraded; + data["UserProductInfo"] = task_data.UserProductInfo; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["AccountID"] = task_data.AccountID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["ClientID"] = task_data.ClientID; + data["VolumeTotal"] = task_data.VolumeTotal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["SessionID"] = task_data.SessionID; + data["TimeCondition"] = task_data.TimeCondition; + data["OrderStatus"] = task_data.OrderStatus; + data["OrderSysID"] = task_data.OrderSysID; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["IsETF"] = task_data.IsETF; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["StatusMsg"] = task_data.StatusMsg; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["OrderType"] = task_data.OrderType; + data["UpdateTime"] = task_data.UpdateTime; + data["TradingDay"] = task_data.TradingDay; + data["ActiveTime"] = task_data.ActiveTime; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["FrontID"] = task_data.FrontID; + data["SuspendTime"] = task_data.SuspendTime; + data["InstrumentType"] = task_data.InstrumentType; + data["ClearingPartID"] = task_data.ClearingPartID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["CancelTime"] = task_data.CancelTime; + data["GTDDate"] = task_data.GTDDate; + data["OrderLocalID"] = task_data.OrderLocalID; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + data["OrderSource"] = task_data.OrderSource; + data["BranchPBU"] = task_data.BranchPBU; + data["TradeAmount"] = task_data.TradeAmount; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + this->onRtnOrder(data); +}; + +void TdApi::processRtnTrade(Task task) +{ + CSecurityFtdcTradeField task_data = any_cast(task.task_data); + dict data; + data["TradeType"] = task_data.TradeType; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TradeTime"] = task_data.TradeTime; + data["Direction"] = task_data.Direction; + data["ParticipantID"] = task_data.ParticipantID; + data["Price"] = task_data.Price; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["OrderSysID"] = task_data.OrderSysID; + data["ClearingPartID"] = task_data.ClearingPartID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["TradeIndex"] = task_data.TradeIndex; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["TradeSource"] = task_data.TradeSource; + data["OffsetFlag"] = task_data.OffsetFlag; + data["OrderLocalID"] = task_data.OrderLocalID; + data["TradeID"] = task_data.TradeID; + data["TradeDate"] = task_data.TradeDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["BranchPBU"] = task_data.BranchPBU; + data["PriceSource"] = task_data.PriceSource; + data["TradingRole"] = task_data.TradingRole; + data["TradeAmount"] = task_data.TradeAmount; + + this->onRtnTrade(data); +}; + +void TdApi::processErrRtnOrderInsert(Task task) +{ + CSecurityFtdcInputOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["Direction"] = task_data.Direction; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["TimeCondition"] = task_data.TimeCondition; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["BrokerID"] = task_data.BrokerID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["GTDDate"] = task_data.GTDDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnOrderInsert(data, error); +}; + +void TdApi::processErrRtnOrderAction(Task task) +{ + CSecurityFtdcOrderActionField task_data = any_cast(task.task_data); + dict data; + data["ActionTime"] = task_data.ActionTime; + data["InvestorID"] = task_data.InvestorID; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["ClientID"] = task_data.ClientID; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["OrderActionRef"] = task_data.OrderActionRef; + data["VolumeChange"] = task_data.VolumeChange; + data["SessionID"] = task_data.SessionID; + data["ActionFlag"] = task_data.ActionFlag; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["BrokerID"] = task_data.BrokerID; + data["InstrumentType"] = task_data.InstrumentType; + data["ActionDate"] = task_data.ActionDate; + data["OrderLocalID"] = task_data.OrderLocalID; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["OrderRef"] = task_data.OrderRef; + data["ActionLocalID"] = task_data.ActionLocalID; + data["RequestID"] = task_data.RequestID; + data["FrontID"] = task_data.FrontID; + data["BranchPBU"] = task_data.BranchPBU; + data["OrderActionStatus"] = task_data.OrderActionStatus; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnOrderAction(data, error); +}; + +void TdApi::processRspFundOutByLiber(Task task) +{ + CSecurityFtdcInputFundTransferField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["AccountType"] = task_data.AccountType; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspFundOutByLiber(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnFundOutByLiber(Task task) +{ + CSecurityFtdcFundTransferField task_data = any_cast(task.task_data); + dict data; + data["PlateSerial"] = task_data.PlateSerial; + data["TradingDay"] = task_data.TradingDay; + data["ErrorMsg"] = task_data.ErrorMsg; + data["ErrorID"] = task_data.ErrorID; + data["UserID"] = task_data.UserID; + data["TransferSerial"] = task_data.TransferSerial; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["LiberSerial"] = task_data.LiberSerial; + data["BrokerID"] = task_data.BrokerID; + data["FundDirection"] = task_data.FundDirection; + data["TradeTime"] = task_data.TradeTime; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + this->onRtnFundOutByLiber(data); +}; + +void TdApi::processErrRtnFundOutByLiber(Task task) +{ + CSecurityFtdcInputFundTransferField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["AccountType"] = task_data.AccountType; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnFundOutByLiber(data, error); +}; + +void TdApi::processRtnFundInByBank(Task task) +{ + CSecurityFtdcFundTransferField task_data = any_cast(task.task_data); + dict data; + data["PlateSerial"] = task_data.PlateSerial; + data["TradingDay"] = task_data.TradingDay; + data["ErrorMsg"] = task_data.ErrorMsg; + data["ErrorID"] = task_data.ErrorID; + data["UserID"] = task_data.UserID; + data["TransferSerial"] = task_data.TransferSerial; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["LiberSerial"] = task_data.LiberSerial; + data["BrokerID"] = task_data.BrokerID; + data["FundDirection"] = task_data.FundDirection; + data["TradeTime"] = task_data.TradeTime; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + this->onRtnFundInByBank(data); +}; + +void TdApi::processRspQryFundTransferSerial(Task task) +{ + CSecurityFtdcFundTransferField task_data = any_cast(task.task_data); + dict data; + data["PlateSerial"] = task_data.PlateSerial; + data["TradingDay"] = task_data.TradingDay; + data["ErrorMsg"] = task_data.ErrorMsg; + data["ErrorID"] = task_data.ErrorID; + data["UserID"] = task_data.UserID; + data["TransferSerial"] = task_data.TransferSerial; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["LiberSerial"] = task_data.LiberSerial; + data["BrokerID"] = task_data.BrokerID; + data["FundDirection"] = task_data.FundDirection; + data["TradeTime"] = task_data.TradeTime; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryFundTransferSerial(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspFundInterTransfer(Task task) +{ + CSecurityFtdcFundInterTransferField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspFundInterTransfer(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryFundInterTransferSerial(Task task) +{ + CSecurityFtdcFundInterTransferSerialField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["ErrorMsg"] = task_data.ErrorMsg; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["TransferTime"] = task_data.TransferTime; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["ErrorID"] = task_data.ErrorID; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryFundInterTransferSerial(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnFundInterTransferSerial(Task task) +{ + CSecurityFtdcFundInterTransferSerialField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["ErrorMsg"] = task_data.ErrorMsg; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["TransferTime"] = task_data.TransferTime; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["ErrorID"] = task_data.ErrorID; + data["AccountID"] = task_data.AccountID; + + this->onRtnFundInterTransferSerial(data); +}; + +void TdApi::processErrRtnFundInterTransfer(Task task) +{ + CSecurityFtdcFundInterTransferField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnFundInterTransfer(data, error); +}; + diff --git a/vn.lts/pyscript/lts_td_switch.cpp b/vn.lts/pyscript/lts_td_switch.cpp new file mode 100644 index 00000000..a04a9341 --- /dev/null +++ b/vn.lts/pyscript/lts_td_switch.cpp @@ -0,0 +1,234 @@ +case ONFRONTCONNECTED: +{ + this->processFrontConnected(task); + break; +} + +case ONFRONTDISCONNECTED: +{ + this->processFrontDisconnected(task); + break; +} + +case ONHEARTBEATWARNING: +{ + this->processHeartBeatWarning(task); + break; +} + +case ONRSPERROR: +{ + this->processRspError(task); + break; +} + +case ONRSPUSERLOGIN: +{ + this->processRspUserLogin(task); + break; +} + +case ONRSPUSERLOGOUT: +{ + this->processRspUserLogout(task); + break; +} + +case ONRSPORDERINSERT: +{ + this->processRspOrderInsert(task); + break; +} + +case ONRSPORDERACTION: +{ + this->processRspOrderAction(task); + break; +} + +case ONRSPUSERPASSWORDUPDATE: +{ + this->processRspUserPasswordUpdate(task); + break; +} + +case ONRSPTRADINGACCOUNTPASSWORDUPDATE: +{ + this->processRspTradingAccountPasswordUpdate(task); + break; +} + +case ONRSPQRYEXCHANGE: +{ + this->processRspQryExchange(task); + break; +} + +case ONRSPQRYINSTRUMENT: +{ + this->processRspQryInstrument(task); + break; +} + +case ONRSPQRYINVESTOR: +{ + this->processRspQryInvestor(task); + break; +} + +case ONRSPQRYTRADINGCODE: +{ + this->processRspQryTradingCode(task); + break; +} + +case ONRSPQRYTRADINGACCOUNT: +{ + this->processRspQryTradingAccount(task); + break; +} + +case ONRSPQRYDEPTHMARKETDATA: +{ + this->processRspQryDepthMarketData(task); + break; +} + +case ONRSPQRYBONDINTEREST: +{ + this->processRspQryBondInterest(task); + break; +} + +case ONRSPQRYMARKETRATIONINFO: +{ + this->processRspQryMarketRationInfo(task); + break; +} + +case ONRSPQRYINSTRUMENTCOMMISSIONRATE: +{ + this->processRspQryInstrumentCommissionRate(task); + break; +} + +case ONRSPQRYETFINSTRUMENT: +{ + this->processRspQryETFInstrument(task); + break; +} + +case ONRSPQRYETFBASKET: +{ + this->processRspQryETFBasket(task); + break; +} + +case ONRSPQRYOFINSTRUMENT: +{ + this->processRspQryOFInstrument(task); + break; +} + +case ONRSPQRYSFINSTRUMENT: +{ + this->processRspQrySFInstrument(task); + break; +} + +case ONRSPQRYORDER: +{ + this->processRspQryOrder(task); + break; +} + +case ONRSPQRYTRADE: +{ + this->processRspQryTrade(task); + break; +} + +case ONRSPQRYINVESTORPOSITION: +{ + this->processRspQryInvestorPosition(task); + break; +} + +case ONRTNORDER: +{ + this->processRtnOrder(task); + break; +} + +case ONRTNTRADE: +{ + this->processRtnTrade(task); + break; +} + +case ONERRRTNORDERINSERT: +{ + this->processErrRtnOrderInsert(task); + break; +} + +case ONERRRTNORDERACTION: +{ + this->processErrRtnOrderAction(task); + break; +} + +case ONRSPFUNDOUTBYLIBER: +{ + this->processRspFundOutByLiber(task); + break; +} + +case ONRTNFUNDOUTBYLIBER: +{ + this->processRtnFundOutByLiber(task); + break; +} + +case ONERRRTNFUNDOUTBYLIBER: +{ + this->processErrRtnFundOutByLiber(task); + break; +} + +case ONRTNFUNDINBYBANK: +{ + this->processRtnFundInByBank(task); + break; +} + +case ONRSPQRYFUNDTRANSFERSERIAL: +{ + this->processRspQryFundTransferSerial(task); + break; +} + +case ONRSPFUNDINTERTRANSFER: +{ + this->processRspFundInterTransfer(task); + break; +} + +case ONRSPQRYFUNDINTERTRANSFERSERIAL: +{ + this->processRspQryFundInterTransferSerial(task); + break; +} + +case ONRTNFUNDINTERTRANSFERSERIAL: +{ + this->processRtnFundInterTransferSerial(task); + break; +} + +case ONERRRTNFUNDINTERTRANSFER: +{ + this->processErrRtnFundInterTransfer(task); + break; +} + diff --git a/vn.lts/pyscript/lts_td_task.cpp b/vn.lts/pyscript/lts_td_task.cpp new file mode 100644 index 00000000..1c670b5f --- /dev/null +++ b/vn.lts/pyscript/lts_td_task.cpp @@ -0,0 +1,675 @@ +void TdApi::OnFrontConnected() +{ + Task task = Task(); + task.task_name = ONFRONTCONNECTED; + this->task_queue.push(task); +}; + +void TdApi::OnFrontDisconnected(int nReason) +{ + Task task = Task(); + task.task_name = ONFRONTDISCONNECTED; + task.task_id = nReason; + this->task_queue.push(task); +}; + +void TdApi::OnHeartBeatWarning(int nTimeLapse) +{ + Task task = Task(); + task.task_name = ONHEARTBEATWARNING; + task.task_id = nTimeLapse{}; +; + this->task_queue.push(task); +}; + +void TdApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPERROR; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGIN; + task.task_data = *pRspUserLogin; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGOUT; + task.task_data = *pUserLogout; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPORDERINSERT; + task.task_data = *pInputOrder; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPORDERACTION; + task.task_data = *pInputOrderAction; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERPASSWORDUPDATE; + task.task_data = *pUserPasswordUpdate; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPTRADINGACCOUNTPASSWORDUPDATE; + task.task_data = *pTradingAccountPasswordUpdate; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryExchange(CSecurityFtdcExchangeField *pExchange, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXCHANGE; + task.task_data = *pExchange; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENT; + task.task_data = *pInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTOR; + task.task_data = *pInvestor; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryTradingCode(CSecurityFtdcTradingCodeField *pTradingCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGCODE; + task.task_data = *pTradingCode; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGACCOUNT; + task.task_data = *pTradingAccount; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYDEPTHMARKETDATA; + task.task_data = *pDepthMarketData; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryBondInterest(CSecurityFtdcBondInterestField *pBondInterest, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYBONDINTEREST; + task.task_data = *pBondInterest; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryMarketRationInfo(CSecurityFtdcMarketRationInfoField *pMarketRationInfo, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYMARKETRATIONINFO; + task.task_data = *pMarketRationInfo; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInstrumentCommissionRate(CSecurityFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENTCOMMISSIONRATE; + task.task_data = *pInstrumentCommissionRate; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryETFInstrument(CSecurityFtdcETFInstrumentField *pETFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYETFINSTRUMENT; + task.task_data = *pETFInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryETFBasket(CSecurityFtdcETFBasketField *pETFBasket, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYETFBASKET; + task.task_data = *pETFBasket; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryOFInstrument(CSecurityFtdcOFInstrumentField *pOFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYOFINSTRUMENT; + task.task_data = *pOFInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQrySFInstrument(CSecurityFtdcSFInstrumentField *pSFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYSFINSTRUMENT; + task.task_data = *pSFInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYORDER; + task.task_data = *pOrder; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADE; + task.task_data = *pTrade; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORPOSITION; + task.task_data = *pInvestorPosition; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRtnOrder(CSecurityFtdcOrderField *pOrder) +{ + Task task = Task(); + task.task_name = ONRTNORDER; + task.task_data = *pOrder; + this->task_queue.push(task); +}; + +void TdApi::OnRtnTrade(CSecurityFtdcTradeField *pTrade) +{ + Task task = Task(); + task.task_name = ONRTNTRADE; + task.task_data = *pTrade; + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNORDERINSERT; + task.task_data = *pInputOrder; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNORDERACTION; + task.task_data = *pOrderAction; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRspFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFUNDOUTBYLIBER; + task.task_data = *pInputFundTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRtnFundOutByLiber(CSecurityFtdcFundTransferField *pFundTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFUNDOUTBYLIBER; + task.task_data = *pFundTransfer; + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNFUNDOUTBYLIBER; + task.task_data = *pInputFundTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnFundInByBank(CSecurityFtdcFundTransferField *pFundTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFUNDINBYBANK; + task.task_data = *pFundTransfer; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryFundTransferSerial(CSecurityFtdcFundTransferField *pFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYFUNDTRANSFERSERIAL; + task.task_data = *pFundTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFUNDINTERTRANSFER; + task.task_data = *pFundInterTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYFUNDINTERTRANSFERSERIAL; + task.task_data = *pFundInterTransferSerial; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRtnFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial) +{ + Task task = Task(); + task.task_name = ONRTNFUNDINTERTRANSFERSERIAL; + task.task_data = *pFundInterTransferSerial; + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNFUNDINTERTRANSFER; + task.task_data = *pFundInterTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + diff --git a/vn.lts/vnltsmd/pyltsmd/ReadMe.txt b/vn.lts/vnltsmd/pyltsmd/ReadMe.txt new file mode 100644 index 00000000..0adb2586 --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/ReadMe.txt @@ -0,0 +1,32 @@ +======================================================================== + 动态链接库:pyltsmd 项目概述 +======================================================================== + +应用程序向导已为您创建了此 pyltsmd DLL。 + +本文件概要介绍组成 pyltsmd 应用程序的每个文件的内容。 + + +pyltsmd.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +pyltsmd.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +pyltsmd.cpp + 这是主 DLL 源文件。 + + 此 DLL 在创建时不导出任何符号。因此,生成时不会产生 .lib 文件。如果希望此项目成为其他某个项目的项目依赖项,则需要添加代码以从 DLL 导出某些符号,以便产生一个导出库,或者,也可以在项目“属性页”对话框中的“链接器”文件夹中,将“常规”属性页上的“忽略输入库”属性设置为“是”。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h, StdAfx.cpp + 这些文件用于生成名为 pyltsmd.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/vn.lts/vnltsmd/pyltsmd/dllmain.cpp b/vn.lts/vnltsmd/pyltsmd/dllmain.cpp new file mode 100644 index 00000000..260abc6d --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : DLL Ӧóڵ㡣 +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/vn.lts/vnltsmd/pyltsmd/stdafx.cpp b/vn.lts/vnltsmd/pyltsmd/stdafx.cpp new file mode 100644 index 00000000..e673ac76 --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// pyltsmd.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H +// κĸͷļڴļ diff --git a/vn.lts/vnltsmd/pyltsmd/stdafx.h b/vn.lts/vnltsmd/pyltsmd/stdafx.h new file mode 100644 index 00000000..2ec1caa0 --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Windows ͷļųʹõϢ +// Windows ͷļ: +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/vn.lts/vnltsmd/pyltsmd/targetver.h b/vn.lts/vnltsmd/pyltsmd/targetver.h new file mode 100644 index 00000000..7a7d2c83 --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/vn.lts/vnltsmd/pyltsmd/vnltsmd.cpp b/vn.lts/vnltsmd/pyltsmd/vnltsmd.cpp new file mode 100644 index 00000000..35d4a459 --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/vnltsmd.cpp @@ -0,0 +1,588 @@ +// MdApi.cpp : DLL Ӧóĵ +// + +#include "stdafx.h" +#include "vnltsmd.h" + + + +///------------------------------------------------------------------------------------- +///PythonC++תõĺ +///------------------------------------------------------------------------------------- + +void getInt(dict d, string key, int *value) +{ + if (d.has_key(key)) //ֵǷڸüֵ + { + object o = d[key]; //ȡüֵ + extract x(o); //ȡ + if (x.check()) //ȡ + { + *value = x(); //Ŀָ븳ֵ + } + } +}; + +void getDouble(dict d, string key, double *value) +{ + if (d.has_key(key)) + { + object o = d[key]; + extract x(o); + if (x.check()) + { + *value = x(); + } + } +}; + +void getChar(dict d, string key, char *value) +{ + if (d.has_key(key)) + { + object o = d[key]; + extract x(o); + if (x.check()) + { + string s = x(); + const char *buffer = s.c_str(); + //ַָ븳ֵʹstrcpy_s, vs2013ʹstrcpyͨ + //+1ӦΪC++ַĽβţرȷ1 + strcpy_s(value, strlen(buffer) + 1, buffer); + } + } +}; + + + +///------------------------------------------------------------------------------------- +///C++Ļصݱ浽 +///------------------------------------------------------------------------------------- + +void MdApi::OnFrontConnected() +{ + Task task = Task(); + task.task_name = ONFRONTCONNECTED; + this->task_queue.push(task); +}; + +void MdApi::OnFrontDisconnected(int nReason) +{ + Task task = Task(); + task.task_name = ONFRONTDISCONNECTED; + task.task_id = nReason; + this->task_queue.push(task); +}; + +void MdApi::OnHeartBeatWarning(int nTimeLapse) +{ + Task task = Task(); + task.task_name = ONHEARTBEATWARNING; + task.task_id = nTimeLapse; + this->task_queue.push(task); +}; + +void MdApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPERROR; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGIN; + task.task_data = *pRspUserLogin; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGOUT; + task.task_data = *pUserLogout; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPSUBMARKETDATA; + task.task_data = *pSpecificInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRspUnSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUNSUBMARKETDATA; + task.task_data = *pSpecificInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void MdApi::OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData) +{ + Task task = Task(); + task.task_name = ONRTNDEPTHMARKETDATA; + task.task_data = *pDepthMarketData; + this->task_queue.push(task); +}; + + + + + +///------------------------------------------------------------------------------------- +///̴߳ӶȡݣתΪpython󣬽 +///------------------------------------------------------------------------------------- + +void MdApi::processTask() +{ + while (1) + { + Task task = this->task_queue.wait_and_pop(); + + switch (task.task_name) + { + case ONFRONTCONNECTED: + { + this->processFrontConnected(task); + break; + } + + case ONFRONTDISCONNECTED: + { + this->processFrontDisconnected(task); + break; + } + + case ONHEARTBEATWARNING: + { + this->processHeartBeatWarning(task); + break; + } + + case ONRSPERROR: + { + this->processRspError(task); + break; + } + + case ONRSPUSERLOGIN: + { + this->processRspUserLogin(task); + break; + } + + case ONRSPUSERLOGOUT: + { + this->processRspUserLogout(task); + break; + } + + case ONRSPSUBMARKETDATA: + { + this->processRspSubMarketData(task); + break; + } + + case ONRSPUNSUBMARKETDATA: + { + this->processRspUnSubMarketData(task); + break; + } + + case ONRTNDEPTHMARKETDATA: + { + this->processRtnDepthMarketData(task); + break; + } + }; + } +}; + +void MdApi::processFrontConnected(Task task) +{ + this->onFrontConnected(); +}; + +void MdApi::processFrontDisconnected(Task task) +{ + this->onFrontDisconnected(task.task_id); +}; + +void MdApi::processHeartBeatWarning(Task task) +{ + this->onHeartBeatWarning(task.task_id); +}; + +void MdApi::processRspError(Task task) +{ + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspError(error, task.task_id, task.task_last); +}; + +void MdApi::processRspUserLogin(Task task) +{ + CSecurityFtdcRspUserLoginField task_data = any_cast(task.task_data); + dict data; + data["MaxOrderRef"] = task_data.MaxOrderRef; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["SessionID"] = task_data.SessionID; + data["SystemName"] = task_data.SystemName; + data["FrontID"] = task_data.FrontID; + data["BrokerID"] = task_data.BrokerID; + data["LoginTime"] = task_data.LoginTime; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogin(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspUserLogout(Task task) +{ + CSecurityFtdcUserLogoutField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogout(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspSubMarketData(Task task) +{ + CSecurityFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspSubMarketData(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspUnSubMarketData(Task task) +{ + CSecurityFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUnSubMarketData(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRtnDepthMarketData(Task task) +{ + CSecurityFtdcDepthMarketDataField task_data = any_cast(task.task_data); + dict data; + data["HighestPrice"] = task_data.HighestPrice; + data["BidPrice5"] = task_data.BidPrice5; + data["BidPrice4"] = task_data.BidPrice4; + data["BidPrice1"] = task_data.BidPrice1; + data["BidPrice3"] = task_data.BidPrice3; + data["BidPrice2"] = task_data.BidPrice2; + data["LowerLimitPrice"] = task_data.LowerLimitPrice; + data["OpenPrice"] = task_data.OpenPrice; + data["AskPrice5"] = task_data.AskPrice5; + data["AskPrice4"] = task_data.AskPrice4; + data["AskPrice3"] = task_data.AskPrice3; + data["PreClosePrice"] = task_data.PreClosePrice; + data["AskPrice1"] = task_data.AskPrice1; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["AskVolume1"] = task_data.AskVolume1; + data["UpdateTime"] = task_data.UpdateTime; + data["UpdateMillisec"] = task_data.UpdateMillisec; + data["AveragePrice"] = task_data.AveragePrice; + data["BidVolume5"] = task_data.BidVolume5; + data["BidVolume4"] = task_data.BidVolume4; + data["BidVolume3"] = task_data.BidVolume3; + data["BidVolume2"] = task_data.BidVolume2; + data["PreOpenInterest"] = task_data.PreOpenInterest; + data["AskPrice2"] = task_data.AskPrice2; + data["Volume"] = task_data.Volume; + data["AskVolume3"] = task_data.AskVolume3; + data["AskVolume2"] = task_data.AskVolume2; + data["AskVolume5"] = task_data.AskVolume5; + data["AskVolume4"] = task_data.AskVolume4; + data["UpperLimitPrice"] = task_data.UpperLimitPrice; + data["BidVolume1"] = task_data.BidVolume1; + data["InstrumentID"] = task_data.InstrumentID; + data["ClosePrice"] = task_data.ClosePrice; + data["ExchangeID"] = task_data.ExchangeID; + data["TradingDay"] = task_data.TradingDay; + data["PreDelta"] = task_data.PreDelta; + data["OpenInterest"] = task_data.OpenInterest; + data["CurrDelta"] = task_data.CurrDelta; + data["Turnover"] = task_data.Turnover; + data["LastPrice"] = task_data.LastPrice; + data["SettlementPrice"] = task_data.SettlementPrice; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["LowestPrice"] = task_data.LowestPrice; + data["ActionDay"] = task_data.ActionDay; + + this->onRtnDepthMarketData(data); +}; + + + +///------------------------------------------------------------------------------------- +/// +///------------------------------------------------------------------------------------- + +void MdApi::createFtdcMdApi(string pszFlowPath) +{ + this->api = CSecurityFtdcMdApi::CreateFtdcMdApi(pszFlowPath.c_str()); + this->api->RegisterSpi(this); +}; + +void MdApi::release() +{ + this->api->Release(); +}; + +void MdApi::init() +{ + this->api->Init(); +}; + +int MdApi::join() +{ + int i = this->api->Join(); + return i; +}; + +string MdApi::getTradingDay() +{ + string day = this->api->GetTradingDay(); + return day; +}; + +void MdApi::registerFront(string pszFrontAddress) +{ + this->api->RegisterFront((char*)pszFrontAddress.c_str()); +}; + +int MdApi::subscribeMarketData(dict req) +{ + char instrumentID[256]; + char exchangeID[256]; + getChar(req, "InstrumentID", instrumentID); + getChar(req, "ExchangeID", exchangeID); + char* myreq[1] = { instrumentID }; + int i = this->api->SubscribeMarketData(myreq, 1, exchangeID); + return i; +}; + +int MdApi::unSubscribeMarketData(dict req) +{ + char instrumentID[256]; + char exchangeID[256]; + getChar(req, "InstrumentID", instrumentID); + getChar(req, "ExchangeID", exchangeID); + char* myreq[1] = { instrumentID }; + int i = this->api->UnSubscribeMarketData(myreq, 1, exchangeID); + return i; +}; + +int MdApi::reqUserLogin(dict req, int nRequestID) +{ + CSecurityFtdcReqUserLoginField myreq = CSecurityFtdcReqUserLoginField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "MacAddress", myreq.MacAddress); + 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); + int i = this->api->ReqUserLogin(&myreq, nRequestID); + return i; +}; + +int MdApi::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; +}; + + + +///------------------------------------------------------------------------------------- +///Boost.Pythonװ +///------------------------------------------------------------------------------------- + +struct MdApiWrap : MdApi, wrapper < MdApi > +{ + virtual void onFrontConnected() + { + PyLock lock; + this->get_override("onFrontConnected")(); + }; + + virtual void onFrontDisconnected(int i) + { + PyLock lock; + this->get_override("onFrontDisconnected")(i); + }; + + virtual void onHeartBeatWarning(int i) + { + PyLock lock; + this->get_override("onHeartBeatWarning")(i); + }; + + virtual void onRspError(dict data, int id, bool last) + { + PyLock lock; + this->get_override("onRspError")(data, id, last); + }; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspUserLogin")(data, error, id, last); + }; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspUserLogout")(data, error, id, last); + }; + + virtual void onRspSubMarketData(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspSubMarketData")(data, error, id, last); + }; + + virtual void onRspUnSubMarketData(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspUnSubMarketData")(data, error, id, last); + }; + + virtual void onRtnDepthMarketData(dict data) + { + PyLock lock; + this->get_override("onRtnDepthMarketData")(data); + }; +}; + + +BOOST_PYTHON_MODULE(vnltsmd) +{ + PyEval_InitThreads(); //ʱУ֤ȴGIL + + class_("MdApi") + .def("createFtdcMdApi", &MdApiWrap::createFtdcMdApi) + .def("release", &MdApiWrap::release) + .def("init", &MdApiWrap::init) + .def("join", &MdApiWrap::join) + .def("getTradingDay", &MdApiWrap::getTradingDay) + .def("registerFront", &MdApiWrap::registerFront) + .def("subscribeMarketData", &MdApiWrap::subscribeMarketData) + .def("unSubscribeMarketData", &MdApiWrap::unSubscribeMarketData) + .def("reqUserLogin", &MdApiWrap::reqUserLogin) + .def("reqUserLogout", &MdApiWrap::reqUserLogout) + + .def("onFrontConnected", pure_virtual(&MdApiWrap::onFrontConnected)) + .def("onFrontDisconnected", pure_virtual(&MdApiWrap::onFrontDisconnected)) + .def("onHeartBeatWarning", pure_virtual(&MdApiWrap::onHeartBeatWarning)) + .def("onRspError", pure_virtual(&MdApiWrap::onRspError)) + .def("onRspUserLogin", pure_virtual(&MdApiWrap::onRspUserLogin)) + .def("onRspUserLogout", pure_virtual(&MdApiWrap::onRspUserLogout)) + .def("onRspSubMarketData", pure_virtual(&MdApiWrap::onRspSubMarketData)) + .def("onRspUnSubMarketData", pure_virtual(&MdApiWrap::onRspUnSubMarketData)) + .def("onRtnDepthMarketData", pure_virtual(&MdApiWrap::onRtnDepthMarketData)) + ; +}; \ No newline at end of file diff --git a/vn.lts/vnltsmd/pyltsmd/vnltsmd.h b/vn.lts/vnltsmd/pyltsmd/vnltsmd.h new file mode 100644 index 00000000..b5bf9190 --- /dev/null +++ b/vn.lts/vnltsmd/pyltsmd/vnltsmd.h @@ -0,0 +1,272 @@ +//˵ + +//ϵͳ +#include "stdafx.h" +#include +#include + +//Boost +#define BOOST_PYTHON_STATIC_LIB +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //е̹߳ +#include //е̹߳ +#include //еʵ + +//API +#include "SecurityFtdcMdApi.h" + +//ռ +using namespace std; +using namespace boost::python; +using namespace boost; + +// +#define ONFRONTCONNECTED 0 +#define ONFRONTDISCONNECTED 1 +#define ONHEARTBEATWARNING 2 +#define ONRSPERROR 3 +#define ONRSPUSERLOGIN 4 +#define ONRSPUSERLOGOUT 5 +#define ONRSPSUBMARKETDATA 6 +#define ONRSPUNSUBMARKETDATA 7 +#define ONRTNDEPTHMARKETDATA 8 +#define EXIT 0 + + +///------------------------------------------------------------------------------------- +///APIеIJ +///------------------------------------------------------------------------------------- + +//GILȫ򻯻ȡã +//ڰC++̻߳GILӶֹpython +class PyLock +{ +private: + PyGILState_STATE gil_state; + +public: + //ijдöʱGIL + PyLock() + { + gil_state = PyGILState_Ensure(); + } + + //ijɺٸöʱGIL + ~PyLock() + { + PyGILState_Release(gil_state); + } +}; + + +//ṹ +struct Task +{ + int task_name; //صƶӦij + any task_data; //ݽṹ + any task_error; //ṹ + int task_id; //id + bool task_last; //ǷΪ󷵻 +}; + + +///̰߳ȫĶ +template + +class ConcurrentQueue +{ +private: + queue the_queue; //׼ + mutable mutex the_mutex; //boost + condition_variable the_condition_variable; //boost + +public: + + //µ + void push(Data const& data) + { + mutex::scoped_lock lock(the_mutex); //ȡ + the_queue.push(data); //д + lock.unlock(); //ͷ + the_condition_variable.notify_one(); //֪ͨȴ߳ + } + + //ǷΪ + bool empty() const + { + mutex::scoped_lock lock(the_mutex); + return the_queue.empty(); + } + + //ȡ + Data wait_and_pop() + { + mutex::scoped_lock lock(the_mutex); + + while (the_queue.empty()) //Ϊʱ + { + the_condition_variable.wait(lock); //ȴ֪ͨ + } + + Data popped_value = the_queue.front(); //ȡеһ + the_queue.pop(); //ɾ + return popped_value; //ظ + } + +}; + + +//ֵлȡijֵӦֵṹֵ +void getInt(dict d, string key, int* value); + + +//ֵлȡijֵӦĸֵṹֵ +void getDouble(dict d, string key, double* value); + + +//ֵлȡijֵӦֵַṹֵ +void getChar(dict d, string key, char* value); + + + +///------------------------------------------------------------------------------------- +///C++ SPIĻصʵ +///------------------------------------------------------------------------------------- + +//APIļ̳ʵ +class MdApi : public CSecurityFtdcMdSpi +{ +private: + CSecurityFtdcMdApi* api; //API + thread *task_thread; //ָ߳루pythonݣ + ConcurrentQueue task_queue; // + +public: + MdApi() + { + function0 f = boost::bind(&MdApi::processTask, this); + thread t(f); + this->task_thread = &t; + }; + + ~MdApi() + { + }; + + //------------------------------------------------------------------------------------- + //APIص + //------------------------------------------------------------------------------------- + + //ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(); + + //ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + //@param nReason ԭ + // 0x1001 ʧ + // 0x1002 дʧ + // 0x2001 ʱ + // 0x2002 ʧ + // 0x2003 յ + virtual void OnFrontDisconnected(int nReason); + + //ʱ档ʱδյʱ÷á + //@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse); + + //Ӧ + virtual void OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + //¼Ӧ + virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + //dzӦ + virtual void OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + //Ӧ + virtual void OnRspSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + //ȡӦ + virtual void OnRspUnSubMarketData(CSecurityFtdcSpecificInstrumentField *pSpecificInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + //֪ͨ + virtual void OnRtnDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData); + + + //------------------------------------------------------------------------------------- + //task + //------------------------------------------------------------------------------------- + + void processTask(); + + void processFrontConnected(Task task); + + void processFrontDisconnected(Task task); + + void processHeartBeatWarning(Task task); + + void processRspError(Task task); + + void processRspUserLogin(Task task); + + void processRspUserLogout(Task task); + + void processRspSubMarketData(Task task); + + void processRspUnSubMarketData(Task task); + + void processRtnDepthMarketData(Task task); + + //------------------------------------------------------------------------------------- + //dataصֵ + //errorصĴֵ + //idid + //lastǷΪ󷵻 + //i + //------------------------------------------------------------------------------------- + + virtual void onFrontConnected(){}; + + virtual void onFrontDisconnected(int i){}; + + virtual void onHeartBeatWarning(int i){}; + + virtual void onRspError(dict data, int id, bool last) {}; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) {}; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) {}; + + virtual void onRspSubMarketData(dict data, dict error, int id, bool last) {}; + + virtual void onRspUnSubMarketData(dict data, dict error, int id, bool last) {}; + + virtual void onRtnDepthMarketData(dict data) {}; + + //------------------------------------------------------------------------------------- + //req:ֵ + //------------------------------------------------------------------------------------- + + void createFtdcMdApi(string pszFlowPath = ""); + + void release(); + + void init(); + + int join(); + + string getTradingDay(); + + void registerFront(string pszFrontAddress); + + int subscribeMarketData(dict req); + + int unSubscribeMarketData(dict req); + + int reqUserLogin(dict req, int nRequestID); + + int reqUserLogout(dict req, int nRequestID); +}; diff --git a/vn.lts/vnltsmd/test/mdtest.py b/vn.lts/vnltsmd/test/mdtest.py new file mode 100644 index 00000000..b2c0364b --- /dev/null +++ b/vn.lts/vnltsmd/test/mdtest.py @@ -0,0 +1,151 @@ +# encoding = UTF-8 + +import sys +from time import sleep + +from PyQt4 import QtGui + +from vnltsmd import * + + +#---------------------------------------------------------------------- +def print_dict(d): + """ռֵӡһֵ""" + for key,value in d.items(): + print key + ':' + str(value) + + +#---------------------------------------------------------------------- +def simple_log(func): + """װ""" + def wrapper(*args, **kw): + print "" + print str(func.__name__) + return func(*args, **kw) + return wrapper + + +######################################################################## +class TestMdApi(MdApi): + """ʵ""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(TestMdApi, self).__init__() + + #---------------------------------------------------------------------- + @simple_log + def onFrontConnected(self): + """""" + pass + + #---------------------------------------------------------------------- + @simple_log + def onFrontDisconnected(self, n): + """Ͽ""" + print n + + #---------------------------------------------------------------------- + @simple_log + def onHeartBeatWarning(self, n): + """""" + print n + + #---------------------------------------------------------------------- + @simple_log + def onRspError(self, error, n, last): + """""" + print_dict(error) + + #---------------------------------------------------------------------- + def onRspUserLogin(self, data, error, n, last): + """½ر""" + print_dict(data) + print_dict(error) + + #---------------------------------------------------------------------- + @simple_log + def onRspUserLogout(self, data, error, n, last): + """dzر""" + print_dict(data) + print_dict(error) + + #---------------------------------------------------------------------- + @simple_log + def onRspSubMarketData(self, data, error, n, last): + """ĺԼر""" + print_dict(data) + print_dict(error) + + #---------------------------------------------------------------------- + @simple_log + def onRspUnSubMarketData(self, data, error, n, last): + """˶Լر""" + print_dict(data) + print_dict(error) + + #---------------------------------------------------------------------- + @simple_log + def onRtnDepthMarketData(self, data): + """""" + print_dict(data) + + + +#---------------------------------------------------------------------- +def main(): + """ԺֶʱԿʹsleep""" + reqid = 0 + + # QtӦö¼ѭ + app = QtGui.QApplication(sys.argv) + + # API + api = TestMdApi() + + # C++дMdApi󣬴ϣ.conļĵַ + api.createFtdcMdApi('') + + # עǰûַ + api.registerFront("tcp://101.231.210.1:24513") + + # ʼapiǰû + api.init() + sleep(0.5) + + # ½ + loginReq = {} # һֵ + loginReq['UserID'] = '' # Ϊֵֵķʽ + loginReq['Password'] = '' # C++еĽṹԱӦ + loginReq['BrokerID'] = '2011' + reqid = reqid + 1 # 뱣Ψһ + i = api.reqUserLogin(loginReq, 1) + sleep(0.5) + + ## dz + #reqid = reqid + 1 + #i = api.reqUserLogout({}, 1) + #sleep(0.5) + + # ȡգĿǰΪ + #day = api.getTradingDay() + #print 'Trading Day is:' + str(day) + #sleep(0.5) + + # ĺԼ + subReq = {} + subReq['InstrumentID'] = '600600' + subReq['ExchangeID'] = 'SSE' + i = api.subscribeMarketData(subReq) + + ## ˶Լ + #i = api.unSubscribeMarketData(subReq) + + # У + app.exec_() + + + +if __name__ == '__main__': + main() diff --git a/vn.lts/vnltsmd/test/securitymduserapi.dll b/vn.lts/vnltsmd/test/securitymduserapi.dll new file mode 100644 index 00000000..3ad8abd3 Binary files /dev/null and b/vn.lts/vnltsmd/test/securitymduserapi.dll differ diff --git a/vn.lts/vnltsmd/test/vnltsmd.pyd b/vn.lts/vnltsmd/test/vnltsmd.pyd new file mode 100644 index 00000000..f2cc12d4 Binary files /dev/null and b/vn.lts/vnltsmd/test/vnltsmd.pyd differ diff --git a/vn.lts/vnltstd/PythonTest/securitytraderapi.dll b/vn.lts/vnltstd/PythonTest/securitytraderapi.dll new file mode 100644 index 00000000..347bd863 Binary files /dev/null and b/vn.lts/vnltstd/PythonTest/securitytraderapi.dll differ diff --git a/vn.lts/vnltstd/PythonTest/test.py b/vn.lts/vnltstd/PythonTest/test.py new file mode 100644 index 00000000..4565019a --- /dev/null +++ b/vn.lts/vnltstd/PythonTest/test.py @@ -0,0 +1,83 @@ +# encoding = UTF-8 + +from PyQt4 import QtGui +import sys +from time import sleep + +from vnltstd import * + +def printdict(error): + for key, value in error.items(): + print key + ':' + str(value) + +class MyTdApi(TdApi): + def __init__(self): + super(MyTdApi, self).__init__() + + def onFrontConnected(self): + print 'connected' + + def onFrontDisconnected(self, i): + print 'disconnected' + + def onHeartBeatWarning(self, i): + print 'heartbeat' + + def onRspError(self, data, id_, last): + print 'error' + print data + + def onRspUserLogin(self, data, error, id_, last) : + print 'login' + printdict(data) + printdict(error) + + + def onRspUserLogout(self, data, error, id_, last): + print 'logout' + printdict(data) + printdict(error) + + #---------------------------------------------------------------------- + def onRspQryInstrument(self, data, error, id_, last): + """""" + printdict(data) + + #---------------------------------------------------------------------- + def onRspQryInvestor(self, data, error, id_, last): + """""" + printdict(data) + +def main(): + + app = QtGui.QApplication(sys.argv) + + api = MyTdApi() + api.createFtdcTraderApi('') + + api.registerFront("tcp://101.231.210.1:24505") + api.init() + sleep(1.0) + + lgreq = {} + lgreq['UserID'] = '010000058678' + lgreq['Password'] = '0656032' + lgreq['BrokerID'] = '2011' + i = api.reqUserLogin(lgreq, 1) + print i + sleep(1.0) + + #req2 = {} + #req2['InstrumentID'] = '600600' + #req2['ExchangeID'] = 'SSE' + #api.subscribeMarketData(req2) + + ireq = {} + #a = api.reqQryInstrument(ireq, 3) + b = api.reqQryInvestor(ireq, 3) + #print 'a is:'+ str(a) + + app.exec_() + +if __name__ == '__main__': + main() diff --git a/vn.lts/vnltstd/PythonTest/vnltstd.pyd b/vn.lts/vnltstd/PythonTest/vnltstd.pyd new file mode 100644 index 00000000..eeb5758b Binary files /dev/null and b/vn.lts/vnltstd/PythonTest/vnltstd.pyd differ diff --git a/vn.lts/vnltstd/pyltstd.opensdf b/vn.lts/vnltstd/pyltstd.opensdf new file mode 100644 index 00000000..f445973d Binary files /dev/null and b/vn.lts/vnltstd/pyltstd.opensdf differ diff --git a/vn.lts/vnltstd/pyltstd/ReadMe.txt b/vn.lts/vnltstd/pyltstd/ReadMe.txt new file mode 100644 index 00000000..ee136cc0 --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/ReadMe.txt @@ -0,0 +1,32 @@ +======================================================================== + 动态链接库:pyltstd 项目概述 +======================================================================== + +应用程序向导已为您创建了此 pyltstd DLL。 + +本文件概要介绍组成 pyltstd 应用程序的每个文件的内容。 + + +pyltstd.vcxproj + 这是使用应用程序向导生成的 VC++ 项目的主项目文件,其中包含生成该文件的 Visual C++ 的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。 + +pyltstd.vcxproj.filters + 这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。它包含有关项目文件与筛选器之间的关联信息。在 IDE 中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。例如,“.cpp”文件与“源文件”筛选器关联。 + +pyltstd.cpp + 这是主 DLL 源文件。 + + 此 DLL 在创建时不导出任何符号。因此,生成时不会产生 .lib 文件。如果希望此项目成为其他某个项目的项目依赖项,则需要添加代码以从 DLL 导出某些符号,以便产生一个导出库,或者,也可以在项目“属性页”对话框中的“链接器”文件夹中,将“常规”属性页上的“忽略输入库”属性设置为“是”。 + +///////////////////////////////////////////////////////////////////////////// +其他标准文件: + +StdAfx.h, StdAfx.cpp + 这些文件用于生成名为 pyltstd.pch 的预编译头 (PCH) 文件和名为 StdAfx.obj 的预编译类型文件。 + +///////////////////////////////////////////////////////////////////////////// +其他注释: + +应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。 + +///////////////////////////////////////////////////////////////////////////// diff --git a/vn.lts/vnltstd/pyltstd/dllmain.cpp b/vn.lts/vnltstd/pyltstd/dllmain.cpp new file mode 100644 index 00000000..260abc6d --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : DLL Ӧóڵ㡣 +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/vn.lts/vnltstd/pyltstd/stdafx.cpp b/vn.lts/vnltstd/pyltstd/stdafx.cpp new file mode 100644 index 00000000..d2d4f71f --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// pyltstd.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H +// κĸͷļڴļ diff --git a/vn.lts/vnltstd/pyltstd/stdafx.h b/vn.lts/vnltstd/pyltstd/stdafx.h new file mode 100644 index 00000000..2ec1caa0 --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Windows ͷļųʹõϢ +// Windows ͷļ: +#include + + + +// TODO: ڴ˴óҪͷļ diff --git a/vn.lts/vnltstd/pyltstd/targetver.h b/vn.lts/vnltstd/pyltstd/targetver.h new file mode 100644 index 00000000..7a7d2c83 --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/vn.lts/vnltstd/pyltstd/vnltstd.cpp b/vn.lts/vnltstd/pyltstd/vnltstd.cpp new file mode 100644 index 00000000..a325d3a1 --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/vnltstd.cpp @@ -0,0 +1,2841 @@ +// MdApi.cpp : DLL Ӧóĵ +// + +#include "stdafx.h" +#include "vnltstd.h" + + + +///------------------------------------------------------------------------------------- +///PythonC++תõĺ +///------------------------------------------------------------------------------------- + +void getInt(dict d, string key, int *value) +{ + if (d.has_key(key)) //ֵǷڸüֵ + { + object o = d[key]; //ȡüֵ + extract x(o); //ȡ + if (x.check()) //ȡ + { + *value = x(); //Ŀָ븳ֵ + } + } +} + +void getDouble(dict d, string key, double *value) +{ + if (d.has_key(key)) + { + object o = d[key]; + extract x(o); + if (x.check()) + { + *value = x(); + } + } +} + +void getChar(dict d, string key, char *value) +{ + if (d.has_key(key)) + { + object o = d[key]; + extract x(o); + if (x.check()) + { + string s = x(); + const char *buffer = s.c_str(); + //ַָ븳ֵʹstrcpy_s, vs2013ʹstrcpyͨ + //+1ӦΪC++ַĽβţرȷ1 + strcpy_s(value, strlen(buffer) + 1, buffer); + } + } +} + + + +///------------------------------------------------------------------------------------- +///C++Ļصݱ浽 +///------------------------------------------------------------------------------------- + +void TdApi::OnFrontConnected() +{ + Task task = Task(); + task.task_name = ONFRONTCONNECTED; + this->task_queue.push(task); +}; + +void TdApi::OnFrontDisconnected(int nReason) +{ + Task task = Task(); + task.task_name = ONFRONTDISCONNECTED; + task.task_id = nReason; + this->task_queue.push(task); +}; + +void TdApi::OnHeartBeatWarning(int nTimeLapse) +{ + Task task = Task(); + task.task_name = ONHEARTBEATWARNING; + task.task_id = nTimeLapse; + this->task_queue.push(task); +}; + +void TdApi::OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPERROR; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGIN; + task.task_data = *pRspUserLogin; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGOUT; + task.task_data = *pUserLogout; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPORDERINSERT; + task.task_data = *pInputOrder; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPORDERACTION; + task.task_data = *pInputOrderAction; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERPASSWORDUPDATE; + task.task_data = *pUserPasswordUpdate; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPTRADINGACCOUNTPASSWORDUPDATE; + task.task_data = *pTradingAccountPasswordUpdate; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryExchange(CSecurityFtdcExchangeField *pExchange, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXCHANGE; + task.task_data = *pExchange; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENT; + task.task_data = *pInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTOR; + task.task_data = *pInvestor; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryTradingCode(CSecurityFtdcTradingCodeField *pTradingCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGCODE; + task.task_data = *pTradingCode; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGACCOUNT; + task.task_data = *pTradingAccount; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYDEPTHMARKETDATA; + task.task_data = *pDepthMarketData; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryBondInterest(CSecurityFtdcBondInterestField *pBondInterest, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYBONDINTEREST; + task.task_data = *pBondInterest; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryMarketRationInfo(CSecurityFtdcMarketRationInfoField *pMarketRationInfo, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYMARKETRATIONINFO; + task.task_data = *pMarketRationInfo; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInstrumentCommissionRate(CSecurityFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENTCOMMISSIONRATE; + task.task_data = *pInstrumentCommissionRate; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryETFInstrument(CSecurityFtdcETFInstrumentField *pETFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYETFINSTRUMENT; + task.task_data = *pETFInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryETFBasket(CSecurityFtdcETFBasketField *pETFBasket, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYETFBASKET; + task.task_data = *pETFBasket; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryOFInstrument(CSecurityFtdcOFInstrumentField *pOFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYOFINSTRUMENT; + task.task_data = *pOFInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQrySFInstrument(CSecurityFtdcSFInstrumentField *pSFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYSFINSTRUMENT; + task.task_data = *pSFInstrument; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYORDER; + task.task_data = *pOrder; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADE; + task.task_data = *pTrade; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORPOSITION; + task.task_data = *pInvestorPosition; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRtnOrder(CSecurityFtdcOrderField *pOrder) +{ + Task task = Task(); + task.task_name = ONRTNORDER; + task.task_data = *pOrder; + this->task_queue.push(task); +}; + +void TdApi::OnRtnTrade(CSecurityFtdcTradeField *pTrade) +{ + Task task = Task(); + task.task_name = ONRTNTRADE; + task.task_data = *pTrade; + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNORDERINSERT; + task.task_data = *pInputOrder; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNORDERACTION; + task.task_data = *pOrderAction; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRspFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFUNDOUTBYLIBER; + task.task_data = *pInputFundTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRtnFundOutByLiber(CSecurityFtdcFundTransferField *pFundTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFUNDOUTBYLIBER; + task.task_data = *pFundTransfer; + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNFUNDOUTBYLIBER; + task.task_data = *pInputFundTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnFundInByBank(CSecurityFtdcFundTransferField *pFundTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFUNDINBYBANK; + task.task_data = *pFundTransfer; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryFundTransferSerial(CSecurityFtdcFundTransferField *pFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYFUNDTRANSFERSERIAL; + task.task_data = *pFundTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFUNDINTERTRANSFER; + task.task_data = *pFundInterTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRspQryFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYFUNDINTERTRANSFERSERIAL; + task.task_data = *pFundInterTransferSerial; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + task.task_id = nRequestID; + task.task_last = bIsLast; + this->task_queue.push(task); +}; + +void TdApi::OnRtnFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial) +{ + Task task = Task(); + task.task_name = ONRTNFUNDINTERTRANSFERSERIAL; + task.task_data = *pFundInterTransferSerial; + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNFUNDINTERTRANSFER; + task.task_data = *pFundInterTransfer; + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CSecurityFtdcRspInfoField empty_error = CSecurityFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + + + + + + +///------------------------------------------------------------------------------------- +///̴߳ӶȡݣתΪpython󣬽 +///------------------------------------------------------------------------------------- + +void TdApi::processTask() +{ + while (1) + { + Task task = this->task_queue.wait_and_pop(); + + switch (task.task_name) + { + case ONFRONTCONNECTED: + { + this->processFrontConnected(task); + break; + } + + case ONFRONTDISCONNECTED: + { + this->processFrontDisconnected(task); + break; + } + + case ONHEARTBEATWARNING: + { + this->processHeartBeatWarning(task); + break; + } + + case ONRSPERROR: + { + this->processRspError(task); + break; + } + + case ONRSPUSERLOGIN: + { + this->processRspUserLogin(task); + break; + } + + case ONRSPUSERLOGOUT: + { + this->processRspUserLogout(task); + break; + } + + case ONRSPORDERINSERT: + { + this->processRspOrderInsert(task); + break; + } + + case ONRSPORDERACTION: + { + this->processRspOrderAction(task); + break; + } + + case ONRSPUSERPASSWORDUPDATE: + { + this->processRspUserPasswordUpdate(task); + break; + } + + case ONRSPTRADINGACCOUNTPASSWORDUPDATE: + { + this->processRspTradingAccountPasswordUpdate(task); + break; + } + + case ONRSPQRYEXCHANGE: + { + this->processRspQryExchange(task); + break; + } + + case ONRSPQRYINSTRUMENT: + { + this->processRspQryInstrument(task); + break; + } + + case ONRSPQRYINVESTOR: + { + this->processRspQryInvestor(task); + break; + } + + case ONRSPQRYTRADINGCODE: + { + this->processRspQryTradingCode(task); + break; + } + + case ONRSPQRYTRADINGACCOUNT: + { + this->processRspQryTradingAccount(task); + break; + } + + case ONRSPQRYDEPTHMARKETDATA: + { + this->processRspQryDepthMarketData(task); + break; + } + + case ONRSPQRYBONDINTEREST: + { + this->processRspQryBondInterest(task); + break; + } + + case ONRSPQRYMARKETRATIONINFO: + { + this->processRspQryMarketRationInfo(task); + break; + } + + case ONRSPQRYINSTRUMENTCOMMISSIONRATE: + { + this->processRspQryInstrumentCommissionRate(task); + break; + } + + case ONRSPQRYETFINSTRUMENT: + { + this->processRspQryETFInstrument(task); + break; + } + + case ONRSPQRYETFBASKET: + { + this->processRspQryETFBasket(task); + break; + } + + case ONRSPQRYOFINSTRUMENT: + { + this->processRspQryOFInstrument(task); + break; + } + + case ONRSPQRYSFINSTRUMENT: + { + this->processRspQrySFInstrument(task); + break; + } + + case ONRSPQRYORDER: + { + this->processRspQryOrder(task); + break; + } + + case ONRSPQRYTRADE: + { + this->processRspQryTrade(task); + break; + } + + case ONRSPQRYINVESTORPOSITION: + { + this->processRspQryInvestorPosition(task); + break; + } + + case ONRTNORDER: + { + this->processRtnOrder(task); + break; + } + + case ONRTNTRADE: + { + this->processRtnTrade(task); + break; + } + + case ONERRRTNORDERINSERT: + { + this->processErrRtnOrderInsert(task); + break; + } + + case ONERRRTNORDERACTION: + { + this->processErrRtnOrderAction(task); + break; + } + + case ONRSPFUNDOUTBYLIBER: + { + this->processRspFundOutByLiber(task); + break; + } + + case ONRTNFUNDOUTBYLIBER: + { + this->processRtnFundOutByLiber(task); + break; + } + + case ONERRRTNFUNDOUTBYLIBER: + { + this->processErrRtnFundOutByLiber(task); + break; + } + + case ONRTNFUNDINBYBANK: + { + this->processRtnFundInByBank(task); + break; + } + + case ONRSPQRYFUNDTRANSFERSERIAL: + { + this->processRspQryFundTransferSerial(task); + break; + } + + case ONRSPFUNDINTERTRANSFER: + { + this->processRspFundInterTransfer(task); + break; + } + + case ONRSPQRYFUNDINTERTRANSFERSERIAL: + { + this->processRspQryFundInterTransferSerial(task); + break; + } + + case ONRTNFUNDINTERTRANSFERSERIAL: + { + this->processRtnFundInterTransferSerial(task); + break; + } + + case ONERRRTNFUNDINTERTRANSFER: + { + this->processErrRtnFundInterTransfer(task); + break; + } + } + } +} + +void TdApi::processFrontConnected(Task task) +{ + this->onFrontConnected(); +}; + +void TdApi::processFrontDisconnected(Task task) +{ + this->onFrontDisconnected(task.task_id); +}; + +void TdApi::processHeartBeatWarning(Task task) +{ + this->onHeartBeatWarning(task.task_id); +}; + +void TdApi::processRspError(Task task) +{ + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspError(error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserLogin(Task task) +{ + CSecurityFtdcRspUserLoginField task_data = any_cast(task.task_data); + dict data; + data["MaxOrderRef"] = task_data.MaxOrderRef; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["SessionID"] = task_data.SessionID; + data["SystemName"] = task_data.SystemName; + data["FrontID"] = task_data.FrontID; + data["BrokerID"] = task_data.BrokerID; + data["LoginTime"] = task_data.LoginTime; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogin(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserLogout(Task task) +{ + CSecurityFtdcUserLogoutField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserLogout(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspOrderInsert(Task task) +{ + CSecurityFtdcInputOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["Direction"] = task_data.Direction; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["TimeCondition"] = task_data.TimeCondition; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["BrokerID"] = task_data.BrokerID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["GTDDate"] = task_data.GTDDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspOrderInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspOrderAction(Task task) +{ + CSecurityFtdcInputOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["OrderLocalID"] = task_data.OrderLocalID; + data["OrderActionRef"] = task_data.OrderActionRef; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["VolumeChange"] = task_data.VolumeChange; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ActionFlag"] = task_data.ActionFlag; + data["FrontID"] = task_data.FrontID; + data["BranchPBU"] = task_data.BranchPBU; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspOrderAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserPasswordUpdate(Task task) +{ + CSecurityFtdcUserPasswordUpdateField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["NewPassword"] = task_data.NewPassword; + data["OldPassword"] = task_data.OldPassword; + data["BrokerID"] = task_data.BrokerID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUserPasswordUpdate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspTradingAccountPasswordUpdate(Task task) +{ + CSecurityFtdcTradingAccountPasswordUpdateField task_data = any_cast(task.task_data); + dict data; + data["NewPassword"] = task_data.NewPassword; + data["OldPassword"] = task_data.OldPassword; + data["BrokerID"] = task_data.BrokerID; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspTradingAccountPasswordUpdate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExchange(Task task) +{ + CSecurityFtdcExchangeField task_data = any_cast(task.task_data); + dict data; + data["ExchangeProperty"] = task_data.ExchangeProperty; + data["ExchangeID"] = task_data.ExchangeID; + data["ExchangeName"] = task_data.ExchangeName; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExchange(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInstrument(Task task) +{ + CSecurityFtdcInstrumentField task_data = any_cast(task.task_data); + dict data; + data["IsTrading"] = task_data.IsTrading; + data["ExpireDate"] = task_data.ExpireDate; + data["UnitMargin"] = task_data.UnitMargin; + data["OrderCanBeWithdraw"] = task_data.OrderCanBeWithdraw; + data["PositionType"] = task_data.PositionType; + data["ProductClass"] = task_data.ProductClass; + data["MinSellVolume"] = task_data.MinSellVolume; + data["InstrumentName"] = task_data.InstrumentName; + data["ExecPrice"] = task_data.ExecPrice; + data["RightModelID"] = task_data.RightModelID; + data["VolumeMultiple"] = task_data.VolumeMultiple; + data["DeliveryYear"] = task_data.DeliveryYear; + data["OptionsMarginParam2"] = task_data.OptionsMarginParam2; + data["OptionsMarginParam1"] = task_data.OptionsMarginParam1; + data["PosTradeType"] = task_data.PosTradeType; + data["CreateDate"] = task_data.CreateDate; + data["InstrumentID"] = task_data.InstrumentID; + data["MaxLimitOrderVolume"] = task_data.MaxLimitOrderVolume; + data["ExchangeID"] = task_data.ExchangeID; + data["MinLimitOrderVolume"] = task_data.MinLimitOrderVolume; + data["MaxMarketOrderVolume"] = task_data.MaxMarketOrderVolume; + data["StartDelivDate"] = task_data.StartDelivDate; + data["InstrumentType"] = task_data.InstrumentType; + data["DeliveryMonth"] = task_data.DeliveryMonth; + data["MinBuyVolume"] = task_data.MinBuyVolume; + data["PriceTick"] = task_data.PriceTick; + data["InstLifePhase"] = task_data.InstLifePhase; + data["MarketID"] = task_data.MarketID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["MinMarketOrderVolume"] = task_data.MinMarketOrderVolume; + data["EndDelivDate"] = task_data.EndDelivDate; + data["OpenDate"] = task_data.OpenDate; + data["ProductID"] = task_data.ProductID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestor(Task task) +{ + CSecurityFtdcInvestorField task_data = any_cast(task.task_data); + dict data; + data["SZBranchID"] = task_data.SZBranchID; + data["InvestorName"] = task_data.InvestorName; + data["SHBranchID"] = task_data.SHBranchID; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["InvestorGroupID"] = task_data.InvestorGroupID; + data["SettleSystemType"] = task_data.SettleSystemType; + data["InvestorLevel"] = task_data.InvestorLevel; + data["IsActive"] = task_data.IsActive; + data["IdentifiedCardType"] = task_data.IdentifiedCardType; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestor(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTradingCode(Task task) +{ + CSecurityFtdcTradingCodeField task_data = any_cast(task.task_data); + dict data; + data["PBU"] = task_data.PBU; + data["ExchangeID"] = task_data.ExchangeID; + data["ClientType"] = task_data.ClientType; + data["ClientID"] = task_data.ClientID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["IsActive"] = task_data.IsActive; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTradingCode(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTradingAccount(Task task) +{ + CSecurityFtdcTradingAccountField task_data = any_cast(task.task_data); + dict data; + data["MarginTradeAmount"] = task_data.MarginTradeAmount; + data["FrozenTransferFee"] = task_data.FrozenTransferFee; + data["Mortgage"] = task_data.Mortgage; + data["ExchangeDeliveryMargin"] = task_data.ExchangeDeliveryMargin; + data["FrozenMargin"] = task_data.FrozenMargin; + data["WithdrawQuota"] = task_data.WithdrawQuota; + data["TransferFee"] = task_data.TransferFee; + data["Commission"] = task_data.Commission; + data["Interest"] = task_data.Interest; + data["ShortSellProfit"] = task_data.ShortSellProfit; + data["FrozenExecCash"] = task_data.FrozenExecCash; + data["CashIn"] = task_data.CashIn; + data["AccountID"] = task_data.AccountID; + data["Available"] = task_data.Available; + data["PreCredit"] = task_data.PreCredit; + data["PreMortgage"] = task_data.PreMortgage; + data["CreditRatio"] = task_data.CreditRatio; + data["CreditAmount"] = task_data.CreditAmount; + data["InterestBase"] = task_data.InterestBase; + data["ExchangeMargin"] = task_data.ExchangeMargin; + data["ConversionAmount"] = task_data.ConversionAmount; + data["SSStockValue"] = task_data.SSStockValue; + data["ShortSellAmount"] = task_data.ShortSellAmount; + data["PreMargin"] = task_data.PreMargin; + data["CurrencyCode"] = task_data.CurrencyCode; + data["DeliveryMargin"] = task_data.DeliveryMargin; + data["BondRepurchaseAmount"] = task_data.BondRepurchaseAmount; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["FrozenCash"] = task_data.FrozenCash; + data["Withdraw"] = task_data.Withdraw; + data["ReverseRepurchaseAmount"] = task_data.ReverseRepurchaseAmount; + data["StampTax"] = task_data.StampTax; + data["Balance"] = task_data.Balance; + data["FrozenStampTax"] = task_data.FrozenStampTax; + data["Reserve"] = task_data.Reserve; + data["PreDeposit"] = task_data.PreDeposit; + data["MarginTradeProfit"] = task_data.MarginTradeProfit; + data["Credit"] = task_data.Credit; + data["PreBalance"] = task_data.PreBalance; + data["CurrMargin"] = task_data.CurrMargin; + data["FrozenCommission"] = task_data.FrozenCommission; + data["AccountType"] = task_data.AccountType; + data["StockValue"] = task_data.StockValue; + data["Deposit"] = task_data.Deposit; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTradingAccount(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryDepthMarketData(Task task) +{ + CSecurityFtdcDepthMarketDataField task_data = any_cast(task.task_data); + dict data; + data["HighestPrice"] = task_data.HighestPrice; + data["BidPrice5"] = task_data.BidPrice5; + data["BidPrice4"] = task_data.BidPrice4; + data["BidPrice1"] = task_data.BidPrice1; + data["BidPrice3"] = task_data.BidPrice3; + data["BidPrice2"] = task_data.BidPrice2; + data["LowerLimitPrice"] = task_data.LowerLimitPrice; + data["OpenPrice"] = task_data.OpenPrice; + data["AskPrice5"] = task_data.AskPrice5; + data["AskPrice4"] = task_data.AskPrice4; + data["AskPrice3"] = task_data.AskPrice3; + data["PreClosePrice"] = task_data.PreClosePrice; + data["AskPrice1"] = task_data.AskPrice1; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["AskVolume1"] = task_data.AskVolume1; + data["UpdateTime"] = task_data.UpdateTime; + data["UpdateMillisec"] = task_data.UpdateMillisec; + data["AveragePrice"] = task_data.AveragePrice; + data["BidVolume5"] = task_data.BidVolume5; + data["BidVolume4"] = task_data.BidVolume4; + data["BidVolume3"] = task_data.BidVolume3; + data["BidVolume2"] = task_data.BidVolume2; + data["PreOpenInterest"] = task_data.PreOpenInterest; + data["AskPrice2"] = task_data.AskPrice2; + data["Volume"] = task_data.Volume; + data["AskVolume3"] = task_data.AskVolume3; + data["AskVolume2"] = task_data.AskVolume2; + data["AskVolume5"] = task_data.AskVolume5; + data["AskVolume4"] = task_data.AskVolume4; + data["UpperLimitPrice"] = task_data.UpperLimitPrice; + data["BidVolume1"] = task_data.BidVolume1; + data["InstrumentID"] = task_data.InstrumentID; + data["ClosePrice"] = task_data.ClosePrice; + data["ExchangeID"] = task_data.ExchangeID; + data["TradingDay"] = task_data.TradingDay; + data["PreDelta"] = task_data.PreDelta; + data["OpenInterest"] = task_data.OpenInterest; + data["CurrDelta"] = task_data.CurrDelta; + data["Turnover"] = task_data.Turnover; + data["LastPrice"] = task_data.LastPrice; + data["SettlementPrice"] = task_data.SettlementPrice; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["LowestPrice"] = task_data.LowestPrice; + data["ActionDay"] = task_data.ActionDay; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryDepthMarketData(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryBondInterest(Task task) +{ + CSecurityFtdcBondInterestField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["TradingDay"] = task_data.TradingDay; + data["ExchangeID"] = task_data.ExchangeID; + data["Interest"] = task_data.Interest; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryBondInterest(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryMarketRationInfo(Task task) +{ + CSecurityFtdcMarketRationInfoField task_data = any_cast(task.task_data); + dict data; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeID"] = task_data.ExchangeID; + data["BrokerID"] = task_data.BrokerID; + data["RationVolume"] = task_data.RationVolume; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryMarketRationInfo(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInstrumentCommissionRate(Task task) +{ + CSecurityFtdcInstrumentCommissionRateField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["TradeFeeByMoney"] = task_data.TradeFeeByMoney; + data["Direction"] = task_data.Direction; + data["MinTradeFee"] = task_data.MinTradeFee; + data["StampTaxRateByMoney"] = task_data.StampTaxRateByMoney; + data["InvestorID"] = task_data.InvestorID; + data["MarginByMoney"] = task_data.MarginByMoney; + data["StampTaxRateByVolume"] = task_data.StampTaxRateByVolume; + data["BrokerID"] = task_data.BrokerID; + data["InvestorRange"] = task_data.InvestorRange; + data["TransferFeeRateByVolume"] = task_data.TransferFeeRateByVolume; + data["TransferFeeRateByMoney"] = task_data.TransferFeeRateByMoney; + data["TradeFeeByVolume"] = task_data.TradeFeeByVolume; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInstrumentCommissionRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryETFInstrument(Task task) +{ + CSecurityFtdcETFInstrumentField task_data = any_cast(task.task_data); + dict data; + data["ETFInstrumentID"] = task_data.ETFInstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["ETFPurRedInstrumentID"] = task_data.ETFPurRedInstrumentID; + data["EstimateCashComponent"] = task_data.EstimateCashComponent; + data["CreationRedemptionUnit"] = task_data.CreationRedemptionUnit; + data["Maxcashratio"] = task_data.Maxcashratio; + data["Creationredemption"] = task_data.Creationredemption; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryETFInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryETFBasket(Task task) +{ + CSecurityFtdcETFBasketField task_data = any_cast(task.task_data); + dict data; + data["ETFInstrumentID"] = task_data.ETFInstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["Premium"] = task_data.Premium; + data["StockInstrumentName"] = task_data.StockInstrumentName; + data["CurrenceReplaceStatus"] = task_data.CurrenceReplaceStatus; + data["Volume"] = task_data.Volume; + data["Amount"] = task_data.Amount; + data["StockInstrumentID"] = task_data.StockInstrumentID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryETFBasket(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOFInstrument(Task task) +{ + CSecurityFtdcOFInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["NetPrice"] = task_data.NetPrice; + data["Creationredemption"] = task_data.Creationredemption; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryOFInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQrySFInstrument(Task task) +{ + CSecurityFtdcSFInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["NetPrice"] = task_data.NetPrice; + data["MinMergeVolume"] = task_data.MinMergeVolume; + data["SFInstrumentID"] = task_data.SFInstrumentID; + data["MinSplitVolume"] = task_data.MinSplitVolume; + data["VolumeRatio"] = task_data.VolumeRatio; + data["SplitMergeStatus"] = task_data.SplitMergeStatus; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQrySFInstrument(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOrder(Task task) +{ + CSecurityFtdcOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["NotifySequence"] = task_data.NotifySequence; + data["ActiveUserID"] = task_data.ActiveUserID; + data["VolumeTraded"] = task_data.VolumeTraded; + data["UserProductInfo"] = task_data.UserProductInfo; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["AccountID"] = task_data.AccountID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["ClientID"] = task_data.ClientID; + data["VolumeTotal"] = task_data.VolumeTotal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["SessionID"] = task_data.SessionID; + data["TimeCondition"] = task_data.TimeCondition; + data["OrderStatus"] = task_data.OrderStatus; + data["OrderSysID"] = task_data.OrderSysID; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["IsETF"] = task_data.IsETF; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["StatusMsg"] = task_data.StatusMsg; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["OrderType"] = task_data.OrderType; + data["UpdateTime"] = task_data.UpdateTime; + data["TradingDay"] = task_data.TradingDay; + data["ActiveTime"] = task_data.ActiveTime; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["FrontID"] = task_data.FrontID; + data["SuspendTime"] = task_data.SuspendTime; + data["InstrumentType"] = task_data.InstrumentType; + data["ClearingPartID"] = task_data.ClearingPartID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["CancelTime"] = task_data.CancelTime; + data["GTDDate"] = task_data.GTDDate; + data["OrderLocalID"] = task_data.OrderLocalID; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + data["OrderSource"] = task_data.OrderSource; + data["BranchPBU"] = task_data.BranchPBU; + data["TradeAmount"] = task_data.TradeAmount; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryOrder(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTrade(Task task) +{ + CSecurityFtdcTradeField task_data = any_cast(task.task_data); + dict data; + data["TradeType"] = task_data.TradeType; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TradeTime"] = task_data.TradeTime; + data["Direction"] = task_data.Direction; + data["ParticipantID"] = task_data.ParticipantID; + data["Price"] = task_data.Price; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["OrderSysID"] = task_data.OrderSysID; + data["ClearingPartID"] = task_data.ClearingPartID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["TradeIndex"] = task_data.TradeIndex; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["TradeSource"] = task_data.TradeSource; + data["OffsetFlag"] = task_data.OffsetFlag; + data["OrderLocalID"] = task_data.OrderLocalID; + data["TradeID"] = task_data.TradeID; + data["TradeDate"] = task_data.TradeDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["BranchPBU"] = task_data.BranchPBU; + data["PriceSource"] = task_data.PriceSource; + data["TradingRole"] = task_data.TradingRole; + data["TradeAmount"] = task_data.TradeAmount; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTrade(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestorPosition(Task task) +{ + CSecurityFtdcInvestorPositionField task_data = any_cast(task.task_data); + dict data; + data["LockPosition"] = task_data.LockPosition; + data["MarginTradeAmount"] = task_data.MarginTradeAmount; + data["ShortFrozenAmount"] = task_data.ShortFrozenAmount; + data["ShortSellAmount"] = task_data.ShortSellAmount; + data["TodaySSPosition"] = task_data.TodaySSPosition; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TransferFee"] = task_data.TransferFee; + data["Commission"] = task_data.Commission; + data["ShortSellVolume"] = task_data.ShortSellVolume; + data["CoverFrozenPosition"] = task_data.CoverFrozenPosition; + data["TodayPurRedVolume"] = task_data.TodayPurRedVolume; + data["PurRedShortFrozen"] = task_data.PurRedShortFrozen; + data["CashIn"] = task_data.CashIn; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["ShortSellFrozenAmount"] = task_data.ShortSellFrozenAmount; + data["CloseAmount"] = task_data.CloseAmount; + data["PosiDirection"] = task_data.PosiDirection; + data["LockFrozenPosition"] = task_data.LockFrozenPosition; + data["RepurchasePosition"] = task_data.RepurchasePosition; + data["MarginTradeVolume"] = task_data.MarginTradeVolume; + data["YdPosition"] = task_data.YdPosition; + data["MarginTradeFrozenVolume"] = task_data.MarginTradeFrozenVolume; + data["ConversionRate"] = task_data.ConversionRate; + data["ShortSellFrozenVolume"] = task_data.ShortSellFrozenVolume; + data["OpenVolume"] = task_data.OpenVolume; + data["TodayMTPosition"] = task_data.TodayMTPosition; + data["CoverPosition"] = task_data.CoverPosition; + data["CloseVolume"] = task_data.CloseVolume; + data["AccountID"] = task_data.AccountID; + data["ConversionAmount"] = task_data.ConversionAmount; + data["ShortSellConversionProfit"] = task_data.ShortSellConversionProfit; + data["InstrumentID"] = task_data.InstrumentID; + data["PositionDate"] = task_data.PositionDate; + data["ExchangeID"] = task_data.ExchangeID; + data["MarginTradeFrozenAmount"] = task_data.MarginTradeFrozenAmount; + data["ShortFrozen"] = task_data.ShortFrozen; + data["LongFrozen"] = task_data.LongFrozen; + data["TodayPosition"] = task_data.TodayPosition; + data["TradingDay"] = task_data.TradingDay; + data["PositionCost"] = task_data.PositionCost; + data["BrokerID"] = task_data.BrokerID; + data["FrozenCash"] = task_data.FrozenCash; + data["OpenAmount"] = task_data.OpenAmount; + data["OpenCost"] = task_data.OpenCost; + data["StampTax"] = task_data.StampTax; + data["Position"] = task_data.Position; + data["ExecFrozenPosition"] = task_data.ExecFrozenPosition; + data["ExchangeMargin"] = task_data.ExchangeMargin; + data["PledgeInPosition"] = task_data.PledgeInPosition; + data["SettlementPrice"] = task_data.SettlementPrice; + data["LongFrozenAmount"] = task_data.LongFrozenAmount; + data["InvestorID"] = task_data.InvestorID; + data["UnlockFrozenPosition"] = task_data.UnlockFrozenPosition; + data["YdOpenCost"] = task_data.YdOpenCost; + data["MarginTradeConversionProfit"] = task_data.MarginTradeConversionProfit; + data["SSStockValue"] = task_data.SSStockValue; + data["StockValue"] = task_data.StockValue; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestorPosition(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnOrder(Task task) +{ + CSecurityFtdcOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["NotifySequence"] = task_data.NotifySequence; + data["ActiveUserID"] = task_data.ActiveUserID; + data["VolumeTraded"] = task_data.VolumeTraded; + data["UserProductInfo"] = task_data.UserProductInfo; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["AccountID"] = task_data.AccountID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["ClientID"] = task_data.ClientID; + data["VolumeTotal"] = task_data.VolumeTotal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["SessionID"] = task_data.SessionID; + data["TimeCondition"] = task_data.TimeCondition; + data["OrderStatus"] = task_data.OrderStatus; + data["OrderSysID"] = task_data.OrderSysID; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["IsETF"] = task_data.IsETF; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["StatusMsg"] = task_data.StatusMsg; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["OrderType"] = task_data.OrderType; + data["UpdateTime"] = task_data.UpdateTime; + data["TradingDay"] = task_data.TradingDay; + data["ActiveTime"] = task_data.ActiveTime; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["FrontID"] = task_data.FrontID; + data["SuspendTime"] = task_data.SuspendTime; + data["InstrumentType"] = task_data.InstrumentType; + data["ClearingPartID"] = task_data.ClearingPartID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["CancelTime"] = task_data.CancelTime; + data["GTDDate"] = task_data.GTDDate; + data["OrderLocalID"] = task_data.OrderLocalID; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + data["OrderSource"] = task_data.OrderSource; + data["BranchPBU"] = task_data.BranchPBU; + data["TradeAmount"] = task_data.TradeAmount; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + this->onRtnOrder(data); +}; + +void TdApi::processRtnTrade(Task task) +{ + CSecurityFtdcTradeField task_data = any_cast(task.task_data); + dict data; + data["TradeType"] = task_data.TradeType; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TradeTime"] = task_data.TradeTime; + data["Direction"] = task_data.Direction; + data["ParticipantID"] = task_data.ParticipantID; + data["Price"] = task_data.Price; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["OrderSysID"] = task_data.OrderSysID; + data["ClearingPartID"] = task_data.ClearingPartID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["TradeIndex"] = task_data.TradeIndex; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["TradeSource"] = task_data.TradeSource; + data["OffsetFlag"] = task_data.OffsetFlag; + data["OrderLocalID"] = task_data.OrderLocalID; + data["TradeID"] = task_data.TradeID; + data["TradeDate"] = task_data.TradeDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["SequenceNo"] = task_data.SequenceNo; + data["OrderRef"] = task_data.OrderRef; + data["BrokerOrderSeq"] = task_data.BrokerOrderSeq; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["BranchPBU"] = task_data.BranchPBU; + data["PriceSource"] = task_data.PriceSource; + data["TradingRole"] = task_data.TradingRole; + data["TradeAmount"] = task_data.TradeAmount; + + this->onRtnTrade(data); +}; + +void TdApi::processErrRtnOrderInsert(Task task) +{ + CSecurityFtdcInputOrderField task_data = any_cast(task.task_data); + dict data; + data["ContingentCondition"] = task_data.ContingentCondition; + data["CombOffsetFlag"] = task_data.CombOffsetFlag; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["Direction"] = task_data.Direction; + data["VolumeTotalOriginal"] = task_data.VolumeTotalOriginal; + data["OrderPriceType"] = task_data.OrderPriceType; + data["TimeCondition"] = task_data.TimeCondition; + data["IsAutoSuspend"] = task_data.IsAutoSuspend; + data["StopPrice"] = task_data.StopPrice; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["MinVolume"] = task_data.MinVolume; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["BrokerID"] = task_data.BrokerID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["GTDDate"] = task_data.GTDDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnOrderInsert(data, error); +}; + +void TdApi::processErrRtnOrderAction(Task task) +{ + CSecurityFtdcOrderActionField task_data = any_cast(task.task_data); + dict data; + data["ActionTime"] = task_data.ActionTime; + data["InvestorID"] = task_data.InvestorID; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["ClientID"] = task_data.ClientID; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["OrderActionRef"] = task_data.OrderActionRef; + data["VolumeChange"] = task_data.VolumeChange; + data["SessionID"] = task_data.SessionID; + data["ActionFlag"] = task_data.ActionFlag; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["BrokerID"] = task_data.BrokerID; + data["InstrumentType"] = task_data.InstrumentType; + data["ActionDate"] = task_data.ActionDate; + data["OrderLocalID"] = task_data.OrderLocalID; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["OrderRef"] = task_data.OrderRef; + data["ActionLocalID"] = task_data.ActionLocalID; + data["RequestID"] = task_data.RequestID; + data["FrontID"] = task_data.FrontID; + data["BranchPBU"] = task_data.BranchPBU; + data["OrderActionStatus"] = task_data.OrderActionStatus; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnOrderAction(data, error); +}; + +void TdApi::processRspFundOutByLiber(Task task) +{ + CSecurityFtdcInputFundTransferField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["AccountType"] = task_data.AccountType; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspFundOutByLiber(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnFundOutByLiber(Task task) +{ + CSecurityFtdcFundTransferField task_data = any_cast(task.task_data); + dict data; + data["PlateSerial"] = task_data.PlateSerial; + data["TradingDay"] = task_data.TradingDay; + data["ErrorMsg"] = task_data.ErrorMsg; + data["ErrorID"] = task_data.ErrorID; + data["UserID"] = task_data.UserID; + data["TransferSerial"] = task_data.TransferSerial; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["LiberSerial"] = task_data.LiberSerial; + data["BrokerID"] = task_data.BrokerID; + data["FundDirection"] = task_data.FundDirection; + data["TradeTime"] = task_data.TradeTime; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + this->onRtnFundOutByLiber(data); +}; + +void TdApi::processErrRtnFundOutByLiber(Task task) +{ + CSecurityFtdcInputFundTransferField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["AccountType"] = task_data.AccountType; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnFundOutByLiber(data, error); +}; + +void TdApi::processRtnFundInByBank(Task task) +{ + CSecurityFtdcFundTransferField task_data = any_cast(task.task_data); + dict data; + data["PlateSerial"] = task_data.PlateSerial; + data["TradingDay"] = task_data.TradingDay; + data["ErrorMsg"] = task_data.ErrorMsg; + data["ErrorID"] = task_data.ErrorID; + data["UserID"] = task_data.UserID; + data["TransferSerial"] = task_data.TransferSerial; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["LiberSerial"] = task_data.LiberSerial; + data["BrokerID"] = task_data.BrokerID; + data["FundDirection"] = task_data.FundDirection; + data["TradeTime"] = task_data.TradeTime; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + this->onRtnFundInByBank(data); +}; + +void TdApi::processRspQryFundTransferSerial(Task task) +{ + CSecurityFtdcFundTransferField task_data = any_cast(task.task_data); + dict data; + data["PlateSerial"] = task_data.PlateSerial; + data["TradingDay"] = task_data.TradingDay; + data["ErrorMsg"] = task_data.ErrorMsg; + data["ErrorID"] = task_data.ErrorID; + data["UserID"] = task_data.UserID; + data["TransferSerial"] = task_data.TransferSerial; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["LiberSerial"] = task_data.LiberSerial; + data["BrokerID"] = task_data.BrokerID; + data["FundDirection"] = task_data.FundDirection; + data["TradeTime"] = task_data.TradeTime; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryFundTransferSerial(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspFundInterTransfer(Task task) +{ + CSecurityFtdcFundInterTransferField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspFundInterTransfer(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryFundInterTransferSerial(Task task) +{ + CSecurityFtdcFundInterTransferSerialField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["ErrorMsg"] = task_data.ErrorMsg; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["TransferTime"] = task_data.TransferTime; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["ErrorID"] = task_data.ErrorID; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryFundInterTransferSerial(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnFundInterTransferSerial(Task task) +{ + CSecurityFtdcFundInterTransferSerialField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["ErrorMsg"] = task_data.ErrorMsg; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["TransferTime"] = task_data.TransferTime; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["ErrorID"] = task_data.ErrorID; + data["AccountID"] = task_data.AccountID; + + this->onRtnFundInterTransferSerial(data); +}; + +void TdApi::processErrRtnFundInterTransfer(Task task) +{ + CSecurityFtdcFundInterTransferField task_data = any_cast(task.task_data); + dict data; + data["SerialID"] = task_data.SerialID; + data["TransferType"] = task_data.TransferType; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["Password"] = task_data.Password; + data["TradeAmount"] = task_data.TradeAmount; + data["AccountID"] = task_data.AccountID; + + CSecurityFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnFundInterTransfer(data, error); +}; + + +///------------------------------------------------------------------------------------- +/// +///------------------------------------------------------------------------------------- + +void TdApi::createFtdcTraderApi(string pszFlowPath) +{ + this->api = CSecurityFtdcTraderApi::CreateFtdcTraderApi(pszFlowPath.c_str()); + this->api->RegisterSpi(this); +}; + +void TdApi::release() +{ + this->api->Release(); +}; + +void TdApi::init() +{ + this->api->Init(); +}; + +int TdApi::join() +{ + int i = this->api->Join(); + return i; +}; + +string TdApi::getTradingDay() +{ + string day = this->api->GetTradingDay(); + return day; +}; + +void TdApi::registerFront(string pszFrontAddress) +{ + this->api->RegisterFront((char*)pszFrontAddress.c_str()); +}; + +void TdApi::subscribePrivateTopic(int nType) +{ + //úΪֶд + SECURITY_TE_RESUME_TYPE type; + + switch (nType) + { + case 0: + { + type = SECURITY_TERT_RESTART; + break; + }; + + case 1: + { + type = SECURITY_TERT_RESUME; + break; + }; + + case 2: + { + type = SECURITY_TERT_QUICK; + break; + }; + } + + this->api->SubscribePrivateTopic(type); + + +}; + +void TdApi::subscribePublicTopic(int nType) +{ + //úΪֶд + SECURITY_TE_RESUME_TYPE type; + + switch (nType) + { + case 0: + { + type = SECURITY_TERT_RESTART; + break; + }; + + case 1: + { + type = SECURITY_TERT_RESUME; + break; + }; + + case 2: + { + type = SECURITY_TERT_QUICK; + break; + }; + } + + this->api->SubscribePublicTopic(type); +}; + +int TdApi::reqUserLogin(dict req, int nRequestID) +{ + CSecurityFtdcReqUserLoginField myreq = CSecurityFtdcReqUserLoginField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "MacAddress", myreq.MacAddress); + 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); + int i = this->api->ReqUserLogin(&myreq, nRequestID); + return i; +}; + +int TdApi::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 TdApi::reqOrderInsert(dict req, int nRequestID) +{ + CSecurityFtdcInputOrderField myreq = CSecurityFtdcInputOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "ContingentCondition", &myreq.ContingentCondition); + getChar(req, "CombOffsetFlag", myreq.CombOffsetFlag); + getChar(req, "UserID", myreq.UserID); + getChar(req, "LimitPrice", myreq.LimitPrice); + getInt(req, "UserForceClose", &myreq.UserForceClose); + getChar(req, "Direction", &myreq.Direction); + getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal); + getChar(req, "OrderPriceType", &myreq.OrderPriceType); + getChar(req, "TimeCondition", &myreq.TimeCondition); + getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); + getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); + getChar(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "ExchangeID", myreq.ExchangeID); + getInt(req, "MinVolume", &myreq.MinVolume); + getChar(req, "ForceCloseReason", &myreq.ForceCloseReason); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "CombHedgeFlag", myreq.CombHedgeFlag); + getChar(req, "GTDDate", myreq.GTDDate); + getChar(req, "BusinessUnit", myreq.BusinessUnit); + getChar(req, "OrderRef", myreq.OrderRef); + getChar(req, "InvestorID", myreq.InvestorID); + getChar(req, "VolumeCondition", &myreq.VolumeCondition); + getInt(req, "RequestID", &myreq.RequestID); + int i = this->api->ReqOrderInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqOrderAction(dict req, int nRequestID) +{ + CSecurityFtdcInputOrderActionField myreq = CSecurityFtdcInputOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "OrderLocalID", myreq.OrderLocalID); + getInt(req, "OrderActionRef", &myreq.OrderActionRef); + getChar(req, "UserID", myreq.UserID); + getChar(req, "UserID", myreq.UserID); + getChar(req, "OrderRef", myreq.OrderRef); + getChar(req, "InvestorID", myreq.InvestorID); + getInt(req, "SessionID", &myreq.SessionID); + getInt(req, "VolumeChange", &myreq.VolumeChange); + getChar(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "ActionFlag", &myreq.ActionFlag); + getInt(req, "FrontID", &myreq.FrontID); + getChar(req, "BranchPBU", myreq.BranchPBU); + int i = this->api->ReqOrderAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqUserPasswordUpdate(dict req, int nRequestID) +{ + CSecurityFtdcUserPasswordUpdateField myreq = CSecurityFtdcUserPasswordUpdateField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "UserID", myreq.UserID); + getChar(req, "NewPassword", myreq.NewPassword); + getChar(req, "OldPassword", myreq.OldPassword); + getChar(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqUserPasswordUpdate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqTradingAccountPasswordUpdate(dict req, int nRequestID) +{ + CSecurityFtdcTradingAccountPasswordUpdateField myreq = CSecurityFtdcTradingAccountPasswordUpdateField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "NewPassword", myreq.NewPassword); + getChar(req, "OldPassword", myreq.OldPassword); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "AccountID", myreq.AccountID); + int i = this->api->ReqTradingAccountPasswordUpdate(&myreq, nRequestID); + return i; +}; + +int TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::reqQryDepthMarketData(dict req, int nRequestID) +{ + CSecurityFtdcQryDepthMarketDataField myreq = CSecurityFtdcQryDepthMarketDataField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "InstrumentID", myreq.InstrumentID); + int i = this->api->ReqQryDepthMarketData(&myreq, nRequestID); + return i; +}; + +int TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::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 TdApi::reqFundOutByLiber(dict req, int nRequestID) +{ + CSecurityFtdcInputFundTransferField myreq = CSecurityFtdcInputFundTransferField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "UserID", myreq.UserID); + getChar(req, "InvestorID", myreq.InvestorID); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "AccountType", &myreq.AccountType); + getChar(req, "Password", myreq.Password); + getChar(req, "Password", myreq.Password); + getChar(req, "Digest", myreq.Digest); + getChar(req, "AccountID", myreq.AccountID); + int i = this->api->ReqFundOutByLiber(&myreq, nRequestID); + return i; +}; + +int TdApi::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 TdApi::reqFundInterTransfer(dict req, int nRequestID) +{ + CSecurityFtdcFundInterTransferField myreq = CSecurityFtdcFundInterTransferField(); + memset(&myreq, 0, sizeof(myreq)); + getInt(req, "SerialID", &myreq.SerialID); + getChar(req, "TransferType", &myreq.TransferType); + getChar(req, "UserID", myreq.UserID); + getChar(req, "InvestorID", myreq.InvestorID); + getChar(req, "BrokerID", myreq.BrokerID); + getChar(req, "Password", myreq.Password); + getChar(req, "Password", myreq.Password); + getChar(req, "AccountID", myreq.AccountID); + int i = this->api->ReqFundInterTransfer(&myreq, nRequestID); + return i; +}; + +int TdApi::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; +}; + + +///------------------------------------------------------------------------------------- +///Boost.Pythonװ +///------------------------------------------------------------------------------------- + +struct TdApiWrap : TdApi, wrapper < TdApi > +{ + virtual void onFrontConnected() + { + PyLock lock; + this->get_override("onFrontConnected")(); + }; + + virtual void onFrontDisconnected(int i) + { + PyLock lock; + this->get_override("onFrontDisconnected")(i); + }; + + virtual void onHeartBeatWarning(int i) + { + PyLock lock; + this->get_override("onHeartBeatWarning")(i); + }; + + virtual void onRspError(dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspError")(error, id, last); + }; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspUserLogin")(data, error, id, last); + }; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspUserLogout")(data, error, id, last); + }; + + virtual void onRspOrderInsert(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspOrderInsert")(data, error, id, last); + }; + + virtual void onRspOrderAction(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspOrderAction")(data, error, id, last); + }; + + virtual void onRspUserPasswordUpdate(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspUserPasswordUpdate")(data, error, id, last); + }; + + virtual void onRspTradingAccountPasswordUpdate(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspTradingAccountPasswordUpdate")(data, error, id, last); + }; + + virtual void onRspQryExchange(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryExchange")(data, error, id, last); + }; + + virtual void onRspQryInstrument(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryInstrument")(data, error, id, last); + }; + + virtual void onRspQryInvestor(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryInvestor")(data, error, id, last); + }; + + virtual void onRspQryTradingCode(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryTradingCode")(data, error, id, last); + }; + + virtual void onRspQryTradingAccount(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryTradingAccount")(data, error, id, last); + }; + + virtual void onRspQryDepthMarketData(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryDepthMarketData")(data, error, id, last); + }; + + virtual void onRspQryBondInterest(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryBondInterest")(data, error, id, last); + }; + + virtual void onRspQryMarketRationInfo(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryMarketRationInfo")(data, error, id, last); + }; + + virtual void onRspQryInstrumentCommissionRate(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryInstrumentCommissionRate")(data, error, id, last); + }; + + virtual void onRspQryETFInstrument(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryETFInstrument")(data, error, id, last); + }; + + virtual void onRspQryETFBasket(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryETFBasket")(data, error, id, last); + }; + + virtual void onRspQryOFInstrument(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryOFInstrument")(data, error, id, last); + }; + + virtual void onRspQrySFInstrument(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQrySFInstrument")(data, error, id, last); + }; + + virtual void onRspQryOrder(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryOrder")(data, error, id, last); + }; + + virtual void onRspQryTrade(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryTrade")(data, error, id, last); + }; + + virtual void onRspQryInvestorPosition(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryInvestorPosition")(data, error, id, last); + }; + + virtual void onRtnOrder(dict data) + { + PyLock lock; + this->get_override("onRtnOrder")(data); + }; + + virtual void onRtnTrade(dict data) + { + PyLock lock; + this->get_override("onRtnTrade")(data); + }; + + virtual void onErrRtnOrderInsert(dict data, dict error) + { + PyLock lock; + this->get_override("onErrRtnOrderInsert")(data, error); + }; + + virtual void onErrRtnOrderAction(dict data, dict error) + { + PyLock lock; + this->get_override("onErrRtnOrderAction")(data, error); + }; + + virtual void onRspFundOutByLiber(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspFundOutByLiber")(data, error, id, last); + }; + + virtual void onRtnFundOutByLiber(dict data) + { + PyLock lock; + this->get_override("onRtnFundOutByLiber")(data); + }; + + virtual void onErrRtnFundOutByLiber(dict data, dict error) + { + PyLock lock; + this->get_override("onErrRtnFundOutByLiber")(data, error); + }; + + virtual void onRtnFundInByBank(dict data) + { + PyLock lock; + this->get_override("onRtnFundInByBank")(data); + }; + + virtual void onRspQryFundTransferSerial(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryFundTransferSerial")(data, error, id, last); + }; + + virtual void onRspFundInterTransfer(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspFundInterTransfer")(data, error, id, last); + }; + + virtual void onRspQryFundInterTransferSerial(dict data, dict error, int id, bool last) + { + PyLock lock; + this->get_override("onRspQryFundInterTransferSerial")(data, error, id, last); + }; + + virtual void onRtnFundInterTransferSerial(dict data) + { + PyLock lock; + this->get_override("onRtnFundInterTransferSerial")(data); + }; + + virtual void onErrRtnFundInterTransfer(dict data, dict error) + { + PyLock lock; + this->get_override("onErrRtnFundInterTransfer")(data, error); + }; +}; + + +BOOST_PYTHON_MODULE(vnltstd) +{ + PyEval_InitThreads(); //ʱУ֤ȴGIL + + class_("TdApi") + .def("createFtdcTraderApi", &TdApiWrap::createFtdcTraderApi) + .def("release", &TdApiWrap::release) + .def("init", &TdApiWrap::init) + .def("join", &TdApiWrap::join) + .def("getTradingDay", &TdApiWrap::getTradingDay) + .def("registerFront", &TdApiWrap::registerFront) + .def("subscribePrivateTopic", &TdApiWrap::subscribePrivateTopic) + .def("subscribePublicTopic", &TdApiWrap::subscribePublicTopic) + .def("reqUserLogin", &TdApiWrap::reqUserLogin) + .def("reqUserLogout", &TdApiWrap::reqUserLogout) + .def("reqOrderInsert", &TdApiWrap::reqOrderInsert) + .def("reqOrderAction", &TdApiWrap::reqOrderAction) + .def("reqUserPasswordUpdate", &TdApiWrap::reqUserPasswordUpdate) + .def("reqTradingAccountPasswordUpdate", &TdApiWrap::reqTradingAccountPasswordUpdate) + .def("reqQryExchange", &TdApiWrap::reqQryExchange) + .def("reqQryInstrument", &TdApiWrap::reqQryInstrument) + .def("reqQryInvestor", &TdApiWrap::reqQryInvestor) + .def("reqQryTradingCode", &TdApiWrap::reqQryTradingCode) + .def("reqQryTradingAccount", &TdApiWrap::reqQryTradingAccount) + .def("reqQryDepthMarketData", &TdApiWrap::reqQryDepthMarketData) + .def("reqQryBondInterest", &TdApiWrap::reqQryBondInterest) + .def("reqQryMarketRationInfo", &TdApiWrap::reqQryMarketRationInfo) + .def("reqQryInstrumentCommissionRate", &TdApiWrap::reqQryInstrumentCommissionRate) + .def("reqQryETFInstrument", &TdApiWrap::reqQryETFInstrument) + .def("reqQryETFBasket", &TdApiWrap::reqQryETFBasket) + .def("reqQryOFInstrument", &TdApiWrap::reqQryOFInstrument) + .def("reqQrySFInstrument", &TdApiWrap::reqQrySFInstrument) + .def("reqQryOrder", &TdApiWrap::reqQryOrder) + .def("reqQryTrade", &TdApiWrap::reqQryTrade) + .def("reqQryInvestorPosition", &TdApiWrap::reqQryInvestorPosition) + .def("reqFundOutByLiber", &TdApiWrap::reqFundOutByLiber) + .def("reqQryFundTransferSerial", &TdApiWrap::reqQryFundTransferSerial) + .def("reqFundInterTransfer", &TdApiWrap::reqFundInterTransfer) + .def("reqQryFundInterTransferSerial", &TdApiWrap::reqQryFundInterTransferSerial) + + .def("onFrontConnected", pure_virtual(&TdApiWrap::onFrontConnected)) + .def("onFrontDisconnected", pure_virtual(&TdApiWrap::onFrontDisconnected)) + .def("onHeartBeatWarning", pure_virtual(&TdApiWrap::onHeartBeatWarning)) + .def("onRspError", pure_virtual(&TdApiWrap::onRspError)) + .def("onRspUserLogin", pure_virtual(&TdApiWrap::onRspUserLogin)) + .def("onRspUserLogout", pure_virtual(&TdApiWrap::onRspUserLogout)) + .def("onRspOrderInsert", pure_virtual(&TdApiWrap::onRspOrderInsert)) + .def("onRspOrderAction", pure_virtual(&TdApiWrap::onRspOrderAction)) + .def("onRspUserPasswordUpdate", pure_virtual(&TdApiWrap::onRspUserPasswordUpdate)) + .def("onRspTradingAccountPasswordUpdate", pure_virtual(&TdApiWrap::onRspTradingAccountPasswordUpdate)) + .def("onRspQryExchange", pure_virtual(&TdApiWrap::onRspQryExchange)) + .def("onRspQryInstrument", pure_virtual(&TdApiWrap::onRspQryInstrument)) + .def("onRspQryInvestor", pure_virtual(&TdApiWrap::onRspQryInvestor)) + .def("onRspQryTradingCode", pure_virtual(&TdApiWrap::onRspQryTradingCode)) + .def("onRspQryTradingAccount", pure_virtual(&TdApiWrap::onRspQryTradingAccount)) + .def("onRspQryDepthMarketData", pure_virtual(&TdApiWrap::onRspQryDepthMarketData)) + .def("onRspQryBondInterest", pure_virtual(&TdApiWrap::onRspQryBondInterest)) + .def("onRspQryMarketRationInfo", pure_virtual(&TdApiWrap::onRspQryMarketRationInfo)) + .def("onRspQryInstrumentCommissionRate", pure_virtual(&TdApiWrap::onRspQryInstrumentCommissionRate)) + .def("onRspQryETFInstrument", pure_virtual(&TdApiWrap::onRspQryETFInstrument)) + .def("onRspQryETFBasket", pure_virtual(&TdApiWrap::onRspQryETFBasket)) + .def("onRspQryOFInstrument", pure_virtual(&TdApiWrap::onRspQryOFInstrument)) + .def("onRspQrySFInstrument", pure_virtual(&TdApiWrap::onRspQrySFInstrument)) + .def("onRspQryOrder", pure_virtual(&TdApiWrap::onRspQryOrder)) + .def("onRspQryTrade", pure_virtual(&TdApiWrap::onRspQryTrade)) + .def("onRspQryInvestorPosition", pure_virtual(&TdApiWrap::onRspQryInvestorPosition)) + .def("onRtnOrder", pure_virtual(&TdApiWrap::onRtnOrder)) + .def("onRtnTrade", pure_virtual(&TdApiWrap::onRtnTrade)) + .def("onErrRtnOrderInsert", pure_virtual(&TdApiWrap::onErrRtnOrderInsert)) + .def("onErrRtnOrderAction", pure_virtual(&TdApiWrap::onErrRtnOrderAction)) + .def("onRspFundOutByLiber", pure_virtual(&TdApiWrap::onRspFundOutByLiber)) + .def("onRtnFundOutByLiber", pure_virtual(&TdApiWrap::onRtnFundOutByLiber)) + .def("onErrRtnFundOutByLiber", pure_virtual(&TdApiWrap::onErrRtnFundOutByLiber)) + .def("onRtnFundInByBank", pure_virtual(&TdApiWrap::onRtnFundInByBank)) + .def("onRspQryFundTransferSerial", pure_virtual(&TdApiWrap::onRspQryFundTransferSerial)) + .def("onRspFundInterTransfer", pure_virtual(&TdApiWrap::onRspFundInterTransfer)) + .def("onRspQryFundInterTransferSerial", pure_virtual(&TdApiWrap::onRspQryFundInterTransferSerial)) + .def("onRtnFundInterTransferSerial", pure_virtual(&TdApiWrap::onRtnFundInterTransferSerial)) + .def("onErrRtnFundInterTransfer", pure_virtual(&TdApiWrap::onErrRtnFundInterTransfer)) + ; +} \ No newline at end of file diff --git a/vn.lts/vnltstd/pyltstd/vnltstd.h b/vn.lts/vnltstd/pyltstd/vnltstd.h new file mode 100644 index 00000000..417778fe --- /dev/null +++ b/vn.lts/vnltstd/pyltstd/vnltstd.h @@ -0,0 +1,558 @@ +//˵ + +//ϵͳ +#include "stdafx.h" +#include +#include + +//Boost +#define BOOST_PYTHON_STATIC_LIB +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //е̹߳ +#include //е̹߳ +#include //еʵ + +//API +#include "SecurityFtdcTraderApi.h" + +//ռ +using namespace std; +using namespace boost::python; +using namespace boost; + +// +#define ONFRONTCONNECTED 1 +#define ONFRONTDISCONNECTED 2 +#define ONHEARTBEATWARNING 3 +#define ONRSPERROR 4 +#define ONRSPUSERLOGIN 5 +#define ONRSPUSERLOGOUT 6 +#define ONRSPORDERINSERT 7 +#define ONRSPORDERACTION 8 +#define ONRSPUSERPASSWORDUPDATE 9 +#define ONRSPTRADINGACCOUNTPASSWORDUPDATE 10 +#define ONRSPQRYEXCHANGE 11 +#define ONRSPQRYINSTRUMENT 12 +#define ONRSPQRYINVESTOR 13 +#define ONRSPQRYTRADINGCODE 14 +#define ONRSPQRYTRADINGACCOUNT 15 +#define ONRSPQRYDEPTHMARKETDATA 16 +#define ONRSPQRYBONDINTEREST 17 +#define ONRSPQRYMARKETRATIONINFO 18 +#define ONRSPQRYINSTRUMENTCOMMISSIONRATE 19 +#define ONRSPQRYETFINSTRUMENT 20 +#define ONRSPQRYETFBASKET 21 +#define ONRSPQRYOFINSTRUMENT 22 +#define ONRSPQRYSFINSTRUMENT 23 +#define ONRSPQRYORDER 24 +#define ONRSPQRYTRADE 25 +#define ONRSPQRYINVESTORPOSITION 26 +#define ONRTNORDER 27 +#define ONRTNTRADE 28 +#define ONERRRTNORDERINSERT 29 +#define ONERRRTNORDERACTION 30 +#define ONRSPFUNDOUTBYLIBER 31 +#define ONRTNFUNDOUTBYLIBER 32 +#define ONERRRTNFUNDOUTBYLIBER 33 +#define ONRTNFUNDINBYBANK 34 +#define ONRSPQRYFUNDTRANSFERSERIAL 35 +#define ONRSPFUNDINTERTRANSFER 36 +#define ONRSPQRYFUNDINTERTRANSFERSERIAL 37 +#define ONRTNFUNDINTERTRANSFERSERIAL 38 +#define ONERRRTNFUNDINTERTRANSFER 39 + + +///------------------------------------------------------------------------------------- +///APIеIJ +///------------------------------------------------------------------------------------- + +//GILȫ򻯻ȡã +//ڰC++̻߳GILӶֹpython +class PyLock +{ +private: + PyGILState_STATE gil_state; + +public: + //ijдöʱGIL + PyLock() + { + gil_state = PyGILState_Ensure(); + } + + //ijɺٸöʱGIL + ~PyLock() + { + PyGILState_Release(gil_state); + } +}; + + +//ṹ +struct Task +{ + int task_name; //صƶӦij + any task_data; //ݽṹ + any task_error; //ṹ + int task_id; //id + bool task_last; //ǷΪ󷵻 +}; + + +///̰߳ȫĶ +template + +class ConcurrentQueue +{ +private: + queue the_queue; //׼ + mutable mutex the_mutex; //boost + condition_variable the_condition_variable; //boost + +public: + + //µ + void push(Data const& data) + { + mutex::scoped_lock lock(the_mutex); //ȡ + the_queue.push(data); //д + lock.unlock(); //ͷ + the_condition_variable.notify_one(); //֪ͨȴ߳ + } + + //ǷΪ + bool empty() const + { + mutex::scoped_lock lock(the_mutex); + return the_queue.empty(); + } + + //ȡ + Data wait_and_pop() + { + mutex::scoped_lock lock(the_mutex); + + while (the_queue.empty()) //Ϊʱ + { + the_condition_variable.wait(lock); //ȴ֪ͨ + } + + Data popped_value = the_queue.front(); //ȡеһ + the_queue.pop(); //ɾ + return popped_value; //ظ + } + +}; + + +//ֵлȡijֵӦֵṹֵ +void getInt(dict d, string key, int* value); + + +//ֵлȡijֵӦĸֵṹֵ +void getDouble(dict d, string key, double* value); + + +//ֵлȡijֵӦֵַṹֵ +void getChar(dict d, string key, char* value); + + + +///------------------------------------------------------------------------------------- +///C++ SPIĻصʵ +///------------------------------------------------------------------------------------- + +//APIļ̳ʵ +class TdApi : public CSecurityFtdcTraderSpi +{ +private: + CSecurityFtdcTraderApi* api; //API + thread *task_thread; //ָ߳루pythonݣ + ConcurrentQueue task_queue; // + +public: + TdApi() + { + function0 f = boost::bind(&TdApi::processTask, this); + thread t(f); + this->task_thread = &t; + }; + + ~TdApi() + { + }; + + //------------------------------------------------------------------------------------- + //APIص + //------------------------------------------------------------------------------------- + + ///ͻ뽻׺̨ͨʱδ¼ǰ÷á + virtual void OnFrontConnected(); + + ///ͻ뽻׺̨ͨӶϿʱ÷áAPIԶӣͻ˿ɲ + ///@param nReason ԭ + /// 0x1001 ʧ + /// 0x1002 дʧ + /// 0x2001 ʱ + /// 0x2002 ʧ + /// 0x2003 յ + virtual void OnFrontDisconnected(int nReason); + + ///ʱ档ʱδյʱ÷á + ///@param nTimeLapse ϴνձĵʱ + virtual void OnHeartBeatWarning(int nTimeLapse); + + ///Ӧ + virtual void OnRspError(CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///¼Ӧ + virtual void OnRspUserLogin(CSecurityFtdcRspUserLoginField *pRspUserLogin, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///dzӦ + virtual void OnRspUserLogout(CSecurityFtdcUserLogoutField *pUserLogout, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///¼Ӧ + virtual void OnRspOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///Ӧ + virtual void OnRspOrderAction(CSecurityFtdcInputOrderActionField *pInputOrderAction, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CSecurityFtdcUserPasswordUpdateField *pUserPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CSecurityFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯӦ + virtual void OnRspQryExchange(CSecurityFtdcExchangeField *pExchange, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯԼӦ + virtual void OnRspQryInstrument(CSecurityFtdcInstrumentField *pInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯͶӦ + virtual void OnRspQryInvestor(CSecurityFtdcInvestorField *pInvestor, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯױӦ + virtual void OnRspQryTradingCode(CSecurityFtdcTradingCodeField *pTradingCode, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CSecurityFtdcTradingAccountField *pTradingAccount, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CSecurityFtdcDepthMarketDataField *pDepthMarketData, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯծȯϢӦ + virtual void OnRspQryBondInterest(CSecurityFtdcBondInterestField *pBondInterest, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯֵϢӦ + virtual void OnRspQryMarketRationInfo(CSecurityFtdcMarketRationInfoField *pMarketRationInfo, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CSecurityFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯETFԼӦ + virtual void OnRspQryETFInstrument(CSecurityFtdcETFInstrumentField *pETFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯETFƱӦ + virtual void OnRspQryETFBasket(CSecurityFtdcETFBasketField *pETFBasket, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯOFԼӦ + virtual void OnRspQryOFInstrument(CSecurityFtdcOFInstrumentField *pOFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯSFԼӦ + virtual void OnRspQrySFInstrument(CSecurityFtdcSFInstrumentField *pSFInstrument, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯӦ + virtual void OnRspQryOrder(CSecurityFtdcOrderField *pOrder, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯɽӦ + virtual void OnRspQryTrade(CSecurityFtdcTradeField *pTrade, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CSecurityFtdcInvestorPositionField *pInvestorPosition, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///֪ͨ + virtual void OnRtnOrder(CSecurityFtdcOrderField *pOrder); + + ///ɽ֪ͨ + virtual void OnRtnTrade(CSecurityFtdcTradeField *pTrade); + + ///¼ر + virtual void OnErrRtnOrderInsert(CSecurityFtdcInputOrderField *pInputOrder, CSecurityFtdcRspInfoField *pRspInfo); + + ///ر + virtual void OnErrRtnOrderAction(CSecurityFtdcOrderActionField *pOrderAction, CSecurityFtdcRspInfoField *pRspInfo); + + ///LiberӦ + virtual void OnRspFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///Liber֪ͨ + virtual void OnRtnFundOutByLiber(CSecurityFtdcFundTransferField *pFundTransfer); + + ///Liberر + virtual void OnErrRtnFundOutByLiber(CSecurityFtdcInputFundTransferField *pInputFundTransfer, CSecurityFtdcRspInfoField *pRspInfo); + + ///з֪ͨ + virtual void OnRtnFundInByBank(CSecurityFtdcFundTransferField *pFundTransfer); + + ///ʽת˲ѯӦ + virtual void OnRspQryFundTransferSerial(CSecurityFtdcFundTransferField *pFundTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ʽתӦ + virtual void OnRspFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ʽתˮѯӦ + virtual void OnRspQryFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial, CSecurityFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ʽתˮ֪ͨ + virtual void OnRtnFundInterTransferSerial(CSecurityFtdcFundInterTransferSerialField *pFundInterTransferSerial); + + ///ʽתر + virtual void OnErrRtnFundInterTransfer(CSecurityFtdcFundInterTransferField *pFundInterTransfer, CSecurityFtdcRspInfoField *pRspInfo); + + //------------------------------------------------------------------------------------- + //task + //------------------------------------------------------------------------------------- + + void processTask(); + + void processFrontConnected(Task task); + + void processFrontDisconnected(Task task); + + void processHeartBeatWarning(Task task); + + void processRspError(Task task); + + void processRspUserLogin(Task task); + + void processRspUserLogout(Task task); + + void processRspOrderInsert(Task task); + + void processRspOrderAction(Task task); + + void processRspUserPasswordUpdate(Task task); + + void processRspTradingAccountPasswordUpdate(Task task); + + void processRspQryExchange(Task task); + + void processRspQryInstrument(Task task); + + void processRspQryInvestor(Task task); + + void processRspQryTradingCode(Task task); + + void processRspQryTradingAccount(Task task); + + void processRspQryDepthMarketData(Task task); + + void processRspQryBondInterest(Task task); + + void processRspQryMarketRationInfo(Task task); + + void processRspQryInstrumentCommissionRate(Task task); + + void processRspQryETFInstrument(Task task); + + void processRspQryETFBasket(Task task); + + void processRspQryOFInstrument(Task task); + + void processRspQrySFInstrument(Task task); + + void processRspQryOrder(Task task); + + void processRspQryTrade(Task task); + + void processRspQryInvestorPosition(Task task); + + void processRtnOrder(Task task); + + void processRtnTrade(Task task); + + void processErrRtnOrderInsert(Task task); + + void processErrRtnOrderAction(Task task); + + void processRspFundOutByLiber(Task task); + + void processRtnFundOutByLiber(Task task); + + void processErrRtnFundOutByLiber(Task task); + + void processRtnFundInByBank(Task task); + + void processRspQryFundTransferSerial(Task task); + + void processRspFundInterTransfer(Task task); + + void processRspQryFundInterTransferSerial(Task task); + + void processRtnFundInterTransferSerial(Task task); + + void processErrRtnFundInterTransfer(Task task); + + //------------------------------------------------------------------------------------- + //dataصֵ + //errorصĴֵ + //idid + //lastǷΪ󷵻 + //i + //------------------------------------------------------------------------------------- + + virtual void onFrontConnected(){}; + + virtual void onFrontDisconnected(int i){}; + + virtual void onHeartBeatWarning(int i){}; + + virtual void onRspError(dict error, int id, bool last) {}; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) {}; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) {}; + + virtual void onRspOrderInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspOrderAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspUserPasswordUpdate(dict data, dict error, int id, bool last) {}; + + virtual void onRspTradingAccountPasswordUpdate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExchange(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInstrument(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInvestor(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryTradingCode(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryTradingAccount(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryDepthMarketData(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryBondInterest(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryMarketRationInfo(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInstrumentCommissionRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryETFInstrument(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryETFBasket(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryOFInstrument(dict data, dict error, int id, bool last) {}; + + virtual void onRspQrySFInstrument(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryOrder(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryTrade(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInvestorPosition(dict data, dict error, int id, bool last) {}; + + virtual void onRtnOrder(dict data) {}; + + virtual void onRtnTrade(dict data) {}; + + virtual void onErrRtnOrderInsert(dict data, dict error) {}; + + virtual void onErrRtnOrderAction(dict data, dict error) {}; + + virtual void onRspFundOutByLiber(dict data, dict error, int id, bool last) {}; + + virtual void onRtnFundOutByLiber(dict data) {}; + + virtual void onErrRtnFundOutByLiber(dict data, dict error) {}; + + virtual void onRtnFundInByBank(dict data) {}; + + virtual void onRspQryFundTransferSerial(dict data, dict error, int id, bool last) {}; + + virtual void onRspFundInterTransfer(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryFundInterTransferSerial(dict data, dict error, int id, bool last) {}; + + virtual void onRtnFundInterTransferSerial(dict data) {}; + + virtual void onErrRtnFundInterTransfer(dict data, dict error) {}; + + //------------------------------------------------------------------------------------- + //req:ֵ + //------------------------------------------------------------------------------------- + + void createFtdcTraderApi(string pszFlowPath = ""); + + void release(); + + void init(); + + int join(); + + string getTradingDay(); + + void registerFront(string pszFrontAddress); + + void subscribePrivateTopic(int nType); + + void subscribePublicTopic(int nType); + + int reqUserLogin(dict req, int nRequestID); + + int reqUserLogout(dict req, int nRequestID); + + int reqOrderInsert(dict req, int nRequestID); + + int reqOrderAction(dict req, int nRequestID); + + int reqUserPasswordUpdate(dict req, int nRequestID); + + int reqTradingAccountPasswordUpdate(dict req, int nRequestID); + + int reqQryExchange(dict req, int nRequestID); + + int reqQryInstrument(dict req, int nRequestID); + + int reqQryInvestor(dict req, int nRequestID); + + int reqQryTradingCode(dict req, int nRequestID); + + int reqQryTradingAccount(dict req, int nRequestID); + + int reqQryDepthMarketData(dict req, int nRequestID); + + int reqQryBondInterest(dict req, int nRequestID); + + int reqQryMarketRationInfo(dict req, int nRequestID); + + int reqQryInstrumentCommissionRate(dict req, int nRequestID); + + int reqQryETFInstrument(dict req, int nRequestID); + + int reqQryETFBasket(dict req, int nRequestID); + + int reqQryOFInstrument(dict req, int nRequestID); + + int reqQrySFInstrument(dict req, int nRequestID); + + int reqQryOrder(dict req, int nRequestID); + + int reqQryTrade(dict req, int nRequestID); + + int reqQryInvestorPosition(dict req, int nRequestID); + + int reqFundOutByLiber(dict req, int nRequestID); + + int reqQryFundTransferSerial(dict req, int nRequestID); + + int reqFundInterTransfer(dict req, int nRequestID); + + int reqQryFundInterTransferSerial(dict req, int nRequestID); +};