diff --git a/vn.ctp/vnctpmd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml b/vn.ctp/vnctpmd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml index 1ebb14536d..0759817f9e 100644 --- a/vn.ctp/vnctpmd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml +++ b/vn.ctp/vnctpmd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml @@ -1,5 +1,5 @@ - AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAFu2zqVyKekyvVmiKknbo5gAAAAACAAAAAAAQZgAAAAEAACAAAAAAYmnCE5TZ7OTMycBfVOT5oRy7AAf9RG/yNygue3I/KgAAAAAOgAAAAAIAACAAAABNPnwcQSkIhCBqPDlzsY14A7QhHxWle3w4tJAd8EpvmhAAAADpa6MuW7qJqbUoGp68HfxTQAAAAFM1L12/VZX0bKg3A4QLJrHd62B2rhv4emdG+dsfUENr0YV2ELCAkb6TcoqTvRHrEn1GlvU9G5THu0m1mllqFPs= + AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAyRIhRmRN8UK7w5RuPHePCQAAAAACAAAAAAAQZgAAAAEAACAAAABOKZJ+rmRrqvwh5QNfnCozvUYDOg+U0BzjckGAMhcYjQAAAAAOgAAAAAIAACAAAABhb4q4toOQ9w2A0T0uaQRj2eZRLPM5uC94WAyAcK9T+RAAAADkg9a8iCcry5TKQN55FgXBQAAAAA/yyrOHkXNSwl7z644L4X680aDKtmMvD38Fwvi8mIW48PLSVfOFYjTlhO/lbIPFWfHENRgYSShBuwZq2JZC4Cg= \ No newline at end of file diff --git a/vn.ctp/vnctptd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml b/vn.ctp/vnctptd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml new file mode 100644 index 0000000000..cbc957e64a --- /dev/null +++ b/vn.ctp/vnctptd/Visual Studio 2013/settings/Windows Azure Subscriptions.xml @@ -0,0 +1,5 @@ + + + + AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAyRIhRmRN8UK7w5RuPHePCQAAAAACAAAAAAAQZgAAAAEAACAAAADf91WYlm11XNlY7oqd3a/lm23SaZ+dbvdXbsHLH8XtIQAAAAAOgAAAAAIAACAAAACabh6Uk42N14p8/h/LJl5cueb8GnuquGzdgRt632QaqBAAAACJ3D67W4v3AJfMXokvrZL0QAAAACKDHSe4qcbNXTFiPSsWABZTXHPj/HA8LEdrFx2kT2ihCkykngHqEnoX0Jxjpb35ruIVUL0YVwZxLkAjjPPSttk= + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.ctp_t2t/CMakeLists.txt b/vn.how/tick2trade/vn.ctp_t2t/CMakeLists.txt new file mode 100644 index 0000000000..c024981b19 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/CMakeLists.txt @@ -0,0 +1,106 @@ +cmake_minimum_required(VERSION 2.8) +project(vn_ctp_api) + +# 设置使用的编译器 +set(CMAKE_BUILD_TYPE "Release") +if (CMAKE_COMPILER_IS_GNUC OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++11") +endif () + +# 设置输出目录 +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) + +# 使用64位编译 +option(USE_64BITS "comiple 64bits" ON) +if (USE_64BITS) + add_definitions(-DUSE_64BITS) + #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") +endif() + +# 设置C++ API源文件的所在目录 +if (WIN32) + set(CTPAPI_PATH ctpapi) +elseif (UNIX) + message("Under unix: " ${CMAKE_SIZEOF_VOID_P}) + if (CMAKE_SIZEOF_VOID_P MATCHES "8") + set(CTPAPI_PATH ctpapi/x64_linux) + endif() +endif() +include_directories(${CTPAPI_PATH}) +set(CTPAPI_LIBRARY ) +find_library(CTPAPI_MD_LIBRARY + NAMES thostmduserapi + PATHS ${CTPAPI_PATH}) +find_library(CTPAPI_TD_LIBRARY + NAMES thosttraderapi + PATHS ${CTPAPI_PATH}) + + +# 设置编译源文件 +set (vnctpmd ) +set (vnctptd ) + +option(BUILD_CTP_MD "build ctp md" ON) +if (BUILD_CTP_MD) + add_definitions(-DBUILD_CTP_MD) + set(CTP_MD_PATH vnctpmd/vnctpmd) + include_directories(CTP_MD_PATH) + set(VN_CTP_MD_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/vnctpmd/vnctpmd/vnctpmd.cpp) + add_library(vnctpmd SHARED ${VN_CTP_MD_SOURCE}) +endif() +option(BUILD_CTP_TD "build ctp td" ON) +if (BUILD_CTP_TD) + add_definitions(-DBUILD_CTP_TD) + set(CTP_TD_PATH vnctptd/vnctptd) + include_directories(CTP_TD_PATH) + set(VN_CTP_TD_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/vnctptd/vnctptd/vnctptd.cpp) + add_library(vnctptd SHARED ${VN_CTP_TD_SOURCE}) +endif() + +# 设置Python所在的目录 +set(PYTHON_LIBRARY ) +if (WIN32) +set(PYTHON_INCLUDE_PATH C:/Python27/include) +find_library(PYTHON_LIBRARY + NAMES python27 + PATHS C:/Python27/libs) +include_directories(${PYTHON_INCLUDE_PATH}) +else() +set(PYTHON_INCLUDE_PATH /usr/include/python2.7/) +find_library(PYTHON_LIBRARY + NAMES python2.7 + PATHS /usr/lib/x86_64-linux-gnu) +include_directories(${PYTHON_INCLUDE_PATH}) +endif() + +# 链接boost库,anaconda +if (WIN32) + set(Boost_USE_STATIC_LIBS ON) #链接boost静态库 +endif() +set(Boost_USE_MULTITHREADED ON) +find_package(Boost 1.55.0 COMPONENTS python thread date_time system chrono REQUIRED) # 如果boost库没有完全编译,需要将编译的库明确地指出,否者message(${Boost_LIBRARIES})会出错 +if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) +endif() + +# 去掉生成的so文件名中前缀的lib +set_target_properties(vnctpmd PROPERTIES PREFIX "") + +# 链接生成.so文件 +target_link_libraries(vnctpmd ${Boost_LIBRARIES} ${PYTHON_LIBRARY} ${CTPAPI_MD_LIBRARY}) + +# 将生成的dll文件后缀名修改为pyd(仅在windows下) +set(MD_DLL "${LIBRARY_OUTPUT_PATH}/Release/vnctpmd.dll") +if (EXISTS ${MD_DLL}) + file(RENAME ${MD_DLL} ${LIBRARY_OUTPUT_PATH}/Release/vnctpmd.pyd) +endif() + +# 和上面的MD相同 +set_target_properties(vnctptd PROPERTIES PREFIX "") +target_link_libraries(vnctptd ${Boost_LIBRARIES} ${PYTHON_LIBRARY} ${CTPAPI_TD_LIBRARY}) +set(TD_DLL ${LIBRARY_OUTPUT_PATH}/Release/vnctptd.dll) +if (EXISTS ${TD_DLL}) + file(RENAME ${TD_DLL} ${LIBRARY_OUTPUT_PATH}/Release/vnctptd.pyd) +endif() diff --git a/vn.how/tick2trade/vn.ctp_t2t/build.sh b/vn.how/tick2trade/vn.ctp_t2t/build.sh new file mode 100644 index 0000000000..83858574c1 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Written by Suzhengchun on 20160213 + +set -e +BUILDDIR=build +rm -rf $BUILDDIR +if [ ! -f $BUILDDIR ]; then + mkdir -p $BUILDDIR +fi +pushd $BUILDDIR +cmake .. +make VERBOSE=1 -j 1 +ln -fs `pwd`/lib/vnctpmd.so ../vnctpmd/test/vnctpmd.so +ln -fs `pwd`/lib/vnctptd.so ../vnctptd/test/vnctptd.so +cp ../vnctpmd/test/vnctpmd.* ../../vn.trader/ctpGateway/ +cp ../vnctptd/test/vnctptd.* ../../vn.trader/ctpGateway/ +popd diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcMdApi.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcMdApi.h new file mode 100644 index 0000000000..ece33f7e7e --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcMdApi.h @@ -0,0 +1,162 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcMdApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCMDAPI_H) +#define THOST_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.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 CThostFtdcMdSpi +{ +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 OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡѯӦ + virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; +}; + +class MD_API_EXPORT CThostFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@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 pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///˶ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CThostFtdcMdApi(){}; +}; + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcTraderApi.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcTraderApi.h new file mode 100644 index 0000000000..94dd4c0b3c --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcTraderApi.h @@ -0,0 +1,660 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcTraderApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCTRADERAPI_H) +#define THOST_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.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 CThostFtdcTraderSpi +{ +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 OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ¼Ӧ + virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ񳷵¼Ӧ + virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ͷ߽ȷӦ + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤӦ + virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤ񳷵Ӧ + virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִ¼Ӧ + virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִӦ + virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ¼Ӧ + virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///۲Ӧ + virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߽Ӧ + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתӦ + virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϢȷӦ + virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ϵͳ͹˾ʽ˻ԿӦ + virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵ۵ϢӦ + virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԱȨӦ + virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷۻ + virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨ׳ɱӦ + virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯִӦ + virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯѯӦ + virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ȯλӦ + virtual void OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߷ּ + virtual void OnRspQryInvestorLevel(CThostFtdcInvestorLevelField *pInvestorLevel, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯE+1ȨӦ + virtual void OnRspQryExecFreeze(CThostFtdcExecFreezeField *pExecFreeze, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϺԼȫϵӦ + virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתˮӦ + virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯǩԼϵӦ + virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {}; + + ///ִ֪ͨ + virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {}; + + ///ִ¼ر + virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ִر + virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ¼ر + virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {}; + + ///¼ر + virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///۲ر + virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + + ///֤û + virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {}; + + ///֪ͨ + virtual void OnRtnLock(CThostFtdcLockField *pLock) {}; + + ///֪ͨ + virtual void OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {}; + + ///¼ر + virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯǩԼӦ + virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤӦ + virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤ񳷵Ӧ + virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾㷨Ӧ + virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯû + virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зתڻ֪ͨ + virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///зڻת֪ͨ + virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ڻڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ϵͳʱڻֹתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ϵͳʱڻֹڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻѯ֪ͨ + virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {}; + + ///ڻʽתڻر + virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻڻʽתдر + virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹתڻر + virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹڻתдر + virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻѯر + virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻӦ + virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻڻʽתӦ + virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻѯӦ + virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зڿ֪ͨ + virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {}; + + ///з֪ͨ + virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {}; + + ///з˺֪ͨ + virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {}; +}; + +class TRADER_API_EXPORT CThostFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@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 pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///ͻ֤ + virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + ///Ԥ¼ + virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0; + + ///Ԥ񳷵¼ + virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ󱨵 + virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0; + + ///Ͷ߽ȷ + virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0; + + ///ɾԤ + virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0; + + ///ɾԤ񳷵 + virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0; + + ///ִ¼ + virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0; + + ///ִ + virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0; + + ///ѯ¼ + virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0; + + ///¼ + virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0; + + ///۲ + virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0; + + /// + virtual int ReqLockInsert(CThostFtdcInputLockField *pInputLock, int nRequestID) = 0; + + ///¼ + virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯͶ߽ + virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0; + + ///ѯת + virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͻ֪ͨ + virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0; + + ///ѯϢȷ + virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0; + + ///ѯ֤ϵͳ͹˾ʽ˻Կ + virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0; + + ///ѯֵ۵Ϣ + virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0; + + ///ѯͶƷ/Ʒֱ֤ + virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0; + + ///ѯԱȨ + virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0; + + ///ѯƷۻ + virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0; + + ///ѯȨ׳ɱ + virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0; + + ///ѯִ + virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0; + + ///ѯѯ + virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryLock(CThostFtdcQryLockField *pQryLock, int nRequestID) = 0; + + ///ѯ֤ȯλ + virtual int ReqQryLockPosition(CThostFtdcQryLockPositionField *pQryLockPosition, int nRequestID) = 0; + + ///ѯͶ߷ּ + virtual int ReqQryInvestorLevel(CThostFtdcQryInvestorLevelField *pQryInvestorLevel, int nRequestID) = 0; + + ///ѯE+1Ȩ + virtual int ReqQryExecFreeze(CThostFtdcQryExecFreezeField *pQryExecFreeze, int nRequestID) = 0; + + ///ѯϺԼȫϵ + virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0; + + ///ѯתˮ + virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0; + + ///ѯǩԼϵ + virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0; + + ///ѯǩԼ + virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0; + + ///ѯԤ + virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0; + + ///ѯԤ񳷵 + virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///ѯ͹˾ײ + virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0; + + ///ѯ͹˾㷨 + virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0; + + ///ѯû + virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0; + + ///ڻʽתڻ + virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻڻʽת + virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻѯ + virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0; +protected: + ~CThostFtdcTraderApi(){}; +}; + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcUserApiDataType.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcUserApiDataType.h new file mode 100644 index 0000000000..ca7e082545 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcUserApiDataType.h @@ -0,0 +1,6460 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiDataType.h +///@brief ˿ͻ˽ӿʹõҵ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#ifndef THOST_FTDCDATATYPE_H +#define THOST_FTDCDATATYPE_H + +enum THOST_TE_RESUME_TYPE +{ + THOST_TERT_RESTART = 0, + THOST_TERT_RESUME, + THOST_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentCodeTypeһԼʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeAbbrTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EXP_Normal '0' +///ݳɽɱ +#define THOST_FTDC_EXP_GenOrderByTrade '1' + +typedef char TThostFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLongTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLongTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define THOST_FTDC_ICT_EID '0' +///й֤ +#define THOST_FTDC_ICT_IDCard '1' +///֤ +#define THOST_FTDC_ICT_OfficerIDCard '2' +///֤ +#define THOST_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define THOST_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define THOST_FTDC_ICT_HouseholdRegister '5' +/// +#define THOST_FTDC_ICT_Passport '6' +///̨֤ +#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define THOST_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define THOST_FTDC_ICT_LicenseNo '9' +///˰ǼǺ/˰ID +#define THOST_FTDC_ICT_TaxNo 'A' +///۰ľڵ֤ͨ +#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B' +///̨½֤ͨ +#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C' +/// +#define THOST_FTDC_ICT_DrivingLicense 'D' +///籣ID +#define THOST_FTDC_ICT_SocialID 'F' +///֤ +#define THOST_FTDC_ICT_LocalID 'G' +///ҵǼ֤ +#define THOST_FTDC_ICT_BusinessRegistration 'H' +///۰Ծ֤ +#define THOST_FTDC_ICT_HKMCIDCard 'I' +///п֤ +#define THOST_FTDC_ICT_AccountsPermits 'J' +///֤ +#define THOST_FTDC_ICT_OtherCard 'x' + +typedef char TThostFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContentTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContentType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IR_All '1' +///Ͷ +#define THOST_FTDC_IR_Group '2' +///һͶ +#define THOST_FTDC_IR_Single '3' + +typedef char TThostFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DR_All '1' +///ܹ֯ +#define THOST_FTDC_DR_Group '2' +///һͶ +#define THOST_FTDC_DR_Single '3' + +typedef char TThostFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_DS_Asynchronous '1' +///ͬ +#define THOST_FTDC_DS_Synchronizing '2' +///ͬ +#define THOST_FTDC_DS_Synchronized '3' + +typedef char TThostFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_BDS_Synchronized '1' +///ͬ +#define THOST_FTDC_BDS_Synchronizing '2' + +typedef char TThostFtdcBrokerDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define THOST_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define THOST_FTDC_ECS_GotInformation '9' + +typedef char TThostFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_TCS_NotConnected '1' +///Ѿ +#define THOST_FTDC_TCS_Connected '2' +///ѾԼѯ +#define THOST_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define THOST_FTDC_TCS_SubPrivateFlow '4' + +typedef char TThostFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_FC_DataAsync '1' +///ǿûdz +#define THOST_FTDC_FC_ForceUserLogout '2' +///û +#define THOST_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define THOST_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define THOST_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define THOST_FTDC_FC_OrderInsert '6' +/// +#define THOST_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define THOST_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define THOST_FTDC_FC_SyncBrokerData '9' +///ͬ͹˾ +#define THOST_FTDC_FC_BachSyncBrokerData 'A' +///ѯ +#define THOST_FTDC_FC_SuperQuery 'B' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderInsert 'C' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define THOST_FTDC_FC_SyncOTP 'E' +///ɾδ֪ +#define THOST_FTDC_FC_DeleteOrder 'F' + +typedef char TThostFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define THOST_FTDC_BFC_ForceUserLogout '1' +///û +#define THOST_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define THOST_FTDC_BFC_SyncBrokerData '3' +///ͬ͹˾ +#define THOST_FTDC_BFC_BachSyncBrokerData '4' +/// +#define THOST_FTDC_BFC_OrderInsert '5' +/// +#define THOST_FTDC_BFC_OrderAction '6' +///ȫѯ +#define THOST_FTDC_BFC_AllQuery '7' +///ϵͳܣ/dz/޸ +#define THOST_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define THOST_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define THOST_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define THOST_FTDC_BFC_Trade 'd' +///ת +#define THOST_FTDC_BFC_Virement 'e' +///ռ +#define THOST_FTDC_BFC_Risk 'f' +///ѯ/ѯỰ˵ +#define THOST_FTDC_BFC_Session 'g' +///֪ͨ +#define THOST_FTDC_BFC_RiskNoticeCtl 'h' +///֪ͨ +#define THOST_FTDC_BFC_RiskNotice 'i' +///쿴͹˾ʽȨ +#define THOST_FTDC_BFC_BrokerDeposit 'j' +///ʽѯ +#define THOST_FTDC_BFC_QueryFund 'k' +///ѯ +#define THOST_FTDC_BFC_QueryOrder 'l' +///ɽѯ +#define THOST_FTDC_BFC_QueryTrade 'm' +///ֲֲѯ +#define THOST_FTDC_BFC_QueryPosition 'n' +///ѯ +#define THOST_FTDC_BFC_QueryMarketData 'o' +///û¼ѯ +#define THOST_FTDC_BFC_QueryUserEvent 'p' +///֪ͨѯ +#define THOST_FTDC_BFC_QueryRiskNotify 'q' +///ѯ +#define THOST_FTDC_BFC_QueryFundChange 'r' +///ͶϢѯ +#define THOST_FTDC_BFC_QueryInvestor 's' +///ױѯ +#define THOST_FTDC_BFC_QueryTradingCode 't' +///ǿƽ +#define THOST_FTDC_BFC_ForceClose 'u' +///ѹ +#define THOST_FTDC_BFC_PressTest 'v' +///Ȩ淴 +#define THOST_FTDC_BFC_RemainCalc 'w' +///ֱֲָ֤ +#define THOST_FTDC_BFC_NetPositionInd 'x' +///Ԥ +#define THOST_FTDC_BFC_RiskPredict 'y' +///ݵ +#define THOST_FTDC_BFC_DataExport 'z' +///ָ +#define THOST_FTDC_BFC_RiskTargetSetup 'A' +///Ԥ +#define THOST_FTDC_BFC_MarketDataWarn 'B' +///ҵ֪ͨѯ +#define THOST_FTDC_BFC_QryBizNotice 'C' +///ҵ֪ͨģ +#define THOST_FTDC_BFC_CfgBizNotice 'D' +///̬ͬ +#define THOST_FTDC_BFC_SyncOTP 'E' +///ҵ֪ͨ +#define THOST_FTDC_BFC_SendBizNotice 'F' +///ռ׼ +#define THOST_FTDC_BFC_CfgRiskLevelStd 'G' +///նӦ +#define THOST_FTDC_BFC_TbCommand 'H' +///ɾδ֪ +#define THOST_FTDC_BFC_DeleteOrder 'J' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderInsert 'K' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderAction 'L' + +typedef char TThostFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OAS_Submitted 'a' +///Ѿ +#define THOST_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_OAS_Rejected 'c' + +typedef char TThostFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define THOST_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define THOST_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define THOST_FTDC_OST_NoTradeNotQueueing '4' +/// +#define THOST_FTDC_OST_Canceled '5' +///δ֪ +#define THOST_FTDC_OST_Unknown 'a' +///δ +#define THOST_FTDC_OST_NotTouched 'b' +///Ѵ +#define THOST_FTDC_OST_Touched 'c' + +typedef char TThostFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define THOST_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define THOST_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define THOST_FTDC_OSS_Accepted '3' +///Ѿܾ +#define THOST_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define THOST_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define THOST_FTDC_OSS_ModifyRejected '6' + +typedef char TThostFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define THOST_FTDC_PSD_Today '1' +///ʷֲ +#define THOST_FTDC_PSD_History '2' + +typedef char TThostFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define THOST_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define THOST_FTDC_PDT_NoUseHistory '2' + +typedef char TThostFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ER_Broker '1' +///Ӫ +#define THOST_FTDC_ER_Host '2' +/// +#define THOST_FTDC_ER_Maker '3' + +typedef char TThostFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PC_Futures '1' +///ڻȨ +#define THOST_FTDC_PC_Options '2' +/// +#define THOST_FTDC_PC_Combination '3' +/// +#define THOST_FTDC_PC_Spot '4' +///ת +#define THOST_FTDC_PC_EFP '5' +///ֻȨ +#define THOST_FTDC_PC_SpotOption '6' +///Ȩ +#define THOST_FTDC_PC_ETFOption '7' +///֤ȯ +#define THOST_FTDC_PC_Stock '8' + +typedef char TThostFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_IP_NotStart '0' +/// +#define THOST_FTDC_IP_Started '1' +///ͣ +#define THOST_FTDC_IP_Pause '2' +/// +#define THOST_FTDC_IP_Expired '3' + +typedef char TThostFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_D_Buy '0' +/// +#define THOST_FTDC_D_Sell '1' + +typedef char TThostFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define THOST_FTDC_PT_Net '1' +///ۺϳֲ +#define THOST_FTDC_PT_Gross '2' + +typedef char TThostFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PD_Net '1' +///ͷ +#define THOST_FTDC_PD_Long '2' +///ͷ +#define THOST_FTDC_PD_Short '3' + +typedef char TThostFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysSettlementStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_SS_NonActive '1' +/// +#define THOST_FTDC_SS_Startup '2' +/// +#define THOST_FTDC_SS_Operating '3' +/// +#define THOST_FTDC_SS_Settlement '4' +/// +#define THOST_FTDC_SS_SettlementFinished '5' + +typedef char TThostFtdcSysSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioAttrTypeһ +///////////////////////////////////////////////////////////////////////// +///׷ +#define THOST_FTDC_RA_Trade '0' +/// +#define THOST_FTDC_RA_Settlement '1' + +typedef char TThostFtdcRatioAttrType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_HF_Speculation '1' +/// +#define THOST_FTDC_HF_Arbitrage '2' +///ױ +#define THOST_FTDC_HF_Hedge '3' +/// +#define THOST_FTDC_HF_Covered '4' + +typedef char TThostFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BHF_Speculation '1' +/// +#define THOST_FTDC_BHF_Arbitrage '2' +///ױ +#define THOST_FTDC_BHF_Hedge '3' + +typedef char TThostFtdcBillHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_CIDT_Speculation '1' +/// +#define THOST_FTDC_CIDT_Arbitrage '2' +///ױ +#define THOST_FTDC_CIDT_Hedge '3' + +typedef char TThostFtdcClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OPT_AnyPrice '1' +///޼ +#define THOST_FTDC_OPT_LimitPrice '2' +///ż +#define THOST_FTDC_OPT_BestPrice '3' +///¼ +#define THOST_FTDC_OPT_LastPrice '4' +///¼۸ϸ1ticks +#define THOST_FTDC_OPT_LastPricePlusOneTicks '5' +///¼۸ϸ2ticks +#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' +///¼۸ϸ3ticks +#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' +///һ +#define THOST_FTDC_OPT_AskPrice1 '8' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' +///һ +#define THOST_FTDC_OPT_BidPrice1 'C' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' +///嵵 +#define THOST_FTDC_OPT_FiveLevelPrice 'G' +///ż +#define THOST_FTDC_OPT_BestPriceThisSide 'H' + +typedef char TThostFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OF_Open '0' +///ƽ +#define THOST_FTDC_OF_Close '1' +///ǿƽ +#define THOST_FTDC_OF_ForceClose '2' +///ƽ +#define THOST_FTDC_OF_CloseToday '3' +///ƽ +#define THOST_FTDC_OF_CloseYesterday '4' +///ǿ +#define THOST_FTDC_OF_ForceOff '5' +///ǿƽ +#define THOST_FTDC_OF_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define THOST_FTDC_FCC_NotForceClose '0' +///ʽ +#define THOST_FTDC_FCC_LackDeposit '1' +///ͻ +#define THOST_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define THOST_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define THOST_FTDC_FCC_NotMultiple '4' +///Υ +#define THOST_FTDC_FCC_Violation '5' +/// +#define THOST_FTDC_FCC_Other '6' +///Ȼٽ +#define THOST_FTDC_FCC_PersonDeliv '7' + +typedef char TThostFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORDT_Normal '0' +/// +#define THOST_FTDC_ORDT_DeriveFromQuote '1' +/// +#define THOST_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define THOST_FTDC_ORDT_Combination '3' +/// +#define THOST_FTDC_ORDT_ConditionalOrder '4' +/// +#define THOST_FTDC_ORDT_Swap '5' + +typedef char TThostFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define THOST_FTDC_TC_IOC '1' +///Ч +#define THOST_FTDC_TC_GFS '2' +///Ч +#define THOST_FTDC_TC_GFD '3' +///ָǰЧ +#define THOST_FTDC_TC_GTD '4' +///ǰЧ +#define THOST_FTDC_TC_GTC '5' +///ϾЧ +#define THOST_FTDC_TC_GFA '6' + +typedef char TThostFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define THOST_FTDC_VC_AV '1' +///С +#define THOST_FTDC_VC_MV '2' +///ȫ +#define THOST_FTDC_VC_CV '3' + +typedef char TThostFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CC_Immediately '1' +///ֹ +#define THOST_FTDC_CC_Touch '2' +///ֹӮ +#define THOST_FTDC_CC_TouchProfit '3' +///Ԥ +#define THOST_FTDC_CC_ParkedOrder '4' +///¼۴ +#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TThostFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define THOST_FTDC_AF_Delete '0' +///޸ +#define THOST_FTDC_AF_Modify '3' + +typedef char TThostFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define THOST_FTDC_TR_Allow '0' +///ֻƽ +#define THOST_FTDC_TR_CloseOnly '1' +///ܽ +#define THOST_FTDC_TR_Forbidden '2' + +typedef char TThostFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define THOST_FTDC_OSRC_Participant '0' +///ԹԱ +#define THOST_FTDC_OSRC_Administrator '1' + +typedef char TThostFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ϳֲֲΪһֲ,ʼӦ͵ijֲ +#define THOST_FTDC_TRDT_SplitCombination '#' +///ͨɽ +#define THOST_FTDC_TRDT_Common '0' +///Ȩִ +#define THOST_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define THOST_FTDC_TRDT_OTC '2' +///תɽ +#define THOST_FTDC_TRDT_EFPDerived '3' +///ɽ +#define THOST_FTDC_TRDT_CombinationDerived '4' + +typedef char TThostFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define THOST_FTDC_PSRC_LastPrice '0' +///ίм +#define THOST_FTDC_PSRC_Buy '1' +///ίм +#define THOST_FTDC_PSRC_Sell '2' + +typedef char TThostFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentStatusTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_IS_BeforeTrading '0' +///ǽ +#define THOST_FTDC_IS_NoTrading '1' +/// +#define THOST_FTDC_IS_Continous '2' +///Ͼ۱ +#define THOST_FTDC_IS_AuctionOrdering '3' +///Ͼۼ۸ƽ +#define THOST_FTDC_IS_AuctionBalance '4' +///Ͼ۴ +#define THOST_FTDC_IS_AuctionMatch '5' +/// +#define THOST_FTDC_IS_Closed '6' + +typedef char TThostFtdcInstrumentStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ +///////////////////////////////////////////////////////////////////////// +///Զл +#define THOST_FTDC_IER_Automatic '1' +///ֶл +#define THOST_FTDC_IER_Manual '2' +///۶ +#define THOST_FTDC_IER_Fuse '3' + +typedef char TThostFtdcInstStatusEnterReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallCountTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSettlementIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingSegmentSNTypeһ׽׶α +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradingSegmentSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceLabelTypeһб +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSequenceLabelType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUnderlyingMultipleTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcUnderlyingMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContractCodeTypeһͬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContractCodeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCityType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsStockTypeһǷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsStockType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcChannelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcChannelType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddressTypeһͨѶַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddressType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcZipCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTelephoneTypeһϵ绰 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTelephoneType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFaxTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFaxType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobileTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobileType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEMailTypeһʼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEMailType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyCodeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyCodeType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebsiteTypeһվַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebsiteType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTaxNoTypeһ˰ǼǺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTaxNoType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δϴ +#define THOST_FTDC_BS_NoUpload '1' +///ϴ +#define THOST_FTDC_BS_Uploaded '2' +///ʧ +#define THOST_FTDC_BS_Failed '3' + +typedef char TThostFtdcBatchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyIDTypeһԴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNoTypeһӪҵִպ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentIDTypeһ˴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStyleTypeһƷַʽ +///////////////////////////////////////////////////////////////////////// +///Ʒ +#define THOST_FTDC_RS_All '1' +///Ʒ +#define THOST_FTDC_RS_ByProduct '2' + +typedef char TThostFtdcReturnStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnPatternTypeһģʽ +///////////////////////////////////////////////////////////////////////// +///ɽ +#define THOST_FTDC_RP_ByVolume '1' +/// +#define THOST_FTDC_RP_ByFeeOnHand '2' + +typedef char TThostFtdcReturnPatternType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///1 +#define THOST_FTDC_RL_Level1 '1' +///2 +#define THOST_FTDC_RL_Level2 '2' +///3 +#define THOST_FTDC_RL_Level3 '3' +///4 +#define THOST_FTDC_RL_Level4 '4' +///5 +#define THOST_FTDC_RL_Level5 '5' +///6 +#define THOST_FTDC_RL_Level6 '6' +///7 +#define THOST_FTDC_RL_Level7 '7' +///8 +#define THOST_FTDC_RL_Level8 '8' +///9 +#define THOST_FTDC_RL_Level9 '9' + +typedef char TThostFtdcReturnLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStandardTypeһ׼ +///////////////////////////////////////////////////////////////////////// +///ֽ׶η +#define THOST_FTDC_RSD_ByPeriod '1' +///ijһ׼ +#define THOST_FTDC_RSD_ByStandard '2' + +typedef char TThostFtdcReturnStandardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///ʳ +#define THOST_FTDC_MT_Out '0' +/// +#define THOST_FTDC_MT_In '1' + +typedef char TThostFtdcMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorSettlementParamIDTypeһͶ߽ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ISPI_MortgageRatio '4' +///֤㷨 +#define THOST_FTDC_ISPI_MarginWay '5' +///㵥ǷѺ +#define THOST_FTDC_ISPI_BillDeposit '9' + +typedef char TThostFtdcInvestorSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeSettlementParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ESPI_MortgageRatio '1' +///ʽ +#define THOST_FTDC_ESPI_OtherFundItem '2' +///ʽ뽻 +#define THOST_FTDC_ESPI_OtherFundImport '3' +///нͿý +#define THOST_FTDC_ESPI_CFFEXMinPrepa '6' +///֣㷽ʽ +#define THOST_FTDC_ESPI_CZCESettlementType '7' +///ȡʽ +#define THOST_FTDC_ESPI_ExchDelivFeeMode '9' +///Ͷ߽ȡʽ +#define THOST_FTDC_ESPI_DelivFeeMode '0' +///֣ϳֱֲ֤ȡʽ +#define THOST_FTDC_ESPI_CZCEComMarginType 'A' +///֤ǷŻ +#define THOST_FTDC_ESPI_DceComMarginType 'B' +///ֵȨ֤Żݱ +#define THOST_FTDC_ESPI_OptOutDisCountRate 'a' +///ͱϵ +#define THOST_FTDC_ESPI_OptMiniGuarantee 'b' + +typedef char TThostFtdcExchangeSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ͶߴС +#define THOST_FTDC_SPI_InvestorIDMinLength '1' +///ͶʺŴС +#define THOST_FTDC_SPI_AccountIDMinLength '2' +///Ͷ߿Ĭϵ¼Ȩ +#define THOST_FTDC_SPI_UserRightLogon '3' +///Ͷ߽׽㵥ɽܷʽ +#define THOST_FTDC_SPI_SettlementBillTrade '4' +///ͳһ½ױ뷽ʽ +#define THOST_FTDC_SPI_TradingCode '5' +///Ƿжϴδ˵ijͷʽ +#define THOST_FTDC_SPI_CheckFund '6' +///ǷģȨ +#define THOST_FTDC_SPI_CommModelRight '7' +///Ƿñ֤ģȨ +#define THOST_FTDC_SPI_MarginModelRight '9' +///Ƿ淶ûܼ +#define THOST_FTDC_SPI_IsStandardActive '8' +///ϴĽļ· +#define THOST_FTDC_SPI_UploadSettlementFile 'U' +///ϱ֤ļ· +#define THOST_FTDC_SPI_DownloadCSRCFile 'D' +///ɵĽ㵥ļ· +#define THOST_FTDC_SPI_SettlementBillFile 'S' +///֤ļʶ +#define THOST_FTDC_SPI_CSRCOthersFile 'C' +///ͶƬ· +#define THOST_FTDC_SPI_InvestorPhoto 'P' +///ȫᾭ͹˾ϴļ· +#define THOST_FTDC_SPI_CSRCData 'R' +///¼뷽ʽ +#define THOST_FTDC_SPI_InvestorPwdModel 'I' +///Ͷнļ· +#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F' +///Ͷߴ뷽ʽ +#define THOST_FTDC_SPI_InvestorIDType 'a' +///߻Ȩ +#define THOST_FTDC_SPI_FreezeMaxReMain 'r' +///زʵʱϳ +#define THOST_FTDC_SPI_IsSync 'A' +///Ȩ +#define THOST_FTDC_SPI_RelieveOpenLimit 'O' +///Ƿ淶û +#define THOST_FTDC_SPI_IsStandardFreeze 'X' +///֣Ƿ񿪷Ʒױ +#define THOST_FTDC_SPI_CZCENormalProductHedge 'B' + +typedef char TThostFtdcSystemParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define THOST_FTDC_TPID_EncryptionStandard 'E' +///ϵͳ㷨 +#define THOST_FTDC_TPID_RiskMode 'R' +///ϵͳ㷨Ƿȫ 0- 1- +#define THOST_FTDC_TPID_RiskModeGlobal 'G' +///㷨 +#define THOST_FTDC_TPID_modeEncode 'P' +///۸Сλ +#define THOST_FTDC_TPID_tickMode 'T' +///ûỰ +#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define THOST_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define THOST_FTDC_TPID_IsAuthForce 'A' +///Ƿ񶳽֤ȯֲ +#define THOST_FTDC_TPID_IsPosiFreeze 'F' +///Ƿ޲ +#define THOST_FTDC_TPID_IsPosiLimit 'M' +///֣ѯʱ +#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q' + +typedef char TThostFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrandCodeTypeһƺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrandCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWarehouseTypeһֿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWarehouseType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductDateType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGradeTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcGradeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClassifyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClassifyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPositionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYieldlyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcYieldlyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWeightTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWeightType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubEntryFundNoTypeһʽˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSubEntryFundNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileIDTypeһļʶ +///////////////////////////////////////////////////////////////////////// +///ʽ +#define THOST_FTDC_FI_SettlementFund 'F' +///ɽ +#define THOST_FTDC_FI_Trade 'T' +///Ͷֲ߳ +#define THOST_FTDC_FI_InvestorPosition 'P' +///Ͷ߷ʽ +#define THOST_FTDC_FI_SubEntryFund 'O' +///ϳֲ +#define THOST_FTDC_FI_CZCECombinationPos 'C' +///ϱ֤ +#define THOST_FTDC_FI_CSRCData 'R' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCEClose 'L' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCENoClose 'N' +///ֲϸ +#define THOST_FTDC_FI_PositionDtl 'D' +///Ȩִļ +#define THOST_FTDC_FI_OptionStrike 'S' +///۱ȶļ +#define THOST_FTDC_FI_SettlementPriceComparison 'M' +///dzֱֲ䶯ϸ +#define THOST_FTDC_FI_NonTradePosChange 'B' + +typedef char TThostFtdcFileIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileTypeTypeһļϴ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FUT_Settlement '0' +///˶ +#define THOST_FTDC_FUT_Check '1' + +typedef char TThostFtdcFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileFormatTypeһļʽ +///////////////////////////////////////////////////////////////////////// +///ıļ(.txt) +#define THOST_FTDC_FFT_Txt '0' +///ѹļ(.zip) +#define THOST_FTDC_FFT_Zip '1' +///DBFļ(.dbf) +#define THOST_FTDC_FFT_DBF '2' + +typedef char TThostFtdcFileFormatType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileUploadStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///ϴɹ +#define THOST_FTDC_FUS_SucceedUpload '1' +///ϴʧ +#define THOST_FTDC_FUS_FailedUpload '2' +///ɹ +#define THOST_FTDC_FUS_SucceedLoad '3' +///벿ֳɹ +#define THOST_FTDC_FUS_PartSucceedLoad '4' +///ʧ +#define THOST_FTDC_FUS_FailedLoad '5' + +typedef char TThostFtdcFileUploadStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferDirectionTypeһƲַ +///////////////////////////////////////////////////////////////////////// +///Ƴ +#define THOST_FTDC_TD_Out '0' +/// +#define THOST_FTDC_TD_In '1' + +typedef char TThostFtdcTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUploadModeTypeһϴļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUploadModeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAccountIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankFlagType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenNameTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenBankTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishPathTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPublishPathType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthCountTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAdvanceMonthArrayTypeһ·ǰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAdvanceMonthArrayType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateExprTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateExprType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDExprTypeһԼʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameExprTypeһԼƱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecialCreateRuleTypeһĴ +///////////////////////////////////////////////////////////////////////// +///ûⴴ +#define THOST_FTDC_SC_NoSpecialRule '0' +/// +#define THOST_FTDC_SC_NoSpringFestival '1' + +typedef char TThostFtdcSpecialCreateRuleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBasisPriceTypeTypeһƻ׼ +///////////////////////////////////////////////////////////////////////// +///һԼ +#define THOST_FTDC_IPT_LastSettlement '1' +///һԼ̼ +#define THOST_FTDC_IPT_LaseClose '2' + +typedef char TThostFtdcBasisPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductLifePhaseTypeһƷ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_PLP_Active '1' +///Ծ +#define THOST_FTDC_PLP_NonActive '2' +///ע +#define THOST_FTDC_PLP_Canceled '3' + +typedef char TThostFtdcProductLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define THOST_FTDC_DM_CashDeliv '1' +///ʵサ +#define THOST_FTDC_DM_CommodityDeliv '2' + +typedef char TThostFtdcDeliveryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FIOT_FundIO '1' +///ת +#define THOST_FTDC_FIOT_Transfer '2' +///ڻ +#define THOST_FTDC_FIOT_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FT_Deposite '1' +///ʽ +#define THOST_FTDC_FT_ItemFund '2' +///˾ +#define THOST_FTDC_FT_Company '3' +///ʽת +#define THOST_FTDC_FT_InnerTransfer '4' + +typedef char TThostFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FD_In '1' +/// +#define THOST_FTDC_FD_Out '2' + +typedef char TThostFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_FS_Record '1' +///Ѹ +#define THOST_FTDC_FS_Check '2' +///ѳ +#define THOST_FTDC_FS_Charge '3' + +typedef char TThostFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNameTypeһƱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNameType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PS_None '1' +///ڷ +#define THOST_FTDC_PS_Publishing '2' +///ѷ +#define THOST_FTDC_PS_Published '3' + +typedef char TThostFtdcPublishStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueIDTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueTypeTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueLabelTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueLabelType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueResultTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueResultType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_ES_NonActive '1' +/// +#define THOST_FTDC_ES_Startup '2' +///׿ʼʼ +#define THOST_FTDC_ES_Initialize '3' +///ɳʼ +#define THOST_FTDC_ES_Initialized '4' +///пʼ +#define THOST_FTDC_ES_Close '5' +/// +#define THOST_FTDC_ES_Closed '6' +/// +#define THOST_FTDC_ES_Settlement '7' + +typedef char TThostFtdcSystemStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_STS_Initialize '0' +/// +#define THOST_FTDC_STS_Settlementing '1' +///ѽ +#define THOST_FTDC_STS_Settlemented '2' +/// +#define THOST_FTDC_STS_Finished '3' + +typedef char TThostFtdcSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntTypeTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntFromTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntFromType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntToTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntToType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionValueCodeTypeһܱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionValueCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineIDTypeһϱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineTypeType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CT_Person '0' +/// +#define THOST_FTDC_CT_Company '1' +///Ͷʻ +#define THOST_FTDC_CT_Fund '2' +///ⷨ +#define THOST_FTDC_CT_SpecialOrgan '3' +///ʹܻ +#define THOST_FTDC_CT_Asset '4' + +typedef char TThostFtdcInvestorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerTypeTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +///׻Ա +#define THOST_FTDC_BT_Trade '0' +///׽Ա +#define THOST_FTDC_BT_TradeSettle '1' + +typedef char TThostFtdcBrokerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskLevelTypeһյȼ +///////////////////////////////////////////////////////////////////////// +///ͷտͻ +#define THOST_FTDC_FAS_Low '1' +///ͨͻ +#define THOST_FTDC_FAS_Normal '2' +///עͻ +#define THOST_FTDC_FAS_Focus '3' +///տͻ +#define THOST_FTDC_FAS_Risk '4' + +typedef char TThostFtdcRiskLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeeAcceptStyleTypeһȡʽ +///////////////////////////////////////////////////////////////////////// +///ȡ +#define THOST_FTDC_FAS_ByTrade '1' +///ȡ +#define THOST_FTDC_FAS_ByDeliv '2' +/// +#define THOST_FTDC_FAS_None '3' +///ָȡ +#define THOST_FTDC_FAS_FixFee '4' + +typedef char TThostFtdcFeeAcceptStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PWDT_Trade '1' +///ʽ +#define THOST_FTDC_PWDT_Account '2' + +typedef char TThostFtdcPasswordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_AG_All '1' +///ӯƣ +#define THOST_FTDC_AG_OnlyLost '2' +///ӯƣ +#define THOST_FTDC_AG_OnlyGain '3' +///ӯ +#define THOST_FTDC_AG_None '4' + +typedef char TThostFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define THOST_FTDC_ICP_Include '0' +///ƽӯ +#define THOST_FTDC_ICP_NotInclude '2' + +typedef char TThostFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///޲޳ɽܿ +#define THOST_FTDC_AWT_Enable '0' +///ܿ +#define THOST_FTDC_AWT_Disable '2' +///޲ֲܿ +#define THOST_FTDC_AWT_NoHoldEnable '3' + +typedef char TThostFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommentTypeһӯ㷨˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommentType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVersionTypeһ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcVersionType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeSerialType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeSerialNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureIDTypeһڻ˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBranchIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBranchIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordNumTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRecordNumType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountTypeһڻʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountType[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturePwdFlagTypeһʽ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_FPWD_UnCheck '0' +///˶ +#define THOST_FTDC_FPWD_Check '1' + +typedef char TThostFtdcFuturePwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferTypeTypeһת +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_TT_BankToFuture '0' +///ڻת +#define THOST_FTDC_TT_FutureToBank '1' + +typedef char TThostFtdcTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccPwdTypeһڻʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccPwdType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetCodeTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetInfoTypeһӦϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmtTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUseAmtTypeһп +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUseAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFetchAmtTypeһпȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFetchAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferValidFlagTypeһתЧ־ +///////////////////////////////////////////////////////////////////////// +///Чʧ +#define THOST_FTDC_TVF_Invalid '0' +///Ч +#define THOST_FTDC_TVF_Valid '1' +/// +#define THOST_FTDC_TVF_Reverse '2' + +typedef char TThostFtdcTransferValidFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCertCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReasonTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RN_CD '0' +///ʽ; +#define THOST_FTDC_RN_ZT '1' +/// +#define THOST_FTDC_RN_QT '2' + +typedef char TThostFtdcReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSexTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_SEX_None '0' +/// +#define THOST_FTDC_SEX_Man '1' +///Ů +#define THOST_FTDC_SEX_Woman '2' + +typedef char TThostFtdcSexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProfessionTypeһְҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProfessionType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNationalType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProvinceTypeһʡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProvinceType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRegionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRegionType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNOTypeһӪҵִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNOType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyTypeType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessScopeTypeһӪΧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessScopeType[1001]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalCurrencyTypeһעʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCapitalCurrencyType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_UT_Investor '0' +///Ա +#define THOST_FTDC_UT_Operator '1' +///Ա +#define THOST_FTDC_UT_SuperUser '2' + +typedef char TThostFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchIDTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_RATETYPE_MarginRate '2' + +typedef char TThostFtdcRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNoteTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +///׽㵥 +#define THOST_FTDC_NOTETYPE_TradeSettleBill '1' +///׽± +#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2' +///׷ӱ֤֪ͨ +#define THOST_FTDC_NOTETYPE_CallMarginNotes '3' +///ǿƽ֪ͨ +#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4' +///ɽ֪ͨ +#define THOST_FTDC_NOTETYPE_TradeNotes '5' +///֪ͨ +#define THOST_FTDC_NOTETYPE_DelivNotes '6' + +typedef char TThostFtdcNoteTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStyleTypeһ㵥ʽ +///////////////////////////////////////////////////////////////////////// +///ն +#define THOST_FTDC_SBS_Day '1' +///ʶԳ +#define THOST_FTDC_SBS_Volume '2' + +typedef char TThostFtdcSettlementStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDNSTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerDNSType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSentenceTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSentenceType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementBillTypeTypeһ㵥 +///////////////////////////////////////////////////////////////////////// +///ձ +#define THOST_FTDC_ST_Day '0' +///± +#define THOST_FTDC_ST_Month '1' + +typedef char TThostFtdcSettlementBillTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_URT_Logon '1' +///ת +#define THOST_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define THOST_FTDC_URT_EMail '3' +///㵥 +#define THOST_FTDC_URT_Fax '4' +/// +#define THOST_FTDC_URT_ConditionOrder '5' + +typedef char TThostFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define THOST_FTDC_MPT_SettlementPrice '2' +///ɽ +#define THOST_FTDC_MPT_AveragePrice '3' +///ּ +#define THOST_FTDC_MPT_OpenPrice '4' + +typedef char TThostFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillGenStatusTypeһ㵥״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_BGS_None '0' +/// +#define THOST_FTDC_BGS_NoGenerated '1' +/// +#define THOST_FTDC_BGS_Generated '2' + +typedef char TThostFtdcBillGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgoTypeTypeһ㷨 +///////////////////////////////////////////////////////////////////////// +///ֲִ㷨 +#define THOST_FTDC_AT_HandlePositionAlgo '1' +///Ѱұ֤㷨 +#define THOST_FTDC_AT_FindMarginRateAlgo '2' + +typedef char TThostFtdcAlgoTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HPA_Base '1' +///Ʒ +#define THOST_FTDC_HPA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HPA_CZCE '3' + +typedef char TThostFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMRA_Base '1' +///Ʒ +#define THOST_FTDC_FMRA_DCE '2' +///֣Ʒ +#define THOST_FTDC_FMRA_CZCE '3' + +typedef char TThostFtdcFindMarginRateAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HTAA_Base '1' +///Ʒ +#define THOST_FTDC_HTAA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HTAA_CZCE '3' + +typedef char TThostFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPersonTypeTypeһϵ +///////////////////////////////////////////////////////////////////////// +///ָµ +#define THOST_FTDC_PST_Order '1' +///Ȩ +#define THOST_FTDC_PST_Open '2' +///ʽ +#define THOST_FTDC_PST_Fund '3' +///㵥ȷ +#define THOST_FTDC_PST_Settlement '4' +/// +#define THOST_FTDC_PST_Company '5' +///˴ +#define THOST_FTDC_PST_Corporation '6' +///Ͷϵ +#define THOST_FTDC_PST_LinkMan '7' +///ֻʲ +#define THOST_FTDC_PST_Ledger '8' +///У +#define THOST_FTDC_PST_Trustee '9' +///Уܻ˴ +#define THOST_FTDC_PST_TrusteeCorporation 'A' +///УܻȨ +#define THOST_FTDC_PST_TrusteeOpen 'B' +///Уܻϵ +#define THOST_FTDC_PST_TrusteeContact 'C' +///Ȼ˲ο֤ +#define THOST_FTDC_PST_ForeignerRefer 'D' +///˴ο֤ +#define THOST_FTDC_PST_CorporationRefer 'E' + +typedef char TThostFtdcPersonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryInvestorRangeTypeһѯΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_QIR_All '1' +///ѯ +#define THOST_FTDC_QIR_Group '2' +///һͶ +#define THOST_FTDC_QIR_Single '3' + +typedef char TThostFtdcQueryInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRiskStatusTypeһͶ߷״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IRS_Normal '1' +/// +#define THOST_FTDC_IRS_Warn '2' +///׷ +#define THOST_FTDC_IRS_Call '3' +///ǿƽ +#define THOST_FTDC_IRS_Force '4' +///쳣 +#define THOST_FTDC_IRS_Exception '5' + +typedef char TThostFtdcInvestorRiskStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegIDTypeһȱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegMultipleTypeһȳ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImplyLevelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcImplyLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNOTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNOType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearbarchIDTypeһ˻к +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearbarchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_UET_Login '1' +///dz +#define THOST_FTDC_UET_Logout '2' +///׳ɹ +#define THOST_FTDC_UET_Trading '3' +///ʧ +#define THOST_FTDC_UET_TradingError '4' +///޸ +#define THOST_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define THOST_FTDC_UET_Authenticate '6' +/// +#define THOST_FTDC_UET_Other '9' + +typedef char TThostFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseStyleTypeһƽַʽ +///////////////////////////////////////////////////////////////////////// +///ȿƽ +#define THOST_FTDC_ICS_Close '0' +///ƽƽ +#define THOST_FTDC_ICS_CloseToday '1' + +typedef char TThostFtdcCloseStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatModeTypeһͳƷʽ +///////////////////////////////////////////////////////////////////////// +///---- +#define THOST_FTDC_SM_Non '0' +///Լͳ +#define THOST_FTDC_SM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_SM_Product '2' +///Ͷͳ +#define THOST_FTDC_SM_Investor '3' + +typedef char TThostFtdcStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderStatusTypeһԤ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PAOS_NotSend '1' +///ѷ +#define THOST_FTDC_PAOS_Send '2' +///ɾ +#define THOST_FTDC_PAOS_Deleted '3' + +typedef char TThostFtdcParkedOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderIDTypeһԤ񱨵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderActionIDTypeһԤ񳷵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderActionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirDealStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ڴ +#define THOST_FTDC_VDS_Dealing '1' +///ɹ +#define THOST_FTDC_VDS_DeaclSucceed '2' + +typedef char TThostFtdcVirDealStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrgSystemIDTypeһԭϵͳ +///////////////////////////////////////////////////////////////////////// +///ۺϽƽ̨ +#define THOST_FTDC_ORGS_Standard '0' +///ʢϵͳ +#define THOST_FTDC_ORGS_ESunny '1' +///˴V6ϵͳ +#define THOST_FTDC_ORGS_KingStarV6 '2' + +typedef char TThostFtdcOrgSystemIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirTradeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VTS_NaturalDeal '0' +///ɹ +#define THOST_FTDC_VTS_SucceedEnd '1' +///ʧܽ +#define THOST_FTDC_VTS_FailedEND '2' +///쳣 +#define THOST_FTDC_VTS_Exception '3' +///˹쳣 +#define THOST_FTDC_VTS_ManualDeal '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_VTS_MesException '5' +///ϵͳ˹ +#define THOST_FTDC_VTS_SysException '6' + +typedef char TThostFtdcVirTradeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirBankAccTypeTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VBAT_BankBook '1' +/// +#define THOST_FTDC_VBAT_BankCard '2' +///ÿ +#define THOST_FTDC_VBAT_CreditCard '3' + +typedef char TThostFtdcVirBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementStatusTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VMS_Natural '0' +/// +#define THOST_FTDC_VMS_Canceled '9' + +typedef char TThostFtdcVirementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementAvailAbilityTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_VAA_NoAvailAbility '0' +///Ч +#define THOST_FTDC_VAA_AvailAbility '1' +/// +#define THOST_FTDC_VAA_Repeal '2' + +typedef char TThostFtdcVirementAvailAbilityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +///зʽתڻ +#define THOST_FTDC_VTC_BankBankToFuture '102001' +///зڻʽת +#define THOST_FTDC_VTC_BankFutureToBank '102002' +///ڻʽתڻ +#define THOST_FTDC_VTC_FutureBankToFuture '202001' +///ڻڻʽת +#define THOST_FTDC_VTC_FutureFutureToBank '202002' + +typedef char TThostFtdcVirementTradeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeIDTypeһӰʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTopicIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTopicIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportTypeIDTypeһױͱʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReportTypeIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCharacterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCharacterIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInvestorTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeDirectTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeDirectType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeModelTypeһʽʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeModelType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLOpParamValueTypeһҵֵ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLOpParamValueType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCustomerCardTypeType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionNameTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLDistrictIDTypeһڻڵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLDistrictIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLRelationShipType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionIDTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLAccountTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradingTypeTypeһ׷ʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradingTypeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTransactClassTypeһ֧׷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTransactClassType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalIOTypeһʽոʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalIOType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSiteTypeһ׵ص +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSiteType[10]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalPurposeTypeһʽ; +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalPurposeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSerialNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSerialNoType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLGenStatusTypeһAmlɷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_GEN_Program '0' +///˹ +#define THOST_FTDC_GEN_HandWork '1' + +typedef char TThostFtdcAMLGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSeqCodeTypeһҵʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSeqCodeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileNameTypeһAMLļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLMoneyTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileAmountTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcAMLFileAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyTypeһԿ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCKeyType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCTokenTypeһ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCTokenType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFMMCKK_REQUEST 'R' +///CFMMCԶ +#define THOST_FTDC_CFMMCKK_AUTO 'A' +///CFMMCֶ +#define THOST_FTDC_CFMMCKK_MANUAL 'M' + +typedef char TThostFtdcCFMMCKeyKindType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComdTypeTypeһDBF +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComdTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComTimeTypeһDBFʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComTimeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComNoTypeһDBFˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFFdNameTypeһDBFֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFFdNameType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFFdContentTypeһDBFֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFFdContentType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyIDTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustNumberTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCustNumberType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganCodeType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSuperOrganCodeType[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchIDTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchNameTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganFlagTypeһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForFutureTypeһжڻ˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCodingForFutureType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankReturnCodeTypeһжԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPlateReturnCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSubBranchIDTypeһз֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureBranchIDTypeһڻ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnCodeTypeһش +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearDepIDTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearBrchIDTypeһʻк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvDepIDTypeһͶ˺Ż +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvBrchIDTypeһͶк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMessageFormatVersionTypeһϢʽ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMessageFormatVersionType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthenticDataTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthenticDataType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountNameTypeһڻʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobilePhoneTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobilePhoneType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureMainKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureWorkKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTransKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankMainKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankWorkKeyTypeһйԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankTransKeyTypeһдԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankServerDescriptionTypeһзϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankServerDescriptionType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescrInfoForReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescrInfoForReturnCodeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorrectSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCorrectSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureSerialTypeһڻ˾ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFutureSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplicationIDTypeһӦñʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcApplicationIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankProxyIDTypeһдʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBankProxyIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTCoreIDTypeһתʺϵͳʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTCoreIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServerPortTypeһ˿ں +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServerPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealedTimesTypeһѾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealedTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealTimeIntervalTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealTimeIntervalType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalTimesTypeһÿۼתʴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTotalTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTRequestIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureFeeTypeһӦڻ˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFutureFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMaxAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMaxAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMinAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMinAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalAmtTypeһÿۼתʶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTotalAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertificationTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_CFT_IDCard '0' +/// +#define THOST_FTDC_CFT_Passport '1' +///֤ +#define THOST_FTDC_CFT_OfficerIDCard '2' +///ʿ֤ +#define THOST_FTDC_CFT_SoldierIDCard '3' +///֤ +#define THOST_FTDC_CFT_HomeComingCard '4' +///ڲ +#define THOST_FTDC_CFT_HouseholdRegister '5' +///Ӫҵִպ +#define THOST_FTDC_CFT_LicenseNo '6' +///֤֯ +#define THOST_FTDC_CFT_InstitutionCodeCard '7' +///ʱӪҵִպ +#define THOST_FTDC_CFT_TempLicenseNo '8' +///ҵǼ֤ +#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9' +///֤ +#define THOST_FTDC_CFT_OtherCard 'x' +///ܲ +#define THOST_FTDC_CFT_SuperDepAgree 'a' + +typedef char TThostFtdcCertificationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileBusinessCodeTypeһļҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBC_Others '0' +///ת˽ϸ +#define THOST_FTDC_FBC_TransferDetails '1' +///ͻ˻״̬ +#define THOST_FTDC_FBC_CustAccStatus '2' +///˻ཻϸ +#define THOST_FTDC_FBC_AccountTradeDetails '3' +///ڻ˻Ϣϸ +#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4' +///ͻʽ̨ϸ +#define THOST_FTDC_FBC_CustMoneyDetail '5' +///ͻϢϸ +#define THOST_FTDC_FBC_CustCancelAccountInfo '6' +///ͻʽ˽ +#define THOST_FTDC_FBC_CustMoneyResult '7' +///쳣ļ +#define THOST_FTDC_FBC_OthersExceptionResult '8' +///ͻϢϸ +#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9' +///ͻʽϸ +#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' +///˴ʽջ +#define THOST_FTDC_FBC_CorporationMoneyTotal 'b' +///ʽջ +#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c' +///ܷƽ +#define THOST_FTDC_FBC_MainPartMonitorData 'd' +///б +#define THOST_FTDC_FBC_PreparationMoney 'e' +///Эʽ +#define THOST_FTDC_FBC_BankMoneyMonitorData 'f' + +typedef char TThostFtdcFileBusinessCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCashExchangeCodeTypeһ㳮־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CEC_Exchange '1' +/// +#define THOST_FTDC_CEC_Cash '2' + +typedef char TThostFtdcCashExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_YNI_Yes '0' +/// +#define THOST_FTDC_YNI_No '1' + +typedef char TThostFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBanlanceTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_BLT_CurrentMoney '0' +/// +#define THOST_FTDC_BLT_UsableMoney '1' +///ȡ +#define THOST_FTDC_BLT_FetchableMoney '2' +/// +#define THOST_FTDC_BLT_FreezeMoney '3' + +typedef char TThostFtdcBanlanceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGenderTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪״̬ +#define THOST_FTDC_GD_Unknown '0' +/// +#define THOST_FTDC_GD_Male '1' +///Ů +#define THOST_FTDC_GD_Female '2' + +typedef char TThostFtdcGenderType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define THOST_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define THOST_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define THOST_FTDC_FPF_SHA '2' + +typedef char TThostFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassWordKeyTypeTypeһԿ +///////////////////////////////////////////////////////////////////////// +///Կ +#define THOST_FTDC_PWKT_ExchangeKey '0' +///Կ +#define THOST_FTDC_PWKT_PassWordKey '1' +///MACԿ +#define THOST_FTDC_PWKT_MACKey '2' +///Կ +#define THOST_FTDC_PWKT_MessageKey '3' + +typedef char TThostFtdcPassWordKeyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTPassWordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ѯ +#define THOST_FTDC_PWT_Query '0' +///ȡ +#define THOST_FTDC_PWT_Fetch '1' +///ת +#define THOST_FTDC_PWT_Transfer '2' +/// +#define THOST_FTDC_PWT_Trade '3' + +typedef char TThostFtdcFBTPassWordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTEncryModeTypeһܷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EM_NoEncry '0' +///DES +#define THOST_FTDC_EM_DES '1' +///3DES +#define THOST_FTDC_EM_3DES '2' + +typedef char TThostFtdcFBTEncryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankRepealFlagTypeһг־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRF_BankNotNeedRepeal '0' +///дԶ +#define THOST_FTDC_BRF_BankWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRF_BankBeenRepealed '2' + +typedef char TThostFtdcBankRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerRepealFlagTypeһ̳־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0' +///̴Զ +#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRORF_BrokerBeenRepealed '2' + +typedef char TThostFtdcBrokerRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstitutionTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TS_Bank '0' +/// +#define THOST_FTDC_TS_Future '1' +///ȯ +#define THOST_FTDC_TS_Store '2' + +typedef char TThostFtdcInstitutionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define THOST_FTDC_LF_Yes '0' +///Ƭ +#define THOST_FTDC_LF_No '1' + +typedef char TThostFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccStatusTypeһ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BAS_Normal '0' +/// +#define THOST_FTDC_BAS_Freeze '1' +///ʧ +#define THOST_FTDC_BAS_ReportLoss '2' + +typedef char TThostFtdcBankAccStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyAccountStatusTypeһʽ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MAS_Normal '0' +/// +#define THOST_FTDC_MAS_Cancel '1' + +typedef char TThostFtdcMoneyAccountStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcManageStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ָ +#define THOST_FTDC_MSS_Point '0' +///Ԥָ +#define THOST_FTDC_MSS_PrePoint '1' +///ָ +#define THOST_FTDC_MSS_CancelPoint '2' + +typedef char TThostFtdcManageStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemTypeTypeһӦϵͳ +///////////////////////////////////////////////////////////////////////// +///ת +#define THOST_FTDC_SYT_FutureBankTransfer '0' +///֤ת +#define THOST_FTDC_SYT_StockBankTransfer '1' +/// +#define THOST_FTDC_SYT_TheThirdPartStore '2' + +typedef char TThostFtdcSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTxnEndFlagTypeһתʻת־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TEF_NormalProcessing '0' +///ɹ +#define THOST_FTDC_TEF_Success '1' +///ʧܽ +#define THOST_FTDC_TEF_Failed '2' +///쳣 +#define THOST_FTDC_TEF_Abnormal '3' +///˹쳣 +#define THOST_FTDC_TEF_ManualProcessedForException '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5' +///ϵͳ˹ +#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6' + +typedef char TThostFtdcTxnEndFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessStatusTypeһתʷ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PSS_NotProcess '0' +///ʼ +#define THOST_FTDC_PSS_StartProcess '1' +/// +#define THOST_FTDC_PSS_Finished '2' + +typedef char TThostFtdcProcessStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CUSTT_Person '0' +/// +#define THOST_FTDC_CUSTT_Institution '1' + +typedef char TThostFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTransferDirectionTypeһתʷ +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_FBTTD_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTTD_FromFutureToBank '2' + +typedef char TThostFtdcFBTTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenOrDestroyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OOD_Open '1' +/// +#define THOST_FTDC_OOD_Destroy '0' + +typedef char TThostFtdcOpenOrDestroyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_AVAF_Invalid '0' +///Ч +#define THOST_FTDC_AVAF_Valid '1' +/// +#define THOST_FTDC_AVAF_Repeal '2' + +typedef char TThostFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_OT_Bank '1' +///ǰ +#define THOST_FTDC_OT_Future '2' +///תƽ̨ +#define THOST_FTDC_OT_PlateForm '9' + +typedef char TThostFtdcOrganTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///лܲ +#define THOST_FTDC_OL_HeadQuarters '1' +///зĻڻ˾Ӫҵ +#define THOST_FTDC_OL_Branch '2' + +typedef char TThostFtdcOrganLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocalIDTypeһЭ +///////////////////////////////////////////////////////////////////////// +///Э +#define THOST_FTDC_PID_FutureProtocal '0' +///Э +#define THOST_FTDC_PID_ICBCProtocal '1' +///ũЭ +#define THOST_FTDC_PID_ABCProtocal '2' +///йЭ +#define THOST_FTDC_PID_CBCProtocal '3' +///Э +#define THOST_FTDC_PID_CCBProtocal '4' +///Э +#define THOST_FTDC_PID_BOCOMProtocal '5' +///תƽ̨Э +#define THOST_FTDC_PID_FBTPlateFormProtocal 'X' + +typedef char TThostFtdcProtocalIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConnectModeTypeһ׽ӷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CM_ShortConnect '0' +/// +#define THOST_FTDC_CM_LongConnect '1' + +typedef char TThostFtdcConnectModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncModeTypeһ׽ͨŷʽ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_SRM_ASync '0' +///ͬ +#define THOST_FTDC_SRM_Sync '1' + +typedef char TThostFtdcSyncModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_BAT_BankBook '1' +/// +#define THOST_FTDC_BAT_SavingCard '2' +///ÿ +#define THOST_FTDC_BAT_CreditCard '3' + +typedef char TThostFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccTypeTypeһڻ˾ʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FAT_BankBook '1' +/// +#define THOST_FTDC_FAT_SavingCard '2' +///ÿ +#define THOST_FTDC_FAT_CreditCard '3' + +typedef char TThostFtdcFutureAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OS_Ready '0' +///ǩ +#define THOST_FTDC_OS_CheckIn '1' +///ǩ +#define THOST_FTDC_OS_CheckOut '2' +///ļ +#define THOST_FTDC_OS_CheckFileArrived '3' +/// +#define THOST_FTDC_OS_CheckDetail '4' +/// +#define THOST_FTDC_OS_DayEndClean '5' +///ע +#define THOST_FTDC_OS_Invalid '9' + +typedef char TThostFtdcOrganStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCCBFeeModeTypeһշģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CCBFM_ByAmount '1' +///¿ +#define THOST_FTDC_CCBFM_ByMonth '2' + +typedef char TThostFtdcCCBFeeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiTypeTypeһͨѶAPI +///////////////////////////////////////////////////////////////////////// +///ͻ +#define THOST_FTDC_CAPIT_Client '1' +/// +#define THOST_FTDC_CAPIT_Server '2' +///ϵͳUserApi +#define THOST_FTDC_CAPIT_UserApi '3' + +typedef char TThostFtdcCommApiTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceLineNoTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceLineNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcServiceNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLinkStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿ +#define THOST_FTDC_LS_Connected '1' +///û +#define THOST_FTDC_LS_Disconnected '2' + +typedef char TThostFtdcLinkStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiPointerTypeһͨѶAPIָ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommApiPointerType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define THOST_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define THOST_FTDC_BPWDF_EncryptCheck '2' + +typedef char TThostFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecuAccTypeTypeһڻʺ +///////////////////////////////////////////////////////////////////////// +///ʽʺ +#define THOST_FTDC_SAT_AccountID '1' +///ʽ𿨺 +#define THOST_FTDC_SAT_CardID '2' +///Ϻɶʺ +#define THOST_FTDC_SAT_SHStockholderID '3' +///ڹɶʺ +#define THOST_FTDC_SAT_SZStockholderID '4' + +typedef char TThostFtdcSecuAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TRFS_Normal '0' +/// +#define THOST_FTDC_TRFS_Repealed '1' + +typedef char TThostFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSponsorTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SPTYPE_Broker '0' +/// +#define THOST_FTDC_SPTYPE_Bank '1' + +typedef char TThostFtdcSponsorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqRspTypeTypeһӦ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_REQRSP_Request '0' +///Ӧ +#define THOST_FTDC_REQRSP_Response '1' + +typedef char TThostFtdcReqRspTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTUserEventTypeTypeһתû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBTUET_SignIn '0' +///תڻ +#define THOST_FTDC_FBTUET_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTUET_FromFutureToBank '2' +/// +#define THOST_FTDC_FBTUET_OpenAccount '3' +/// +#define THOST_FTDC_FBTUET_CancelAccount '4' +///˻ +#define THOST_FTDC_FBTUET_ChangeAccount '5' +///תڻ +#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6' +///ڻת +#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7' +///ѯ˻ +#define THOST_FTDC_FBTUET_QueryBankAccount '8' +///ѯڻ˻ +#define THOST_FTDC_FBTUET_QueryFutureAccount '9' +///ǩ +#define THOST_FTDC_FBTUET_SignOut 'A' +///Կͬ +#define THOST_FTDC_FBTUET_SyncKey 'B' +/// +#define THOST_FTDC_FBTUET_Other 'Z' + +typedef char TThostFtdcFBTUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDByBankTypeһԼı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDByBankType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankOperNoTypeһвԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankOperNoType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCustNoTypeһпͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCustNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOPSeqNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDBOPSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTableNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTableNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKValueTypeһFBTֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKValueType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOperationTypeһ¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DBOP_Insert '0' +/// +#define THOST_FTDC_DBOP_Update '1' +///ɾ +#define THOST_FTDC_DBOP_Delete '2' + +typedef char TThostFtdcDBOperationType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncFlagTypeһͬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_SYNF_Yes '0' +///δͬ +#define THOST_FTDC_SYNF_No '1' + +typedef char TThostFtdcSyncFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTargetIDTypeһͬĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTargetIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncTypeTypeһͬ +///////////////////////////////////////////////////////////////////////// +///һͬ +#define THOST_FTDC_SYNT_OneOffSync '0' +///ʱͬ +#define THOST_FTDC_SYNT_TimerSync '1' +///ʱȫͬ +#define THOST_FTDC_SYNT_TimerFullSync '2' + +typedef char TThostFtdcSyncTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETimeTypeһֻʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBETimeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBECertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBECertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExDirectionTypeһ㷽 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEDIR_Settlement '0' +///ۻ +#define THOST_FTDC_FBEDIR_Sale '1' + +typedef char TThostFtdcExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountNameTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAmtTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFBEAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEPostScriptTypeһ㸽 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEPostScriptType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERemarkTypeһ㱸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERemarkType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEResultFlagTypeһɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_FBERES_Success '0' +///˻ +#define THOST_FTDC_FBERES_InsufficientBalance '1' +///׽δ֪ +#define THOST_FTDC_FBERES_UnknownTrading '8' +///ʧ +#define THOST_FTDC_FBERES_Fail 'x' + +typedef char TThostFtdcFBEResultFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERtnMsgTypeһ㷵Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERtnMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExtendMsgTypeһչϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEExtendMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessSerialType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBESystemSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBESystemSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETotalExCntTypeһ㽻ܱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBETotalExCntType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExchStatusTypeһ㽻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEES_Normal '0' +///ط +#define THOST_FTDC_FBEES_ReExchange '1' + +typedef char TThostFtdcFBEExchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileFlagTypeһļ־ +///////////////////////////////////////////////////////////////////////// +///ݰ +#define THOST_FTDC_FBEFG_DataPackage '0' +///ļ +#define THOST_FTDC_FBEFG_File '1' + +typedef char TThostFtdcFBEFileFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAlreadyTradeTypeһѽױ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBEAT_NotTrade '0' +///ѽ +#define THOST_FTDC_FBEAT_Trade '1' + +typedef char TThostFtdcFBEAlreadyTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEOpenBankTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEOpenBankType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEUserEventTypeTypeһڻû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBEUET_SignIn '0' +/// +#define THOST_FTDC_FBEUET_Exchange '1' +///ط +#define THOST_FTDC_FBEUET_ReExchange '2' +///˻ѯ +#define THOST_FTDC_FBEUET_QueryBankAccount '3' +///ϸѯ +#define THOST_FTDC_FBEUET_QueryExchDetial '4' +///ܲѯ +#define THOST_FTDC_FBEUET_QueryExchSummary '5' +///ʲѯ +#define THOST_FTDC_FBEUET_QueryExchRate '6' +///ļ֪ͨ +#define THOST_FTDC_FBEUET_CheckBankAccount '7' +///ǩ +#define THOST_FTDC_FBEUET_SignOut '8' +/// +#define THOST_FTDC_FBEUET_Other 'Z' + +typedef char TThostFtdcFBEUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEFileNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBatchSerialTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBatchSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBERF_UnProcessed '0' +///ȴ +#define THOST_FTDC_FBERF_WaitSend '1' +///ͳɹ +#define THOST_FTDC_FBERF_SendSuccess '2' +///ʧ +#define THOST_FTDC_FBERF_SendFailed '3' +///ȴط +#define THOST_FTDC_FBERF_WaitReSend '4' + +typedef char TThostFtdcFBEReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNotifyClassTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_NC_NOERROR '0' +///ʾ +#define THOST_FTDC_NC_Warn '1' +///׷ +#define THOST_FTDC_NC_Call '2' +///ǿƽ +#define THOST_FTDC_NC_Force '3' +/// +#define THOST_FTDC_NC_CHUANCANG '4' +///쳣 +#define THOST_FTDC_NC_Exception '5' + +typedef char TThostFtdcNotifyClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskNofityInfoType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseSceneIdTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcForceCloseSceneIdType[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseTypeTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +///ֹǿƽ +#define THOST_FTDC_FCT_Manual '0' +///һͶ߸ǿƽ +#define THOST_FTDC_FCT_Single '1' +///Ͷ߸ǿƽ +#define THOST_FTDC_FCT_Group '2' + +typedef char TThostFtdcForceCloseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyMethodTypeһ֪ͨ; +///////////////////////////////////////////////////////////////////////// +///ϵͳ֪ͨ +#define THOST_FTDC_RNM_System '0' +///֪ͨ +#define THOST_FTDC_RNM_SMS '1' +///ʼ֪ͨ +#define THOST_FTDC_RNM_EMail '2' +///˹֪ͨ +#define THOST_FTDC_RNM_Manual '3' + +typedef char TThostFtdcRiskNotifyMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_RNS_NotGen '0' +///δ +#define THOST_FTDC_RNS_Generated '1' +///ʧ +#define THOST_FTDC_RNS_SendError '2' +///ѷδ +#define THOST_FTDC_RNS_SendOk '3' +///ѽδȷ +#define THOST_FTDC_RNS_Received '4' +///ȷ +#define THOST_FTDC_RNS_Confirmed '5' + +typedef char TThostFtdcRiskNotifyStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskUserEventTypeһû¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RUE_ExportData '0' + +typedef char TThostFtdcRiskUserEventType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamValueType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConditionalOrderSortTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ʹ¼ +#define THOST_FTDC_COST_LastPriceAsc '0' +///ʹ¼۽ +#define THOST_FTDC_COST_LastPriceDesc '1' +///ʹ +#define THOST_FTDC_COST_AskPriceAsc '2' +///ʹ۽ +#define THOST_FTDC_COST_AskPriceDesc '3' +///ʹ +#define THOST_FTDC_COST_BidPriceAsc '4' +///ʹ۽ +#define THOST_FTDC_COST_BidPriceDesc '5' + +typedef char TThostFtdcConditionalOrderSortTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendTypeTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOAST_NoSend '0' +///ѷ +#define THOST_FTDC_UOAST_Sended '1' +/// +#define THOST_FTDC_UOAST_Generated '2' +///ʧ +#define THOST_FTDC_UOAST_SendFail '3' +///ճɹ +#define THOST_FTDC_UOAST_Success '4' +///ʧ +#define THOST_FTDC_UOAST_Fail '5' +///ȡ +#define THOST_FTDC_UOAST_Cancel '6' + +typedef char TThostFtdcSendTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDStatusTypeһױ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOACS_NoApply '1' +///ύ +#define THOST_FTDC_UOACS_Submited '2' +///ѷ +#define THOST_FTDC_UOACS_Sended '3' +/// +#define THOST_FTDC_UOACS_Success '4' +///ܾ +#define THOST_FTDC_UOACS_Refuse '5' +///ѳ +#define THOST_FTDC_UOACS_Cancel '6' + +typedef char TThostFtdcClientIDStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndustryIDTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndustryIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionIDTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionContentTypeһϢ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionContentType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionIDTypeһѡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionContentTypeһѡ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionContentType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionTypeTypeһϢ +///////////////////////////////////////////////////////////////////////// +///ѡ +#define THOST_FTDC_QT_Radio '1' +///ѡ +#define THOST_FTDC_QT_Option '2' +/// +#define THOST_FTDC_QT_Blank '3' + +typedef char TThostFtdcQuestionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessIDTypeһҵˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAProcessStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAProcessStatusType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessTypeTypeһ̹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BT_Request '1' +///Ӧ +#define THOST_FTDC_BT_Response '2' +///֪ͨ +#define THOST_FTDC_BT_Notice '3' + +typedef char TThostFtdcBusinessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCfmmcReturnCodeTypeһķ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_CRC_Success '0' +///ÿͻѾڴ +#define THOST_FTDC_CRC_Working '1' +///пͻϼʧ +#define THOST_FTDC_CRC_InfoFail '2' +///ʵƼʧ +#define THOST_FTDC_CRC_IDCardFail '3' +/// +#define THOST_FTDC_CRC_OtherFail '4' + +typedef char TThostFtdcCfmmcReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcExReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CfMMCCT_All '0' +/// +#define THOST_FTDC_CfMMCCT_Person '1' +///λ +#define THOST_FTDC_CfMMCCT_Company '2' +/// +#define THOST_FTDC_CfMMCCT_Other '3' +///ⷨ +#define THOST_FTDC_CfMMCCT_SpecialOrgan '4' +///ʹܻ +#define THOST_FTDC_CfMMCCT_Asset '5' + +typedef char TThostFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///Ϻڻ +#define THOST_FTDC_EIDT_SHFE 'S' +///֣Ʒ +#define THOST_FTDC_EIDT_CZCE 'Z' +///Ʒ +#define THOST_FTDC_EIDT_DCE 'D' +///йڻ +#define THOST_FTDC_EIDT_CFFEX 'J' +///ϺԴĹɷ޹˾ +#define THOST_FTDC_EIDT_INE 'N' +///Ϻ֤ȯ +#define THOST_FTDC_EIDT_SSE 'A' +///֤ȯ +#define THOST_FTDC_EIDT_SZSE 'E' + +typedef char TThostFtdcExchangeIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ױ +#define THOST_FTDC_ECIDT_Hedge '1' +/// +#define THOST_FTDC_ECIDT_Arbitrage '2' +///Ͷ +#define THOST_FTDC_ECIDT_Speculation '3' + +typedef char TThostFtdcExClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientClassifyTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientClassifyType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAOrganTypeTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAOrganTypeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOACountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOACountryCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAreaCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAreaCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturesIDTypeһΪͻĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFuturesIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNocIDTypeһ֯ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNocIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUpdateFlagTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UF_NoUpdate '0' +///ȫϢɹ +#define THOST_FTDC_UF_Success '1' +///ȫϢʧ +#define THOST_FTDC_UF_Fail '2' +///½ױɹ +#define THOST_FTDC_UF_TCSuccess '3' +///½ױʧ +#define THOST_FTDC_UF_TCFail '4' +///Ѷ +#define THOST_FTDC_UF_Cancel '5' + +typedef char TThostFtdcUpdateFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyOperateIDTypeһ붯 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AOID_OpenInvestor '1' +///޸Ϣ +#define THOST_FTDC_AOID_ModifyIDCard '2' +///޸һϢ +#define THOST_FTDC_AOID_ModifyNoIDCard '3' +///뽻ױ +#define THOST_FTDC_AOID_ApplyTradingCode '4' +///ױ +#define THOST_FTDC_AOID_CancelTradingCode '5' +/// +#define THOST_FTDC_AOID_CancelInvestor '6' +///˻ +#define THOST_FTDC_AOID_FreezeAccount '8' +///˻ +#define THOST_FTDC_AOID_ActiveFreezeAccount '9' + +typedef char TThostFtdcApplyOperateIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyStatusIDTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δȫ +#define THOST_FTDC_ASID_NoComplete '1' +///ύ +#define THOST_FTDC_ASID_Submited '2' +/// +#define THOST_FTDC_ASID_Checked '3' +///Ѿܾ +#define THOST_FTDC_ASID_Refused '4' +///ɾ +#define THOST_FTDC_ASID_Deleted '5' + +typedef char TThostFtdcApplyStatusIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendMethodTypeһͷʽ +///////////////////////////////////////////////////////////////////////// +///ļ +#define THOST_FTDC_UOASM_ByAPI '1' +///ӷ +#define THOST_FTDC_UOASM_ByFile '2' + +typedef char TThostFtdcSendMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEventTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventModeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EvM_ADD '1' +///޸ +#define THOST_FTDC_EvM_UPDATE '2' +///ɾ +#define THOST_FTDC_EvM_DELETE '3' +/// +#define THOST_FTDC_EvM_CHECK '4' +/// +#define THOST_FTDC_EvM_COPY '5' +///ע +#define THOST_FTDC_EvM_CANCEL '6' +/// +#define THOST_FTDC_EvM_Reverse '7' + +typedef char TThostFtdcEventModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAutoSendTypeһͳһԶ +///////////////////////////////////////////////////////////////////////// +///ԶͲ +#define THOST_FTDC_UOAA_ASR '1' +///ԶͣԶ +#define THOST_FTDC_UOAA_ASNR '2' +///ԶͣԶ +#define THOST_FTDC_UOAA_NSAR '3' +///ԶͣҲԶ +#define THOST_FTDC_UOAA_NSR '4' + +typedef char TThostFtdcUOAAutoSendType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryDepthTypeһѯ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcQueryDepthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataCenterIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlowIDTypeһID +///////////////////////////////////////////////////////////////////////// +///Ͷ߶ӦͶ +#define THOST_FTDC_EvM_InvestorGroupFlow '1' +///Ͷ +#define THOST_FTDC_EvM_InvestorRate '2' +///Ͷģϵ +#define THOST_FTDC_EvM_InvestorCommRateModel '3' + +typedef char TThostFtdcFlowIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_CL_Zero '0' +///һ +#define THOST_FTDC_CL_One '1' +/// +#define THOST_FTDC_CL_Two '2' + +typedef char TThostFtdcCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCheckNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckStatusTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_CHS_Init '0' +/// +#define THOST_FTDC_CHS_Checking '1' +///Ѹ +#define THOST_FTDC_CHS_Checked '2' +///ܾ +#define THOST_FTDC_CHS_Refuse '3' +/// +#define THOST_FTDC_CHS_Cancel '4' + +typedef char TThostFtdcCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUsedStatusTypeһЧ״̬ +///////////////////////////////////////////////////////////////////////// +///δЧ +#define THOST_FTDC_CHU_Unused '0' +///Ч +#define THOST_FTDC_CHU_Used '1' +///Чʧ +#define THOST_FTDC_CHU_Fail '2' + +typedef char TThostFtdcUsedStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyStringTypeһڲѯͶֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyStringType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAcountOriginTypeһ˻Դ +///////////////////////////////////////////////////////////////////////// +///ֹ¼ +#define THOST_FTDC_BAO_ByAccProperty '0' +///ת +#define THOST_FTDC_BAO_ByFBTransfer '1' + +typedef char TThostFtdcBankAcountOriginType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ +///////////////////////////////////////////////////////////////////////// +///ͬͬԼ +#define THOST_FTDC_MBTS_ByInstrument '0' +///ͬͬԼͬ۸ +#define THOST_FTDC_MBTS_ByDayInsPrc '1' +///ͬԼ +#define THOST_FTDC_MBTS_ByDayIns '2' + +typedef char TThostFtdcMonthBillTradeSumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTradeCodeEnumTypeһڽ״ö +///////////////////////////////////////////////////////////////////////// +///зתڻ +#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001' +///ڻתڻ +#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001' +///зڻת +#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002' +///ڻڻת +#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + +typedef char TThostFtdcFBTTradeCodeEnumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateIDTypeһģʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimestampTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTimestampType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleNameTypeһŶι +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleExprTypeһŶιʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleExprType[513]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define THOST_FTDC_OTP_NONE '0' +///ʱ +#define THOST_FTDC_OTP_TOTP '1' + +typedef char TThostFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsNameTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPStatusTypeһ̬״̬ +///////////////////////////////////////////////////////////////////////// +///δʹ +#define THOST_FTDC_OTPS_Unused '0' +///ʹ +#define THOST_FTDC_OTPS_Used '1' +///ע +#define THOST_FTDC_OTPS_Disuse '2' + +typedef char TThostFtdcOTPStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerUserTypeTypeһù˾û +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BUT_Investor '1' +///Ա +#define THOST_FTDC_BUT_BrokerUser '2' + +typedef char TThostFtdcBrokerUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define THOST_FTDC_FUTT_Commodity '1' +///ڻ +#define THOST_FTDC_FUTT_Financial '2' + +typedef char TThostFtdcFutureTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundEventTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ת޶ +#define THOST_FTDC_FET_Restriction '0' +///ת޶ +#define THOST_FTDC_FET_TodayRestriction '1' +///ˮ +#define THOST_FTDC_FET_Transfer '2' +///ʽ𶳽 +#define THOST_FTDC_FET_Credit '3' +///Ͷ߿ʽ +#define THOST_FTDC_FET_InvestorWithdrawAlm '4' +///ʻת޶ +#define THOST_FTDC_FET_BankRestriction '5' +///ǩԼ˻ +#define THOST_FTDC_FET_Accountregister '6' +/// +#define THOST_FTDC_FET_ExchangeFundIO '7' +///Ͷ߳ +#define THOST_FTDC_FET_InvestorFundIO '8' + +typedef char TThostFtdcFundEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSourceTypeTypeһʽ˻Դ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_AST_FBTransfer '0' +///ֹ¼ +#define THOST_FTDC_AST_ManualEntry '1' + +typedef char TThostFtdcAccountSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCodeSourceTypeTypeһױԴ +///////////////////////////////////////////////////////////////////////// +///ͳһ(ѹ淶) +#define THOST_FTDC_CST_UnifyAccount '0' +///ֹ¼(δ淶) +#define THOST_FTDC_CST_ManualEntry '1' + +typedef char TThostFtdcCodeSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRangeTypeһԱΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_UR_All '0' +///һԱ +#define THOST_FTDC_UR_Single '1' + +typedef char TThostFtdcUserRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeSpanType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImportSequenceIDTypeһ̬Ƶα +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcImportSequenceIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByGroupTypeһͳƱͻͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ͷͳ +#define THOST_FTDC_BG_Investor '2' +///ͳ +#define THOST_FTDC_BG_Group '1' + +typedef char TThostFtdcByGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Լͳ +#define THOST_FTDC_TSSM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_TSSM_Product '2' +///ͳ +#define THOST_FTDC_TSSM_Exchange '3' + +typedef char TThostFtdcTradeSumStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComTypeTypeһϳɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcComTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductIDTypeһƷʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductMemoTypeһƷ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCCancelFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCCancelFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenInvestorNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorIDTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankFlagTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankFlagType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemoTypeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTradeIDTypeһɽˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCExchangeInstIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMortgageNameTypeһѺƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMortgageNameType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCReasonTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCReasonType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsSettlementTypeһǷΪǽԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsSettlementType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOptionsTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCStrikePriceTypeһִм +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCStrikePriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetProductIDTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetProductIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetInstrIDTypeһĺԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetInstrIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelMemoTypeһģ屸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExprSetModeTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +///й +#define THOST_FTDC_ESM_Relative '1' +/// +#define THOST_FTDC_ESM_Typical '2' + +typedef char TThostFtdcExprSetModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +///˾׼ +#define THOST_FTDC_RIR_All '1' +///ģ +#define THOST_FTDC_RIR_Model '2' +///һͶ +#define THOST_FTDC_RIR_Single '3' + +typedef char TThostFtdcRateInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentBrokerIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDRIdentityIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDRIdentityNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBLinkIDTypeһDBLinkʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBLinkIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncDataStatusTypeһϵͳͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_SDS_Initialize '0' +///ͬ +#define THOST_FTDC_SDS_Settlementing '1' +///ͬ +#define THOST_FTDC_SDS_Settlemented '2' + +typedef char TThostFtdcSyncDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define THOST_FTDC_TSRC_NORMAL '0' +///Բѯ +#define THOST_FTDC_TSRC_QUERY '1' + +typedef char TThostFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlexStatModeTypeһƷԼͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ʒͳ +#define THOST_FTDC_FSM_Product '1' +///ͳ +#define THOST_FTDC_FSM_Exchange '2' +///ͳ +#define THOST_FTDC_FSM_All '3' + +typedef char TThostFtdcFlexStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///ͳ +#define THOST_FTDC_BIR_Property '1' +///ͳ +#define THOST_FTDC_BIR_All '2' + +typedef char TThostFtdcByInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNo12Typeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNo12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PIR_All '1' +///Ͷ +#define THOST_FTDC_PIR_Property '2' +///һͶ +#define THOST_FTDC_PIR_Single '3' + +typedef char TThostFtdcPropertyInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FIS_NoCreate '0' +/// +#define THOST_FTDC_FIS_Created '1' +///ʧ +#define THOST_FTDC_FIS_Failed '2' + +typedef char TThostFtdcFileStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileGenStyleTypeһļɷʽ +///////////////////////////////////////////////////////////////////////// +///· +#define THOST_FTDC_FGS_FileTransmit '0' +/// +#define THOST_FTDC_FGS_FileGen '1' + +typedef char TThostFtdcFileGenStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperModeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SoM_Add '1' +///޸ +#define THOST_FTDC_SoM_Update '2' +///ɾ +#define THOST_FTDC_SoM_Delete '3' +/// +#define THOST_FTDC_SoM_Copy '4' +/// +#define THOST_FTDC_SoM_AcTive '5' +///ע +#define THOST_FTDC_SoM_CanCel '6' +/// +#define THOST_FTDC_SoM_ReSet '7' + +typedef char TThostFtdcSysOperModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperTypeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +///޸IJԱ +#define THOST_FTDC_SoT_UpdatePassword '0' +///Աܹ֯ϵ +#define THOST_FTDC_SoT_UserDepartment '1' +///ɫ +#define THOST_FTDC_SoT_RoleManager '2' +///ɫ +#define THOST_FTDC_SoT_RoleFunction '3' +/// +#define THOST_FTDC_SoT_BaseParam '4' +///òԱ +#define THOST_FTDC_SoT_SetUserID '5' +///ûɫ +#define THOST_FTDC_SoT_SetUserRole '6' +///ûIP +#define THOST_FTDC_SoT_UserIpRestriction '7' +///ܹ֯ +#define THOST_FTDC_SoT_DepartmentManager '8' +///ܹ֯ѯิ +#define THOST_FTDC_SoT_DepartmentCopy '9' +///ױ +#define THOST_FTDC_SoT_Tradingcode 'A' +///Ͷ״̬ά +#define THOST_FTDC_SoT_InvestorStatus 'B' +///ͶȨ޹ +#define THOST_FTDC_SoT_InvestorAuthority 'C' +/// +#define THOST_FTDC_SoT_PropertySet 'D' +///Ͷ +#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E' +///Ͷ߸Ϣά +#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F' + +typedef char TThostFtdcSysOperTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDataQueyTypeTypeһϱݲѯ +///////////////////////////////////////////////////////////////////////// +///ѯǰձ͵ +#define THOST_FTDC_CSRCQ_Current '0' +///ѯʷ͵Ĵ͹˾ +#define THOST_FTDC_CSRCQ_History '1' + +typedef char TThostFtdcCSRCDataQueyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_FRS_Normal '1' +/// +#define THOST_FTDC_FRS_Freeze '0' + +typedef char TThostFtdcFreezeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStandardStatusTypeһ淶״̬ +///////////////////////////////////////////////////////////////////////// +///ѹ淶 +#define THOST_FTDC_STST_Standard '0' +///δ淶 +#define THOST_FTDC_STST_NonStandard '1' + +typedef char TThostFtdcStandardStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCFreezeStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightParamTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///߻ +#define THOST_FTDC_RPT_Freeze '1' +///߻ +#define THOST_FTDC_RPT_FreezeActive '2' +///Ȩ +#define THOST_FTDC_RPT_OpenLimit '3' +///Ȩ +#define THOST_FTDC_RPT_RelieveOpenLimit '4' + +typedef char TThostFtdcRightParamTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataStatusTypeһϴǮ˱״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDS_Normal '0' +///ɾ +#define THOST_FTDC_AMLDS_Deleted '1' + +typedef char TThostFtdcDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCheckStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_AMLCHS_Init '0' +/// +#define THOST_FTDC_AMLCHS_Checking '1' +///Ѹ +#define THOST_FTDC_AMLCHS_Checked '2' +///ܾϱ +#define THOST_FTDC_AMLCHS_RefuseReport '3' + +typedef char TThostFtdcAMLCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlDateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDT_DrawDay '0' +/// +#define THOST_FTDC_AMLDT_TouchDay '1' + +typedef char TThostFtdcAmlDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_AMLCL_CheckLevel0 '0' +///һ +#define THOST_FTDC_AMLCL_CheckLevel1 '1' +/// +#define THOST_FTDC_AMLCL_CheckLevel2 '2' +/// +#define THOST_FTDC_AMLCL_CheckLevel3 '3' + +typedef char TThostFtdcAmlCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckFlowTypeһϴǮݳȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmlCheckFlowType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDataTypeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExportFileTypeTypeһļ +///////////////////////////////////////////////////////////////////////// +///CSV +#define THOST_FTDC_EFT_CSV '0' +///Excel +#define THOST_FTDC_EFT_EXCEL '1' +///DBF +#define THOST_FTDC_EFT_DBF '2' + +typedef char TThostFtdcExportFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ׼ +#define THOST_FTDC_SMT_Before '1' +/// +#define THOST_FTDC_SMT_Settlement '2' +///˶ +#define THOST_FTDC_SMT_After '3' +/// +#define THOST_FTDC_SMT_Settlemented '4' + +typedef char TThostFtdcSettleManagerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerIDTypeһô +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerLevelTypeһõȼ +///////////////////////////////////////////////////////////////////////// +///Ҫ +#define THOST_FTDC_SML_Must '1' +/// +#define THOST_FTDC_SML_Alarm '2' +///ʾ +#define THOST_FTDC_SML_Prompt '3' +/// +#define THOST_FTDC_SML_Ignore '4' + +typedef char TThostFtdcSettleManagerLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerGroupTypeһģ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_SMG_Exhcange '1' +///ڲ˶ +#define THOST_FTDC_SMG_ASP '2' +///ϱݺ˶ +#define THOST_FTDC_SMG_CSRC '3' + +typedef char TThostFtdcSettleManagerGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckResultMemoTypeһ˶Խ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCheckResultMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionUrlTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionUrlType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthInfoTypeһͻ֤Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLimitUseTypeTypeһֵʹ +///////////////////////////////////////////////////////////////////////// +///ظʹ +#define THOST_FTDC_LUT_Repeatable '1' +///ظʹ +#define THOST_FTDC_LUT_Unrepeatable '2' + +typedef char TThostFtdcLimitUseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataResourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_DAR_Settle '1' +/// +#define THOST_FTDC_DAR_Exchange '2' +/// +#define THOST_FTDC_DAR_CSRC '3' + +typedef char TThostFtdcDataResourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MGT_ExchMarginRate '0' +///Ͷ֤߱ +#define THOST_FTDC_MGT_InstrMarginRate '1' +///Ͷ߽ױ֤ +#define THOST_FTDC_MGT_InstrMarginRateTrade '2' + +typedef char TThostFtdcMarginTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActiveTypeTypeһЧ +///////////////////////////////////////////////////////////////////////// +///Ч +#define THOST_FTDC_ACT_Intraday '1' +///Ч +#define THOST_FTDC_ACT_Long '2' + +typedef char TThostFtdcActiveTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginRateTypeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MRT_Exchange '1' +///Ͷ֤߱ +#define THOST_FTDC_MRT_Investor '2' +///Ͷ߽ױ֤ +#define THOST_FTDC_MRT_InvestorTrade '3' + +typedef char TThostFtdcMarginRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBackUpStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_BUS_UnBak '0' +/// +#define THOST_FTDC_BUS_BakUp '1' +///ɱ +#define THOST_FTDC_BUS_BakUped '2' +///ʧ +#define THOST_FTDC_BUS_BakFail '3' + +typedef char TThostFtdcBackUpStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInitSettlementTypeһʼ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼδʼ +#define THOST_FTDC_SIS_UnInitialize '0' +///ʼ +#define THOST_FTDC_SIS_Initialize '1' +///ʼ +#define THOST_FTDC_SIS_Initialized '2' + +typedef char TThostFtdcInitSettlementType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_SRS_NoCreate '0' +/// +#define THOST_FTDC_SRS_Create '1' +///ɱ +#define THOST_FTDC_SRS_Created '2' +///ɱʧ +#define THOST_FTDC_SRS_CreateFail '3' + +typedef char TThostFtdcReportStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSaveStatusTypeһݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///鵵δ +#define THOST_FTDC_SSS_UnSaveData '0' +///鵵 +#define THOST_FTDC_SSS_SaveDatad '1' + +typedef char TThostFtdcSaveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettArchiveStatusTypeһȷݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///δ鵵 +#define THOST_FTDC_SAS_UnArchived '0' +///ݹ鵵 +#define THOST_FTDC_SAS_Archiving '1' +///ѹ鵵 +#define THOST_FTDC_SAS_Archived '2' +///鵵ʧ +#define THOST_FTDC_SAS_ArchiveFail '3' + +typedef char TThostFtdcSettArchiveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCTPTypeTypeһCTPϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_CTPT_Unkown '0' +/// +#define THOST_FTDC_CTPT_MainCenter '1' +/// +#define THOST_FTDC_CTPT_BackUp '2' + +typedef char TThostFtdcCTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolIDTypeһߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDealTypeTypeһƽִ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CDT_Normal '0' +///Ͷƽ +#define THOST_FTDC_CDT_SpecFirst '1' + +typedef char TThostFtdcCloseDealTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageFundUseRangeTypeһѺʽ÷Χ +///////////////////////////////////////////////////////////////////////// +///ʹ +#define THOST_FTDC_MFUR_None '0' +///ڱ֤ +#define THOST_FTDC_MFUR_Margin '1' +///ѡӯ֤ +#define THOST_FTDC_MFUR_All '2' + +typedef char TThostFtdcMortgageFundUseRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyUnitTypeһֵλ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCurrencyUnitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExchangeRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///֣ױƷ +#define THOST_FTDC_SPT_CzceHedge '1' +///ѺƷ +#define THOST_FTDC_SPT_IneForeignCurrency '2' +///߿ƽֲƷ +#define THOST_FTDC_SPT_DceOpenClose '3' + +typedef char TThostFtdcSpecProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_FMT_Mortgage '1' +/// +#define THOST_FTDC_FMT_Redemption '2' + +typedef char TThostFtdcFundMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSettlementParamIDTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_ASPI_BaseMargin '1' +///Ȩ׼ +#define THOST_FTDC_ASPI_LowestInterest '2' + +typedef char TThostFtdcAccountSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySignTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySignType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionTypeһѺ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMD_In '1' +///ʳ +#define THOST_FTDC_FMD_Out '2' + +typedef char TThostFtdcFundMortDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessClassTypeһ +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_BT_Profit '0' +/// +#define THOST_FTDC_BT_Loss '1' +/// +#define THOST_FTDC_BT_Other 'Z' + +typedef char TThostFtdcBusinessClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapSourceTypeTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_SST_Manual '0' +///Զ +#define THOST_FTDC_SST_Automatic '1' + +typedef char TThostFtdcSwapSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CED_Settlement '0' +///ۻ +#define THOST_FTDC_CED_Sale '1' + +typedef char TThostFtdcCurrExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_CSS_Entry '1' +/// +#define THOST_FTDC_CSS_Approve '2' +///Ѿܾ +#define THOST_FTDC_CSS_Refuse '3' +///ѳ +#define THOST_FTDC_CSS_Revoke '4' +///ѷ +#define THOST_FTDC_CSS_Send '5' +///ɹ +#define THOST_FTDC_CSS_Success '6' +///ʧ +#define THOST_FTDC_CSS_Failure '7' + +typedef char TThostFtdcCurrencySwapStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExchCertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrExchCertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchSerialNoTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBatchSerialNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_REQF_NoSend '0' +///ͳɹ +#define THOST_FTDC_REQF_SendSuccess '1' +///ʧ +#define THOST_FTDC_REQF_SendFailed '2' +///ȴط +#define THOST_FTDC_REQF_WaitReSend '3' + +typedef char TThostFtdcReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcResFlagTypeһ㷵سɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_RESF_Success '0' +///˻ +#define THOST_FTDC_RESF_InsuffiCient '1' +///׽δ֪ +#define THOST_FTDC_RESF_UnKnown '8' + +typedef char TThostFtdcResFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPageControlTypeһҳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPageControlType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordCountTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRecordCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapMemoTypeһȷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySwapMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExStatusTypeһ޸״̬ +///////////////////////////////////////////////////////////////////////// +///޸ǰ +#define THOST_FTDC_EXS_Before '0' +///޸ĺ +#define THOST_FTDC_EXS_After '1' + +typedef char TThostFtdcExStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientRegionTypeһͻ +///////////////////////////////////////////////////////////////////////// +///ڿͻ +#define THOST_FTDC_CR_Domestic '1' +///۰̨ͻ +#define THOST_FTDC_CR_GMT '2' +///ͻ +#define THOST_FTDC_CR_Foreign '3' + +typedef char TThostFtdcClientRegionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWorkPlaceTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWorkPlaceType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessPeriodTypeһӪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessPeriodType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebSiteTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebSiteType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAIdCardTypeTypeһͳһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientModeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorFullNameTypeһͶȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOABrokerIDTypeһнID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOABrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAZipCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAEMailTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAEMailType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOldCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOldCityType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorporateIdentifiedCardNoTypeһ˴֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCorporateIdentifiedCardNoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasBoardTypeһǷж» +///////////////////////////////////////////////////////////////////////// +///û +#define THOST_FTDC_HB_No '0' +/// +#define THOST_FTDC_HB_Yes '1' + +typedef char TThostFtdcHasBoardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStartModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SM_Normal '1' +///Ӧ +#define THOST_FTDC_SM_Emerge '2' +///ָ +#define THOST_FTDC_SM_Restore '3' + +typedef char TThostFtdcStartModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateTypeTypeһģ +///////////////////////////////////////////////////////////////////////// +///ȫ +#define THOST_FTDC_TPT_Full '1' +/// +#define THOST_FTDC_TPT_Increment '2' +/// +#define THOST_FTDC_TPT_BackUp '3' + +typedef char TThostFtdcTemplateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLoginModeTypeһ¼ģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LM_Trade '0' +///ת +#define THOST_FTDC_LM_Transfer '1' + +typedef char TThostFtdcLoginModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPromptTypeTypeһʾ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CPT_Instrument '1' +///ֶ֤Ч +#define THOST_FTDC_CPT_Margin '2' + +typedef char TThostFtdcPromptTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageIDTypeһֻʲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageIDType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestVarietyTypeһͶƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestVarietyType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageBankTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentNameTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentCodeTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasTrusteeTypeһǷй +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HT_Yes '1' +///û +#define THOST_FTDC_HT_No '0' + +typedef char TThostFtdcHasTrusteeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemo1Typeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemo1Type[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrCFullNameTypeһʲҵڻ˾ȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrCFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrApprovalNOTypeһʲҵĺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrApprovalNOType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrMgrNameTypeһʲҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrMgrNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMT_Bank '1' +///֤ȯ˾ +#define THOST_FTDC_AMT_Securities '2' +///˾ +#define THOST_FTDC_AMT_Fund '3' +///չ˾ +#define THOST_FTDC_AMT_Insurance '4' +///й˾ +#define THOST_FTDC_AMT_Trust '5' +/// +#define THOST_FTDC_AMT_Other '9' + +typedef char TThostFtdcAmTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCAmTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFIOT_FundIO '0' +///ڻ +#define THOST_FTDC_CFIOT_SwapCurrency '1' + +typedef char TThostFtdcCSRCFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCusAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ڻ˻ +#define THOST_FTDC_CAT_Futures '1' +///ڻʹҵµʹܽ˻ +#define THOST_FTDC_CAT_AssetmgrFuture '2' +///ۺʹҵµڻʹй˻ +#define THOST_FTDC_CAT_AssetmgrTrustee '3' +///ۺʹҵµʽת˻ +#define THOST_FTDC_CAT_AssetmgrTransfer '4' + +typedef char TThostFtdcCusAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCNationalType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCSecAgentIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCSecAgentIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLanguageTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LT_Chinese '1' +///Ӣ +#define THOST_FTDC_LT_English '2' + +typedef char TThostFtdcLanguageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmAccountTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///ʹܿͻ +#define THOST_FTDC_AMCT_Person '1' +///λʹܿͻ +#define THOST_FTDC_AMCT_Organ '2' +///ⵥλʹܿͻ +#define THOST_FTDC_AMCT_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_ASST_Futures '3' +///ۺ +#define THOST_FTDC_ASST_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOMTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOMType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEInstLifePhaseType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEProductClassType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceDecimalTypeһ۸Сλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPriceDecimalType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInTheMoneyFlagTypeһƽֵȨ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInTheMoneyFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckInstrTypeTypeһԼȽ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CIT_HasExch '0' +///Լϵͳ +#define THOST_FTDC_CIT_HasATP '1' +///ԼȽϲһ +#define THOST_FTDC_CIT_HasDiff '2' + +typedef char TThostFtdcCheckInstrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_DT_HandDeliv '1' +///ڽ +#define THOST_FTDC_DT_PersonDeliv '2' + +typedef char TThostFtdcDeliveryTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBigMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcBigMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMaxMarginSideAlgorithmTypeһ֤߱㷨 +///////////////////////////////////////////////////////////////////////// +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_NO '0' +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_YES '1' + +typedef char TThostFtdcMaxMarginSideAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDAClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CACT_Person '0' +/// +#define THOST_FTDC_CACT_Company '1' +/// +#define THOST_FTDC_CACT_Other '2' + +typedef char TThostFtdcDAClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinInstrIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinInstrIDType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinSettlePriceTypeһȽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinSettlePriceType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDCEPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeGroupIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeGroupIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsCheckPrepaTypeһǷУ鿪ʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIsCheckPrepaType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_UOAAT_Futures '1' +///ۺ +#define THOST_FTDC_UOAAT_SpecialOrgan '2' + +typedef char TThostFtdcUOAAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Buy +#define THOST_FTDC_DEN_Buy '0' +///Sell +#define THOST_FTDC_DEN_Sell '1' + +typedef char TThostFtdcDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagEnTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +///Position Opening +#define THOST_FTDC_OFEN_Open '0' +///Position Close +#define THOST_FTDC_OFEN_Close '1' +///Forced Liquidation +#define THOST_FTDC_OFEN_ForceClose '2' +///Close Today +#define THOST_FTDC_OFEN_CloseToday '3' +///Close Prev. +#define THOST_FTDC_OFEN_CloseYesterday '4' +///Forced Reduction +#define THOST_FTDC_OFEN_ForceOff '5' +///Local Forced Liquidation +#define THOST_FTDC_OFEN_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagEnTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Speculation +#define THOST_FTDC_HFEN_Speculation '1' +///Arbitrage +#define THOST_FTDC_HFEN_Arbitrage '2' +///Hedge +#define THOST_FTDC_HFEN_Hedge '3' + +typedef char TThostFtdcHedgeFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit/Withdrawal +#define THOST_FTDC_FIOTEN_FundIO '1' +///Bank-Futures Transfer +#define THOST_FTDC_FIOTEN_Transfer '2' +///Bank-Futures FX Exchange +#define THOST_FTDC_FIOTEN_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeEnTypeһʽ +///////////////////////////////////////////////////////////////////////// +///Bank Deposit +#define THOST_FTDC_FTEN_Deposite '1' +///Payment/Fee +#define THOST_FTDC_FTEN_ItemFund '2' +///Brokerage Adj +#define THOST_FTDC_FTEN_Company '3' +///Internal Transfer +#define THOST_FTDC_FTEN_InnerTransfer '4' + +typedef char TThostFtdcFundTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit +#define THOST_FTDC_FDEN_In '1' +///Withdrawal +#define THOST_FTDC_FDEN_Out '2' + +typedef char TThostFtdcFundDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionEnTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Pledge +#define THOST_FTDC_FMDEN_In '1' +///Redemption +#define THOST_FTDC_FMDEN_Out '2' + +typedef char TThostFtdcFundMortDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSwapBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CP_CallOptions '1' +/// +#define THOST_FTDC_CP_PutOptions '2' + +typedef char TThostFtdcOptionsTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeModeTypeһִзʽ +///////////////////////////////////////////////////////////////////////// +///ŷʽ +#define THOST_FTDC_STM_Continental '0' +///ʽ +#define THOST_FTDC_STM_American '1' +///Ľ +#define THOST_FTDC_STM_Bermuda '2' + +typedef char TThostFtdcStrikeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///Գ +#define THOST_FTDC_STT_Hedge '0' +///ƥִ +#define THOST_FTDC_STT_Match '1' + +typedef char TThostFtdcStrikeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyTypeTypeһнȨִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_APPT_NotStrikeNum '4' + +typedef char TThostFtdcApplyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGiveUpDataSourceTypeһִԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_GUDS_Gen '0' +///ֹ +#define THOST_FTDC_GUDS_Hand '1' + +typedef char TThostFtdcGiveUpDataSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderSysIDTypeһִϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecResultTypeһִн +///////////////////////////////////////////////////////////////////////// +///ûִ +#define THOST_FTDC_OER_NoExec 'n' +///Ѿȡ +#define THOST_FTDC_OER_Canceled 'c' +///ִгɹ +#define THOST_FTDC_OER_OK '0' +///Ȩֲֲ +#define THOST_FTDC_OER_NoPosition '1' +///ʽ𲻹 +#define THOST_FTDC_OER_NoDeposit '2' +///Ա +#define THOST_FTDC_OER_NoParticipant '3' +///ͻ +#define THOST_FTDC_OER_NoClient '4' +///Լ +#define THOST_FTDC_OER_NoInstrument '6' +///ûִȨ +#define THOST_FTDC_OER_NoRight '7' +/// +#define THOST_FTDC_OER_InvalidVolume '8' +///û㹻ʷɽ +#define THOST_FTDC_OER_NoEnoughHistoryTrade '9' +///δ֪ +#define THOST_FTDC_OER_Unknown 'a' + +typedef char TThostFtdcExecResultType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeSequenceTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcStrikeSequenceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTimeTypeһִʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStrikeTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinationTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_COMBT_Future '0' +///ֱ۲BUL +#define THOST_FTDC_COMBT_BUL '1' +///ֱ۲BER +#define THOST_FTDC_COMBT_BER '2' +///ʽ +#define THOST_FTDC_COMBT_STD '3' +///ʽ +#define THOST_FTDC_COMBT_STG '4' +/// +#define THOST_FTDC_COMBT_PRT '5' +///ʱ۲ +#define THOST_FTDC_COMBT_CLD '6' + +typedef char TThostFtdcCombinationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionRoyaltyPriceTypeTypeһȨȨ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORPT_PreSettlementPrice '1' +///ּ +#define THOST_FTDC_ORPT_OpenPrice '4' + +typedef char TThostFtdcOptionRoyaltyPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBalanceAlgorithmTypeһȨ㷨 +///////////////////////////////////////////////////////////////////////// +///Ȩֵӯ +#define THOST_FTDC_BLAG_Default '1' +///Ȩֵ +#define THOST_FTDC_BLAG_IncludeOptValLost '2' + +typedef char TThostFtdcBalanceAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_ACTP_Exec '1' +/// +#define THOST_FTDC_ACTP_Abandon '2' + +typedef char TThostFtdcActionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForQuoteStatusTypeһѯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_FQST_Submitted 'a' +///Ѿ +#define THOST_FTDC_FQST_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_FQST_Rejected 'c' + +typedef char TThostFtdcForQuoteStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcValueMethodTypeһȡֵʽ +///////////////////////////////////////////////////////////////////////// +///ֵ +#define THOST_FTDC_VM_Absolute '0' +/// +#define THOST_FTDC_VM_Ratio '1' + +typedef char TThostFtdcValueMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderPositionFlagTypeһȨȨǷڻͷı +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EOPF_Reserve '0' +/// +#define THOST_FTDC_EOPF_UnReserve '1' + +typedef char TThostFtdcExecOrderPositionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderCloseFlagTypeһȨȨɵͷǷԶƽ +///////////////////////////////////////////////////////////////////////// +///Զƽ +#define THOST_FTDC_EOCF_AutoClose '0' +///Զƽ +#define THOST_FTDC_EOCF_NotToClose '1' + +typedef char TThostFtdcExecOrderCloseFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PTE_Futures '1' +///Ȩ +#define THOST_FTDC_PTE_Options '2' + +typedef char TThostFtdcProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCZCEUploadFileNameTypeһ֣ļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_zz_\d{4} +#define THOST_FTDC_CUFN_CUFN_O 'O' +///^\d{8}ɽ +#define THOST_FTDC_CUFN_CUFN_T 'T' +///^\d{8}ȳֱֲnew +#define THOST_FTDC_CUFN_CUFN_P 'P' +///^\d{8}ƽ˽ +#define THOST_FTDC_CUFN_CUFN_N 'N' +///^\d{8}ƽֱ +#define THOST_FTDC_CUFN_CUFN_L 'L' +///^\d{8}ʽ +#define THOST_FTDC_CUFN_CUFN_F 'F' +///^\d{8}ϳֱֲ +#define THOST_FTDC_CUFN_CUFN_C 'C' +///^\d{8}֤ +#define THOST_FTDC_CUFN_CUFN_M 'M' + +typedef char TThostFtdcCZCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_dl_\d{3} +#define THOST_FTDC_DUFN_DUFN_O 'O' +///^\d{8}_ɽ +#define THOST_FTDC_DUFN_DUFN_T 'T' +///^\d{8}_ֱֲ +#define THOST_FTDC_DUFN_DUFN_P 'P' +///^\d{8}_ʽ +#define THOST_FTDC_DUFN_DUFN_F 'F' +///^\d{8}_Żϳֲϸ +#define THOST_FTDC_DUFN_DUFN_C 'C' +///^\d{8}_ֲϸ +#define THOST_FTDC_DUFN_DUFN_D 'D' +///^\d{8}_֤ +#define THOST_FTDC_DUFN_DUFN_M 'M' +///^\d{8}_Ȩִб +#define THOST_FTDC_DUFN_DUFN_S 'S' + +typedef char TThostFtdcDCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_\d{8}_\d{8}_DailyFundChg +#define THOST_FTDC_SUFN_SUFN_O 'O' +///^\d{4}_\d{8}_\d{8}_Trade +#define THOST_FTDC_SUFN_SUFN_T 'T' +///^\d{4}_\d{8}_\d{8}_SettlementDetail +#define THOST_FTDC_SUFN_SUFN_P 'P' +///^\d{4}_\d{8}_\d{8}_Capital +#define THOST_FTDC_SUFN_SUFN_F 'F' + +typedef char TThostFtdcSHFEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFFEXUploadFileNameTypeһнļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade +#define THOST_FTDC_CFUFN_SUFN_T 'T' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail +#define THOST_FTDC_CFUFN_SUFN_P 'P' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital +#define THOST_FTDC_CFUFN_SUFN_F 'F' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec +#define THOST_FTDC_CFUFN_SUFN_S 'S' + +typedef char TThostFtdcCFFEXUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombDirectionTypeһָ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CMDR_Comb '0' +/// +#define THOST_FTDC_CMDR_UnComb '1' + +typedef char TThostFtdcCombDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLockTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LCKT_Lock '1' +/// +#define THOST_FTDC_LCKT_Unlock '2' + +typedef char TThostFtdcLockTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBizTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_BZTP_Future '1' +///֤ȯ +#define THOST_FTDC_BZTP_Stock '2' + +typedef char TThostFtdcBizTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDesignateTypeTypeһָ +///////////////////////////////////////////////////////////////////////// +///ָǼ +#define THOST_FTDC_DSTP_Register '1' +///ָ +#define THOST_FTDC_DSTP_Cancel '2' + +typedef char TThostFtdcDesignateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeReasonTypeTypeһԭ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_FRTP_Init '1' +/// +#define THOST_FTDC_FRTP_Lock '2' +///ִ +#define THOST_FTDC_FRTP_Exec '3' +///λУ +#define THOST_FTDC_FRTP_Check '4' +///E+1ִж +#define THOST_FTDC_FRTP_ExecFreeze '5' + +typedef char TThostFtdcFreezeReasonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FZTP_Freeze '1' +///ⶳ +#define THOST_FTDC_FZTP_Unfreeze '2' +///ǿִ +#define THOST_FTDC_FZTP_Force '3' + +typedef char TThostFtdcFreezeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSystemTypeTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ϵͳ +#define THOST_FTDC_TSTP_Unknow '0' +///ڻϵͳ +#define THOST_FTDC_TSTP_Future '1' +///ϵͳ +#define THOST_FTDC_TSTP_IShare '2' + +typedef char TThostFtdcTradeSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalTypeTypeһ֤ȯ÷ +///////////////////////////////////////////////////////////////////////// +///뾭͹˾˻ +#define THOST_FTDC_STPT_ToBroker '1' +///Ͷ˻ +#define THOST_FTDC_STPT_ToInvestor '2' + +typedef char TThostFtdcStockDisposalTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalSysIDTypeһ֤ȯñ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStockDisposalSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalStatusTypeһ֤ȯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_SDPS_Submitted 'a' +///Ѿ +#define THOST_FTDC_SDPS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_SDPS_Rejected 'c' +///Ѿ +#define THOST_FTDC_SDPS_Cancelled 'd' + +typedef char TThostFtdcStockDisposalStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstructionRightTypeTypeһָȨ +///////////////////////////////////////////////////////////////////////// +///޼۵ +#define THOST_FTDC_ISTR_Limit '1' +///޼ȫɽȡ +#define THOST_FTDC_ISTR_Limit_FOK '2' +///м۶ʣת޼ +#define THOST_FTDC_ISTR_Market_RemainLimit '3' +///м۶ʣ೷ +#define THOST_FTDC_ISTR_Market_FAK '4' +///мȫɽȡ +#define THOST_FTDC_ISTR_Market_FOK '5' +///֤ȯ +#define THOST_FTDC_ISTR_Lock '6' +///֤ȯ +#define THOST_FTDC_ISTR_Unlock '7' + +typedef char TThostFtdcInstructionRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLevelTypeTypeһͶ߷ּ +///////////////////////////////////////////////////////////////////////// +///һͶ +#define THOST_FTDC_IVLV_FirstLevel '1' +///Ͷ +#define THOST_FTDC_IVLV_SecondLevel '2' +///Ͷ +#define THOST_FTDC_IVLV_ThirdLevel '3' + +typedef char TThostFtdcLevelTypeType; + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcUserApiStruct.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcUserApiStruct.h new file mode 100644 index 0000000000..a54a39092f --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/ThostFtdcUserApiStruct.h @@ -0,0 +1,8941 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiStruct.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCSTRUCT_H) +#define THOST_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiDataType.h" + +///Ϣַ +struct CThostFtdcDisseminationField +{ + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼ +struct CThostFtdcReqUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///նIPַ + TThostFtdcIPAddressType ClientIPAddress; +}; + +///û¼Ӧ +struct CThostFtdcRspUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///¼ɹʱ + TThostFtdcTimeType LoginTime; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///ûdz +struct CThostFtdcUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ǿƽԱ˳ +struct CThostFtdcForceUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ͻ֤ +struct CThostFtdcReqAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; +}; + +///ͻ֤Ӧ +struct CThostFtdcRspAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; +}; + +///ͻ֤Ϣ +struct CThostFtdcAuthenticationInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TThostFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TThostFtdcBoolType IsResult; +}; + +///תʱͷ +struct CThostFtdcTransferHeaderField +{ + ///汾ţ1.0 + TThostFtdcVersionType Version; + ///״룬 + TThostFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TThostFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TThostFtdcTradeTimeType TradeTime; + ///ˮţN/A + TThostFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TThostFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TThostFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TThostFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TThostFtdcOperNoType OperNo; + ///豸ͣN/A + TThostFtdcDeviceIDType DeviceID; + ///¼N/A + TThostFtdcRecordNumType RecordNum; + ///ỰţN/A + TThostFtdcSessionIDType SessionID; + ///ţN/A + TThostFtdcRequestIDType RequestID; +}; + +///ʽתڻTradeCode=202001 +struct CThostFtdcTransferBankToFutureReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ʽתڻӦ +struct CThostFtdcTransferBankToFutureRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתTradeCode=202002 +struct CThostFtdcTransferFutureToBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתӦ +struct CThostFtdcTransferFutureToBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽTradeCode=204002 +struct CThostFtdcTransferQryBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽӦ +struct CThostFtdcTransferQryBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + /// + TThostFtdcMoneyType TradeAmt; + ///п + TThostFtdcMoneyType UseAmt; + ///пȡ + TThostFtdcMoneyType FetchAmt; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯнϸTradeCode=204999 +struct CThostFtdcTransferQryDetailReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; +}; + +///ѯнϸӦ +struct CThostFtdcTransferQryDetailRspField +{ + /// + TThostFtdcDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///ڻˮ + TThostFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TThostFtdcFutureIDType FutureID; + ///ʽʺ + TThostFtdcFutureAccountType FutureAccount; + ///ˮ + TThostFtdcTradeSerialNoType BankSerial; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + ///˺ + TThostFtdcBankAccountType BankAccount; + ///֤ + TThostFtdcCertCodeType CertCode; + ///Ҵ + TThostFtdcCurrencyCodeType CurrencyCode; + /// + TThostFtdcMoneyType TxAmount; + ///Ч־ + TThostFtdcTransferValidFlagType Flag; +}; + +///ӦϢ +struct CThostFtdcRspInfoField +{ + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + /// + TThostFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CThostFtdcProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ƽִ + TThostFtdcCloseDealTypeType CloseDealType; + ///ױ + TThostFtdcCurrencyIDType TradeCurrencyID; + ///Ѻʽ÷Χ + TThostFtdcMortgageFundUseRangeType MortgageFundUseRange; + ///Ʒ + TThostFtdcInstrumentIDType ExchangeProductID; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; +}; + +///Լ +struct CThostFtdcInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcYearType DeliveryYear; + /// + TThostFtdcMonthType DeliveryMonth; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + /// + TThostFtdcDateType CreateDate; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcDateType ExpireDate; + ///ʼ + TThostFtdcDateType StartDelivDate; + /// + TThostFtdcDateType EndDelivDate; + ///Լ״̬ + TThostFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TThostFtdcBoolType IsTrading; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatio; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatio; + ///Ƿʹô֤߱㷨 + TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm; + ///Ʒ + TThostFtdcInstrumentIDType UnderlyingInstrID; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + /// + TThostFtdcCombinationTypeType CombinationType; + ///Сµλ + TThostFtdcVolumeType MinBuyVolume; + ///Сµλ + TThostFtdcVolumeType MinSellVolume; + ///Լʶ + TThostFtdcInstrumentCodeType InstrumentCode; +}; + +///͹˾ +struct CThostFtdcBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TThostFtdcBrokerNameType BrokerName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///Ա +struct CThostFtdcTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallCountType InstallCount; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///Ͷ +struct CThostFtdcInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ױ +struct CThostFtdcTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ա;͹˾ձ +struct CThostFtdcPartBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcSuperUserField +{ + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + /// + TThostFtdcPasswordType Password; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ûȨ +struct CThostFtdcSuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; + ///ܴ + TThostFtdcFunctionCodeType FunctionCode; +}; + +///Ͷ +struct CThostFtdcInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ͷֲ߳ +struct CThostFtdcInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִж + TThostFtdcVolumeType YdStrikeFrozen; +}; + +///Լ֤ +struct CThostFtdcInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///Լ +struct CThostFtdcInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +/// +struct CThostFtdcDepthMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + ///վ + TThostFtdcPriceType AveragePrice; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͶߺԼȨ +struct CThostFtdcInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///͹˾û +struct CThostFtdcBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + ///û + TThostFtdcUserTypeType UserType; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///Ƿʹ + TThostFtdcBoolType IsUsingOTP; +}; + +///͹˾û +struct CThostFtdcBrokerUserPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; +}; + +///͹˾ûȨ +struct CThostFtdcBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///͹˾ܴ + TThostFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///Ա̻ +struct CThostFtdcTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ͷ߽ +struct CThostFtdcSettlementInfoField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType Content; +}; + +///Լ֤ʵ +struct CThostFtdcInstrumentMarginRateAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///֤ +struct CThostFtdcExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; +}; + +///֤ʵ +struct CThostFtdcExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchLongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchLongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchShortMarginRatioByVolume; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType NoLongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType NoLongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType NoShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType NoShortMarginRatioByVolume; +}; + +/// +struct CThostFtdcExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Դֵλ + TThostFtdcCurrencyUnitType FromCurrencyUnit; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +/// +struct CThostFtdcSettlementRefField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰʱ +struct CThostFtdcCurrentTimeField +{ + ///ǰ + TThostFtdcDateType CurrDate; + ///ǰʱ + TThostFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TThostFtdcMillisecType CurrMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͨѶ׶ +struct CThostFtdcCommPhaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ͨѶʱα + TThostFtdcCommPhaseNoType CommPhaseNo; + ///ϵͳ + TThostFtdcSystemIDType SystemID; +}; + +///¼Ϣ +struct CThostFtdcLoginInfoField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + /// + TThostFtdcPasswordType Password; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///¼Ϣ +struct CThostFtdcLogoutAllField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; +}; + +///ǰ״̬ +struct CThostFtdcFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcUserPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///뱨 +struct CThostFtdcInputOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +/// +struct CThostFtdcExchangeOrderField +{ + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ʧ +struct CThostFtdcExchangeOrderInsertErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///뱨 +struct CThostFtdcInputOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +/// +struct CThostFtdcExchangeOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ʧ +struct CThostFtdcExchangeOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ɽ +struct CThostFtdcExchangeTradeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ɽ +struct CThostFtdcTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ûỰ +struct CThostFtdcUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ߽ȷϢ +struct CThostFtdcSettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ȷ + TThostFtdcDateType ConfirmDate; + ///ȷʱ + TThostFtdcTimeType ConfirmTime; +}; + +///ͬ +struct CThostFtdcSyncDepositField +{ + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + ///Ƿǿƽ + TThostFtdcBoolType IsForce; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Ѻͬ +struct CThostFtdcSyncFundMortgageField +{ + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ѻ + TThostFtdcMoneyType MortgageAmount; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///͹˾ͬ +struct CThostFtdcBrokerSyncField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͬеͶ +struct CThostFtdcSyncingInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ͬеĽ״ +struct CThostFtdcSyncingTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ͬеͶ߷ +struct CThostFtdcSyncingInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ͬеĽ˺ +struct CThostFtdcSyncingTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; +}; + +///ͬеͶֲ߳ +struct CThostFtdcSyncingInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִж + TThostFtdcVolumeType YdStrikeFrozen; +}; + +///ͬеĺԼ֤ +struct CThostFtdcSyncingInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///ͬеĺԼ +struct CThostFtdcSyncingInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͬеĺԼȨ +struct CThostFtdcSyncingInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯɽ +struct CThostFtdcQryTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ʼʱ + TThostFtdcTimeType TradeTimeStart; + ///ʱ + TThostFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryInvestorPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯʽ˻ +struct CThostFtdcQryTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CThostFtdcQryTradingCodeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԼ֤ +struct CThostFtdcQryInstrumentMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԼȨ +struct CThostFtdcQryInstrumentTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾ +struct CThostFtdcQryBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԱ +struct CThostFtdcQryTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯûȨ +struct CThostFtdcQrySuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯûỰ +struct CThostFtdcQryUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾Ա +struct CThostFtdcQryPartBrokerField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; +}; + +///ѯǰ״̬ +struct CThostFtdcQryFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ +struct CThostFtdcQryOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯû +struct CThostFtdcQrySuperUserField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CThostFtdcQryProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԼ +struct CThostFtdcQryInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ѯ +struct CThostFtdcQryDepthMarketDataField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾û +struct CThostFtdcQryBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CThostFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯԱ̻ +struct CThostFtdcQryTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯˮ +struct CThostFtdcQrySyncDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; +}; + +///ѯͶ߽ +struct CThostFtdcQrySettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///ѯѺˮ +struct CThostFtdcQrySyncFundMortgageField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; +}; + +///ѯ +struct CThostFtdcQryHisOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰȨԼС֤ +struct CThostFtdcOptionInstrMiniMarginField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///λ֣ȨԼС֤ + TThostFtdcMoneyType MinMargin; + ///ȡֵʽ + TThostFtdcValueMethodType ValueMethod; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼ֤ϵ +struct CThostFtdcOptionInstrMarginAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼѵϸ +struct CThostFtdcOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ׳ɱ +struct CThostFtdcOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType FixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + ///ȨԼȨ + TThostFtdcMoneyType Royalty; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType ExchFixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType ExchMiniMargin; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ׳ɱѯ +struct CThostFtdcQryOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ + TThostFtdcPriceType InputPrice; + ///ļ۸,0 + TThostFtdcPriceType UnderlyingPrice; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩʲѯ +struct CThostFtdcQryOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָָֻ +struct CThostFtdcIndexPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcInputExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcInputExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ִ +struct CThostFtdcExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerExecOrderSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִ +struct CThostFtdcExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ִϢ +struct CThostFtdcExchangeExecOrderField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcExchangeExecOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִ +struct CThostFtdcErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ִ +struct CThostFtdcErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ͶȨԼȨ +struct CThostFtdcOptionInstrTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDirectionType Direction; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯȨԼȨ +struct CThostFtdcQryOptionInstrTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcInputForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ѯ۱ + TThostFtdcSequenceNoType BrokerForQutoSeq; +}; + +///ѯ۲ѯ +struct CThostFtdcQryForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯϢ +struct CThostFtdcExchangeForQuoteField +{ + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; +}; + +///ѯ۲ѯ +struct CThostFtdcQryExchangeForQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ı +struct CThostFtdcInputQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///뱨۲ +struct CThostFtdcInputQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾۱ + TThostFtdcSequenceNoType BrokerQuoteSeq; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ +struct CThostFtdcQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///Ϣ +struct CThostFtdcExchangeQuoteField +{ + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///۲ +struct CThostFtdcExchangeQuoteActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ȨԼdeltaֵ +struct CThostFtdcOptionInstrDeltaField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Deltaֵ + TThostFtdcRatioType Delta; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///̵ѯ +struct CThostFtdcForQuoteRspField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ѯʱ + TThostFtdcTimeType ForQuoteTime; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼִƫֵϸ +struct CThostFtdcStrikeOffsetField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִƫֵ + TThostFtdcMoneyType Offset; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩִƫֵѯ +struct CThostFtdcQryStrikeOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///¼ +struct CThostFtdcInputLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerLockSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ѯ +struct CThostFtdcQryLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType LockSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///֤ȯλ +struct CThostFtdcLockPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcVolumeType FrozenVolume; +}; + +///ѯ֤ȯλ +struct CThostFtdcQryLockPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰETFȨԼѵϸ +struct CThostFtdcETFOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲַ + TThostFtdcPosiDirectionType PosiDirection; +}; + +///ETFȨʲѯ +struct CThostFtdcQryETFOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ijֲֶ +struct CThostFtdcPosiFreezeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcVolumeType Volume; + ///ԭ + TThostFtdcFreezeReasonTypeType FreezeReasonType; + /// + TThostFtdcFreezeTypeType FreezeType; +}; + +///ѯ +struct CThostFtdcQryExchangeLockField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +/// +struct CThostFtdcExchangeLockField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +/// +struct CThostFtdcExchangeExecOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +/// +struct CThostFtdcInputBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; +}; + +/// +struct CThostFtdcBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; +}; + +/// +struct CThostFtdcExchangeBatchOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳ +struct CThostFtdcLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcVolumeType LongVolumeFrozen; + ///նͷ + TThostFtdcVolumeType OpenVolumeFrozen; + ///ͷֲֽ + TThostFtdcMoneyType LongAmountFrozen; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ֲ +struct CThostFtdcBrokerLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; + /// + TThostFtdcLargeVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcLargeVolumeType LongVolumeFrozen; +}; + +///ѯ͹˾ֲ +struct CThostFtdcQryBrokerLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ֤ȯֲ +struct CThostFtdcLimitPosiSField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///տ + TThostFtdcVolumeType OpenVolumeFrozen; +}; + +///ѯͶ֤ȯֲ +struct CThostFtdcQryLimitPosiSField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳Ʋ +struct CThostFtdcLimitPosiParamField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; +}; + +///͹˾ֲƲ +struct CThostFtdcBrokerLimitPosiParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; +}; + +///Ͷ֤ȯֲƲ +struct CThostFtdcLimitPosiParamSField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; +}; + +///֤ȯò +struct CThostFtdcInputStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///֤ȯò +struct CThostFtdcStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯòѯ +struct CThostFtdcQryStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯò +struct CThostFtdcExchangeStockDisposalActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯò +struct CThostFtdcQryExchangeStockDisposalActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ֤ȯò +struct CThostFtdcQryErrStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///֤ȯò +struct CThostFtdcExchangeStockDisposalActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯñ + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ȯò +struct CThostFtdcErrStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ͷ߷ּ +struct CThostFtdcInvestorLevelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷ߷ּ + TThostFtdcLevelTypeType LevelType; +}; + +///ϺԼȫϵ +struct CThostFtdcCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcRatioType GuarantRatio; +}; + +///ϺԼȫϵѯ +struct CThostFtdcQryCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcInputCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; +}; + +///ϲѯ +struct CThostFtdcQryCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ϣ +struct CThostFtdcExchangeCombActionField +{ + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ϲѯ +struct CThostFtdcQryExchangeCombActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///Ʒۻ +struct CThostFtdcProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///۱ + TThostFtdcCurrencyIDType QuoteCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +///Ʒۻʲѯ +struct CThostFtdcQryProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ָ +struct CThostFtdcInputDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָ +struct CThostFtdcDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ָ +struct CThostFtdcQryDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָϢ +struct CThostFtdcExchangeDesignateField +{ + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯ +struct CThostFtdcInputStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯ +struct CThostFtdcStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; +}; + +///֤ȯ +struct CThostFtdcQryStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯϢ +struct CThostFtdcExchangeStockDisposalField +{ + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; +}; + +///ѯͶ߷ּ +struct CThostFtdcQryInvestorLevelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯѯۼ۲ +struct CThostFtdcQryForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯۼ۲ +struct CThostFtdcForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///¼ + TThostFtdcPriceType LastPrice; + ///۲ + TThostFtdcPriceType PriceInterval; +}; + +///ѯȨ +struct CThostFtdcQryExecFreezeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ +struct CThostFtdcExecFreezeField +{ + ///ĺԼ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///_λ + TThostFtdcVolumeType Volume; + /// + TThostFtdcMoneyType FrozenAmount; +}; + +///г +struct CThostFtdcMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +/// +struct CThostFtdcMarketDataBaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TThostFtdcRatioType PreDelta; +}; + +///龲̬ +struct CThostFtdcMarketDataStaticField +{ + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcPriceType ClosePrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ʵ + TThostFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CThostFtdcMarketDataLastMatchField +{ + ///¼ + TThostFtdcPriceType LastPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CThostFtdcMarketDataBestPriceField +{ + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; +}; + +/// +struct CThostFtdcMarketDataBid23Field +{ + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; +}; + +/// +struct CThostFtdcMarketDataAsk23Field +{ + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; +}; + +///ġ +struct CThostFtdcMarketDataBid45Field +{ + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; +}; + +///ġ +struct CThostFtdcMarketDataAsk45Field +{ + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CThostFtdcMarketDataUpdateTimeField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///齻 +struct CThostFtdcMarketDataExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָĺԼ +struct CThostFtdcSpecificInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///Լ״̬ +struct CThostFtdcInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TThostFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TThostFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TThostFtdcTimeType EnterTime; + ///뱾״̬ԭ + TThostFtdcInstStatusEnterReasonType EnterReason; +}; + +///ѯԼ״̬ +struct CThostFtdcQryInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; +}; + +///Ͷ˻ +struct CThostFtdcInvestorAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ӯ㷨 +struct CThostFtdcPositionProfitAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///ע + TThostFtdcMemoType Memo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Աʽۿ +struct CThostFtdcDiscountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽۿ۱ + TThostFtdcRatioType Discount; +}; + +///ѯת +struct CThostFtdcQryTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ת +struct CThostFtdcTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ѯͶֲ߳ϸ +struct CThostFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳ϸ +struct CThostFtdcInvestorPositionDetailField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcDateType OpenDate; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcVolumeType Volume; + ///ּ + TThostFtdcPriceType OpenPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TThostFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TThostFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + /// + TThostFtdcPriceType LastSettlementPrice; + /// + TThostFtdcPriceType SettlementPrice; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///鱨̻ +struct CThostFtdcMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ѯ鱨̻ +struct CThostFtdcQryMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯͻ֪ͨ +struct CThostFtdcQryNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͻ֪ͨ +struct CThostFtdcNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ϣ + TThostFtdcContentType Content; + ///͹˾֪ͨк + TThostFtdcSequenceLabelType SequenceLabel; +}; + +///ûȨ +struct CThostFtdcUserRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ͻȨ + TThostFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯϢȷ +struct CThostFtdcQrySettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///װؽϢ +struct CThostFtdcLoadSettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcBrokerWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ㷨 + TThostFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TThostFtdcRatioType UsingRatio; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TThostFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ƿû¼ + TThostFtdcBoolType IsBrokerUserEvent; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + ///Ȩ㷨 + TThostFtdcBalanceAlgorithmType BalanceAlgorithm; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateV1Field +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯϺԼ +struct CThostFtdcQryCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; +}; + +///ѯϺԼ +struct CThostFtdcQrySyncStatusField +{ + /// + TThostFtdcDateType TradingDay; +}; + +///Ͻ׺Լĵ +struct CThostFtdcCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + /// + TThostFtdcImplyLevelType ImplyLevel; +}; + +///ͬ״̬ +struct CThostFtdcSyncStatusField +{ + /// + TThostFtdcDateType TradingDay; + ///ͬ״̬ + TThostFtdcDataSyncStatusType DataSyncStatus; +}; + +///ѯϵ +struct CThostFtdcQryLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ϵ +struct CThostFtdcLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵ + TThostFtdcPersonTypeType PersonType; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TThostFtdcPartyNameType PersonName; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcZipCodeType ZipCode; + ///ȼ + TThostFtdcPriorityType Priority; + /// + TThostFtdcUOAZipCodeType UOAZipCode; + ///ȫ + TThostFtdcInvestorFullNameType PersonFullName; +}; + +///ѯ͹˾û¼ +struct CThostFtdcQryBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; +}; + +///ѯ͹˾û¼ +struct CThostFtdcBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + ///û¼ + TThostFtdcSequenceNoType EventSequenceNo; + ///¼ + TThostFtdcDateType EventDate; + ///¼ʱ + TThostFtdcTimeType EventTime; + ///û¼Ϣ + TThostFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯǩԼ +struct CThostFtdcQryContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ѯǩԼӦ +struct CThostFtdcContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; +}; + +///Ͷϳֲϸ +struct CThostFtdcInvestorPositionCombineDetailField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///ϱ + TThostFtdcTradeIDType TradeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ɽ + TThostFtdcTradeGroupIDType TradeGroupID; +}; + +///Ԥ +struct CThostFtdcParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; +}; + +///Ԥ񵥲 +struct CThostFtdcParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯԤ +struct CThostFtdcQryParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԤ񳷵 +struct CThostFtdcQryParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ɾԤ +struct CThostFtdcRemoveParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; +}; + +///ɾԤ񳷵 +struct CThostFtdcRemoveParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcInvestorWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽ + TThostFtdcRatioType UsingRatio; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; +}; + +///ѯϳֲϸ +struct CThostFtdcQryInvestorPositionCombineDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; +}; + +///ɽ +struct CThostFtdcMarketDataAveragePriceField +{ + ///վ + TThostFtdcPriceType AveragePrice; +}; + +///УͶ +struct CThostFtdcVerifyInvestorPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcPasswordType Password; +}; + +///ûIP +struct CThostFtdcUserIPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///IPַ + TThostFtdcIPAddressType IPMask; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///û¼֪ͨϢ +struct CThostFtdcTradingNoticeInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʱ + TThostFtdcTimeType SendTime; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼֪ͨ +struct CThostFtdcTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType SendTime; + ///к + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType FieldContent; +}; + +///ѯ¼֪ͨ +struct CThostFtdcQryTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ󱨵 +struct CThostFtdcErrorConditionalOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ״̬ +struct CThostFtdcQryExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///״̬ +struct CThostFtdcExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TThostFtdcInstrumentStatusType MarketStatus; +}; + +///ݼ۸ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeWithPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾ײ +struct CThostFtdcQryBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///͹˾ײ +struct CThostFtdcBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤۸ + TThostFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ȨȨ۸ + TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType; +}; + +///ѯ͹˾㷨 +struct CThostFtdcQryBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///͹˾㷨 +struct CThostFtdcBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֲִ㷨 + TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID; + ///Ѱұ֤㷨 + TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID; + ///ʽ㷨 + TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID; +}; + +///ѯ͹˾ʽ +struct CThostFtdcQueryBrokerDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ʽ +struct CThostFtdcBrokerDepositField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ʽ + TThostFtdcMoneyType Available; + ///׼ + TThostFtdcMoneyType Reserve; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; +}; + +///ѯ֤ϵͳ͹˾Կ +struct CThostFtdcQryCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ϵͳ͹˾Կ +struct CThostFtdcCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Կ + TThostFtdcDateType CreateDate; + ///Կʱ + TThostFtdcTimeType CreateTime; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; + ///̬Կ + TThostFtdcCFMMCKeyKindType KeyKind; +}; + +///֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; +}; + +///ѯ֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcQryCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û̬Ʋ +struct CThostFtdcBrokerUserOTPParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ṩ + TThostFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TThostFtdcSerialNumberType SerialNumber; + ///Կ + TThostFtdcAuthKeyType AuthKey; + ///Ưֵ + TThostFtdcLastDriftType LastDrift; + ///ɹֵ + TThostFtdcLastSuccessType LastSuccess; + ///̬ + TThostFtdcOTPTypeType OTPType; +}; + +///ֹͬû̬ +struct CThostFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ + TThostFtdcOTPTypeType OTPType; + ///һ̬ + TThostFtdcPasswordType FirstOTP; + ///ڶ̬ + TThostFtdcPasswordType SecondOTP; +}; + +///Ͷģ +struct CThostFtdcCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///ģ + TThostFtdcCommModelNameType CommModelName; +}; + +///ѯͶģ +struct CThostFtdcQryCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; +}; + +///Ͷ֤߱ģ +struct CThostFtdcMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ģ + TThostFtdcCommModelNameType MarginModelName; +}; + +///ѯͶ֤߱ģ +struct CThostFtdcQryMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ֵ۵Ϣ +struct CThostFtdcEWarrantOffsetField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType Volume; +}; + +///ѯֵ۵Ϣ +struct CThostFtdcQryEWarrantOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶƷ/Ʒֱ֤ +struct CThostFtdcQryInvestorProductGroupMarginField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ͶƷ/Ʒֱ֤ +struct CThostFtdcInvestorProductGroupMarginField +{ + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType LongFrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType ShortFrozenMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ͷ֤ + TThostFtdcMoneyType LongUseMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortUseMargin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///ͷ֤ + TThostFtdcMoneyType LongExchMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortExchMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + /// + TThostFtdcMoneyType FrozenCommission; + /// + TThostFtdcMoneyType Commission; + ///ʽ + TThostFtdcMoneyType FrozenCash; + ///ʽ + TThostFtdcMoneyType CashIn; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///۵ܽ + TThostFtdcMoneyType OffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortOffsetAmount; + ///۵ܽ + TThostFtdcMoneyType ExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortExchOffsetAmount; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯû +struct CThostFtdcQueryCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û +struct CThostFtdcCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬ + TThostFtdcCFMMCTokenType Token; +}; + +///ͶָȨ +struct CThostFtdcInstructionRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָȨ + TThostFtdcInstructionRightTypeType InstructionRight; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯƷ +struct CThostFtdcQryProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶƷ/Ʒֱ֤Ʒ +struct CThostFtdcProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; +}; + +///תʿ +struct CThostFtdcReqOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///ת +struct CThostFtdcReqCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///˻ +struct CThostFtdcReqChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ת +struct CThostFtdcReqTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///зʽתڻӦ +struct CThostFtdcRspTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcReqRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///Ӧ +struct CThostFtdcRspRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ +struct CThostFtdcReqQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ѯ˻ϢӦ +struct CThostFtdcRspQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; +}; + +///ǩǩ +struct CThostFtdcFutureSignIOField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ +struct CThostFtdcReqFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯָˮŵĽ׽ +struct CThostFtdcReqQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ѯָˮŵĽ׽Ӧ +struct CThostFtdcRspQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ԭʼش + TThostFtdcReturnCodeType OriginReturnCode; + ///ԭʼ + TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ļ +struct CThostFtdcReqDayEndFileReadyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ļҵ + TThostFtdcFileBusinessCodeType FileBusinessCode; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ؽ +struct CThostFtdcReturnResultField +{ + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///֤ڻʽ +struct CThostFtdcVerifyFuturePasswordField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///ID + TThostFtdcTIDType TID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ͻϢ +struct CThostFtdcVerifyCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcVerifyFuturePasswordAndCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcDepositResultInformField +{ + ///ˮţˮΪڱ̷صˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcRequestIDType RequestID; + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///׺ڱ̷Կͬ +struct CThostFtdcReqSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///׺ڱ̷ԿͬӦ +struct CThostFtdcRspSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ֪ͨ +struct CThostFtdcNotifyQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת˽ˮ +struct CThostFtdcTransferSerialField +{ + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateSerial; + ///׷ + TThostFtdcTradeDateType TradeDate; + /// + TThostFtdcDateType TradingDay; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///Ự + TThostFtdcSessionIDType SessionID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TThostFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///׽ + TThostFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///Ч־ + TThostFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TThostFtdcOperatorCodeType OperatorCode; + ///ʺ + TThostFtdcBankAccountType BankNewAccount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯתˮ +struct CThostFtdcQryTransferSerialField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կ֪ͬͨ +struct CThostFtdcNotifySyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯǩԼϵ +struct CThostFtdcQryAccountregisterField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ͻϢ +struct CThostFtdcAccountregisterField +{ + /// + TThostFtdcTradeDateType TradeDay; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TThostFtdcTradeDateType RegDate; + ///Լ + TThostFtdcTradeDateType OutDate; + ///ID + TThostFtdcTIDType TID; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; +}; + +///ڿϢ +struct CThostFtdcOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ϣ +struct CThostFtdcCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ڱ˺Ϣ +struct CThostFtdcChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ԱȨ +struct CThostFtdcSecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; + ///нʽʺ + TThostFtdcAccountIDType BrokerSecAgentID; +}; + +///ԱȨ޲ѯ +struct CThostFtdcQrySecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ֱĽȨ +struct CThostFtdcUserRightsAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; +}; + +///ù˾ǷڱʾĽȨ +struct CThostFtdcBrokerUserRightAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TThostFtdcBoolType Tradeable; +}; + +///ֱת +struct CThostFtdcDRTransferField +{ + ///ԭĴ + TThostFtdcDRIdentityIDType OrigDRIdentityID; + ///Ŀ꽻Ĵ + TThostFtdcDRIdentityIDType DestDRIdentityID; + ///ԭӦõԪ + TThostFtdcBrokerIDType OrigBrokerID; + ///ĿõԪ + TThostFtdcBrokerIDType DestBrokerID; +}; + +///FensûϢ +struct CThostFtdcFensUserInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ģʽ + TThostFtdcLoginModeType LoginMode; +}; + +///ǰ +struct CThostFtdcCurrTransferIdentityField +{ + ///Ĵ + TThostFtdcDRIdentityIDType IdentityID; +}; + +///ֹ¼û +struct CThostFtdcLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; +}; + +///ѯֹ¼û +struct CThostFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///UDP鲥Ϣ +struct CThostFtdcMulticastGroupInfoField +{ + ///鲥IPַ + TThostFtdcIPAddressType GroupIP; + ///鲥IP˿ + TThostFtdcIPPortType GroupPort; + ///Դַ + TThostFtdcIPAddressType SourceIP; +}; + +///ʽ˻׼ +struct CThostFtdcTradingAccountReserveField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///׼ + TThostFtdcMoneyType Reserve; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///DBF¼ +struct CThostFtdcDBFRecordField +{ + ///DBF + TThostFtdcDBFComdTypeType DBFComdType; + ///DBFʱ + TThostFtdcDBFComTimeType DBFComTime; + ///DBFԭʼˮ + TThostFtdcDBFComNoType DBFOComNo; + ///DBFˮ + TThostFtdcDBFComNoType DBFComNo; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName1; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent1; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName2; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent2; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName3; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent3; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName4; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent4; +}; + + + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/error.dtd b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/error.dtd new file mode 100644 index 0000000000..15e50b7344 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/error.dtd @@ -0,0 +1,9 @@ + + + + + diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/error.xml b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/error.xml new file mode 100644 index 0000000000..57ef9921eb --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/error.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/md5.txt b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/md5.txt new file mode 100644 index 0000000000..fdf8691cab --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/md5.txt @@ -0,0 +1,10 @@ + +MD5sums 1.2 freeware for Win9x/ME/NT/2000/XP+ +Copyright (C) 2001-2005 Jem Berkes - http://www.pc-tools.net/ +Type md5sum -h for help + +[Path] / filename MD5 sum +------------------------------------------------------------------------------- +[D:\workspace\vss\ϵͳ\֤ȯ\20150804_api\traderapi_win\] +thostmduserapi.dll 0a18d7b7678ccc18fefc6d4d5ebff072 +thosttraderapi.dll 6262435975b65fcc68f669f4f5ec8610 diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thostmduserapi.dll b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thostmduserapi.dll new file mode 100644 index 0000000000..b48e747ef3 Binary files /dev/null and b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thostmduserapi.dll differ diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thostmduserapi.lib b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thostmduserapi.lib new file mode 100644 index 0000000000..fc9b55f76f Binary files /dev/null and b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thostmduserapi.lib differ diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thosttraderapi.dll b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thosttraderapi.dll new file mode 100644 index 0000000000..162cc143ce Binary files /dev/null and b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thosttraderapi.dll differ diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thosttraderapi.lib b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thosttraderapi.lib new file mode 100644 index 0000000000..5e1a539c7f Binary files /dev/null and b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/thosttraderapi.lib differ diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcMdApi.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcMdApi.h new file mode 100644 index 0000000000..ece33f7e7e --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcMdApi.h @@ -0,0 +1,162 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcMdApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCMDAPI_H) +#define THOST_FTDCMDAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.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 CThostFtdcMdSpi +{ +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 OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ȡѯӦ + virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; +}; + +class MD_API_EXPORT CThostFtdcMdApi +{ +public: + ///MdApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + ///modify for udp marketdata + static CThostFtdcMdApi *CreateFtdcMdApi(const char *pszFlowPath = "", const bool bIsUsingUdp=false, const bool bIsMulticast=false); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@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 pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcMdSpi *pSpi) = 0; + + ///顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///˶顣 + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeMarketData(char *ppInstrumentID[], int nCount) = 0; + + ///ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int SubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///˶ѯۡ + ///@param ppInstrumentID ԼID + ///@param nCount Ҫ/˶ĺԼ + ///@remark + virtual int UnSubscribeForQuoteRsp(char *ppInstrumentID[], int nCount) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; +protected: + ~CThostFtdcMdApi(){}; +}; + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcTraderApi.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcTraderApi.h new file mode 100644 index 0000000000..94dd4c0b3c --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcTraderApi.h @@ -0,0 +1,660 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcTraderApi.h +///@brief ˿ͻ˽ӿ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCTRADERAPI_H) +#define THOST_FTDCTRADERAPI_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiStruct.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 CThostFtdcTraderSpi +{ +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 OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ¼Ӧ + virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ԥ񳷵¼Ӧ + virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ͷ߽ȷӦ + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤӦ + virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ɾԤ񳷵Ӧ + virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִ¼Ӧ + virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ִӦ + virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ¼Ӧ + virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///۲Ӧ + virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߽Ӧ + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתӦ + virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϢȷӦ + virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ϵͳ͹˾ʽ˻ԿӦ + virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯֵ۵ϢӦ + virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԱȨӦ + virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷۻ + virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨ׳ɱӦ + virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯȨԼӦ + virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯִӦ + virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯѯӦ + virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֤ȯλӦ + virtual void OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯͶ߷ּ + virtual void OnRspQryInvestorLevel(CThostFtdcInvestorLevelField *pInvestorLevel, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯE+1ȨӦ + virtual void OnRspQryExecFreeze(CThostFtdcExecFreezeField *pExecFreeze, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯϺԼȫϵӦ + virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯӦ + virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯתˮӦ + virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯǩԼϵӦ + virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) {}; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) {}; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) {}; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) {}; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) {}; + + ///ִ֪ͨ + virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) {}; + + ///ִ¼ر + virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ִر + virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ¼ر + virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) {}; + + ///¼ر + virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) {}; + + ///۲ر + virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) {}; + + ///֤û + virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) {}; + + ///֪ͨ + virtual void OnRtnLock(CThostFtdcLockField *pLock) {}; + + ///֪ͨ + virtual void OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) {}; + + ///֪ͨ + virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) {}; + + ///¼ر + virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ѯǩԼӦ + virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤӦ + virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯԤ񳷵Ӧ + virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯ͹˾㷨Ӧ + virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ѯû + virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///зתڻ֪ͨ + virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///зڻת֪ͨ + virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ڻڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) {}; + + ///ϵͳʱڻֹתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ϵͳʱڻֹڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻѯ֪ͨ + virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) {}; + + ///ڻʽתڻر + virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻڻʽתдر + virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹתڻر + virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ϵͳʱڻֹڻתдر + virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻѯر + virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) {}; + + ///ڻתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) {}; + + ///ڻʽתڻӦ + virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻڻʽתӦ + virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///ڻѯӦ + virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {}; + + ///зڿ֪ͨ + virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) {}; + + ///з֪ͨ + virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) {}; + + ///з˺֪ͨ + virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) {}; +}; + +class TRADER_API_EXPORT CThostFtdcTraderApi +{ +public: + ///TraderApi + ///@param pszFlowPath ϢļĿ¼ĬΪǰĿ¼ + ///@return UserApi + static CThostFtdcTraderApi *CreateFtdcTraderApi(const char *pszFlowPath = ""); + + ///ȡAPIİ汾Ϣ + ///@retrun ȡİ汾 + static const char *GetApiVersion(); + + ///ɾӿڶ + ///@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 pszNsAddressַַ + ///@remark ַĸʽΪprotocol://ipaddress:port磺tcp://127.0.0.1:12001 + ///@remark tcpЭ飬127.0.0.1ַ12001˿ںš + ///@remark RegisterNameServerRegisterFront + virtual void RegisterNameServer(char *pszNsAddress) = 0; + + ///עַûϢ + ///@param pFensUserInfoûϢ + virtual void RegisterFensUserInfo(CThostFtdcFensUserInfoField * pFensUserInfo) = 0; + + ///עصӿ + ///@param pSpi Իصӿʵ + virtual void RegisterSpi(CThostFtdcTraderSpi *pSpi) = 0; + + ///˽ + ///@param nResumeType ˽شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼˽ + ///@remark ÷ҪInitǰá򲻻յ˽ݡ + virtual void SubscribePrivateTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///Ĺ + ///@param nResumeType شʽ + /// THOST_TERT_RESTART:ӱտʼش + /// THOST_TERT_RESUME:ϴյ + /// THOST_TERT_QUICK:ֻ͵¼󹫹 + ///@remark ÷ҪInitǰá򲻻յݡ + virtual void SubscribePublicTopic(THOST_TE_RESUME_TYPE nResumeType) = 0; + + ///ͻ֤ + virtual int ReqAuthenticate(CThostFtdcReqAuthenticateField *pReqAuthenticateField, int nRequestID) = 0; + + ///û¼ + virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0; + + + ///dz + virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0; + + ///û + virtual int ReqUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, int nRequestID) = 0; + + ///ʽ˻ + virtual int ReqTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, int nRequestID) = 0; + + ///¼ + virtual int ReqOrderInsert(CThostFtdcInputOrderField *pInputOrder, int nRequestID) = 0; + + ///Ԥ¼ + virtual int ReqParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, int nRequestID) = 0; + + ///Ԥ񳷵¼ + virtual int ReqParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, int nRequestID) = 0; + + /// + virtual int ReqOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, int nRequestID) = 0; + + ///ѯ󱨵 + virtual int ReqQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, int nRequestID) = 0; + + ///Ͷ߽ȷ + virtual int ReqSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, int nRequestID) = 0; + + ///ɾԤ + virtual int ReqRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, int nRequestID) = 0; + + ///ɾԤ񳷵 + virtual int ReqRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, int nRequestID) = 0; + + ///ִ¼ + virtual int ReqExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, int nRequestID) = 0; + + ///ִ + virtual int ReqExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, int nRequestID) = 0; + + ///ѯ¼ + virtual int ReqForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, int nRequestID) = 0; + + ///¼ + virtual int ReqQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, int nRequestID) = 0; + + ///۲ + virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0; + + /// + virtual int ReqLockInsert(CThostFtdcInputLockField *pInputLock, int nRequestID) = 0; + + ///¼ + virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0; + + ///ѯɽ + virtual int ReqQryTrade(CThostFtdcQryTradeField *pQryTrade, int nRequestID) = 0; + + ///ѯͶֲ߳ + virtual int ReqQryInvestorPosition(CThostFtdcQryInvestorPositionField *pQryInvestorPosition, int nRequestID) = 0; + + ///ѯʽ˻ + virtual int ReqQryTradingAccount(CThostFtdcQryTradingAccountField *pQryTradingAccount, int nRequestID) = 0; + + ///ѯͶ + virtual int ReqQryInvestor(CThostFtdcQryInvestorField *pQryInvestor, int nRequestID) = 0; + + ///ѯױ + virtual int ReqQryTradingCode(CThostFtdcQryTradingCodeField *pQryTradingCode, int nRequestID) = 0; + + ///ѯԼ֤ + virtual int ReqQryInstrumentMarginRate(CThostFtdcQryInstrumentMarginRateField *pQryInstrumentMarginRate, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrumentCommissionRate(CThostFtdcQryInstrumentCommissionRateField *pQryInstrumentCommissionRate, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchange(CThostFtdcQryExchangeField *pQryExchange, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProduct(CThostFtdcQryProductField *pQryProduct, int nRequestID) = 0; + + ///ѯԼ + virtual int ReqQryInstrument(CThostFtdcQryInstrumentField *pQryInstrument, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryDepthMarketData(CThostFtdcQryDepthMarketDataField *pQryDepthMarketData, int nRequestID) = 0; + + ///ѯͶ߽ + virtual int ReqQrySettlementInfo(CThostFtdcQrySettlementInfoField *pQrySettlementInfo, int nRequestID) = 0; + + ///ѯת + virtual int ReqQryTransferBank(CThostFtdcQryTransferBankField *pQryTransferBank, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionDetail(CThostFtdcQryInvestorPositionDetailField *pQryInvestorPositionDetail, int nRequestID) = 0; + + ///ѯͻ֪ͨ + virtual int ReqQryNotice(CThostFtdcQryNoticeField *pQryNotice, int nRequestID) = 0; + + ///ѯϢȷ + virtual int ReqQrySettlementInfoConfirm(CThostFtdcQrySettlementInfoConfirmField *pQrySettlementInfoConfirm, int nRequestID) = 0; + + ///ѯͶֲ߳ϸ + virtual int ReqQryInvestorPositionCombineDetail(CThostFtdcQryInvestorPositionCombineDetailField *pQryInvestorPositionCombineDetail, int nRequestID) = 0; + + ///ѯ֤ϵͳ͹˾ʽ˻Կ + virtual int ReqQryCFMMCTradingAccountKey(CThostFtdcQryCFMMCTradingAccountKeyField *pQryCFMMCTradingAccountKey, int nRequestID) = 0; + + ///ѯֵ۵Ϣ + virtual int ReqQryEWarrantOffset(CThostFtdcQryEWarrantOffsetField *pQryEWarrantOffset, int nRequestID) = 0; + + ///ѯͶƷ/Ʒֱ֤ + virtual int ReqQryInvestorProductGroupMargin(CThostFtdcQryInvestorProductGroupMarginField *pQryInvestorProductGroupMargin, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRate(CThostFtdcQryExchangeMarginRateField *pQryExchangeMarginRate, int nRequestID) = 0; + + ///ѯ֤ + virtual int ReqQryExchangeMarginRateAdjust(CThostFtdcQryExchangeMarginRateAdjustField *pQryExchangeMarginRateAdjust, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryExchangeRate(CThostFtdcQryExchangeRateField *pQryExchangeRate, int nRequestID) = 0; + + ///ѯԱȨ + virtual int ReqQrySecAgentACIDMap(CThostFtdcQrySecAgentACIDMapField *pQrySecAgentACIDMap, int nRequestID) = 0; + + ///ѯƷۻ + virtual int ReqQryProductExchRate(CThostFtdcQryProductExchRateField *pQryProductExchRate, int nRequestID) = 0; + + ///ѯƷ + virtual int ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0; + + ///ѯȨ׳ɱ + virtual int ReqQryOptionInstrTradeCost(CThostFtdcQryOptionInstrTradeCostField *pQryOptionInstrTradeCost, int nRequestID) = 0; + + ///ѯȨԼ + virtual int ReqQryOptionInstrCommRate(CThostFtdcQryOptionInstrCommRateField *pQryOptionInstrCommRate, int nRequestID) = 0; + + ///ѯִ + virtual int ReqQryExecOrder(CThostFtdcQryExecOrderField *pQryExecOrder, int nRequestID) = 0; + + ///ѯѯ + virtual int ReqQryForQuote(CThostFtdcQryForQuoteField *pQryForQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryQuote(CThostFtdcQryQuoteField *pQryQuote, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryLock(CThostFtdcQryLockField *pQryLock, int nRequestID) = 0; + + ///ѯ֤ȯλ + virtual int ReqQryLockPosition(CThostFtdcQryLockPositionField *pQryLockPosition, int nRequestID) = 0; + + ///ѯͶ߷ּ + virtual int ReqQryInvestorLevel(CThostFtdcQryInvestorLevelField *pQryInvestorLevel, int nRequestID) = 0; + + ///ѯE+1Ȩ + virtual int ReqQryExecFreeze(CThostFtdcQryExecFreezeField *pQryExecFreeze, int nRequestID) = 0; + + ///ѯϺԼȫϵ + virtual int ReqQryCombInstrumentGuard(CThostFtdcQryCombInstrumentGuardField *pQryCombInstrumentGuard, int nRequestID) = 0; + + ///ѯ + virtual int ReqQryCombAction(CThostFtdcQryCombActionField *pQryCombAction, int nRequestID) = 0; + + ///ѯתˮ + virtual int ReqQryTransferSerial(CThostFtdcQryTransferSerialField *pQryTransferSerial, int nRequestID) = 0; + + ///ѯǩԼϵ + virtual int ReqQryAccountregister(CThostFtdcQryAccountregisterField *pQryAccountregister, int nRequestID) = 0; + + ///ѯǩԼ + virtual int ReqQryContractBank(CThostFtdcQryContractBankField *pQryContractBank, int nRequestID) = 0; + + ///ѯԤ + virtual int ReqQryParkedOrder(CThostFtdcQryParkedOrderField *pQryParkedOrder, int nRequestID) = 0; + + ///ѯԤ񳷵 + virtual int ReqQryParkedOrderAction(CThostFtdcQryParkedOrderActionField *pQryParkedOrderAction, int nRequestID) = 0; + + ///ѯ֪ͨ + virtual int ReqQryTradingNotice(CThostFtdcQryTradingNoticeField *pQryTradingNotice, int nRequestID) = 0; + + ///ѯ͹˾ײ + virtual int ReqQryBrokerTradingParams(CThostFtdcQryBrokerTradingParamsField *pQryBrokerTradingParams, int nRequestID) = 0; + + ///ѯ͹˾㷨 + virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0; + + ///ѯû + virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0; + + ///ڻʽתڻ + virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻڻʽת + virtual int ReqFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0; + + ///ڻѯ + virtual int ReqQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, int nRequestID) = 0; +protected: + ~CThostFtdcTraderApi(){}; +}; + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcUserApiDataType.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcUserApiDataType.h new file mode 100644 index 0000000000..ca7e082545 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcUserApiDataType.h @@ -0,0 +1,6460 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiDataType.h +///@brief ˿ͻ˽ӿʹõҵ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#ifndef THOST_FTDCDATATYPE_H +#define THOST_FTDCDATATYPE_H + +enum THOST_TE_RESUME_TYPE +{ + THOST_TERT_RESTART = 0, + THOST_TERT_RESUME, + THOST_TERT_QUICK +}; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTraderIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDTypeһͶߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerAbbrTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerNameTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeInstIDTypeһԼڽĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderRefType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParticipantIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParticipantIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserIDTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserIDType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentCodeTypeһԼʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarketIDTypeһг +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMarketIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeAbbrTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeAbbrType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExchangeFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMacAddressTypeһMacַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMacAddressType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangePropertyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EXP_Normal '0' +///ݳɽɱ +#define THOST_FTDC_EXP_GenOrderByTrade '1' + +typedef char TThostFtdcExchangePropertyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLongTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLongTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementGroupIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSysIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandTypeTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommandTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPAddressTypeһIPַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIPAddressType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIPPortTypeһIP˿ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIPPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductInfoTypeһƷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocolInfoTypeһЭϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProtocolInfoType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessUnitTypeһҵԪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessUnitType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepositSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDepositSeqNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֯ +#define THOST_FTDC_ICT_EID '0' +///й֤ +#define THOST_FTDC_ICT_IDCard '1' +///֤ +#define THOST_FTDC_ICT_OfficerIDCard '2' +///֤ +#define THOST_FTDC_ICT_PoliceIDCard '3' +///ʿ֤ +#define THOST_FTDC_ICT_SoldierIDCard '4' +///ڲ +#define THOST_FTDC_ICT_HouseholdRegister '5' +/// +#define THOST_FTDC_ICT_Passport '6' +///̨֤ +#define THOST_FTDC_ICT_TaiwanCompatriotIDCard '7' +///֤ +#define THOST_FTDC_ICT_HomeComingCard '8' +///Ӫҵִպ +#define THOST_FTDC_ICT_LicenseNo '9' +///˰ǼǺ/˰ID +#define THOST_FTDC_ICT_TaxNo 'A' +///۰ľڵ֤ͨ +#define THOST_FTDC_ICT_HMMainlandTravelPermit 'B' +///̨½֤ͨ +#define THOST_FTDC_ICT_TwMainlandTravelPermit 'C' +/// +#define THOST_FTDC_ICT_DrivingLicense 'D' +///籣ID +#define THOST_FTDC_ICT_SocialID 'F' +///֤ +#define THOST_FTDC_ICT_LocalID 'G' +///ҵǼ֤ +#define THOST_FTDC_ICT_BusinessRegistration 'H' +///۰Ծ֤ +#define THOST_FTDC_ICT_HKMCIDCard 'I' +///п֤ +#define THOST_FTDC_ICT_AccountsPermits 'J' +///֤ +#define THOST_FTDC_ICT_OtherCard 'x' + +typedef char TThostFtdcIdCardTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderLocalIDTypeһر +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrderLocalIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserNameTypeһû +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPartyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPartyNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorMsgTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcErrorMsgType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldNameTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldNameType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFieldContentTypeһֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFieldContentType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemNameTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSystemNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContentTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContentType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IR_All '1' +///Ͷ +#define THOST_FTDC_IR_Group '2' +///һͶ +#define THOST_FTDC_IR_Single '3' + +typedef char TThostFtdcInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDepartmentRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DR_All '1' +///ܹ֯ +#define THOST_FTDC_DR_Group '2' +///һͶ +#define THOST_FTDC_DR_Single '3' + +typedef char TThostFtdcDepartmentRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataSyncStatusTypeһͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_DS_Asynchronous '1' +///ͬ +#define THOST_FTDC_DS_Synchronizing '2' +///ͬ +#define THOST_FTDC_DS_Synchronized '3' + +typedef char TThostFtdcDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDataSyncStatusTypeһ͹˾ͬ״̬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_BDS_Synchronized '1' +///ͬ +#define THOST_FTDC_BDS_Synchronizing '2' + +typedef char TThostFtdcBrokerDataSyncStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeConnectStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_ECS_NoConnection '1' +///ѾԼѯ +#define THOST_FTDC_ECS_QryInstrumentSent '2' +///ѾȡϢ +#define THOST_FTDC_ECS_GotInformation '9' + +typedef char TThostFtdcExchangeConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTraderConnectStatusTypeһԱ״̬ +///////////////////////////////////////////////////////////////////////// +///ûκ +#define THOST_FTDC_TCS_NotConnected '1' +///Ѿ +#define THOST_FTDC_TCS_Connected '2' +///ѾԼѯ +#define THOST_FTDC_TCS_QryInstrumentSent '3' +///˽ +#define THOST_FTDC_TCS_SubPrivateFlow '4' + +typedef char TThostFtdcTraderConnectStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionCodeTypeһܴ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_FC_DataAsync '1' +///ǿûdz +#define THOST_FTDC_FC_ForceUserLogout '2' +///û +#define THOST_FTDC_FC_UserPasswordUpdate '3' +///͹˾ +#define THOST_FTDC_FC_BrokerPasswordUpdate '4' +///Ͷ߿ +#define THOST_FTDC_FC_InvestorPasswordUpdate '5' +/// +#define THOST_FTDC_FC_OrderInsert '6' +/// +#define THOST_FTDC_FC_OrderAction '7' +///ͬϵͳ +#define THOST_FTDC_FC_SyncSystemData '8' +///ͬ͹˾ +#define THOST_FTDC_FC_SyncBrokerData '9' +///ͬ͹˾ +#define THOST_FTDC_FC_BachSyncBrokerData 'A' +///ѯ +#define THOST_FTDC_FC_SuperQuery 'B' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderInsert 'C' +///Ԥ񱨵 +#define THOST_FTDC_FC_ParkedOrderAction 'D' +///̬ͬ +#define THOST_FTDC_FC_SyncOTP 'E' +///ɾδ֪ +#define THOST_FTDC_FC_DeleteOrder 'F' + +typedef char TThostFtdcFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerFunctionCodeTypeһ͹˾ܴ +///////////////////////////////////////////////////////////////////////// +///ǿûdz +#define THOST_FTDC_BFC_ForceUserLogout '1' +///û +#define THOST_FTDC_BFC_UserPasswordUpdate '2' +///ͬ͹˾ +#define THOST_FTDC_BFC_SyncBrokerData '3' +///ͬ͹˾ +#define THOST_FTDC_BFC_BachSyncBrokerData '4' +/// +#define THOST_FTDC_BFC_OrderInsert '5' +/// +#define THOST_FTDC_BFC_OrderAction '6' +///ȫѯ +#define THOST_FTDC_BFC_AllQuery '7' +///ϵͳܣ/dz/޸ +#define THOST_FTDC_BFC_log 'a' +///ѯѯݣԼȳ +#define THOST_FTDC_BFC_BaseQry 'b' +///ײѯɽί +#define THOST_FTDC_BFC_TradeQry 'c' +///׹ܣ +#define THOST_FTDC_BFC_Trade 'd' +///ת +#define THOST_FTDC_BFC_Virement 'e' +///ռ +#define THOST_FTDC_BFC_Risk 'f' +///ѯ/ѯỰ˵ +#define THOST_FTDC_BFC_Session 'g' +///֪ͨ +#define THOST_FTDC_BFC_RiskNoticeCtl 'h' +///֪ͨ +#define THOST_FTDC_BFC_RiskNotice 'i' +///쿴͹˾ʽȨ +#define THOST_FTDC_BFC_BrokerDeposit 'j' +///ʽѯ +#define THOST_FTDC_BFC_QueryFund 'k' +///ѯ +#define THOST_FTDC_BFC_QueryOrder 'l' +///ɽѯ +#define THOST_FTDC_BFC_QueryTrade 'm' +///ֲֲѯ +#define THOST_FTDC_BFC_QueryPosition 'n' +///ѯ +#define THOST_FTDC_BFC_QueryMarketData 'o' +///û¼ѯ +#define THOST_FTDC_BFC_QueryUserEvent 'p' +///֪ͨѯ +#define THOST_FTDC_BFC_QueryRiskNotify 'q' +///ѯ +#define THOST_FTDC_BFC_QueryFundChange 'r' +///ͶϢѯ +#define THOST_FTDC_BFC_QueryInvestor 's' +///ױѯ +#define THOST_FTDC_BFC_QueryTradingCode 't' +///ǿƽ +#define THOST_FTDC_BFC_ForceClose 'u' +///ѹ +#define THOST_FTDC_BFC_PressTest 'v' +///Ȩ淴 +#define THOST_FTDC_BFC_RemainCalc 'w' +///ֱֲָ֤ +#define THOST_FTDC_BFC_NetPositionInd 'x' +///Ԥ +#define THOST_FTDC_BFC_RiskPredict 'y' +///ݵ +#define THOST_FTDC_BFC_DataExport 'z' +///ָ +#define THOST_FTDC_BFC_RiskTargetSetup 'A' +///Ԥ +#define THOST_FTDC_BFC_MarketDataWarn 'B' +///ҵ֪ͨѯ +#define THOST_FTDC_BFC_QryBizNotice 'C' +///ҵ֪ͨģ +#define THOST_FTDC_BFC_CfgBizNotice 'D' +///̬ͬ +#define THOST_FTDC_BFC_SyncOTP 'E' +///ҵ֪ͨ +#define THOST_FTDC_BFC_SendBizNotice 'F' +///ռ׼ +#define THOST_FTDC_BFC_CfgRiskLevelStd 'G' +///նӦ +#define THOST_FTDC_BFC_TbCommand 'H' +///ɾδ֪ +#define THOST_FTDC_BFC_DeleteOrder 'J' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderInsert 'K' +///Ԥ񱨵 +#define THOST_FTDC_BFC_ParkedOrderAction 'L' + +typedef char TThostFtdcBrokerFunctionCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OAS_Submitted 'a' +///Ѿ +#define THOST_FTDC_OAS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_OAS_Rejected 'c' + +typedef char TThostFtdcOrderActionStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ȫɽ +#define THOST_FTDC_OST_AllTraded '0' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedQueueing '1' +///ֳɽڶ +#define THOST_FTDC_OST_PartTradedNotQueueing '2' +///δɽڶ +#define THOST_FTDC_OST_NoTradeQueueing '3' +///δɽڶ +#define THOST_FTDC_OST_NoTradeNotQueueing '4' +/// +#define THOST_FTDC_OST_Canceled '5' +///δ֪ +#define THOST_FTDC_OST_Unknown 'a' +///δ +#define THOST_FTDC_OST_NotTouched 'b' +///Ѵ +#define THOST_FTDC_OST_Touched 'c' + +typedef char TThostFtdcOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSubmitStatusTypeһύ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_OSS_InsertSubmitted '0' +///Ѿύ +#define THOST_FTDC_OSS_CancelSubmitted '1' +///޸Ѿύ +#define THOST_FTDC_OSS_ModifySubmitted '2' +///Ѿ +#define THOST_FTDC_OSS_Accepted '3' +///Ѿܾ +#define THOST_FTDC_OSS_InsertRejected '4' +///Ѿܾ +#define THOST_FTDC_OSS_CancelRejected '5' +///ĵѾܾ +#define THOST_FTDC_OSS_ModifyRejected '6' + +typedef char TThostFtdcOrderSubmitStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ճֲ +#define THOST_FTDC_PSD_Today '1' +///ʷֲ +#define THOST_FTDC_PSD_History '2' + +typedef char TThostFtdcPositionDateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionDateTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ʹʷֲ +#define THOST_FTDC_PDT_UseHistory '1' +///ʹʷֲ +#define THOST_FTDC_PDT_NoUseHistory '2' + +typedef char TThostFtdcPositionDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRoleTypeһ׽ɫ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ER_Broker '1' +///Ӫ +#define THOST_FTDC_ER_Host '2' +/// +#define THOST_FTDC_ER_Maker '3' + +typedef char TThostFtdcTradingRoleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PC_Futures '1' +///ڻȨ +#define THOST_FTDC_PC_Options '2' +/// +#define THOST_FTDC_PC_Combination '3' +/// +#define THOST_FTDC_PC_Spot '4' +///ת +#define THOST_FTDC_PC_EFP '5' +///ֻȨ +#define THOST_FTDC_PC_SpotOption '6' +///Ȩ +#define THOST_FTDC_PC_ETFOption '7' +///֤ȯ +#define THOST_FTDC_PC_Stock '8' + +typedef char TThostFtdcProductClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_IP_NotStart '0' +/// +#define THOST_FTDC_IP_Started '1' +///ͣ +#define THOST_FTDC_IP_Pause '2' +/// +#define THOST_FTDC_IP_Expired '3' + +typedef char TThostFtdcInstLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_D_Buy '0' +/// +#define THOST_FTDC_D_Sell '1' + +typedef char TThostFtdcDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeTypeһֲ +///////////////////////////////////////////////////////////////////////// +///ֲ +#define THOST_FTDC_PT_Net '1' +///ۺϳֲ +#define THOST_FTDC_PT_Gross '2' + +typedef char TThostFtdcPositionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPosiDirectionTypeһֲֶշ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PD_Net '1' +///ͷ +#define THOST_FTDC_PD_Long '2' +///ͷ +#define THOST_FTDC_PD_Short '3' + +typedef char TThostFtdcPosiDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysSettlementStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_SS_NonActive '1' +/// +#define THOST_FTDC_SS_Startup '2' +/// +#define THOST_FTDC_SS_Operating '3' +/// +#define THOST_FTDC_SS_Settlement '4' +/// +#define THOST_FTDC_SS_SettlementFinished '5' + +typedef char TThostFtdcSysSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioAttrTypeһ +///////////////////////////////////////////////////////////////////////// +///׷ +#define THOST_FTDC_RA_Trade '0' +/// +#define THOST_FTDC_RA_Settlement '1' + +typedef char TThostFtdcRatioAttrType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_HF_Speculation '1' +/// +#define THOST_FTDC_HF_Arbitrage '2' +///ױ +#define THOST_FTDC_HF_Hedge '3' +/// +#define THOST_FTDC_HF_Covered '4' + +typedef char TThostFtdcHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BHF_Speculation '1' +/// +#define THOST_FTDC_BHF_Arbitrage '2' +///ױ +#define THOST_FTDC_BHF_Hedge '3' + +typedef char TThostFtdcBillHedgeFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_CIDT_Speculation '1' +/// +#define THOST_FTDC_CIDT_Arbitrage '2' +///ױ +#define THOST_FTDC_CIDT_Hedge '3' + +typedef char TThostFtdcClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderPriceTypeTypeһ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OPT_AnyPrice '1' +///޼ +#define THOST_FTDC_OPT_LimitPrice '2' +///ż +#define THOST_FTDC_OPT_BestPrice '3' +///¼ +#define THOST_FTDC_OPT_LastPrice '4' +///¼۸ϸ1ticks +#define THOST_FTDC_OPT_LastPricePlusOneTicks '5' +///¼۸ϸ2ticks +#define THOST_FTDC_OPT_LastPricePlusTwoTicks '6' +///¼۸ϸ3ticks +#define THOST_FTDC_OPT_LastPricePlusThreeTicks '7' +///һ +#define THOST_FTDC_OPT_AskPrice1 '8' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_AskPrice1PlusOneTicks '9' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_AskPrice1PlusTwoTicks 'A' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_AskPrice1PlusThreeTicks 'B' +///һ +#define THOST_FTDC_OPT_BidPrice1 'C' +///һ۸ϸ1ticks +#define THOST_FTDC_OPT_BidPrice1PlusOneTicks 'D' +///һ۸ϸ2ticks +#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E' +///һ۸ϸ3ticks +#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F' +///嵵 +#define THOST_FTDC_OPT_FiveLevelPrice 'G' +///ż +#define THOST_FTDC_OPT_BestPriceThisSide 'H' + +typedef char TThostFtdcOrderPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OF_Open '0' +///ƽ +#define THOST_FTDC_OF_Close '1' +///ǿƽ +#define THOST_FTDC_OF_ForceClose '2' +///ƽ +#define THOST_FTDC_OF_CloseToday '3' +///ƽ +#define THOST_FTDC_OF_CloseYesterday '4' +///ǿ +#define THOST_FTDC_OF_ForceOff '5' +///ǿƽ +#define THOST_FTDC_OF_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseReasonTypeһǿƽԭ +///////////////////////////////////////////////////////////////////////// +///ǿƽ +#define THOST_FTDC_FCC_NotForceClose '0' +///ʽ +#define THOST_FTDC_FCC_LackDeposit '1' +///ͻ +#define THOST_FTDC_FCC_ClientOverPositionLimit '2' +///Ա +#define THOST_FTDC_FCC_MemberOverPositionLimit '3' +///ֲַ +#define THOST_FTDC_FCC_NotMultiple '4' +///Υ +#define THOST_FTDC_FCC_Violation '5' +/// +#define THOST_FTDC_FCC_Other '6' +///Ȼٽ +#define THOST_FTDC_FCC_PersonDeliv '7' + +typedef char TThostFtdcForceCloseReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORDT_Normal '0' +/// +#define THOST_FTDC_ORDT_DeriveFromQuote '1' +/// +#define THOST_FTDC_ORDT_DeriveFromCombination '2' +///ϱ +#define THOST_FTDC_ORDT_Combination '3' +/// +#define THOST_FTDC_ORDT_ConditionalOrder '4' +/// +#define THOST_FTDC_ORDT_Swap '5' + +typedef char TThostFtdcOrderTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeConditionTypeһЧ +///////////////////////////////////////////////////////////////////////// +///ɣ +#define THOST_FTDC_TC_IOC '1' +///Ч +#define THOST_FTDC_TC_GFS '2' +///Ч +#define THOST_FTDC_TC_GFD '3' +///ָǰЧ +#define THOST_FTDC_TC_GTD '4' +///ǰЧ +#define THOST_FTDC_TC_GTC '5' +///ϾЧ +#define THOST_FTDC_TC_GFA '6' + +typedef char TThostFtdcTimeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeConditionTypeһɽ +///////////////////////////////////////////////////////////////////////// +///κ +#define THOST_FTDC_VC_AV '1' +///С +#define THOST_FTDC_VC_MV '2' +///ȫ +#define THOST_FTDC_VC_CV '3' + +typedef char TThostFtdcVolumeConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContingentConditionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CC_Immediately '1' +///ֹ +#define THOST_FTDC_CC_Touch '2' +///ֹӮ +#define THOST_FTDC_CC_TouchProfit '3' +///Ԥ +#define THOST_FTDC_CC_ParkedOrder '4' +///¼۴ +#define THOST_FTDC_CC_LastPriceGreaterThanStopPrice '5' +///¼۴ڵ +#define THOST_FTDC_CC_LastPriceGreaterEqualStopPrice '6' +///¼С +#define THOST_FTDC_CC_LastPriceLesserThanStopPrice '7' +///¼Сڵ +#define THOST_FTDC_CC_LastPriceLesserEqualStopPrice '8' +///һ۴ +#define THOST_FTDC_CC_AskPriceGreaterThanStopPrice '9' +///һ۴ڵ +#define THOST_FTDC_CC_AskPriceGreaterEqualStopPrice 'A' +///һС +#define THOST_FTDC_CC_AskPriceLesserThanStopPrice 'B' +///һСڵ +#define THOST_FTDC_CC_AskPriceLesserEqualStopPrice 'C' +///һ۴ +#define THOST_FTDC_CC_BidPriceGreaterThanStopPrice 'D' +///һ۴ڵ +#define THOST_FTDC_CC_BidPriceGreaterEqualStopPrice 'E' +///һС +#define THOST_FTDC_CC_BidPriceLesserThanStopPrice 'F' +///һСڵ +#define THOST_FTDC_CC_BidPriceLesserEqualStopPrice 'H' + +typedef char TThostFtdcContingentConditionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +///ɾ +#define THOST_FTDC_AF_Delete '0' +///޸ +#define THOST_FTDC_AF_Modify '3' + +typedef char TThostFtdcActionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingRightTypeһȨ +///////////////////////////////////////////////////////////////////////// +///Խ +#define THOST_FTDC_TR_Allow '0' +///ֻƽ +#define THOST_FTDC_TR_CloseOnly '1' +///ܽ +#define THOST_FTDC_TR_Forbidden '2' + +typedef char TThostFtdcTradingRightType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderSourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///Բ +#define THOST_FTDC_OSRC_Participant '0' +///ԹԱ +#define THOST_FTDC_OSRC_Administrator '1' + +typedef char TThostFtdcOrderSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTypeTypeһɽ +///////////////////////////////////////////////////////////////////////// +///ϳֲֲΪһֲ,ʼӦ͵ijֲ +#define THOST_FTDC_TRDT_SplitCombination '#' +///ͨɽ +#define THOST_FTDC_TRDT_Common '0' +///Ȩִ +#define THOST_FTDC_TRDT_OptionsExecution '1' +///OTCɽ +#define THOST_FTDC_TRDT_OTC '2' +///תɽ +#define THOST_FTDC_TRDT_EFPDerived '3' +///ɽ +#define THOST_FTDC_TRDT_CombinationDerived '4' + +typedef char TThostFtdcTradeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///ǰɽ +#define THOST_FTDC_PSRC_LastPrice '0' +///ίм +#define THOST_FTDC_PSRC_Buy '1' +///ίм +#define THOST_FTDC_PSRC_Sell '2' + +typedef char TThostFtdcPriceSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentStatusTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_IS_BeforeTrading '0' +///ǽ +#define THOST_FTDC_IS_NoTrading '1' +/// +#define THOST_FTDC_IS_Continous '2' +///Ͼ۱ +#define THOST_FTDC_IS_AuctionOrdering '3' +///Ͼۼ۸ƽ +#define THOST_FTDC_IS_AuctionBalance '4' +///Ͼ۴ +#define THOST_FTDC_IS_AuctionMatch '5' +/// +#define THOST_FTDC_IS_Closed '6' + +typedef char TThostFtdcInstrumentStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstStatusEnterReasonTypeһƷֽ뽻״̬ԭ +///////////////////////////////////////////////////////////////////////// +///Զл +#define THOST_FTDC_IER_Automatic '1' +///ֶл +#define THOST_FTDC_IER_Manual '2' +///۶ +#define THOST_FTDC_IER_Fuse '3' + +typedef char TThostFtdcInstStatusEnterReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrderActionRefTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcOrderActionRefType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallCountTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstallIDTypeһװ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcInstallIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcErrorIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcErrorIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSettlementIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFrontIDTypeһǰñ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFrontIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSessionIDTypeһỰ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSessionIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommandNoTypeһDB +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommandNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMillisecTypeһʱ䣨룩 +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMillisecType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVolumeMultipleTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcVolumeMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradingSegmentSNTypeһ׽׶α +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradingSegmentSNType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRequestIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYearTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcYearType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBoolTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBoolType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombOffsetFlagTypeһϿƽ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombOffsetFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombHedgeFlagTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombHedgeFlagType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRatioTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcRatioType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLargeVolumeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcLargeVolumeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceSeriesTypeһϵк +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcSequenceSeriesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommPhaseNoTypeһͨѶʱα +///////////////////////////////////////////////////////////////////////// +typedef short TThostFtdcCommPhaseNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceLabelTypeһб +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSequenceLabelType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUnderlyingMultipleTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcUnderlyingMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcContractCodeTypeһͬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcContractCodeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCityType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsStockTypeһǷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsStockType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcChannelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcChannelType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddressTypeһͨѶַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddressType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcZipCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTelephoneTypeһϵ绰 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTelephoneType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFaxTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFaxType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobileTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobileType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEMailTypeһʼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEMailType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMemoTypeһע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMemoType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyCodeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyCodeType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebsiteTypeһվַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebsiteType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTaxNoTypeһ˰ǼǺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTaxNoType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δϴ +#define THOST_FTDC_BS_NoUpload '1' +///ϴ +#define THOST_FTDC_BS_Uploaded '2' +///ʧ +#define THOST_FTDC_BS_Failed '3' + +typedef char TThostFtdcBatchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyIDTypeһԴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNoTypeһӪҵִպ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentIDTypeһ˴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentGroupNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStyleTypeһƷַʽ +///////////////////////////////////////////////////////////////////////// +///Ʒ +#define THOST_FTDC_RS_All '1' +///Ʒ +#define THOST_FTDC_RS_ByProduct '2' + +typedef char TThostFtdcReturnStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnPatternTypeһģʽ +///////////////////////////////////////////////////////////////////////// +///ɽ +#define THOST_FTDC_RP_ByVolume '1' +/// +#define THOST_FTDC_RP_ByFeeOnHand '2' + +typedef char TThostFtdcReturnPatternType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///1 +#define THOST_FTDC_RL_Level1 '1' +///2 +#define THOST_FTDC_RL_Level2 '2' +///3 +#define THOST_FTDC_RL_Level3 '3' +///4 +#define THOST_FTDC_RL_Level4 '4' +///5 +#define THOST_FTDC_RL_Level5 '5' +///6 +#define THOST_FTDC_RL_Level6 '6' +///7 +#define THOST_FTDC_RL_Level7 '7' +///8 +#define THOST_FTDC_RL_Level8 '8' +///9 +#define THOST_FTDC_RL_Level9 '9' + +typedef char TThostFtdcReturnLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnStandardTypeһ׼ +///////////////////////////////////////////////////////////////////////// +///ֽ׶η +#define THOST_FTDC_RSD_ByPeriod '1' +///ijһ׼ +#define THOST_FTDC_RSD_ByStandard '2' + +typedef char TThostFtdcReturnStandardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///ʳ +#define THOST_FTDC_MT_Out '0' +/// +#define THOST_FTDC_MT_In '1' + +typedef char TThostFtdcMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorSettlementParamIDTypeһͶ߽ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ISPI_MortgageRatio '4' +///֤㷨 +#define THOST_FTDC_ISPI_MarginWay '5' +///㵥ǷѺ +#define THOST_FTDC_ISPI_BillDeposit '9' + +typedef char TThostFtdcInvestorSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeSettlementParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_ESPI_MortgageRatio '1' +///ʽ +#define THOST_FTDC_ESPI_OtherFundItem '2' +///ʽ뽻 +#define THOST_FTDC_ESPI_OtherFundImport '3' +///нͿý +#define THOST_FTDC_ESPI_CFFEXMinPrepa '6' +///֣㷽ʽ +#define THOST_FTDC_ESPI_CZCESettlementType '7' +///ȡʽ +#define THOST_FTDC_ESPI_ExchDelivFeeMode '9' +///Ͷ߽ȡʽ +#define THOST_FTDC_ESPI_DelivFeeMode '0' +///֣ϳֱֲ֤ȡʽ +#define THOST_FTDC_ESPI_CZCEComMarginType 'A' +///֤ǷŻ +#define THOST_FTDC_ESPI_DceComMarginType 'B' +///ֵȨ֤Żݱ +#define THOST_FTDC_ESPI_OptOutDisCountRate 'a' +///ͱϵ +#define THOST_FTDC_ESPI_OptMiniGuarantee 'b' + +typedef char TThostFtdcExchangeSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ͶߴС +#define THOST_FTDC_SPI_InvestorIDMinLength '1' +///ͶʺŴС +#define THOST_FTDC_SPI_AccountIDMinLength '2' +///Ͷ߿Ĭϵ¼Ȩ +#define THOST_FTDC_SPI_UserRightLogon '3' +///Ͷ߽׽㵥ɽܷʽ +#define THOST_FTDC_SPI_SettlementBillTrade '4' +///ͳһ½ױ뷽ʽ +#define THOST_FTDC_SPI_TradingCode '5' +///Ƿжϴδ˵ijͷʽ +#define THOST_FTDC_SPI_CheckFund '6' +///ǷģȨ +#define THOST_FTDC_SPI_CommModelRight '7' +///Ƿñ֤ģȨ +#define THOST_FTDC_SPI_MarginModelRight '9' +///Ƿ淶ûܼ +#define THOST_FTDC_SPI_IsStandardActive '8' +///ϴĽļ· +#define THOST_FTDC_SPI_UploadSettlementFile 'U' +///ϱ֤ļ· +#define THOST_FTDC_SPI_DownloadCSRCFile 'D' +///ɵĽ㵥ļ· +#define THOST_FTDC_SPI_SettlementBillFile 'S' +///֤ļʶ +#define THOST_FTDC_SPI_CSRCOthersFile 'C' +///ͶƬ· +#define THOST_FTDC_SPI_InvestorPhoto 'P' +///ȫᾭ͹˾ϴļ· +#define THOST_FTDC_SPI_CSRCData 'R' +///¼뷽ʽ +#define THOST_FTDC_SPI_InvestorPwdModel 'I' +///Ͷнļ· +#define THOST_FTDC_SPI_CFFEXInvestorSettleFile 'F' +///Ͷߴ뷽ʽ +#define THOST_FTDC_SPI_InvestorIDType 'a' +///߻Ȩ +#define THOST_FTDC_SPI_FreezeMaxReMain 'r' +///زʵʱϳ +#define THOST_FTDC_SPI_IsSync 'A' +///Ȩ +#define THOST_FTDC_SPI_RelieveOpenLimit 'O' +///Ƿ淶û +#define THOST_FTDC_SPI_IsStandardFreeze 'X' +///֣Ƿ񿪷Ʒױ +#define THOST_FTDC_SPI_CZCENormalProductHedge 'B' + +typedef char TThostFtdcSystemParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeParamIDTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///ϵͳ㷨 +#define THOST_FTDC_TPID_EncryptionStandard 'E' +///ϵͳ㷨 +#define THOST_FTDC_TPID_RiskMode 'R' +///ϵͳ㷨Ƿȫ 0- 1- +#define THOST_FTDC_TPID_RiskModeGlobal 'G' +///㷨 +#define THOST_FTDC_TPID_modeEncode 'P' +///۸Сλ +#define THOST_FTDC_TPID_tickMode 'T' +///ûỰ +#define THOST_FTDC_TPID_SingleUserSessionMaxNum 'S' +///¼ʧ +#define THOST_FTDC_TPID_LoginFailMaxNum 'L' +///Ƿǿ֤ +#define THOST_FTDC_TPID_IsAuthForce 'A' +///Ƿ񶳽֤ȯֲ +#define THOST_FTDC_TPID_IsPosiFreeze 'F' +///Ƿ޲ +#define THOST_FTDC_TPID_IsPosiLimit 'M' +///֣ѯʱ +#define THOST_FTDC_TPID_ForQuoteTimeInterval 'Q' + +typedef char TThostFtdcTradeParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettlementParamValueType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCounterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCounterIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorGroupNameTypeһͶ߷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorGroupNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrandCodeTypeһƺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrandCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWarehouseTypeһֿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWarehouseType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProductDateType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGradeTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcGradeType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClassifyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClassifyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPositionTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPositionType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYieldlyTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcYieldlyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWeightTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWeightType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubEntryFundNoTypeһʽˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSubEntryFundNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileIDTypeһļʶ +///////////////////////////////////////////////////////////////////////// +///ʽ +#define THOST_FTDC_FI_SettlementFund 'F' +///ɽ +#define THOST_FTDC_FI_Trade 'T' +///Ͷֲ߳ +#define THOST_FTDC_FI_InvestorPosition 'P' +///Ͷ߷ʽ +#define THOST_FTDC_FI_SubEntryFund 'O' +///ϳֲ +#define THOST_FTDC_FI_CZCECombinationPos 'C' +///ϱ֤ +#define THOST_FTDC_FI_CSRCData 'R' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCEClose 'L' +///֣ƽ˽ +#define THOST_FTDC_FI_CZCENoClose 'N' +///ֲϸ +#define THOST_FTDC_FI_PositionDtl 'D' +///Ȩִļ +#define THOST_FTDC_FI_OptionStrike 'S' +///۱ȶļ +#define THOST_FTDC_FI_SettlementPriceComparison 'M' +///dzֱֲ䶯ϸ +#define THOST_FTDC_FI_NonTradePosChange 'B' + +typedef char TThostFtdcFileIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileTypeTypeһļϴ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FUT_Settlement '0' +///˶ +#define THOST_FTDC_FUT_Check '1' + +typedef char TThostFtdcFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileFormatTypeһļʽ +///////////////////////////////////////////////////////////////////////// +///ıļ(.txt) +#define THOST_FTDC_FFT_Txt '0' +///ѹļ(.zip) +#define THOST_FTDC_FFT_Zip '1' +///DBFļ(.dbf) +#define THOST_FTDC_FFT_DBF '2' + +typedef char TThostFtdcFileFormatType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileUploadStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///ϴɹ +#define THOST_FTDC_FUS_SucceedUpload '1' +///ϴʧ +#define THOST_FTDC_FUS_FailedUpload '2' +///ɹ +#define THOST_FTDC_FUS_SucceedLoad '3' +///벿ֳɹ +#define THOST_FTDC_FUS_PartSucceedLoad '4' +///ʧ +#define THOST_FTDC_FUS_FailedLoad '5' + +typedef char TThostFtdcFileUploadStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferDirectionTypeһƲַ +///////////////////////////////////////////////////////////////////////// +///Ƴ +#define THOST_FTDC_TD_Out '0' +/// +#define THOST_FTDC_TD_In '1' + +typedef char TThostFtdcTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUploadModeTypeһϴļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUploadModeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountIDTypeһͶʺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAccountIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankFlagTypeһͳһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankFlagType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenNameTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenBankTypeһ˻Ŀ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOpenBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishPathTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPublishPathType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorIDTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthCountTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcMonthCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAdvanceMonthArrayTypeһ·ǰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAdvanceMonthArrayType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDateExprTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDateExprType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDExprTypeһԼʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentNameExprTypeһԼƱʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentNameExprType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecialCreateRuleTypeһĴ +///////////////////////////////////////////////////////////////////////// +///ûⴴ +#define THOST_FTDC_SC_NoSpecialRule '0' +/// +#define THOST_FTDC_SC_NoSpringFestival '1' + +typedef char TThostFtdcSpecialCreateRuleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBasisPriceTypeTypeһƻ׼ +///////////////////////////////////////////////////////////////////////// +///һԼ +#define THOST_FTDC_IPT_LastSettlement '1' +///һԼ̼ +#define THOST_FTDC_IPT_LaseClose '2' + +typedef char TThostFtdcBasisPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductLifePhaseTypeһƷ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_PLP_Active '1' +///Ծ +#define THOST_FTDC_PLP_NonActive '2' +///ע +#define THOST_FTDC_PLP_Canceled '3' + +typedef char TThostFtdcProductLifePhaseType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryModeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ֽ𽻸 +#define THOST_FTDC_DM_CashDeliv '1' +///ʵサ +#define THOST_FTDC_DM_CommodityDeliv '2' + +typedef char TThostFtdcDeliveryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLogLevelTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLogLevelType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessNameTypeһ洢 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperationMemoTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperationMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FIOT_FundIO '1' +///ת +#define THOST_FTDC_FIOT_Transfer '2' +///ڻ +#define THOST_FTDC_FIOT_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FT_Deposite '1' +///ʽ +#define THOST_FTDC_FT_ItemFund '2' +///˾ +#define THOST_FTDC_FT_Company '3' +///ʽת +#define THOST_FTDC_FT_InnerTransfer '4' + +typedef char TThostFtdcFundTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FD_In '1' +/// +#define THOST_FTDC_FD_Out '2' + +typedef char TThostFtdcFundDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundStatusTypeһʽ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_FS_Record '1' +///Ѹ +#define THOST_FTDC_FS_Check '2' +///ѳ +#define THOST_FTDC_FS_Charge '3' + +typedef char TThostFtdcFundStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNoTypeһƱݺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNoType[15]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillNameTypeһƱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBillNameType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPublishStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PS_None '1' +///ڷ +#define THOST_FTDC_PS_Publishing '2' +///ѷ +#define THOST_FTDC_PS_Published '3' + +typedef char TThostFtdcPublishStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueIDTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueIDType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueTypeTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueLabelTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueLabelType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEnumValueResultTypeһöֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEnumValueResultType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemStatusTypeһϵͳ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_ES_NonActive '1' +/// +#define THOST_FTDC_ES_Startup '2' +///׿ʼʼ +#define THOST_FTDC_ES_Initialize '3' +///ɳʼ +#define THOST_FTDC_ES_Initialized '4' +///пʼ +#define THOST_FTDC_ES_Close '5' +/// +#define THOST_FTDC_ES_Closed '6' +/// +#define THOST_FTDC_ES_Settlement '7' + +typedef char TThostFtdcSystemStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_STS_Initialize '0' +/// +#define THOST_FTDC_STS_Settlementing '1' +///ѽ +#define THOST_FTDC_STS_Settlemented '2' +/// +#define THOST_FTDC_STS_Finished '3' + +typedef char TThostFtdcSettlementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntTypeTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntFromTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntFromType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRangeIntToTypeһ޶ֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRangeIntToType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionIDTypeһܴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionValueCodeTypeһܱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionValueCodeType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleIDTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRoleNameTypeһɫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRoleNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescriptionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescriptionType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineIDTypeһϱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineIDType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombineTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombineTypeType[25]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CT_Person '0' +/// +#define THOST_FTDC_CT_Company '1' +///Ͷʻ +#define THOST_FTDC_CT_Fund '2' +///ⷨ +#define THOST_FTDC_CT_SpecialOrgan '3' +///ʹܻ +#define THOST_FTDC_CT_Asset '4' + +typedef char TThostFtdcInvestorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerTypeTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +///׻Ա +#define THOST_FTDC_BT_Trade '0' +///׽Ա +#define THOST_FTDC_BT_TradeSettle '1' + +typedef char TThostFtdcBrokerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskLevelTypeһյȼ +///////////////////////////////////////////////////////////////////////// +///ͷտͻ +#define THOST_FTDC_FAS_Low '1' +///ͨͻ +#define THOST_FTDC_FAS_Normal '2' +///עͻ +#define THOST_FTDC_FAS_Focus '3' +///տͻ +#define THOST_FTDC_FAS_Risk '4' + +typedef char TThostFtdcRiskLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeeAcceptStyleTypeһȡʽ +///////////////////////////////////////////////////////////////////////// +///ȡ +#define THOST_FTDC_FAS_ByTrade '1' +///ȡ +#define THOST_FTDC_FAS_ByDeliv '2' +/// +#define THOST_FTDC_FAS_None '3' +///ָȡ +#define THOST_FTDC_FAS_FixFee '4' + +typedef char TThostFtdcFeeAcceptStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PWDT_Trade '1' +///ʽ +#define THOST_FTDC_PWDT_Account '2' + +typedef char TThostFtdcPasswordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgorithmTypeһӯ㷨 +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_AG_All '1' +///ӯƣ +#define THOST_FTDC_AG_OnlyLost '2' +///ӯƣ +#define THOST_FTDC_AG_OnlyGain '3' +///ӯ +#define THOST_FTDC_AG_None '4' + +typedef char TThostFtdcAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIncludeCloseProfitTypeһǷƽӯ +///////////////////////////////////////////////////////////////////////// +///ƽӯ +#define THOST_FTDC_ICP_Include '0' +///ƽӯ +#define THOST_FTDC_ICP_NotInclude '2' + +typedef char TThostFtdcIncludeCloseProfitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAllWithoutTradeTypeһǷܿ +///////////////////////////////////////////////////////////////////////// +///޲޳ɽܿ +#define THOST_FTDC_AWT_Enable '0' +///ܿ +#define THOST_FTDC_AWT_Disable '2' +///޲ֲܿ +#define THOST_FTDC_AWT_NoHoldEnable '3' + +typedef char TThostFtdcAllWithoutTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommentTypeһӯ㷨˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommentType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVersionTypeһ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcVersionType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeDateType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeTimeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeSerialType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSerialNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeSerialNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureIDTypeһڻ˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDTypeһд +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBrchIDTypeһзĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBrchIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankBranchIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankBranchIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperNoTypeһ׹Ա +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeviceIDTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDeviceIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordNumTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRecordNumType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountTypeһڻʽ˺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountType[22]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturePwdFlagTypeһʽ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_FPWD_UnCheck '0' +///˶ +#define THOST_FTDC_FPWD_Check '1' + +typedef char TThostFtdcFuturePwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferTypeTypeһת +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_TT_BankToFuture '0' +///ڻת +#define THOST_FTDC_TT_FutureToBank '1' + +typedef char TThostFtdcTransferTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccPwdTypeһڻʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccPwdType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyCodeType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetCodeTypeһӦ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRetInfoTypeһӦϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRetInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmtTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTradeAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUseAmtTypeһп +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUseAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFetchAmtTypeһпȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFetchAmtType[20]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferValidFlagTypeһתЧ־ +///////////////////////////////////////////////////////////////////////// +///Чʧ +#define THOST_FTDC_TVF_Invalid '0' +///Ч +#define THOST_FTDC_TVF_Valid '1' +/// +#define THOST_FTDC_TVF_Reverse '2' + +typedef char TThostFtdcTransferValidFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertCodeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCertCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReasonTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RN_CD '0' +///ʽ; +#define THOST_FTDC_RN_ZT '1' +/// +#define THOST_FTDC_RN_QT '2' + +typedef char TThostFtdcReasonType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundProjectIDTypeһʽĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFundProjectIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSexTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_SEX_None '0' +/// +#define THOST_FTDC_SEX_Man '1' +///Ů +#define THOST_FTDC_SEX_Woman '2' + +typedef char TThostFtdcSexType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProfessionTypeһְҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProfessionType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNationalType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProvinceTypeһʡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProvinceType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRegionTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRegionType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLicenseNOTypeһӪҵִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLicenseNOType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCompanyTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCompanyTypeType[16]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessScopeTypeһӪΧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessScopeType[1001]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCapitalCurrencyTypeһעʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCapitalCurrencyType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserTypeTypeһû +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_UT_Investor '0' +///Ա +#define THOST_FTDC_UT_Operator '1' +///Ա +#define THOST_FTDC_UT_SuperUser '2' + +typedef char TThostFtdcUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchIDTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_RATETYPE_MarginRate '2' + +typedef char TThostFtdcRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNoteTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +///׽㵥 +#define THOST_FTDC_NOTETYPE_TradeSettleBill '1' +///׽± +#define THOST_FTDC_NOTETYPE_TradeSettleMonth '2' +///׷ӱ֤֪ͨ +#define THOST_FTDC_NOTETYPE_CallMarginNotes '3' +///ǿƽ֪ͨ +#define THOST_FTDC_NOTETYPE_ForceCloseNotes '4' +///ɽ֪ͨ +#define THOST_FTDC_NOTETYPE_TradeNotes '5' +///֪ͨ +#define THOST_FTDC_NOTETYPE_DelivNotes '6' + +typedef char TThostFtdcNoteTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementStyleTypeһ㵥ʽ +///////////////////////////////////////////////////////////////////////// +///ն +#define THOST_FTDC_SBS_Day '1' +///ʶԳ +#define THOST_FTDC_SBS_Volume '2' + +typedef char TThostFtdcSettlementStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerDNSTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBrokerDNSType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSentenceTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSentenceType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettlementBillTypeTypeһ㵥 +///////////////////////////////////////////////////////////////////////// +///ձ +#define THOST_FTDC_ST_Day '0' +///± +#define THOST_FTDC_ST_Month '1' + +typedef char TThostFtdcSettlementBillTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRightTypeTypeһͻȨ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_URT_Logon '1' +///ת +#define THOST_FTDC_URT_Transfer '2' +///ʼĽ㵥 +#define THOST_FTDC_URT_EMail '3' +///㵥 +#define THOST_FTDC_URT_Fax '4' +/// +#define THOST_FTDC_URT_ConditionOrder '5' + +typedef char TThostFtdcUserRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginPriceTypeTypeһ֤۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MPT_PreSettlementPrice '1' +///¼ +#define THOST_FTDC_MPT_SettlementPrice '2' +///ɽ +#define THOST_FTDC_MPT_AveragePrice '3' +///ּ +#define THOST_FTDC_MPT_OpenPrice '4' + +typedef char TThostFtdcMarginPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBillGenStatusTypeһ㵥״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_BGS_None '0' +/// +#define THOST_FTDC_BGS_NoGenerated '1' +/// +#define THOST_FTDC_BGS_Generated '2' + +typedef char TThostFtdcBillGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAlgoTypeTypeһ㷨 +///////////////////////////////////////////////////////////////////////// +///ֲִ㷨 +#define THOST_FTDC_AT_HandlePositionAlgo '1' +///Ѱұ֤㷨 +#define THOST_FTDC_AT_FindMarginRateAlgo '2' + +typedef char TThostFtdcAlgoTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandlePositionAlgoIDTypeһֲִ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HPA_Base '1' +///Ʒ +#define THOST_FTDC_HPA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HPA_CZCE '3' + +typedef char TThostFtdcHandlePositionAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFindMarginRateAlgoIDTypeһѰұ֤㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMRA_Base '1' +///Ʒ +#define THOST_FTDC_FMRA_DCE '2' +///֣Ʒ +#define THOST_FTDC_FMRA_CZCE '3' + +typedef char TThostFtdcFindMarginRateAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHandleTradingAccountAlgoIDTypeһʽ㷨 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HTAA_Base '1' +///Ʒ +#define THOST_FTDC_HTAA_DCE '2' +///֣Ʒ +#define THOST_FTDC_HTAA_CZCE '3' + +typedef char TThostFtdcHandleTradingAccountAlgoIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPersonTypeTypeһϵ +///////////////////////////////////////////////////////////////////////// +///ָµ +#define THOST_FTDC_PST_Order '1' +///Ȩ +#define THOST_FTDC_PST_Open '2' +///ʽ +#define THOST_FTDC_PST_Fund '3' +///㵥ȷ +#define THOST_FTDC_PST_Settlement '4' +/// +#define THOST_FTDC_PST_Company '5' +///˴ +#define THOST_FTDC_PST_Corporation '6' +///Ͷϵ +#define THOST_FTDC_PST_LinkMan '7' +///ֻʲ +#define THOST_FTDC_PST_Ledger '8' +///У +#define THOST_FTDC_PST_Trustee '9' +///Уܻ˴ +#define THOST_FTDC_PST_TrusteeCorporation 'A' +///УܻȨ +#define THOST_FTDC_PST_TrusteeOpen 'B' +///Уܻϵ +#define THOST_FTDC_PST_TrusteeContact 'C' +///Ȼ˲ο֤ +#define THOST_FTDC_PST_ForeignerRefer 'D' +///˴ο֤ +#define THOST_FTDC_PST_CorporationRefer 'E' + +typedef char TThostFtdcPersonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryInvestorRangeTypeһѯΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_QIR_All '1' +///ѯ +#define THOST_FTDC_QIR_Group '2' +///һͶ +#define THOST_FTDC_QIR_Single '3' + +typedef char TThostFtdcQueryInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorRiskStatusTypeһͶ߷״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_IRS_Normal '1' +/// +#define THOST_FTDC_IRS_Warn '2' +///׷ +#define THOST_FTDC_IRS_Call '3' +///ǿƽ +#define THOST_FTDC_IRS_Force '4' +///쳣 +#define THOST_FTDC_IRS_Exception '5' + +typedef char TThostFtdcInvestorRiskStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegIDTypeһȱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLegMultipleTypeһȳ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLegMultipleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImplyLevelTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcImplyLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNOTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNOType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearbarchIDTypeһ˻к +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearbarchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventTypeTypeһû¼ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_UET_Login '1' +///dz +#define THOST_FTDC_UET_Logout '2' +///׳ɹ +#define THOST_FTDC_UET_Trading '3' +///ʧ +#define THOST_FTDC_UET_TradingError '4' +///޸ +#define THOST_FTDC_UET_UpdatePassword '5' +///ͻ֤ +#define THOST_FTDC_UET_Authenticate '6' +/// +#define THOST_FTDC_UET_Other '9' + +typedef char TThostFtdcUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserEventInfoTypeһû¼Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserEventInfoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseStyleTypeһƽַʽ +///////////////////////////////////////////////////////////////////////// +///ȿƽ +#define THOST_FTDC_ICS_Close '0' +///ƽƽ +#define THOST_FTDC_ICS_CloseToday '1' + +typedef char TThostFtdcCloseStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStatModeTypeһͳƷʽ +///////////////////////////////////////////////////////////////////////// +///---- +#define THOST_FTDC_SM_Non '0' +///Լͳ +#define THOST_FTDC_SM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_SM_Product '2' +///Ͷͳ +#define THOST_FTDC_SM_Investor '3' + +typedef char TThostFtdcStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderStatusTypeһԤ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PAOS_NotSend '1' +///ѷ +#define THOST_FTDC_PAOS_Send '2' +///ɾ +#define THOST_FTDC_PAOS_Deleted '3' + +typedef char TThostFtdcParkedOrderStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderIDTypeһԤ񱨵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParkedOrderActionIDTypeһԤ񳷵 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParkedOrderActionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirDealStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ڴ +#define THOST_FTDC_VDS_Dealing '1' +///ɹ +#define THOST_FTDC_VDS_DeaclSucceed '2' + +typedef char TThostFtdcVirDealStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrgSystemIDTypeһԭϵͳ +///////////////////////////////////////////////////////////////////////// +///ۺϽƽ̨ +#define THOST_FTDC_ORGS_Standard '0' +///ʢϵͳ +#define THOST_FTDC_ORGS_ESunny '1' +///˴V6ϵͳ +#define THOST_FTDC_ORGS_KingStarV6 '2' + +typedef char TThostFtdcOrgSystemIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirTradeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VTS_NaturalDeal '0' +///ɹ +#define THOST_FTDC_VTS_SucceedEnd '1' +///ʧܽ +#define THOST_FTDC_VTS_FailedEND '2' +///쳣 +#define THOST_FTDC_VTS_Exception '3' +///˹쳣 +#define THOST_FTDC_VTS_ManualDeal '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_VTS_MesException '5' +///ϵͳ˹ +#define THOST_FTDC_VTS_SysException '6' + +typedef char TThostFtdcVirTradeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirBankAccTypeTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VBAT_BankBook '1' +/// +#define THOST_FTDC_VBAT_BankCard '2' +///ÿ +#define THOST_FTDC_VBAT_CreditCard '3' + +typedef char TThostFtdcVirBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementStatusTypeһʻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_VMS_Natural '0' +/// +#define THOST_FTDC_VMS_Canceled '9' + +typedef char TThostFtdcVirementStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementAvailAbilityTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_VAA_NoAvailAbility '0' +///Ч +#define THOST_FTDC_VAA_AvailAbility '1' +/// +#define THOST_FTDC_VAA_Repeal '2' + +typedef char TThostFtdcVirementAvailAbilityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcVirementTradeCodeTypeһ״ +///////////////////////////////////////////////////////////////////////// +///зʽתڻ +#define THOST_FTDC_VTC_BankBankToFuture '102001' +///зڻʽת +#define THOST_FTDC_VTC_BankFutureToBank '102002' +///ڻʽתڻ +#define THOST_FTDC_VTC_FutureBankToFuture '202001' +///ڻڻʽת +#define THOST_FTDC_VTC_FutureFutureToBank '202002' + +typedef char TThostFtdcVirementTradeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoTypeIDTypeһӰʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoTypeIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPhotoNameTypeһӰ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPhotoNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTopicIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTopicIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportTypeIDTypeһױͱʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReportTypeIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCharacterIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCharacterIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInvestorTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInvestorTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLIdCardTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeDirectTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeDirectType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradeModelTypeһʽʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradeModelType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLParamIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLOpParamValueTypeһҵֵ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLOpParamValueType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCustomerCardTypeTypeһͻ֤/֤ļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCustomerCardTypeType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionNameTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLDistrictIDTypeһڻڵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLDistrictIDType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLRelationShipTypeһڻ׵Ĺϵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLRelationShipType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLInstitutionIDTypeһڻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLInstitutionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLAccountTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTradingTypeTypeһ׷ʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTradingTypeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLTransactClassTypeһ֧׷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLTransactClassType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalIOTypeһʽոʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalIOType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSiteTypeһ׵ص +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSiteType[10]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCapitalPurposeTypeһʽ; +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLCapitalPurposeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSerialNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSerialNoType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLGenStatusTypeһAmlɷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_GEN_Program '0' +///˹ +#define THOST_FTDC_GEN_HandWork '1' + +typedef char TThostFtdcAMLGenStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLSeqCodeTypeһҵʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLSeqCodeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileNameTypeһAMLļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLFileNameType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLMoneyTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcAMLMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLFileAmountTypeһϴǮʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcAMLFileAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyTypeһԿ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCKeyType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCTokenTypeһ(֤) +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCFMMCTokenType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFMMCKeyKindTypeһ̬Կ(֤) +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFMMCKK_REQUEST 'R' +///CFMMCԶ +#define THOST_FTDC_CFMMCKK_AUTO 'A' +///CFMMCֶ +#define THOST_FTDC_CFMMCKK_MANUAL 'M' + +typedef char TThostFtdcCFMMCKeyKindType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLReportNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAMLReportNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComdTypeTypeһDBF +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComdTypeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComTimeTypeһDBFʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComTimeType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFComNoTypeһDBFˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFComNoType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFFdNameTypeһDBFֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFFdNameType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBFFdContentTypeһDBFֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBFFdContentType[256]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndividualNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndividualNameType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyIDTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustNumberTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCustNumberType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganCodeType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSuperOrganCodeTypeһϼ,ڻ˾ܲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSuperOrganCodeType[12]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchIDTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSubBranchNameTypeһ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSubBranchNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetCodeType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBranchNetNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBranchNetNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganFlagTypeһʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOrganFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCodingForFutureTypeһжڻ˾ı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCodingForFutureType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankReturnCodeTypeһжԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateReturnCodeTypeһתƽ̨ԷĶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPlateReturnCodeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSubBranchIDTypeһз֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSubBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureBranchIDTypeһڻ֧ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureBranchIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReturnCodeTypeһش +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcReturnCodeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOperatorCodeTypeһԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOperatorCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearDepIDTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearBrchIDTypeһʻк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClearNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClearNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountNameTypeһʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountNameType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvDepIDTypeһͶ˺Ż +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvDepIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvBrchIDTypeһͶк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvBrchIDType[6]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMessageFormatVersionTypeһϢʽ汾 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMessageFormatVersionType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDigestTypeһժҪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDigestType[36]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthenticDataTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthenticDataType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPasswordKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPasswordKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccountNameTypeһڻʻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureAccountNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMobilePhoneTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcMobilePhoneType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureMainKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureWorkKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTransKeyTypeһڻ˾Կ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFutureTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankMainKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankMainKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankWorkKeyTypeһйԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankWorkKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankTransKeyTypeһдԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankTransKeyType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankServerDescriptionTypeһзϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankServerDescriptionType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAddInfoTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAddInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDescrInfoForReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDescrInfoForReturnCodeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCountryCodeType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPlateSerialTypeһƽ̨ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcPlateSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankSerialType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorrectSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCorrectSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureSerialTypeһڻ˾ˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFutureSerialType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplicationIDTypeһӦñʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcApplicationIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankProxyIDTypeһдʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcBankProxyIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTCoreIDTypeһתʺϵͳʶ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTCoreIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServerPortTypeһ˿ں +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServerPortType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealedTimesTypeһѾ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealedTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRepealTimeIntervalTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRepealTimeIntervalType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalTimesTypeһÿۼתʴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTotalTimesType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTRequestIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBTRequestIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeAmountTypeһ׽Ԫ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTradeAmountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustFeeTypeһӦտͻãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCustFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureFeeTypeһӦڻ˾ãԪ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFutureFeeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMaxAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMaxAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSingleMinAmtTypeһ޶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcSingleMinAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTotalAmtTypeһÿۼתʶ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcTotalAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCertificationTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_CFT_IDCard '0' +/// +#define THOST_FTDC_CFT_Passport '1' +///֤ +#define THOST_FTDC_CFT_OfficerIDCard '2' +///ʿ֤ +#define THOST_FTDC_CFT_SoldierIDCard '3' +///֤ +#define THOST_FTDC_CFT_HomeComingCard '4' +///ڲ +#define THOST_FTDC_CFT_HouseholdRegister '5' +///Ӫҵִպ +#define THOST_FTDC_CFT_LicenseNo '6' +///֤֯ +#define THOST_FTDC_CFT_InstitutionCodeCard '7' +///ʱӪҵִպ +#define THOST_FTDC_CFT_TempLicenseNo '8' +///ҵǼ֤ +#define THOST_FTDC_CFT_NoEnterpriseLicenseNo '9' +///֤ +#define THOST_FTDC_CFT_OtherCard 'x' +///ܲ +#define THOST_FTDC_CFT_SuperDepAgree 'a' + +typedef char TThostFtdcCertificationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileBusinessCodeTypeһļҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBC_Others '0' +///ת˽ϸ +#define THOST_FTDC_FBC_TransferDetails '1' +///ͻ˻״̬ +#define THOST_FTDC_FBC_CustAccStatus '2' +///˻ཻϸ +#define THOST_FTDC_FBC_AccountTradeDetails '3' +///ڻ˻Ϣϸ +#define THOST_FTDC_FBC_FutureAccountChangeInfoDetails '4' +///ͻʽ̨ϸ +#define THOST_FTDC_FBC_CustMoneyDetail '5' +///ͻϢϸ +#define THOST_FTDC_FBC_CustCancelAccountInfo '6' +///ͻʽ˽ +#define THOST_FTDC_FBC_CustMoneyResult '7' +///쳣ļ +#define THOST_FTDC_FBC_OthersExceptionResult '8' +///ͻϢϸ +#define THOST_FTDC_FBC_CustInterestNetMoneyDetails '9' +///ͻʽϸ +#define THOST_FTDC_FBC_CustMoneySendAndReceiveDetails 'a' +///˴ʽջ +#define THOST_FTDC_FBC_CorporationMoneyTotal 'b' +///ʽջ +#define THOST_FTDC_FBC_MainbodyMoneyTotal 'c' +///ܷƽ +#define THOST_FTDC_FBC_MainPartMonitorData 'd' +///б +#define THOST_FTDC_FBC_PreparationMoney 'e' +///Эʽ +#define THOST_FTDC_FBC_BankMoneyMonitorData 'f' + +typedef char TThostFtdcFileBusinessCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCashExchangeCodeTypeһ㳮־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CEC_Exchange '1' +/// +#define THOST_FTDC_CEC_Cash '2' + +typedef char TThostFtdcCashExchangeCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcYesNoIndicatorTypeһǻʶ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_YNI_Yes '0' +/// +#define THOST_FTDC_YNI_No '1' + +typedef char TThostFtdcYesNoIndicatorType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBanlanceTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ +#define THOST_FTDC_BLT_CurrentMoney '0' +/// +#define THOST_FTDC_BLT_UsableMoney '1' +///ȡ +#define THOST_FTDC_BLT_FetchableMoney '2' +/// +#define THOST_FTDC_BLT_FreezeMoney '3' + +typedef char TThostFtdcBanlanceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGenderTypeһԱ +///////////////////////////////////////////////////////////////////////// +///δ֪״̬ +#define THOST_FTDC_GD_Unknown '0' +/// +#define THOST_FTDC_GD_Male '1' +///Ů +#define THOST_FTDC_GD_Female '2' + +typedef char TThostFtdcGenderType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFeePayFlagTypeһ֧־ +///////////////////////////////////////////////////////////////////////// +///淽֧ +#define THOST_FTDC_FPF_BEN '0' +///ɷͷ֧ +#define THOST_FTDC_FPF_OUR '1' +///ɷͷ֧ķã淽֧ܵķ +#define THOST_FTDC_FPF_SHA '2' + +typedef char TThostFtdcFeePayFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPassWordKeyTypeTypeһԿ +///////////////////////////////////////////////////////////////////////// +///Կ +#define THOST_FTDC_PWKT_ExchangeKey '0' +///Կ +#define THOST_FTDC_PWKT_PassWordKey '1' +///MACԿ +#define THOST_FTDC_PWKT_MACKey '2' +///Կ +#define THOST_FTDC_PWKT_MessageKey '3' + +typedef char TThostFtdcPassWordKeyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTPassWordTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ѯ +#define THOST_FTDC_PWT_Query '0' +///ȡ +#define THOST_FTDC_PWT_Fetch '1' +///ת +#define THOST_FTDC_PWT_Transfer '2' +/// +#define THOST_FTDC_PWT_Trade '3' + +typedef char TThostFtdcFBTPassWordTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTEncryModeTypeһܷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EM_NoEncry '0' +///DES +#define THOST_FTDC_EM_DES '1' +///3DES +#define THOST_FTDC_EM_3DES '2' + +typedef char TThostFtdcFBTEncryModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankRepealFlagTypeһг־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRF_BankNotNeedRepeal '0' +///дԶ +#define THOST_FTDC_BRF_BankWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRF_BankBeenRepealed '2' + +typedef char TThostFtdcBankRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerRepealFlagTypeһ̳־ +///////////////////////////////////////////////////////////////////////// +///Զ +#define THOST_FTDC_BRORF_BrokerNotNeedRepeal '0' +///̴Զ +#define THOST_FTDC_BRORF_BrokerWaitingRepeal '1' +///Զ +#define THOST_FTDC_BRORF_BrokerBeenRepealed '2' + +typedef char TThostFtdcBrokerRepealFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstitutionTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TS_Bank '0' +/// +#define THOST_FTDC_TS_Future '1' +///ȯ +#define THOST_FTDC_TS_Store '2' + +typedef char TThostFtdcInstitutionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastFragmentTypeһƬ־ +///////////////////////////////////////////////////////////////////////// +///Ƭ +#define THOST_FTDC_LF_Yes '0' +///Ƭ +#define THOST_FTDC_LF_No '1' + +typedef char TThostFtdcLastFragmentType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccStatusTypeһ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BAS_Normal '0' +/// +#define THOST_FTDC_BAS_Freeze '1' +///ʧ +#define THOST_FTDC_BAS_ReportLoss '2' + +typedef char TThostFtdcBankAccStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMoneyAccountStatusTypeһʽ˻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_MAS_Normal '0' +/// +#define THOST_FTDC_MAS_Cancel '1' + +typedef char TThostFtdcMoneyAccountStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcManageStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///ָ +#define THOST_FTDC_MSS_Point '0' +///Ԥָ +#define THOST_FTDC_MSS_PrePoint '1' +///ָ +#define THOST_FTDC_MSS_CancelPoint '2' + +typedef char TThostFtdcManageStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSystemTypeTypeһӦϵͳ +///////////////////////////////////////////////////////////////////////// +///ת +#define THOST_FTDC_SYT_FutureBankTransfer '0' +///֤ת +#define THOST_FTDC_SYT_StockBankTransfer '1' +/// +#define THOST_FTDC_SYT_TheThirdPartStore '2' + +typedef char TThostFtdcSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTxnEndFlagTypeһתʻת־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TEF_NormalProcessing '0' +///ɹ +#define THOST_FTDC_TEF_Success '1' +///ʧܽ +#define THOST_FTDC_TEF_Failed '2' +///쳣 +#define THOST_FTDC_TEF_Abnormal '3' +///˹쳣 +#define THOST_FTDC_TEF_ManualProcessedForException '4' +///ͨѶ쳣 ˹ +#define THOST_FTDC_TEF_CommuFailedNeedManualProcess '5' +///ϵͳ˹ +#define THOST_FTDC_TEF_SysErrorNeedManualProcess '6' + +typedef char TThostFtdcTxnEndFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessStatusTypeһתʷ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_PSS_NotProcess '0' +///ʼ +#define THOST_FTDC_PSS_StartProcess '1' +/// +#define THOST_FTDC_PSS_Finished '2' + +typedef char TThostFtdcProcessStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCustTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CUSTT_Person '0' +/// +#define THOST_FTDC_CUSTT_Institution '1' + +typedef char TThostFtdcCustTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTransferDirectionTypeһתʷ +///////////////////////////////////////////////////////////////////////// +///תڻ +#define THOST_FTDC_FBTTD_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTTD_FromFutureToBank '2' + +typedef char TThostFtdcFBTTransferDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOpenOrDestroyTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OOD_Open '1' +/// +#define THOST_FTDC_OOD_Destroy '0' + +typedef char TThostFtdcOpenOrDestroyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAvailabilityFlagTypeһЧ־ +///////////////////////////////////////////////////////////////////////// +///δȷ +#define THOST_FTDC_AVAF_Invalid '0' +///Ч +#define THOST_FTDC_AVAF_Valid '1' +/// +#define THOST_FTDC_AVAF_Repeal '2' + +typedef char TThostFtdcAvailabilityFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_OT_Bank '1' +///ǰ +#define THOST_FTDC_OT_Future '2' +///תƽ̨ +#define THOST_FTDC_OT_PlateForm '9' + +typedef char TThostFtdcOrganTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganLevelTypeһ +///////////////////////////////////////////////////////////////////////// +///лܲ +#define THOST_FTDC_OL_HeadQuarters '1' +///зĻڻ˾Ӫҵ +#define THOST_FTDC_OL_Branch '2' + +typedef char TThostFtdcOrganLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProtocalIDTypeһЭ +///////////////////////////////////////////////////////////////////////// +///Э +#define THOST_FTDC_PID_FutureProtocal '0' +///Э +#define THOST_FTDC_PID_ICBCProtocal '1' +///ũЭ +#define THOST_FTDC_PID_ABCProtocal '2' +///йЭ +#define THOST_FTDC_PID_CBCProtocal '3' +///Э +#define THOST_FTDC_PID_CCBProtocal '4' +///Э +#define THOST_FTDC_PID_BOCOMProtocal '5' +///תƽ̨Э +#define THOST_FTDC_PID_FBTPlateFormProtocal 'X' + +typedef char TThostFtdcProtocalIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConnectModeTypeһ׽ӷʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CM_ShortConnect '0' +/// +#define THOST_FTDC_CM_LongConnect '1' + +typedef char TThostFtdcConnectModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncModeTypeһ׽ͨŷʽ +///////////////////////////////////////////////////////////////////////// +///첽 +#define THOST_FTDC_SRM_ASync '0' +///ͬ +#define THOST_FTDC_SRM_Sync '1' + +typedef char TThostFtdcSyncModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccTypeTypeһʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_BAT_BankBook '1' +/// +#define THOST_FTDC_BAT_SavingCard '2' +///ÿ +#define THOST_FTDC_BAT_CreditCard '3' + +typedef char TThostFtdcBankAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureAccTypeTypeһڻ˾ʺ +///////////////////////////////////////////////////////////////////////// +///д +#define THOST_FTDC_FAT_BankBook '1' +/// +#define THOST_FTDC_FAT_SavingCard '2' +///ÿ +#define THOST_FTDC_FAT_CreditCard '3' + +typedef char TThostFtdcFutureAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOrganStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_OS_Ready '0' +///ǩ +#define THOST_FTDC_OS_CheckIn '1' +///ǩ +#define THOST_FTDC_OS_CheckOut '2' +///ļ +#define THOST_FTDC_OS_CheckFileArrived '3' +/// +#define THOST_FTDC_OS_CheckDetail '4' +/// +#define THOST_FTDC_OS_DayEndClean '5' +///ע +#define THOST_FTDC_OS_Invalid '9' + +typedef char TThostFtdcOrganStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCCBFeeModeTypeһշģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CCBFM_ByAmount '1' +///¿ +#define THOST_FTDC_CCBFM_ByMonth '2' + +typedef char TThostFtdcCCBFeeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiTypeTypeһͨѶAPI +///////////////////////////////////////////////////////////////////////// +///ͻ +#define THOST_FTDC_CAPIT_Client '1' +/// +#define THOST_FTDC_CAPIT_Server '2' +///ϵͳUserApi +#define THOST_FTDC_CAPIT_UserApi '3' + +typedef char TThostFtdcCommApiTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceLineNoTypeһ· +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcServiceLineNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcServiceNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcServiceNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLinkStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿ +#define THOST_FTDC_LS_Connected '1' +///û +#define THOST_FTDC_LS_Disconnected '2' + +typedef char TThostFtdcLinkStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommApiPointerTypeһͨѶAPIָ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCommApiPointerType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPwdFlagTypeһ˶Ա־ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_BPWDF_NoCheck '0' +///ĺ˶ +#define THOST_FTDC_BPWDF_BlankCheck '1' +///ĺ˶ +#define THOST_FTDC_BPWDF_EncryptCheck '2' + +typedef char TThostFtdcPwdFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSecuAccTypeTypeһڻʺ +///////////////////////////////////////////////////////////////////////// +///ʽʺ +#define THOST_FTDC_SAT_AccountID '1' +///ʽ𿨺 +#define THOST_FTDC_SAT_CardID '2' +///Ϻɶʺ +#define THOST_FTDC_SAT_SHStockholderID '3' +///ڹɶʺ +#define THOST_FTDC_SAT_SZStockholderID '4' + +typedef char TThostFtdcSecuAccTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTransferStatusTypeһת˽״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_TRFS_Normal '0' +/// +#define THOST_FTDC_TRFS_Repealed '1' + +typedef char TThostFtdcTransferStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSponsorTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SPTYPE_Broker '0' +/// +#define THOST_FTDC_SPTYPE_Bank '1' + +typedef char TThostFtdcSponsorTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqRspTypeTypeһӦ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_REQRSP_Request '0' +///Ӧ +#define THOST_FTDC_REQRSP_Response '1' + +typedef char TThostFtdcReqRspTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTUserEventTypeTypeһתû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBTUET_SignIn '0' +///תڻ +#define THOST_FTDC_FBTUET_FromBankToFuture '1' +///ڻת +#define THOST_FTDC_FBTUET_FromFutureToBank '2' +/// +#define THOST_FTDC_FBTUET_OpenAccount '3' +/// +#define THOST_FTDC_FBTUET_CancelAccount '4' +///˻ +#define THOST_FTDC_FBTUET_ChangeAccount '5' +///תڻ +#define THOST_FTDC_FBTUET_RepealFromBankToFuture '6' +///ڻת +#define THOST_FTDC_FBTUET_RepealFromFutureToBank '7' +///ѯ˻ +#define THOST_FTDC_FBTUET_QueryBankAccount '8' +///ѯڻ˻ +#define THOST_FTDC_FBTUET_QueryFutureAccount '9' +///ǩ +#define THOST_FTDC_FBTUET_SignOut 'A' +///Կͬ +#define THOST_FTDC_FBTUET_SyncKey 'B' +/// +#define THOST_FTDC_FBTUET_Other 'Z' + +typedef char TThostFtdcFBTUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankIDByBankTypeһԼı +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankIDByBankType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankOperNoTypeһвԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankOperNoType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankCustNoTypeһпͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankCustNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOPSeqNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDBOPSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTableNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTableNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKNameTypeһFBT +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPKValueTypeһFBTֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPKValueType[501]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBOperationTypeһ¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_DBOP_Insert '0' +/// +#define THOST_FTDC_DBOP_Update '1' +///ɾ +#define THOST_FTDC_DBOP_Delete '2' + +typedef char TThostFtdcDBOperationType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncFlagTypeһͬ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_SYNF_Yes '0' +///δͬ +#define THOST_FTDC_SYNF_No '1' + +typedef char TThostFtdcSyncFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTargetIDTypeһͬĿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTargetIDType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncTypeTypeһͬ +///////////////////////////////////////////////////////////////////////// +///һͬ +#define THOST_FTDC_SYNT_OneOffSync '0' +///ʱͬ +#define THOST_FTDC_SYNT_TimerSync '1' +///ʱȫͬ +#define THOST_FTDC_SYNT_TimerFullSync '2' + +typedef char TThostFtdcSyncTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETimeTypeһֻʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBETimeType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankNoTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBECertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBECertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExDirectionTypeһ㷽 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEDIR_Settlement '0' +///ۻ +#define THOST_FTDC_FBEDIR_Sale '1' + +typedef char TThostFtdcExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBankAccountNameTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBankAccountNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAmtTypeһֻ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcFBEAmtType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEPostScriptTypeһ㸽 +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEPostScriptType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERemarkTypeһ㱸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERemarkType[71]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEResultFlagTypeһɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_FBERES_Success '0' +///˻ +#define THOST_FTDC_FBERES_InsufficientBalance '1' +///׽δ֪ +#define THOST_FTDC_FBERES_UnknownTrading '8' +///ʧ +#define THOST_FTDC_FBERES_Fail 'x' + +typedef char TThostFtdcFBEResultFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBERtnMsgTypeһ㷵Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBERtnMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExtendMsgTypeһչϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEExtendMsgType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBusinessSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBusinessSerialType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBESystemSerialTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBESystemSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBETotalExCntTypeһ㽻ܱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcFBETotalExCntType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEExchStatusTypeһ㽻״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FBEES_Normal '0' +///ط +#define THOST_FTDC_FBEES_ReExchange '1' + +typedef char TThostFtdcFBEExchStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileFlagTypeһļ־ +///////////////////////////////////////////////////////////////////////// +///ݰ +#define THOST_FTDC_FBEFG_DataPackage '0' +///ļ +#define THOST_FTDC_FBEFG_File '1' + +typedef char TThostFtdcFBEFileFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEAlreadyTradeTypeһѽױ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBEAT_NotTrade '0' +///ѽ +#define THOST_FTDC_FBEAT_Trade '1' + +typedef char TThostFtdcFBEAlreadyTradeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEOpenBankTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEOpenBankType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEUserEventTypeTypeһڻû¼ +///////////////////////////////////////////////////////////////////////// +///ǩ +#define THOST_FTDC_FBEUET_SignIn '0' +/// +#define THOST_FTDC_FBEUET_Exchange '1' +///ط +#define THOST_FTDC_FBEUET_ReExchange '2' +///˻ѯ +#define THOST_FTDC_FBEUET_QueryBankAccount '3' +///ϸѯ +#define THOST_FTDC_FBEUET_QueryExchDetial '4' +///ܲѯ +#define THOST_FTDC_FBEUET_QueryExchSummary '5' +///ʲѯ +#define THOST_FTDC_FBEUET_QueryExchRate '6' +///ļ֪ͨ +#define THOST_FTDC_FBEUET_CheckBankAccount '7' +///ǩ +#define THOST_FTDC_FBEUET_SignOut '8' +/// +#define THOST_FTDC_FBEUET_Other 'Z' + +typedef char TThostFtdcFBEUserEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEFileNameType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEBatchSerialTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFBEBatchSerialType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBEReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FBERF_UnProcessed '0' +///ȴ +#define THOST_FTDC_FBERF_WaitSend '1' +///ͳɹ +#define THOST_FTDC_FBERF_SendSuccess '2' +///ʧ +#define THOST_FTDC_FBERF_SendFailed '3' +///ȴط +#define THOST_FTDC_FBERF_WaitReSend '4' + +typedef char TThostFtdcFBEReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNotifyClassTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_NC_NOERROR '0' +///ʾ +#define THOST_FTDC_NC_Warn '1' +///׷ +#define THOST_FTDC_NC_Call '2' +///ǿƽ +#define THOST_FTDC_NC_Force '3' +/// +#define THOST_FTDC_NC_CHUANCANG '4' +///쳣 +#define THOST_FTDC_NC_Exception '5' + +typedef char TThostFtdcNotifyClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNofityInfoTypeһͻ֪ͨϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskNofityInfoType[257]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseSceneIdTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcForceCloseSceneIdType[24]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForceCloseTypeTypeһǿƽ +///////////////////////////////////////////////////////////////////////// +///ֹǿƽ +#define THOST_FTDC_FCT_Manual '0' +///һͶ߸ǿƽ +#define THOST_FTDC_FCT_Single '1' +///Ͷ߸ǿƽ +#define THOST_FTDC_FCT_Group '2' + +typedef char TThostFtdcForceCloseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstrumentIDsTypeһƷ,+ָ,cu+zn +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInstrumentIDsType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyMethodTypeһ֪ͨ; +///////////////////////////////////////////////////////////////////////// +///ϵͳ֪ͨ +#define THOST_FTDC_RNM_System '0' +///֪ͨ +#define THOST_FTDC_RNM_SMS '1' +///ʼ֪ͨ +#define THOST_FTDC_RNM_EMail '2' +///˹֪ͨ +#define THOST_FTDC_RNM_Manual '3' + +typedef char TThostFtdcRiskNotifyMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskNotifyStatusTypeһ֪ͨ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_RNS_NotGen '0' +///δ +#define THOST_FTDC_RNS_Generated '1' +///ʧ +#define THOST_FTDC_RNS_SendError '2' +///ѷδ +#define THOST_FTDC_RNS_SendOk '3' +///ѽδȷ +#define THOST_FTDC_RNS_Received '4' +///ȷ +#define THOST_FTDC_RNS_Confirmed '5' + +typedef char TThostFtdcRiskNotifyStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskUserEventTypeһû¼ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_RUE_ExportData '0' + +typedef char TThostFtdcRiskUserEventType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamIDTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamNameType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcParamValueTypeһֵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcParamValueType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcConditionalOrderSortTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ʹ¼ +#define THOST_FTDC_COST_LastPriceAsc '0' +///ʹ¼۽ +#define THOST_FTDC_COST_LastPriceDesc '1' +///ʹ +#define THOST_FTDC_COST_AskPriceAsc '2' +///ʹ۽ +#define THOST_FTDC_COST_AskPriceDesc '3' +///ʹ +#define THOST_FTDC_COST_BidPriceAsc '4' +///ʹ۽ +#define THOST_FTDC_COST_BidPriceDesc '5' + +typedef char TThostFtdcConditionalOrderSortTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendTypeTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOAST_NoSend '0' +///ѷ +#define THOST_FTDC_UOAST_Sended '1' +/// +#define THOST_FTDC_UOAST_Generated '2' +///ʧ +#define THOST_FTDC_UOAST_SendFail '3' +///ճɹ +#define THOST_FTDC_UOAST_Success '4' +///ʧ +#define THOST_FTDC_UOAST_Fail '5' +///ȡ +#define THOST_FTDC_UOAST_Cancel '6' + +typedef char TThostFtdcSendTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientIDStatusTypeһױ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UOACS_NoApply '1' +///ύ +#define THOST_FTDC_UOACS_Submited '2' +///ѷ +#define THOST_FTDC_UOACS_Sended '3' +/// +#define THOST_FTDC_UOACS_Success '4' +///ܾ +#define THOST_FTDC_UOACS_Refuse '5' +///ѳ +#define THOST_FTDC_UOACS_Cancel '6' + +typedef char TThostFtdcClientIDStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIndustryIDTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIndustryIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionIDTypeһϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionIDType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionContentTypeһϢ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcQuestionContentType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionIDTypeһѡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionContentTypeһѡ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOptionContentType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQuestionTypeTypeһϢ +///////////////////////////////////////////////////////////////////////// +///ѡ +#define THOST_FTDC_QT_Radio '1' +///ѡ +#define THOST_FTDC_QT_Option '2' +/// +#define THOST_FTDC_QT_Blank '3' + +typedef char TThostFtdcQuestionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessIDTypeһҵˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSeqNoTypeһˮ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSeqNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAProcessStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAProcessStatusType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProcessTypeTypeһ̹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcProcessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_BT_Request '1' +///Ӧ +#define THOST_FTDC_BT_Response '2' +///֪ͨ +#define THOST_FTDC_BT_Notice '3' + +typedef char TThostFtdcBusinessTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCfmmcReturnCodeTypeһķ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_CRC_Success '0' +///ÿͻѾڴ +#define THOST_FTDC_CRC_Working '1' +///пͻϼʧ +#define THOST_FTDC_CRC_InfoFail '2' +///ʵƼʧ +#define THOST_FTDC_CRC_IDCardFail '3' +/// +#define THOST_FTDC_CRC_OtherFail '4' + +typedef char TThostFtdcCfmmcReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExReturnCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcExReturnCodeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientTypeTypeһͻ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CfMMCCT_All '0' +/// +#define THOST_FTDC_CfMMCCT_Person '1' +///λ +#define THOST_FTDC_CfMMCCT_Company '2' +/// +#define THOST_FTDC_CfMMCCT_Other '3' +///ⷨ +#define THOST_FTDC_CfMMCCT_SpecialOrgan '4' +///ʹܻ +#define THOST_FTDC_CfMMCCT_Asset '5' + +typedef char TThostFtdcClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeIDTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///Ϻڻ +#define THOST_FTDC_EIDT_SHFE 'S' +///֣Ʒ +#define THOST_FTDC_EIDT_CZCE 'Z' +///Ʒ +#define THOST_FTDC_EIDT_DCE 'D' +///йڻ +#define THOST_FTDC_EIDT_CFFEX 'J' +///ϺԴĹɷ޹˾ +#define THOST_FTDC_EIDT_INE 'N' +///Ϻ֤ȯ +#define THOST_FTDC_EIDT_SSE 'A' +///֤ȯ +#define THOST_FTDC_EIDT_SZSE 'E' + +typedef char TThostFtdcExchangeIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExClientIDTypeTypeһױ +///////////////////////////////////////////////////////////////////////// +///ױ +#define THOST_FTDC_ECIDT_Hedge '1' +/// +#define THOST_FTDC_ECIDT_Arbitrage '2' +///Ͷ +#define THOST_FTDC_ECIDT_Speculation '3' + +typedef char TThostFtdcExClientIDTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientClassifyTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientClassifyType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAOrganTypeTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAOrganTypeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOACountryCodeTypeһҴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOACountryCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAreaCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAreaCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFuturesIDTypeһΪͻĴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFuturesIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffmcTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffmcTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcNocIDTypeһ֯ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcNocIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUpdateFlagTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_UF_NoUpdate '0' +///ȫϢɹ +#define THOST_FTDC_UF_Success '1' +///ȫϢʧ +#define THOST_FTDC_UF_Fail '2' +///½ױɹ +#define THOST_FTDC_UF_TCSuccess '3' +///½ױʧ +#define THOST_FTDC_UF_TCFail '4' +///Ѷ +#define THOST_FTDC_UF_Cancel '5' + +typedef char TThostFtdcUpdateFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyOperateIDTypeһ붯 +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AOID_OpenInvestor '1' +///޸Ϣ +#define THOST_FTDC_AOID_ModifyIDCard '2' +///޸һϢ +#define THOST_FTDC_AOID_ModifyNoIDCard '3' +///뽻ױ +#define THOST_FTDC_AOID_ApplyTradingCode '4' +///ױ +#define THOST_FTDC_AOID_CancelTradingCode '5' +/// +#define THOST_FTDC_AOID_CancelInvestor '6' +///˻ +#define THOST_FTDC_AOID_FreezeAccount '8' +///˻ +#define THOST_FTDC_AOID_ActiveFreezeAccount '9' + +typedef char TThostFtdcApplyOperateIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyStatusIDTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δȫ +#define THOST_FTDC_ASID_NoComplete '1' +///ύ +#define THOST_FTDC_ASID_Submited '2' +/// +#define THOST_FTDC_ASID_Checked '3' +///Ѿܾ +#define THOST_FTDC_ASID_Refused '4' +///ɾ +#define THOST_FTDC_ASID_Deleted '5' + +typedef char TThostFtdcApplyStatusIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSendMethodTypeһͷʽ +///////////////////////////////////////////////////////////////////////// +///ļ +#define THOST_FTDC_UOASM_ByAPI '1' +///ӷ +#define THOST_FTDC_UOASM_ByFile '2' + +typedef char TThostFtdcSendMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcEventTypeType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcEventModeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EvM_ADD '1' +///޸ +#define THOST_FTDC_EvM_UPDATE '2' +///ɾ +#define THOST_FTDC_EvM_DELETE '3' +/// +#define THOST_FTDC_EvM_CHECK '4' +/// +#define THOST_FTDC_EvM_COPY '5' +///ע +#define THOST_FTDC_EvM_CANCEL '6' +/// +#define THOST_FTDC_EvM_Reverse '7' + +typedef char TThostFtdcEventModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAutoSendTypeһͳһԶ +///////////////////////////////////////////////////////////////////////// +///ԶͲ +#define THOST_FTDC_UOAA_ASR '1' +///ԶͣԶ +#define THOST_FTDC_UOAA_ASNR '2' +///ԶͣԶ +#define THOST_FTDC_UOAA_NSAR '3' +///ԶͣҲԶ +#define THOST_FTDC_UOAA_NSR '4' + +typedef char TThostFtdcUOAAutoSendType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcQueryDepthTypeһѯ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcQueryDepthType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataCenterIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDataCenterIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlowIDTypeһID +///////////////////////////////////////////////////////////////////////// +///Ͷ߶ӦͶ +#define THOST_FTDC_EvM_InvestorGroupFlow '1' +///Ͷ +#define THOST_FTDC_EvM_InvestorRate '2' +///Ͷģϵ +#define THOST_FTDC_EvM_InvestorCommRateModel '3' + +typedef char TThostFtdcFlowIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_CL_Zero '0' +///һ +#define THOST_FTDC_CL_One '1' +/// +#define THOST_FTDC_CL_Two '2' + +typedef char TThostFtdcCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckNoTypeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcCheckNoType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckStatusTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_CHS_Init '0' +/// +#define THOST_FTDC_CHS_Checking '1' +///Ѹ +#define THOST_FTDC_CHS_Checked '2' +///ܾ +#define THOST_FTDC_CHS_Refuse '3' +/// +#define THOST_FTDC_CHS_Cancel '4' + +typedef char TThostFtdcCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUsedStatusTypeһЧ״̬ +///////////////////////////////////////////////////////////////////////// +///δЧ +#define THOST_FTDC_CHU_Unused '0' +///Ч +#define THOST_FTDC_CHU_Used '1' +///Чʧ +#define THOST_FTDC_CHU_Fail '2' + +typedef char TThostFtdcUsedStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyStringTypeһڲѯͶֶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPropertyStringType[2049]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAcountOriginTypeһ˻Դ +///////////////////////////////////////////////////////////////////////// +///ֹ¼ +#define THOST_FTDC_BAO_ByAccProperty '0' +///ת +#define THOST_FTDC_BAO_ByFBTransfer '1' + +typedef char TThostFtdcBankAcountOriginType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMonthBillTradeSumTypeһ㵥±ɽܷʽ +///////////////////////////////////////////////////////////////////////// +///ͬͬԼ +#define THOST_FTDC_MBTS_ByInstrument '0' +///ͬͬԼͬ۸ +#define THOST_FTDC_MBTS_ByDayInsPrc '1' +///ͬԼ +#define THOST_FTDC_MBTS_ByDayIns '2' + +typedef char TThostFtdcMonthBillTradeSumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFBTTradeCodeEnumTypeһڽ״ö +///////////////////////////////////////////////////////////////////////// +///зתڻ +#define THOST_FTDC_FTC_BankLaunchBankToBroker '102001' +///ڻתڻ +#define THOST_FTDC_FTC_BrokerLaunchBankToBroker '202001' +///зڻת +#define THOST_FTDC_FTC_BankLaunchBrokerToBank '102002' +///ڻڻת +#define THOST_FTDC_FTC_BrokerLaunchBrokerToBank '202002' + +typedef char TThostFtdcFBTTradeCodeEnumType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateTemplateIDTypeһģʹ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRateTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimestampTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTimestampType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleNameTypeһŶι +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorIDRuleExprTypeһŶιʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorIDRuleExprType[513]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastDriftTypeһϴOTPƯֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastDriftType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLastSuccessTypeһϴOTPɹֵ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcLastSuccessType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthKeyTypeһԿ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthKeyType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSerialNumberTypeһк +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSerialNumberType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPTypeTypeһ̬ +///////////////////////////////////////////////////////////////////////// +///޶̬ +#define THOST_FTDC_OTP_NONE '0' +///ʱ +#define THOST_FTDC_OTP_TOTP '1' + +typedef char TThostFtdcOTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsIDTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsIDType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPVendorsNameTypeһ̬ṩ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOTPVendorsNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOTPStatusTypeһ̬״̬ +///////////////////////////////////////////////////////////////////////// +///δʹ +#define THOST_FTDC_OTPS_Unused '0' +///ʹ +#define THOST_FTDC_OTPS_Used '1' +///ע +#define THOST_FTDC_OTPS_Disuse '2' + +typedef char TThostFtdcOTPStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBrokerUserTypeTypeһù˾û +///////////////////////////////////////////////////////////////////////// +///Ͷ +#define THOST_FTDC_BUT_Investor '1' +///Ա +#define THOST_FTDC_BUT_BrokerUser '2' + +typedef char TThostFtdcBrokerUserTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFutureTypeTypeһڻ +///////////////////////////////////////////////////////////////////////// +///Ʒڻ +#define THOST_FTDC_FUTT_Commodity '1' +///ڻ +#define THOST_FTDC_FUTT_Financial '2' + +typedef char TThostFtdcFutureTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundEventTypeTypeһʽ +///////////////////////////////////////////////////////////////////////// +///ת޶ +#define THOST_FTDC_FET_Restriction '0' +///ת޶ +#define THOST_FTDC_FET_TodayRestriction '1' +///ˮ +#define THOST_FTDC_FET_Transfer '2' +///ʽ𶳽 +#define THOST_FTDC_FET_Credit '3' +///Ͷ߿ʽ +#define THOST_FTDC_FET_InvestorWithdrawAlm '4' +///ʻת޶ +#define THOST_FTDC_FET_BankRestriction '5' +///ǩԼ˻ +#define THOST_FTDC_FET_Accountregister '6' +/// +#define THOST_FTDC_FET_ExchangeFundIO '7' +///Ͷ߳ +#define THOST_FTDC_FET_InvestorFundIO '8' + +typedef char TThostFtdcFundEventTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSourceTypeTypeһʽ˻Դ +///////////////////////////////////////////////////////////////////////// +///ͬ +#define THOST_FTDC_AST_FBTransfer '0' +///ֹ¼ +#define THOST_FTDC_AST_ManualEntry '1' + +typedef char TThostFtdcAccountSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCodeSourceTypeTypeһױԴ +///////////////////////////////////////////////////////////////////////// +///ͳһ(ѹ淶) +#define THOST_FTDC_CST_UnifyAccount '0' +///ֹ¼(δ淶) +#define THOST_FTDC_CST_ManualEntry '1' + +typedef char TThostFtdcCodeSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserRangeTypeһԱΧ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_UR_All '0' +///һԱ +#define THOST_FTDC_UR_Single '1' + +typedef char TThostFtdcUserRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTimeSpanTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcTimeSpanType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcImportSequenceIDTypeһ̬Ƶα +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcImportSequenceIDType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByGroupTypeһͳƱͻͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ͷͳ +#define THOST_FTDC_BG_Investor '2' +///ͳ +#define THOST_FTDC_BG_Group '1' + +typedef char TThostFtdcByGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSumStatModeTypeһͳƱΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Լͳ +#define THOST_FTDC_TSSM_Instrument '1' +///Ʒͳ +#define THOST_FTDC_TSSM_Product '2' +///ͳ +#define THOST_FTDC_TSSM_Exchange '3' + +typedef char TThostFtdcTradeSumStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcComTypeTypeһϳɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcComTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductIDTypeһƷʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductNameTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUserProductMemoTypeһƷ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUserProductMemoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCCancelFlagTypeһ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCCancelFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCDateType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorNameType[201]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenInvestorNameTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenInvestorNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCInvestorIDTypeһͻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCInvestorIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCIdentifiedCardNoTypeһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCIdentifiedCardNoType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCClientIDTypeһױ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCClientIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankFlagTypeһбʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankFlagType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCBankAccountTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCBankAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOpenNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOpenNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemoTypeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTimeTypeһʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTimeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTradeIDTypeһɽˮ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTradeIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCExchangeInstIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCExchangeInstIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMortgageNameTypeһѺƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMortgageNameType[7]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCReasonTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCReasonType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsSettlementTypeһǷΪǽԱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcIsSettlementType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCPriceTypeһ۸ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCPriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCOptionsTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCStrikePriceTypeһִм +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCSRCStrikePriceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetProductIDTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetProductIDType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCTargetInstrIDTypeһĺԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCTargetInstrIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelNameType[161]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCommModelMemoTypeһģ屸ע +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCommModelMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExprSetModeTypeһڱʽ +///////////////////////////////////////////////////////////////////////// +///й +#define THOST_FTDC_ESM_Relative '1' +/// +#define THOST_FTDC_ESM_Typical '2' + +typedef char TThostFtdcExprSetModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRateInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +///˾׼ +#define THOST_FTDC_RIR_All '1' +///ģ +#define THOST_FTDC_RIR_Model '2' +///һͶ +#define THOST_FTDC_RIR_Single '3' + +typedef char TThostFtdcRateInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAgentBrokerIDTypeһ͹˾ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAgentBrokerIDType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityIDTypeһĴ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDRIdentityIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDRIdentityNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDRIdentityNameType[65]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDBLinkIDTypeһDBLinkʶ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDBLinkIDType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSyncDataStatusTypeһϵͳͬ״̬ +///////////////////////////////////////////////////////////////////////// +///δͬ +#define THOST_FTDC_SDS_Initialize '0' +///ͬ +#define THOST_FTDC_SDS_Settlementing '1' +///ͬ +#define THOST_FTDC_SDS_Settlemented '2' + +typedef char TThostFtdcSyncDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSourceTypeһɽԴ +///////////////////////////////////////////////////////////////////////// +///Խͨر +#define THOST_FTDC_TSRC_NORMAL '0' +///Բѯ +#define THOST_FTDC_TSRC_QUERY '1' + +typedef char TThostFtdcTradeSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFlexStatModeTypeһƷԼͳƷʽ +///////////////////////////////////////////////////////////////////////// +///Ʒͳ +#define THOST_FTDC_FSM_Product '1' +///ͳ +#define THOST_FTDC_FSM_Exchange '2' +///ͳ +#define THOST_FTDC_FSM_All '3' + +typedef char TThostFtdcFlexStatModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcByInvestorRangeTypeһͶ߷ΧͳƷʽ +///////////////////////////////////////////////////////////////////////// +///ͳ +#define THOST_FTDC_BIR_Property '1' +///ͳ +#define THOST_FTDC_BIR_All '2' + +typedef char TThostFtdcByInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSRiskRateTypeһն +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSRiskRateType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSequenceNo12Typeһ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcSequenceNo12Type; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPropertyInvestorRangeTypeһͶ߷Χ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_PIR_All '1' +///Ͷ +#define THOST_FTDC_PIR_Property '2' +///һͶ +#define THOST_FTDC_PIR_Single '3' + +typedef char TThostFtdcPropertyInvestorRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileStatusTypeһļ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_FIS_NoCreate '0' +/// +#define THOST_FTDC_FIS_Created '1' +///ʧ +#define THOST_FTDC_FIS_Failed '2' + +typedef char TThostFtdcFileStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFileGenStyleTypeһļɷʽ +///////////////////////////////////////////////////////////////////////// +///· +#define THOST_FTDC_FGS_FileTransmit '0' +/// +#define THOST_FTDC_FGS_FileGen '1' + +typedef char TThostFtdcFileGenStyleType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperModeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SoM_Add '1' +///޸ +#define THOST_FTDC_SoM_Update '2' +///ɾ +#define THOST_FTDC_SoM_Delete '3' +/// +#define THOST_FTDC_SoM_Copy '4' +/// +#define THOST_FTDC_SoM_AcTive '5' +///ע +#define THOST_FTDC_SoM_CanCel '6' +/// +#define THOST_FTDC_SoM_ReSet '7' + +typedef char TThostFtdcSysOperModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSysOperTypeTypeһϵͳ־ +///////////////////////////////////////////////////////////////////////// +///޸IJԱ +#define THOST_FTDC_SoT_UpdatePassword '0' +///Աܹ֯ϵ +#define THOST_FTDC_SoT_UserDepartment '1' +///ɫ +#define THOST_FTDC_SoT_RoleManager '2' +///ɫ +#define THOST_FTDC_SoT_RoleFunction '3' +/// +#define THOST_FTDC_SoT_BaseParam '4' +///òԱ +#define THOST_FTDC_SoT_SetUserID '5' +///ûɫ +#define THOST_FTDC_SoT_SetUserRole '6' +///ûIP +#define THOST_FTDC_SoT_UserIpRestriction '7' +///ܹ֯ +#define THOST_FTDC_SoT_DepartmentManager '8' +///ܹ֯ѯิ +#define THOST_FTDC_SoT_DepartmentCopy '9' +///ױ +#define THOST_FTDC_SoT_Tradingcode 'A' +///Ͷ״̬ά +#define THOST_FTDC_SoT_InvestorStatus 'B' +///ͶȨ޹ +#define THOST_FTDC_SoT_InvestorAuthority 'C' +/// +#define THOST_FTDC_SoT_PropertySet 'D' +///Ͷ +#define THOST_FTDC_SoT_ReSetInvestorPasswd 'E' +///Ͷ߸Ϣά +#define THOST_FTDC_SoT_InvestorPersonalityInfo 'F' + +typedef char TThostFtdcSysOperTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCDataQueyTypeTypeһϱݲѯ +///////////////////////////////////////////////////////////////////////// +///ѯǰձ͵ +#define THOST_FTDC_CSRCQ_Current '0' +///ѯʷ͵Ĵ͹˾ +#define THOST_FTDC_CSRCQ_History '1' + +typedef char TThostFtdcCSRCDataQueyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///Ծ +#define THOST_FTDC_FRS_Normal '1' +/// +#define THOST_FTDC_FRS_Freeze '0' + +typedef char TThostFtdcFreezeStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStandardStatusTypeһ淶״̬ +///////////////////////////////////////////////////////////////////////// +///ѹ淶 +#define THOST_FTDC_STST_Standard '0' +///δ淶 +#define THOST_FTDC_STST_NonStandard '1' + +typedef char TThostFtdcStandardStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFreezeStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCFreezeStatusType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightParamTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///߻ +#define THOST_FTDC_RPT_Freeze '1' +///߻ +#define THOST_FTDC_RPT_FreezeActive '2' +///Ȩ +#define THOST_FTDC_RPT_OpenLimit '3' +///Ȩ +#define THOST_FTDC_RPT_RelieveOpenLimit '4' + +typedef char TThostFtdcRightParamTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateIDTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRightTemplateNameTypeһģ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcRightTemplateNameType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataStatusTypeһϴǮ˱״̬ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDS_Normal '0' +///ɾ +#define THOST_FTDC_AMLDS_Deleted '1' + +typedef char TThostFtdcDataStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAMLCheckStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_AMLCHS_Init '0' +/// +#define THOST_FTDC_AMLCHS_Checking '1' +///Ѹ +#define THOST_FTDC_AMLCHS_Checked '2' +///ܾϱ +#define THOST_FTDC_AMLCHS_RefuseReport '3' + +typedef char TThostFtdcAMLCheckStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlDateTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMLDT_DrawDay '0' +/// +#define THOST_FTDC_AMLDT_TouchDay '1' + +typedef char TThostFtdcAmlDateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckLevelTypeһ˼ +///////////////////////////////////////////////////////////////////////// +///㼶 +#define THOST_FTDC_AMLCL_CheckLevel0 '0' +///һ +#define THOST_FTDC_AMLCL_CheckLevel1 '1' +/// +#define THOST_FTDC_AMLCL_CheckLevel2 '2' +/// +#define THOST_FTDC_AMLCL_CheckLevel3 '3' + +typedef char TThostFtdcAmlCheckLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmlCheckFlowTypeһϴǮݳȡ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmlCheckFlowType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcDataTypeType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExportFileTypeTypeһļ +///////////////////////////////////////////////////////////////////////// +///CSV +#define THOST_FTDC_EFT_CSV '0' +///Excel +#define THOST_FTDC_EFT_EXCEL '1' +///DBF +#define THOST_FTDC_EFT_DBF '2' + +typedef char TThostFtdcExportFileTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ǰ׼ +#define THOST_FTDC_SMT_Before '1' +/// +#define THOST_FTDC_SMT_Settlement '2' +///˶ +#define THOST_FTDC_SMT_After '3' +/// +#define THOST_FTDC_SMT_Settlemented '4' + +typedef char TThostFtdcSettleManagerTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerIDTypeһô +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerIDType[33]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSettleManagerNameType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerLevelTypeһõȼ +///////////////////////////////////////////////////////////////////////// +///Ҫ +#define THOST_FTDC_SML_Must '1' +/// +#define THOST_FTDC_SML_Alarm '2' +///ʾ +#define THOST_FTDC_SML_Prompt '3' +/// +#define THOST_FTDC_SML_Ignore '4' + +typedef char TThostFtdcSettleManagerLevelType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettleManagerGroupTypeһģ +///////////////////////////////////////////////////////////////////////// +///˶ +#define THOST_FTDC_SMG_Exhcange '1' +///ڲ˶ +#define THOST_FTDC_SMG_ASP '2' +///ϱݺ˶ +#define THOST_FTDC_SMG_CSRC '3' + +typedef char TThostFtdcSettleManagerGroupType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckResultMemoTypeһ˶Խ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCheckResultMemoType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFunctionUrlTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcFunctionUrlType[1025]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthInfoTypeһͻ֤Ϣ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthInfoType[129]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAuthCodeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAuthCodeType[17]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLimitUseTypeTypeһֵʹ +///////////////////////////////////////////////////////////////////////// +///ظʹ +#define THOST_FTDC_LUT_Repeatable '1' +///ظʹ +#define THOST_FTDC_LUT_Unrepeatable '2' + +typedef char TThostFtdcLimitUseTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDataResourceTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_DAR_Settle '1' +/// +#define THOST_FTDC_DAR_Exchange '2' +/// +#define THOST_FTDC_DAR_CSRC '3' + +typedef char TThostFtdcDataResourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginTypeTypeһ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MGT_ExchMarginRate '0' +///Ͷ֤߱ +#define THOST_FTDC_MGT_InstrMarginRate '1' +///Ͷ߽ױ֤ +#define THOST_FTDC_MGT_InstrMarginRateTrade '2' + +typedef char TThostFtdcMarginTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActiveTypeTypeһЧ +///////////////////////////////////////////////////////////////////////// +///Ч +#define THOST_FTDC_ACT_Intraday '1' +///Ч +#define THOST_FTDC_ACT_Long '2' + +typedef char TThostFtdcActiveTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMarginRateTypeTypeһͻ֤ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_MRT_Exchange '1' +///Ͷ֤߱ +#define THOST_FTDC_MRT_Investor '2' +///Ͷ߽ױ֤ +#define THOST_FTDC_MRT_InvestorTrade '3' + +typedef char TThostFtdcMarginRateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBackUpStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_BUS_UnBak '0' +/// +#define THOST_FTDC_BUS_BakUp '1' +///ɱ +#define THOST_FTDC_BUS_BakUped '2' +///ʧ +#define THOST_FTDC_BUS_BakFail '3' + +typedef char TThostFtdcBackUpStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInitSettlementTypeһʼ״̬ +///////////////////////////////////////////////////////////////////////// +///ʼδʼ +#define THOST_FTDC_SIS_UnInitialize '0' +///ʼ +#define THOST_FTDC_SIS_Initialize '1' +///ʼ +#define THOST_FTDC_SIS_Initialized '2' + +typedef char TThostFtdcInitSettlementType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReportStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///δɱ +#define THOST_FTDC_SRS_NoCreate '0' +/// +#define THOST_FTDC_SRS_Create '1' +///ɱ +#define THOST_FTDC_SRS_Created '2' +///ɱʧ +#define THOST_FTDC_SRS_CreateFail '3' + +typedef char TThostFtdcReportStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSaveStatusTypeһݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///鵵δ +#define THOST_FTDC_SSS_UnSaveData '0' +///鵵 +#define THOST_FTDC_SSS_SaveDatad '1' + +typedef char TThostFtdcSaveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSettArchiveStatusTypeһȷݹ鵵״̬ +///////////////////////////////////////////////////////////////////////// +///δ鵵 +#define THOST_FTDC_SAS_UnArchived '0' +///ݹ鵵 +#define THOST_FTDC_SAS_Archiving '1' +///ѹ鵵 +#define THOST_FTDC_SAS_Archived '2' +///鵵ʧ +#define THOST_FTDC_SAS_ArchiveFail '3' + +typedef char TThostFtdcSettArchiveStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCTPTypeTypeһCTPϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ +#define THOST_FTDC_CTPT_Unkown '0' +/// +#define THOST_FTDC_CTPT_MainCenter '1' +/// +#define THOST_FTDC_CTPT_BackUp '2' + +typedef char TThostFtdcCTPTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolIDTypeһߴ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolIDType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcToolNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcToolNameType[81]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCloseDealTypeTypeһƽִ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CDT_Normal '0' +///Ͷƽ +#define THOST_FTDC_CDT_SpecFirst '1' + +typedef char TThostFtdcCloseDealTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMortgageFundUseRangeTypeһѺʽ÷Χ +///////////////////////////////////////////////////////////////////////// +///ʹ +#define THOST_FTDC_MFUR_None '0' +///ڱ֤ +#define THOST_FTDC_MFUR_Margin '1' +///ѡӯ֤ +#define THOST_FTDC_MFUR_All '2' + +typedef char TThostFtdcMortgageFundUseRangeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyUnitTypeһֵλ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcCurrencyUnitType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExchangeRateTypeһ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcExchangeRateType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSpecProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///֣ױƷ +#define THOST_FTDC_SPT_CzceHedge '1' +///ѺƷ +#define THOST_FTDC_SPT_IneForeignCurrency '2' +///߿ƽֲƷ +#define THOST_FTDC_SPT_DceOpenClose '3' + +typedef char TThostFtdcSpecProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortgageTypeTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Ѻ +#define THOST_FTDC_FMT_Mortgage '1' +/// +#define THOST_FTDC_FMT_Redemption '2' + +typedef char TThostFtdcFundMortgageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAccountSettlementParamIDTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +///֤ +#define THOST_FTDC_ASPI_BaseMargin '1' +///Ȩ׼ +#define THOST_FTDC_ASPI_LowestInterest '2' + +typedef char TThostFtdcAccountSettlementParamIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencyNameTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencyNameType[31]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySignTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySignType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionTypeһѺ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FMD_In '1' +///ʳ +#define THOST_FTDC_FMD_Out '2' + +typedef char TThostFtdcFundMortDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessClassTypeһ +///////////////////////////////////////////////////////////////////////// +///ӯ +#define THOST_FTDC_BT_Profit '0' +/// +#define THOST_FTDC_BT_Loss '1' +/// +#define THOST_FTDC_BT_Other 'Z' + +typedef char TThostFtdcBusinessClassType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapSourceTypeTypeһԴ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_SST_Manual '0' +///Զ +#define THOST_FTDC_SST_Automatic '1' + +typedef char TThostFtdcSwapSourceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExDirectionTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CED_Settlement '0' +///ۻ +#define THOST_FTDC_CED_Sale '1' + +typedef char TThostFtdcCurrExDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapStatusTypeһ״̬ +///////////////////////////////////////////////////////////////////////// +///¼ +#define THOST_FTDC_CSS_Entry '1' +/// +#define THOST_FTDC_CSS_Approve '2' +///Ѿܾ +#define THOST_FTDC_CSS_Refuse '3' +///ѳ +#define THOST_FTDC_CSS_Revoke '4' +///ѷ +#define THOST_FTDC_CSS_Send '5' +///ɹ +#define THOST_FTDC_CSS_Success '6' +///ʧ +#define THOST_FTDC_CSS_Failure '7' + +typedef char TThostFtdcCurrencySwapStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrExchCertNoTypeһƾ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrExchCertNoType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBatchSerialNoTypeһκ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBatchSerialNoType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcReqFlagTypeһ㷢ͱ־ +///////////////////////////////////////////////////////////////////////// +///δ +#define THOST_FTDC_REQF_NoSend '0' +///ͳɹ +#define THOST_FTDC_REQF_SendSuccess '1' +///ʧ +#define THOST_FTDC_REQF_SendFailed '2' +///ȴط +#define THOST_FTDC_REQF_WaitReSend '3' + +typedef char TThostFtdcReqFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcResFlagTypeһ㷵سɹ־ +///////////////////////////////////////////////////////////////////////// +///ɹ +#define THOST_FTDC_RESF_Success '0' +///˻ +#define THOST_FTDC_RESF_InsuffiCient '1' +///׽δ֪ +#define THOST_FTDC_RESF_UnKnown '8' + +typedef char TThostFtdcResFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPageControlTypeһҳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPageControlType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcRecordCountTypeһ¼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcRecordCountType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCurrencySwapMemoTypeһȷϢ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCurrencySwapMemoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExStatusTypeһ޸״̬ +///////////////////////////////////////////////////////////////////////// +///޸ǰ +#define THOST_FTDC_EXS_Before '0' +///޸ĺ +#define THOST_FTDC_EXS_After '1' + +typedef char TThostFtdcExStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientRegionTypeһͻ +///////////////////////////////////////////////////////////////////////// +///ڿͻ +#define THOST_FTDC_CR_Domestic '1' +///۰̨ͻ +#define THOST_FTDC_CR_GMT '2' +///ͻ +#define THOST_FTDC_CR_Foreign '3' + +typedef char TThostFtdcClientRegionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWorkPlaceTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWorkPlaceType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBusinessPeriodTypeһӪ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBusinessPeriodType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcWebSiteTypeһַ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcWebSiteType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAIdCardTypeTypeһͳһ֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAIdCardTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcClientModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcClientModeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestorFullNameTypeһͶȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestorFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOABrokerIDTypeһнID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOABrokerIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAZipCodeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAZipCodeType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAEMailTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOAEMailType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOldCityTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcOldCityType[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCorporateIdentifiedCardNoTypeһ˴֤ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCorporateIdentifiedCardNoType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasBoardTypeһǷж» +///////////////////////////////////////////////////////////////////////// +///û +#define THOST_FTDC_HB_No '0' +/// +#define THOST_FTDC_HB_Yes '1' + +typedef char TThostFtdcHasBoardType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStartModeTypeһģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_SM_Normal '1' +///Ӧ +#define THOST_FTDC_SM_Emerge '2' +///ָ +#define THOST_FTDC_SM_Restore '3' + +typedef char TThostFtdcStartModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTemplateTypeTypeһģ +///////////////////////////////////////////////////////////////////////// +///ȫ +#define THOST_FTDC_TPT_Full '1' +/// +#define THOST_FTDC_TPT_Increment '2' +/// +#define THOST_FTDC_TPT_BackUp '3' + +typedef char TThostFtdcTemplateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLoginModeTypeһ¼ģʽ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LM_Trade '0' +///ת +#define THOST_FTDC_LM_Transfer '1' + +typedef char TThostFtdcLoginModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPromptTypeTypeһʾ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CPT_Instrument '1' +///ֶ֤Ч +#define THOST_FTDC_CPT_Margin '2' + +typedef char TThostFtdcPromptTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageIDTypeһֻʲ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageIDType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInvestVarietyTypeһͶƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInvestVarietyType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBankAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcBankAccountTypeType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLedgerManageBankTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcLedgerManageBankType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentNameTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCffexDepartmentCodeTypeһӪҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCffexDepartmentCodeType[9]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHasTrusteeTypeһǷй +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_HT_Yes '1' +///û +#define THOST_FTDC_HT_No '0' + +typedef char TThostFtdcHasTrusteeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCMemo1Typeһ˵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCMemo1Type[41]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrCFullNameTypeһʲҵڻ˾ȫ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrCFullNameType[101]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrApprovalNOTypeһʲҵĺ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrApprovalNOType[51]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrMgrNameTypeһʲҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAssetmgrMgrNameType[401]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_AMT_Bank '1' +///֤ȯ˾ +#define THOST_FTDC_AMT_Securities '2' +///˾ +#define THOST_FTDC_AMT_Fund '3' +///չ˾ +#define THOST_FTDC_AMT_Insurance '4' +///й˾ +#define THOST_FTDC_AMT_Trust '5' +/// +#define THOST_FTDC_AMT_Other '9' + +typedef char TThostFtdcAmTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCAmTypeTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCAmTypeType[5]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCFundIOTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CFIOT_FundIO '0' +///ڻ +#define THOST_FTDC_CFIOT_SwapCurrency '1' + +typedef char TThostFtdcCSRCFundIOTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCusAccountTypeTypeһ˻ +///////////////////////////////////////////////////////////////////////// +///ڻ˻ +#define THOST_FTDC_CAT_Futures '1' +///ڻʹҵµʹܽ˻ +#define THOST_FTDC_CAT_AssetmgrFuture '2' +///ۺʹҵµڻʹй˻ +#define THOST_FTDC_CAT_AssetmgrTrustee '3' +///ۺʹҵµʽת˻ +#define THOST_FTDC_CAT_AssetmgrTransfer '4' + +typedef char TThostFtdcCusAccountTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCNationalTypeһ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCNationalType[4]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCSRCSecAgentIDTypeһID +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCSRCSecAgentIDType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLanguageTypeTypeһ֪ͨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LT_Chinese '1' +///Ӣ +#define THOST_FTDC_LT_English '2' + +typedef char TThostFtdcLanguageTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAmAccountTypeһͶ˻ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcAmAccountType[23]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///ʹܿͻ +#define THOST_FTDC_AMCT_Person '1' +///λʹܿͻ +#define THOST_FTDC_AMCT_Organ '2' +///ⵥλʹܿͻ +#define THOST_FTDC_AMCT_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_ASST_Futures '3' +///ۺ +#define THOST_FTDC_ASST_SpecialOrgan '4' + +typedef char TThostFtdcAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOMTypeһλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcUOMType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEInstLifePhaseTypeһԼ״̬ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEInstLifePhaseType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEProductClassTypeһƷ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSHFEProductClassType[11]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcPriceDecimalTypeһ۸Сλ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcPriceDecimalType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInTheMoneyFlagTypeһƽֵȨ־ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcInTheMoneyFlagType[2]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCheckInstrTypeTypeһԼȽ +///////////////////////////////////////////////////////////////////////// +///Լ +#define THOST_FTDC_CIT_HasExch '0' +///Լϵͳ +#define THOST_FTDC_CIT_HasATP '1' +///ԼȽϲһ +#define THOST_FTDC_CIT_HasDiff '2' + +typedef char TThostFtdcCheckInstrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDeliveryTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ֹ +#define THOST_FTDC_DT_HandDeliv '1' +///ڽ +#define THOST_FTDC_DT_PersonDeliv '2' + +typedef char TThostFtdcDeliveryTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBigMoneyTypeһʽ +///////////////////////////////////////////////////////////////////////// +typedef double TThostFtdcBigMoneyType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcMaxMarginSideAlgorithmTypeһ֤߱㷨 +///////////////////////////////////////////////////////////////////////// +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_NO '0' +///ʹô֤߱㷨 +#define THOST_FTDC_MMSA_YES '1' + +typedef char TThostFtdcMaxMarginSideAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDAClientTypeTypeһʲͻ +///////////////////////////////////////////////////////////////////////// +///Ȼ +#define THOST_FTDC_CACT_Person '0' +/// +#define THOST_FTDC_CACT_Company '1' +/// +#define THOST_FTDC_CACT_Other '2' + +typedef char TThostFtdcDAClientTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinInstrIDTypeһԼ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinInstrIDType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinSettlePriceTypeһȽ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcCombinSettlePriceType[61]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEPriorityTypeһȼ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcDCEPriorityType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeGroupIDTypeһɽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcTradeGroupIDType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcIsCheckPrepaTypeһǷУ鿪ʽ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcIsCheckPrepaType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcUOAAssetmgrTypeTypeһͶ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_UOAAT_Futures '1' +///ۺ +#define THOST_FTDC_UOAAT_SpecialOrgan '2' + +typedef char TThostFtdcUOAAssetmgrTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Buy +#define THOST_FTDC_DEN_Buy '0' +///Sell +#define THOST_FTDC_DEN_Sell '1' + +typedef char TThostFtdcDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOffsetFlagEnTypeһƽ־ +///////////////////////////////////////////////////////////////////////// +///Position Opening +#define THOST_FTDC_OFEN_Open '0' +///Position Close +#define THOST_FTDC_OFEN_Close '1' +///Forced Liquidation +#define THOST_FTDC_OFEN_ForceClose '2' +///Close Today +#define THOST_FTDC_OFEN_CloseToday '3' +///Close Prev. +#define THOST_FTDC_OFEN_CloseYesterday '4' +///Forced Reduction +#define THOST_FTDC_OFEN_ForceOff '5' +///Local Forced Liquidation +#define THOST_FTDC_OFEN_LocalForceClose '6' + +typedef char TThostFtdcOffsetFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcHedgeFlagEnTypeһͶױ־ +///////////////////////////////////////////////////////////////////////// +///Speculation +#define THOST_FTDC_HFEN_Speculation '1' +///Arbitrage +#define THOST_FTDC_HFEN_Arbitrage '2' +///Hedge +#define THOST_FTDC_HFEN_Hedge '3' + +typedef char TThostFtdcHedgeFlagEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundIOTypeEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit/Withdrawal +#define THOST_FTDC_FIOTEN_FundIO '1' +///Bank-Futures Transfer +#define THOST_FTDC_FIOTEN_Transfer '2' +///Bank-Futures FX Exchange +#define THOST_FTDC_FIOTEN_SwapCurrency '3' + +typedef char TThostFtdcFundIOTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundTypeEnTypeһʽ +///////////////////////////////////////////////////////////////////////// +///Bank Deposit +#define THOST_FTDC_FTEN_Deposite '1' +///Payment/Fee +#define THOST_FTDC_FTEN_ItemFund '2' +///Brokerage Adj +#define THOST_FTDC_FTEN_Company '3' +///Internal Transfer +#define THOST_FTDC_FTEN_InnerTransfer '4' + +typedef char TThostFtdcFundTypeEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundDirectionEnTypeһ +///////////////////////////////////////////////////////////////////////// +///Deposit +#define THOST_FTDC_FDEN_In '1' +///Withdrawal +#define THOST_FTDC_FDEN_Out '2' + +typedef char TThostFtdcFundDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFundMortDirectionEnTypeһѺ +///////////////////////////////////////////////////////////////////////// +///Pledge +#define THOST_FTDC_FMDEN_In '1' +///Redemption +#define THOST_FTDC_FMDEN_Out '2' + +typedef char TThostFtdcFundMortDirectionEnType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSwapBusinessTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcSwapBusinessTypeType[3]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionsTypeTypeһȨ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CP_CallOptions '1' +/// +#define THOST_FTDC_CP_PutOptions '2' + +typedef char TThostFtdcOptionsTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeModeTypeһִзʽ +///////////////////////////////////////////////////////////////////////// +///ŷʽ +#define THOST_FTDC_STM_Continental '0' +///ʽ +#define THOST_FTDC_STM_American '1' +///Ľ +#define THOST_FTDC_STM_Bermuda '2' + +typedef char TThostFtdcStrikeModeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///Գ +#define THOST_FTDC_STT_Hedge '0' +///ƥִ +#define THOST_FTDC_STT_Match '1' + +typedef char TThostFtdcStrikeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcApplyTypeTypeһнȨִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_APPT_NotStrikeNum '4' + +typedef char TThostFtdcApplyTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcGiveUpDataSourceTypeһִԴ +///////////////////////////////////////////////////////////////////////// +///ϵͳ +#define THOST_FTDC_GUDS_Gen '0' +///ֹ +#define THOST_FTDC_GUDS_Hand '1' + +typedef char TThostFtdcGiveUpDataSourceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderSysIDTypeһִϵͳ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcExecOrderSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecResultTypeһִн +///////////////////////////////////////////////////////////////////////// +///ûִ +#define THOST_FTDC_OER_NoExec 'n' +///Ѿȡ +#define THOST_FTDC_OER_Canceled 'c' +///ִгɹ +#define THOST_FTDC_OER_OK '0' +///Ȩֲֲ +#define THOST_FTDC_OER_NoPosition '1' +///ʽ𲻹 +#define THOST_FTDC_OER_NoDeposit '2' +///Ա +#define THOST_FTDC_OER_NoParticipant '3' +///ͻ +#define THOST_FTDC_OER_NoClient '4' +///Լ +#define THOST_FTDC_OER_NoInstrument '6' +///ûִȨ +#define THOST_FTDC_OER_NoRight '7' +/// +#define THOST_FTDC_OER_InvalidVolume '8' +///û㹻ʷɽ +#define THOST_FTDC_OER_NoEnoughHistoryTrade '9' +///δ֪ +#define THOST_FTDC_OER_Unknown 'a' + +typedef char TThostFtdcExecResultType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeSequenceTypeһִ +///////////////////////////////////////////////////////////////////////// +typedef int TThostFtdcStrikeSequenceType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStrikeTimeTypeһִʱ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStrikeTimeType[13]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombinationTypeTypeһ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_COMBT_Future '0' +///ֱ۲BUL +#define THOST_FTDC_COMBT_BUL '1' +///ֱ۲BER +#define THOST_FTDC_COMBT_BER '2' +///ʽ +#define THOST_FTDC_COMBT_STD '3' +///ʽ +#define THOST_FTDC_COMBT_STG '4' +/// +#define THOST_FTDC_COMBT_PRT '5' +///ʱ۲ +#define THOST_FTDC_COMBT_CLD '6' + +typedef char TThostFtdcCombinationTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcOptionRoyaltyPriceTypeTypeһȨȨ۸ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_ORPT_PreSettlementPrice '1' +///ּ +#define THOST_FTDC_ORPT_OpenPrice '4' + +typedef char TThostFtdcOptionRoyaltyPriceTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBalanceAlgorithmTypeһȨ㷨 +///////////////////////////////////////////////////////////////////////// +///Ȩֵӯ +#define THOST_FTDC_BLAG_Default '1' +///Ȩֵ +#define THOST_FTDC_BLAG_IncludeOptValLost '2' + +typedef char TThostFtdcBalanceAlgorithmType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcActionTypeTypeһִ +///////////////////////////////////////////////////////////////////////// +///ִ +#define THOST_FTDC_ACTP_Exec '1' +/// +#define THOST_FTDC_ACTP_Abandon '2' + +typedef char TThostFtdcActionTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcForQuoteStatusTypeһѯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_FQST_Submitted 'a' +///Ѿ +#define THOST_FTDC_FQST_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_FQST_Rejected 'c' + +typedef char TThostFtdcForQuoteStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcValueMethodTypeһȡֵʽ +///////////////////////////////////////////////////////////////////////// +///ֵ +#define THOST_FTDC_VM_Absolute '0' +/// +#define THOST_FTDC_VM_Ratio '1' + +typedef char TThostFtdcValueMethodType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderPositionFlagTypeһȨȨǷڻͷı +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_EOPF_Reserve '0' +/// +#define THOST_FTDC_EOPF_UnReserve '1' + +typedef char TThostFtdcExecOrderPositionFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcExecOrderCloseFlagTypeһȨȨɵͷǷԶƽ +///////////////////////////////////////////////////////////////////////// +///Զƽ +#define THOST_FTDC_EOCF_AutoClose '0' +///Զƽ +#define THOST_FTDC_EOCF_NotToClose '1' + +typedef char TThostFtdcExecOrderCloseFlagType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcProductTypeTypeһƷ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_PTE_Futures '1' +///Ȩ +#define THOST_FTDC_PTE_Options '2' + +typedef char TThostFtdcProductTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCZCEUploadFileNameTypeһ֣ļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_zz_\d{4} +#define THOST_FTDC_CUFN_CUFN_O 'O' +///^\d{8}ɽ +#define THOST_FTDC_CUFN_CUFN_T 'T' +///^\d{8}ȳֱֲnew +#define THOST_FTDC_CUFN_CUFN_P 'P' +///^\d{8}ƽ˽ +#define THOST_FTDC_CUFN_CUFN_N 'N' +///^\d{8}ƽֱ +#define THOST_FTDC_CUFN_CUFN_L 'L' +///^\d{8}ʽ +#define THOST_FTDC_CUFN_CUFN_F 'F' +///^\d{8}ϳֱֲ +#define THOST_FTDC_CUFN_CUFN_C 'C' +///^\d{8}֤ +#define THOST_FTDC_CUFN_CUFN_M 'M' + +typedef char TThostFtdcCZCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDCEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{8}_dl_\d{3} +#define THOST_FTDC_DUFN_DUFN_O 'O' +///^\d{8}_ɽ +#define THOST_FTDC_DUFN_DUFN_T 'T' +///^\d{8}_ֱֲ +#define THOST_FTDC_DUFN_DUFN_P 'P' +///^\d{8}_ʽ +#define THOST_FTDC_DUFN_DUFN_F 'F' +///^\d{8}_Żϳֲϸ +#define THOST_FTDC_DUFN_DUFN_C 'C' +///^\d{8}_ֲϸ +#define THOST_FTDC_DUFN_DUFN_D 'D' +///^\d{8}_֤ +#define THOST_FTDC_DUFN_DUFN_M 'M' +///^\d{8}_Ȩִб +#define THOST_FTDC_DUFN_DUFN_S 'S' + +typedef char TThostFtdcDCEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcSHFEUploadFileNameTypeһļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_\d{8}_\d{8}_DailyFundChg +#define THOST_FTDC_SUFN_SUFN_O 'O' +///^\d{4}_\d{8}_\d{8}_Trade +#define THOST_FTDC_SUFN_SUFN_T 'T' +///^\d{4}_\d{8}_\d{8}_SettlementDetail +#define THOST_FTDC_SUFN_SUFN_P 'P' +///^\d{4}_\d{8}_\d{8}_Capital +#define THOST_FTDC_SUFN_SUFN_F 'F' + +typedef char TThostFtdcSHFEUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCFFEXUploadFileNameTypeһнļ +///////////////////////////////////////////////////////////////////////// +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade +#define THOST_FTDC_CFUFN_SUFN_T 'T' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail +#define THOST_FTDC_CFUFN_SUFN_P 'P' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital +#define THOST_FTDC_CFUFN_SUFN_F 'F' +///^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec +#define THOST_FTDC_CFUFN_SUFN_S 'S' + +typedef char TThostFtdcCFFEXUploadFileNameType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcCombDirectionTypeһָ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_CMDR_Comb '0' +/// +#define THOST_FTDC_CMDR_UnComb '1' + +typedef char TThostFtdcCombDirectionType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLockTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_LCKT_Lock '1' +/// +#define THOST_FTDC_LCKT_Unlock '2' + +typedef char TThostFtdcLockTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcBizTypeTypeһҵ +///////////////////////////////////////////////////////////////////////// +///ڻ +#define THOST_FTDC_BZTP_Future '1' +///֤ȯ +#define THOST_FTDC_BZTP_Stock '2' + +typedef char TThostFtdcBizTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcDesignateTypeTypeһָ +///////////////////////////////////////////////////////////////////////// +///ָǼ +#define THOST_FTDC_DSTP_Register '1' +///ָ +#define THOST_FTDC_DSTP_Cancel '2' + +typedef char TThostFtdcDesignateTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeReasonTypeTypeһԭ +///////////////////////////////////////////////////////////////////////// +///ʼ +#define THOST_FTDC_FRTP_Init '1' +/// +#define THOST_FTDC_FRTP_Lock '2' +///ִ +#define THOST_FTDC_FRTP_Exec '3' +///λУ +#define THOST_FTDC_FRTP_Check '4' +///E+1ִж +#define THOST_FTDC_FRTP_ExecFreeze '5' + +typedef char TThostFtdcFreezeReasonTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcFreezeTypeTypeһ +///////////////////////////////////////////////////////////////////////// +/// +#define THOST_FTDC_FZTP_Freeze '1' +///ⶳ +#define THOST_FTDC_FZTP_Unfreeze '2' +///ǿִ +#define THOST_FTDC_FZTP_Force '3' + +typedef char TThostFtdcFreezeTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcTradeSystemTypeTypeһϵͳ +///////////////////////////////////////////////////////////////////////// +///δ֪ϵͳ +#define THOST_FTDC_TSTP_Unknow '0' +///ڻϵͳ +#define THOST_FTDC_TSTP_Future '1' +///ϵͳ +#define THOST_FTDC_TSTP_IShare '2' + +typedef char TThostFtdcTradeSystemTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalTypeTypeһ֤ȯ÷ +///////////////////////////////////////////////////////////////////////// +///뾭͹˾˻ +#define THOST_FTDC_STPT_ToBroker '1' +///Ͷ˻ +#define THOST_FTDC_STPT_ToInvestor '2' + +typedef char TThostFtdcStockDisposalTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalSysIDTypeһ֤ȯñ +///////////////////////////////////////////////////////////////////////// +typedef char TThostFtdcStockDisposalSysIDType[21]; + +///////////////////////////////////////////////////////////////////////// +///TFtdcStockDisposalStatusTypeһ֤ȯ״̬ +///////////////////////////////////////////////////////////////////////// +///Ѿύ +#define THOST_FTDC_SDPS_Submitted 'a' +///Ѿ +#define THOST_FTDC_SDPS_Accepted 'b' +///Ѿܾ +#define THOST_FTDC_SDPS_Rejected 'c' +///Ѿ +#define THOST_FTDC_SDPS_Cancelled 'd' + +typedef char TThostFtdcStockDisposalStatusType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcInstructionRightTypeTypeһָȨ +///////////////////////////////////////////////////////////////////////// +///޼۵ +#define THOST_FTDC_ISTR_Limit '1' +///޼ȫɽȡ +#define THOST_FTDC_ISTR_Limit_FOK '2' +///м۶ʣת޼ +#define THOST_FTDC_ISTR_Market_RemainLimit '3' +///м۶ʣ೷ +#define THOST_FTDC_ISTR_Market_FAK '4' +///мȫɽȡ +#define THOST_FTDC_ISTR_Market_FOK '5' +///֤ȯ +#define THOST_FTDC_ISTR_Lock '6' +///֤ȯ +#define THOST_FTDC_ISTR_Unlock '7' + +typedef char TThostFtdcInstructionRightTypeType; + +///////////////////////////////////////////////////////////////////////// +///TFtdcLevelTypeTypeһͶ߷ּ +///////////////////////////////////////////////////////////////////////// +///һͶ +#define THOST_FTDC_IVLV_FirstLevel '1' +///Ͷ +#define THOST_FTDC_IVLV_SecondLevel '2' +///Ͷ +#define THOST_FTDC_IVLV_ThirdLevel '3' + +typedef char TThostFtdcLevelTypeType; + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcUserApiStruct.h b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcUserApiStruct.h new file mode 100644 index 0000000000..a54a39092f --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/ThostFtdcUserApiStruct.h @@ -0,0 +1,8941 @@ +///////////////////////////////////////////////////////////////////////// +///@system һϵͳ +///@company ϺڻϢ޹˾ +///@file ThostFtdcUserApiStruct.h +///@brief ˿ͻ˽ӿʹõҵݽṹ +///@history +///20060106 Ժ ļ +///////////////////////////////////////////////////////////////////////// + +#if !defined(THOST_FTDCSTRUCT_H) +#define THOST_FTDCSTRUCT_H + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "ThostFtdcUserApiDataType.h" + +///Ϣַ +struct CThostFtdcDisseminationField +{ + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼ +struct CThostFtdcReqUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///նIPַ + TThostFtdcIPAddressType ClientIPAddress; +}; + +///û¼Ӧ +struct CThostFtdcRspUserLoginField +{ + /// + TThostFtdcDateType TradingDay; + ///¼ɹʱ + TThostFtdcTimeType LoginTime; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///ûdz +struct CThostFtdcUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ǿƽԱ˳ +struct CThostFtdcForceUserLogoutField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ͻ֤ +struct CThostFtdcReqAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤ + TThostFtdcAuthCodeType AuthCode; +}; + +///ͻ֤Ӧ +struct CThostFtdcRspAuthenticateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; +}; + +///ͻ֤Ϣ +struct CThostFtdcAuthenticationInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///֤Ϣ + TThostFtdcAuthInfoType AuthInfo; + ///ǷΪ֤ + TThostFtdcBoolType IsResult; +}; + +///תʱͷ +struct CThostFtdcTransferHeaderField +{ + ///汾ţ1.0 + TThostFtdcVersionType Version; + ///״룬 + TThostFtdcTradeCodeType TradeCode; + ///ڣʽyyyymmdd + TThostFtdcTradeDateType TradeDate; + ///ʱ䣬ʽhhmmss + TThostFtdcTradeTimeType TradeTime; + ///ˮţN/A + TThostFtdcTradeSerialType TradeSerial; + ///ڻ˾룬 + TThostFtdcFutureIDType FutureID; + ///д룬ݲѯеõ + TThostFtdcBankIDType BankID; + ///зĴ룬ݲѯеõ + TThostFtdcBankBrchIDType BankBrchID; + ///ԱN/A + TThostFtdcOperNoType OperNo; + ///豸ͣN/A + TThostFtdcDeviceIDType DeviceID; + ///¼N/A + TThostFtdcRecordNumType RecordNum; + ///ỰţN/A + TThostFtdcSessionIDType SessionID; + ///ţN/A + TThostFtdcRequestIDType RequestID; +}; + +///ʽתڻTradeCode=202001 +struct CThostFtdcTransferBankToFutureReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ʽתڻӦ +struct CThostFtdcTransferBankToFutureRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתTradeCode=202002 +struct CThostFtdcTransferFutureToBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///ת˽ + TThostFtdcMoneyType TradeAmt; + ///ͻ + TThostFtdcMoneyType CustFee; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ڻʽתӦ +struct CThostFtdcTransferFutureToBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///תʽ + TThostFtdcMoneyType TradeAmt; + ///Ӧտͻ + TThostFtdcMoneyType CustFee; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽTradeCode=204002 +struct CThostFtdcTransferQryBankReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; + ///־ + TThostFtdcFuturePwdFlagType FuturePwdFlag; + /// + TThostFtdcFutureAccPwdType FutureAccPwd; + ///֣RMB- USD-Բ HKD-Ԫ + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯʽӦ +struct CThostFtdcTransferQryBankRspField +{ + ///Ӧ + TThostFtdcRetCodeType RetCode; + ///ӦϢ + TThostFtdcRetInfoType RetInfo; + ///ʽ˻ + TThostFtdcAccountIDType FutureAccount; + /// + TThostFtdcMoneyType TradeAmt; + ///п + TThostFtdcMoneyType UseAmt; + ///пȡ + TThostFtdcMoneyType FetchAmt; + /// + TThostFtdcCurrencyCodeType CurrencyCode; +}; + +///ѯнϸTradeCode=204999 +struct CThostFtdcTransferQryDetailReqField +{ + ///ڻʽ˻ + TThostFtdcAccountIDType FutureAccount; +}; + +///ѯнϸӦ +struct CThostFtdcTransferQryDetailRspField +{ + /// + TThostFtdcDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///ڻˮ + TThostFtdcTradeSerialNoType FutureSerial; + ///ڻ˾ + TThostFtdcFutureIDType FutureID; + ///ʽʺ + TThostFtdcFutureAccountType FutureAccount; + ///ˮ + TThostFtdcTradeSerialNoType BankSerial; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + ///˺ + TThostFtdcBankAccountType BankAccount; + ///֤ + TThostFtdcCertCodeType CertCode; + ///Ҵ + TThostFtdcCurrencyCodeType CurrencyCode; + /// + TThostFtdcMoneyType TxAmount; + ///Ч־ + TThostFtdcTransferValidFlagType Flag; +}; + +///ӦϢ +struct CThostFtdcRspInfoField +{ + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcExchangeNameType ExchangeName; + /// + TThostFtdcExchangePropertyType ExchangeProperty; +}; + +///Ʒ +struct CThostFtdcProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductNameType ProductName; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ƽִ + TThostFtdcCloseDealTypeType CloseDealType; + ///ױ + TThostFtdcCurrencyIDType TradeCurrencyID; + ///Ѻʽ÷Χ + TThostFtdcMortgageFundUseRangeType MortgageFundUseRange; + ///Ʒ + TThostFtdcInstrumentIDType ExchangeProductID; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; +}; + +///Լ +struct CThostFtdcInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentNameType InstrumentName; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcYearType DeliveryYear; + /// + TThostFtdcMonthType DeliveryMonth; + ///м۵µ + TThostFtdcVolumeType MaxMarketOrderVolume; + ///м۵Сµ + TThostFtdcVolumeType MinMarketOrderVolume; + ///޼۵µ + TThostFtdcVolumeType MaxLimitOrderVolume; + ///޼۵Сµ + TThostFtdcVolumeType MinLimitOrderVolume; + ///Լ + TThostFtdcVolumeMultipleType VolumeMultiple; + ///С䶯λ + TThostFtdcPriceType PriceTick; + /// + TThostFtdcDateType CreateDate; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcDateType ExpireDate; + ///ʼ + TThostFtdcDateType StartDelivDate; + /// + TThostFtdcDateType EndDelivDate; + ///Լ״̬ + TThostFtdcInstLifePhaseType InstLifePhase; + ///ǰǷ + TThostFtdcBoolType IsTrading; + ///ֲ + TThostFtdcPositionTypeType PositionType; + ///ֲ + TThostFtdcPositionDateTypeType PositionDateType; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatio; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatio; + ///Ƿʹô֤߱㷨 + TThostFtdcMaxMarginSideAlgorithmType MaxMarginSideAlgorithm; + ///Ʒ + TThostFtdcInstrumentIDType UnderlyingInstrID; + ///ִм + TThostFtdcPriceType StrikePrice; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///ԼƷ + TThostFtdcUnderlyingMultipleType UnderlyingMultiple; + /// + TThostFtdcCombinationTypeType CombinationType; + ///Сµλ + TThostFtdcVolumeType MinBuyVolume; + ///Сµλ + TThostFtdcVolumeType MinSellVolume; + ///Լʶ + TThostFtdcInstrumentCodeType InstrumentCode; +}; + +///͹˾ +struct CThostFtdcBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ + TThostFtdcBrokerAbbrType BrokerAbbr; + ///͹˾ + TThostFtdcBrokerNameType BrokerName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///Ա +struct CThostFtdcTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallCountType InstallCount; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///Ͷ +struct CThostFtdcInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ױ +struct CThostFtdcTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ա;͹˾ձ +struct CThostFtdcPartBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcSuperUserField +{ + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + /// + TThostFtdcPasswordType Password; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ûȨ +struct CThostFtdcSuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; + ///ܴ + TThostFtdcFunctionCodeType FunctionCode; +}; + +///Ͷ +struct CThostFtdcInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ͷֲ߳ +struct CThostFtdcInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִж + TThostFtdcVolumeType YdStrikeFrozen; +}; + +///Լ֤ +struct CThostFtdcInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///Լ +struct CThostFtdcInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +/// +struct CThostFtdcDepthMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; + ///վ + TThostFtdcPriceType AveragePrice; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͶߺԼȨ +struct CThostFtdcInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///͹˾û +struct CThostFtdcBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û + TThostFtdcUserNameType UserName; + ///û + TThostFtdcUserTypeType UserType; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///Ƿʹ + TThostFtdcBoolType IsUsingOTP; +}; + +///͹˾û +struct CThostFtdcBrokerUserPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcPasswordType Password; +}; + +///͹˾ûȨ +struct CThostFtdcBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///͹˾ܴ + TThostFtdcBrokerFunctionCodeType BrokerFunctionCode; +}; + +///Ա̻ +struct CThostFtdcTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///Ͷ߽ +struct CThostFtdcSettlementInfoField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType Content; +}; + +///Լ֤ʵ +struct CThostFtdcInstrumentMarginRateAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///֤ +struct CThostFtdcExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; +}; + +///֤ʵ +struct CThostFtdcExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchLongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchLongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ExchShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ExchShortMarginRatioByVolume; + ///潻Ͷ߶ͷ֤ + TThostFtdcRatioType NoLongMarginRatioByMoney; + ///潻Ͷ߶ͷ֤ + TThostFtdcMoneyType NoLongMarginRatioByVolume; + ///潻Ͷ߿ͷ֤ + TThostFtdcRatioType NoShortMarginRatioByMoney; + ///潻Ͷ߿ͷ֤ + TThostFtdcMoneyType NoShortMarginRatioByVolume; +}; + +/// +struct CThostFtdcExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Դֵλ + TThostFtdcCurrencyUnitType FromCurrencyUnit; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +/// +struct CThostFtdcSettlementRefField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰʱ +struct CThostFtdcCurrentTimeField +{ + ///ǰ + TThostFtdcDateType CurrDate; + ///ǰʱ + TThostFtdcTimeType CurrTime; + ///ǰʱ䣨룩 + TThostFtdcMillisecType CurrMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +///ͨѶ׶ +struct CThostFtdcCommPhaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ͨѶʱα + TThostFtdcCommPhaseNoType CommPhaseNo; + ///ϵͳ + TThostFtdcSystemIDType SystemID; +}; + +///¼Ϣ +struct CThostFtdcLoginInfoField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///ϵͳ + TThostFtdcSystemNameType SystemName; + /// + TThostFtdcPasswordType Password; + ///󱨵 + TThostFtdcOrderRefType MaxOrderRef; + ///ʱ + TThostFtdcTimeType SHFETime; + ///ʱ + TThostFtdcTimeType DCETime; + ///֣ʱ + TThostFtdcTimeType CZCETime; + ///нʱ + TThostFtdcTimeType FFEXTime; + ///Macַ + TThostFtdcMacAddressType MacAddress; + ///̬ + TThostFtdcPasswordType OneTimePassword; + ///Դʱ + TThostFtdcTimeType INETime; +}; + +///¼Ϣ +struct CThostFtdcLogoutAllField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ϵͳ + TThostFtdcSystemNameType SystemName; +}; + +///ǰ״̬ +struct CThostFtdcFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///û +struct CThostFtdcUserPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///뱨 +struct CThostFtdcInputOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +/// +struct CThostFtdcExchangeOrderField +{ + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ʧ +struct CThostFtdcExchangeOrderInsertErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///뱨 +struct CThostFtdcInputOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +/// +struct CThostFtdcExchangeOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ʧ +struct CThostFtdcExchangeOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ɽ +struct CThostFtdcExchangeTradeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ɽ +struct CThostFtdcTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///׽ɫ + TThostFtdcTradingRoleType TradingRole; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcVolumeType Volume; + ///ɽʱ + TThostFtdcDateType TradeDate; + ///ɽʱ + TThostFtdcTimeType TradeTime; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ɽԴ + TThostFtdcPriceSourceType PriceSource; + ///Ա + TThostFtdcTraderIDType TraderID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ɽԴ + TThostFtdcTradeSourceType TradeSource; +}; + +///ûỰ +struct CThostFtdcUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ + TThostFtdcDateType LoginDate; + ///¼ʱ + TThostFtdcTimeType LoginTime; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///ӿڶ˲ƷϢ + TThostFtdcProductInfoType InterfaceProductInfo; + ///ЭϢ + TThostFtdcProtocolInfoType ProtocolInfo; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ߽ȷϢ +struct CThostFtdcSettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ȷ + TThostFtdcDateType ConfirmDate; + ///ȷʱ + TThostFtdcTimeType ConfirmTime; +}; + +///ͬ +struct CThostFtdcSyncDepositField +{ + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + ///Ƿǿƽ + TThostFtdcBoolType IsForce; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Ѻͬ +struct CThostFtdcSyncFundMortgageField +{ + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ѻ + TThostFtdcMoneyType MortgageAmount; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///͹˾ͬ +struct CThostFtdcBrokerSyncField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͬеͶ +struct CThostFtdcSyncingInvestorField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ + TThostFtdcPartyNameType InvestorName; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcDateType OpenDate; + ///ֻ + TThostFtdcMobileType Mobile; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ͬеĽ״ +struct CThostFtdcSyncingTradingCodeField +{ + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ǷԾ + TThostFtdcBoolType IsActive; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ͬеͶ߷ +struct CThostFtdcSyncingInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷ + TThostFtdcInvestorIDType InvestorGroupID; + ///Ͷ߷ + TThostFtdcInvestorGroupNameType InvestorGroupName; +}; + +///ͬеĽ˺ +struct CThostFtdcSyncingTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ϴѺ + TThostFtdcMoneyType PreMortgage; + ///ϴö + TThostFtdcMoneyType PreCredit; + ///ϴδ + TThostFtdcMoneyType PreDeposit; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///Ϣ + TThostFtdcMoneyType InterestBase; + ///Ϣ + TThostFtdcMoneyType Interest; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + ///ʽ + TThostFtdcMoneyType Available; + ///ȡʽ + TThostFtdcMoneyType WithdrawQuota; + ///׼ + TThostFtdcMoneyType Reserve; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ö + TThostFtdcMoneyType Credit; + ///Ѻ + TThostFtdcMoneyType Mortgage; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///Ͷ߽֤ + TThostFtdcMoneyType DeliveryMargin; + ///֤ + TThostFtdcMoneyType ExchangeDeliveryMargin; + ///ڻ׼ + TThostFtdcMoneyType ReserveBalance; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ϴλ + TThostFtdcMoneyType PreFundMortgageIn; + ///ϴλʳ + TThostFtdcMoneyType PreFundMortgageOut; + /// + TThostFtdcMoneyType FundMortgageIn; + ///ʳ + TThostFtdcMoneyType FundMortgageOut; + ///Ѻ + TThostFtdcMoneyType FundMortgageAvailable; + ///Ѻҽ + TThostFtdcMoneyType MortgageableFund; + ///Ʒռñ֤ + TThostFtdcMoneyType SpecProductMargin; + ///Ʒᱣ֤ + TThostFtdcMoneyType SpecProductFrozenMargin; + ///Ʒ + TThostFtdcMoneyType SpecProductCommission; + ///Ʒ + TThostFtdcMoneyType SpecProductFrozenCommission; + ///Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfit; + ///Ʒƽӯ + TThostFtdcMoneyType SpecProductCloseProfit; + ///ݳֲӯ㷨Ʒֲӯ + TThostFtdcMoneyType SpecProductPositionProfitByAlg; + ///Ʒ֤ + TThostFtdcMoneyType SpecProductExchangeMargin; +}; + +///ͬеͶֲ߳ +struct CThostFtdcSyncingInvestorPositionField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲ + TThostFtdcPositionDateType PositionDate; + ///ճֲ + TThostFtdcVolumeType YdPosition; + ///ճֲ + TThostFtdcVolumeType Position; + ///ͷ + TThostFtdcVolumeType LongFrozen; + ///ͷ + TThostFtdcVolumeType ShortFrozen; + ///ֶ + TThostFtdcMoneyType LongFrozenAmount; + ///ֶ + TThostFtdcMoneyType ShortFrozenAmount; + /// + TThostFtdcVolumeType OpenVolume; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ֽ + TThostFtdcMoneyType OpenAmount; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; + ///ֲֳɱ + TThostFtdcMoneyType PositionCost; + ///ϴռõı֤ + TThostFtdcMoneyType PreMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ʽ + TThostFtdcMoneyType FrozenCash; + /// + TThostFtdcMoneyType FrozenCommission; + ///ʽ + TThostFtdcMoneyType CashIn; + /// + TThostFtdcMoneyType Commission; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ֳɱ + TThostFtdcMoneyType OpenCost; + ///֤ + TThostFtdcMoneyType ExchangeMargin; + ///ϳɽγɵijֲ + TThostFtdcVolumeType CombPosition; + ///϶ͷ + TThostFtdcVolumeType CombLongFrozen; + ///Ͽͷ + TThostFtdcVolumeType CombShortFrozen; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///ճֲ + TThostFtdcVolumeType TodayPosition; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ִж + TThostFtdcVolumeType StrikeFrozen; + ///ִж + TThostFtdcMoneyType StrikeFrozenAmount; + ///ִж + TThostFtdcVolumeType AbandonFrozen; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִж + TThostFtdcVolumeType YdStrikeFrozen; +}; + +///ͬеĺԼ֤ +struct CThostFtdcSyncingInstrumentMarginRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ͷ֤ + TThostFtdcRatioType LongMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType LongMarginRatioByVolume; + ///ͷ֤ + TThostFtdcRatioType ShortMarginRatioByMoney; + ///ͷ֤ + TThostFtdcMoneyType ShortMarginRatioByVolume; + ///ǷԽȡ + TThostFtdcBoolType IsRelative; +}; + +///ͬеĺԼ +struct CThostFtdcSyncingInstrumentCommissionRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͬеĺԼȨ +struct CThostFtdcSyncingInstrumentTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯɽ +struct CThostFtdcQryTradeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ɽ + TThostFtdcTradeIDType TradeID; + ///ʼʱ + TThostFtdcTimeType TradeTimeStart; + ///ʱ + TThostFtdcTimeType TradeTimeEnd; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryInvestorPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯʽ˻ +struct CThostFtdcQryTradingAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯױ +struct CThostFtdcQryTradingCodeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ױ + TThostFtdcClientIDTypeType ClientIDType; +}; + +///ѯͶ +struct CThostFtdcQryInvestorGroupField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԼ֤ +struct CThostFtdcQryInstrumentMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryInstrumentCommissionRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԼȨ +struct CThostFtdcQryInstrumentTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾ +struct CThostFtdcQryBrokerField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ѯԱ +struct CThostFtdcQryTraderField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯûȨ +struct CThostFtdcQrySuperUserFunctionField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯûỰ +struct CThostFtdcQryUserSessionField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾Ա +struct CThostFtdcQryPartBrokerField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; +}; + +///ѯǰ״̬ +struct CThostFtdcQryFrontStatusField +{ + ///ǰñ + TThostFtdcFrontIDType FrontID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ +struct CThostFtdcQryOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcQryExchangeOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯû +struct CThostFtdcQrySuperUserField +{ + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯƷ +struct CThostFtdcQryProductField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///Ʒ + TThostFtdcProductClassType ProductClass; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԼ +struct CThostFtdcQryInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ѯ +struct CThostFtdcQryDepthMarketDataField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾û +struct CThostFtdcQryBrokerUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ͹˾ûȨ +struct CThostFtdcQryBrokerUserFunctionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯԱ̻ +struct CThostFtdcQryTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯˮ +struct CThostFtdcQrySyncDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ˮ + TThostFtdcDepositSeqNoType DepositSeqNo; +}; + +///ѯͶ߽ +struct CThostFtdcQrySettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ֤ +struct CThostFtdcQryExchangeMarginRateAdjustField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯ +struct CThostFtdcQryExchangeRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Դ + TThostFtdcCurrencyIDType FromCurrencyID; + ///Ŀ + TThostFtdcCurrencyIDType ToCurrencyID; +}; + +///ѯѺˮ +struct CThostFtdcQrySyncFundMortgageField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ѻˮ + TThostFtdcDepositSeqNoType MortgageSeqNo; +}; + +///ѯ +struct CThostFtdcQryHisOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; +}; + +///ǰȨԼС֤ +struct CThostFtdcOptionInstrMiniMarginField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///λ֣ȨԼС֤ + TThostFtdcMoneyType MinMargin; + ///ȡֵʽ + TThostFtdcValueMethodType ValueMethod; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼ֤ϵ +struct CThostFtdcOptionInstrMarginAdjustField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷͷ֤ϵ + TThostFtdcRatioType SShortMarginRatioByMoney; + ///Ͷͷ֤ϵ + TThostFtdcMoneyType SShortMarginRatioByVolume; + ///ֵͷ֤ϵ + TThostFtdcRatioType HShortMarginRatioByMoney; + ///ֵͷ֤ϵ + TThostFtdcMoneyType HShortMarginRatioByVolume; + ///ͷ֤ϵ + TThostFtdcRatioType AShortMarginRatioByMoney; + ///ͷ֤ϵ + TThostFtdcMoneyType AShortMarginRatioByVolume; + ///Ƿ潻ȡ + TThostFtdcBoolType IsRelative; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼѵϸ +struct CThostFtdcOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ׳ɱ +struct CThostFtdcOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType FixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType MiniMargin; + ///ȨԼȨ + TThostFtdcMoneyType Royalty; + ///ȨԼ֤𲻱䲿 + TThostFtdcMoneyType ExchFixedMargin; + ///ȨԼС֤ + TThostFtdcMoneyType ExchMiniMargin; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ׳ɱѯ +struct CThostFtdcQryOptionInstrTradeCostField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ȨԼ + TThostFtdcPriceType InputPrice; + ///ļ۸,0 + TThostFtdcPriceType UnderlyingPrice; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩʲѯ +struct CThostFtdcQryOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָָֻ +struct CThostFtdcIndexPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ָֻ̼ + TThostFtdcPriceType ClosePrice; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcInputExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcInputExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ִ +struct CThostFtdcExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerExecOrderSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִ +struct CThostFtdcExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ִϢ +struct CThostFtdcExchangeExecOrderField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///ִн + TThostFtdcExecResultType ExecResult; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִѯ +struct CThostFtdcQryExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ִ +struct CThostFtdcExchangeExecOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ִѯ +struct CThostFtdcQryExchangeExecOrderActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ִ +struct CThostFtdcErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ִ + TThostFtdcActionTypeType ActionType; + ///ͷijֲַ + TThostFtdcPosiDirectionType PosiDirection; + ///ȨȨǷڻͷı + TThostFtdcExecOrderPositionFlagType ReservePositionFlag; + ///ȨȨɵͷǷԶƽ + TThostFtdcExecOrderCloseFlagType CloseFlag; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ִ +struct CThostFtdcErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcOrderActionRefType ExecOrderActionRef; + ///ִ + TThostFtdcOrderRefType ExecOrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯִ +struct CThostFtdcQryErrExecOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ͶȨԼȨ +struct CThostFtdcOptionInstrTradingRightField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDirectionType Direction; + ///Ȩ + TThostFtdcTradingRightType TradingRight; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯȨԼȨ +struct CThostFtdcQryOptionInstrTradingRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcInputForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ +struct CThostFtdcForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ + TThostFtdcOrderRefType ForQuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ѯ۱ + TThostFtdcSequenceNoType BrokerForQutoSeq; +}; + +///ѯ۲ѯ +struct CThostFtdcQryForQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///ѯϢ +struct CThostFtdcExchangeForQuoteField +{ + ///ѯ۱ + TThostFtdcOrderLocalIDType ForQuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ѯ״̬ + TThostFtdcForQuoteStatusType ForQuoteStatus; +}; + +///ѯ۲ѯ +struct CThostFtdcQryExchangeForQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ı +struct CThostFtdcInputQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///뱨۲ +struct CThostFtdcInputQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType QuoteRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾۱ + TThostFtdcSequenceNoType BrokerQuoteSeq; + /// + TThostFtdcOrderRefType AskOrderRef; + ///򱨵 + TThostFtdcOrderRefType BidOrderRef; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ +struct CThostFtdcQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///۲ + TThostFtdcOrderActionRefType QuoteActionRef; + /// + TThostFtdcOrderRefType QuoteRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///Ϣ +struct CThostFtdcExchangeQuoteField +{ + ///۸ + TThostFtdcPriceType AskPrice; + ///۸ + TThostFtdcPriceType BidPrice; + /// + TThostFtdcVolumeType AskVolume; + /// + TThostFtdcVolumeType BidVolume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///ƽ־ + TThostFtdcOffsetFlagType AskOffsetFlag; + ///ƽ־ + TThostFtdcOffsetFlagType BidOffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType AskHedgeFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType BidHedgeFlag; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///۱ + TThostFtdcOrderSysIDType QuoteSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderStatusType QuoteStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + /// + TThostFtdcOrderSysIDType AskOrderSysID; + ///򷽱 + TThostFtdcOrderSysIDType BidOrderSysID; + ///Ӧ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///۲ѯ +struct CThostFtdcQryQuoteActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///۲ +struct CThostFtdcExchangeQuoteActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///۲ + TThostFtdcOrderSysIDType QuoteSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر۱ + TThostFtdcOrderLocalIDType QuoteLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///۲ѯ +struct CThostFtdcQryExchangeQuoteActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ȨԼdeltaֵ +struct CThostFtdcOptionInstrDeltaField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Deltaֵ + TThostFtdcRatioType Delta; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///̵ѯ +struct CThostFtdcForQuoteRspField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ѯ۱ + TThostFtdcOrderSysIDType ForQuoteSysID; + ///ѯʱ + TThostFtdcTimeType ForQuoteTime; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰȨԼִƫֵϸ +struct CThostFtdcStrikeOffsetField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִƫֵ + TThostFtdcMoneyType Offset; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩִƫֵѯ +struct CThostFtdcQryStrikeOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///¼ +struct CThostFtdcInputLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType LockRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerLockSeq; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ѯ +struct CThostFtdcQryLockField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType LockSysID; + ///ʼʱ + TThostFtdcTimeType InsertTimeStart; + ///ʱ + TThostFtdcTimeType InsertTimeEnd; +}; + +///֤ȯλ +struct CThostFtdcLockPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcVolumeType FrozenVolume; +}; + +///ѯ֤ȯλ +struct CThostFtdcQryLockPositionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ǰETFȨԼѵϸ +struct CThostFtdcETFOptionInstrCommRateField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcRatioType OpenRatioByMoney; + /// + TThostFtdcRatioType OpenRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseRatioByVolume; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByMoney; + ///ƽ + TThostFtdcRatioType CloseTodayRatioByVolume; + ///ִ + TThostFtdcRatioType StrikeRatioByMoney; + ///ִ + TThostFtdcRatioType StrikeRatioByVolume; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ֲַ + TThostFtdcPosiDirectionType PosiDirection; +}; + +///ETFȨʲѯ +struct CThostFtdcQryETFOptionInstrCommRateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ijֲֶ +struct CThostFtdcPosiFreezeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///װ + TThostFtdcInstallIDType InstallID; + /// + TThostFtdcVolumeType Volume; + ///ԭ + TThostFtdcFreezeReasonTypeType FreezeReasonType; + /// + TThostFtdcFreezeTypeType FreezeType; +}; + +///ѯ +struct CThostFtdcQryExchangeLockField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +/// +struct CThostFtdcExchangeLockField +{ + /// + TThostFtdcVolumeType Volume; + /// + TThostFtdcRequestIDType RequestID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcLockTypeType LockType; + /// + TThostFtdcOrderLocalIDType LockLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType LockSysID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///״̬ + TThostFtdcOrderActionStatusType LockStatus; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +/// +struct CThostFtdcExchangeExecOrderActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ִ + TThostFtdcExecOrderSysIDType ExecOrderSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ִ + TThostFtdcOrderLocalIDType ExecOrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +/// +struct CThostFtdcInputBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///û + TThostFtdcUserIDType UserID; +}; + +/// +struct CThostFtdcBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; +}; + +/// +struct CThostFtdcExchangeBatchOrderActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; +}; + +///ѯ +struct CThostFtdcQryBatchOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳ +struct CThostFtdcLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcVolumeType LongVolumeFrozen; + ///նͷ + TThostFtdcVolumeType OpenVolumeFrozen; + ///ͷֲֽ + TThostFtdcMoneyType LongAmountFrozen; +}; + +///ѯͶֲ߳ +struct CThostFtdcQryLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ֲ +struct CThostFtdcBrokerLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; + /// + TThostFtdcLargeVolumeType TotalVolumeFrozen; + ///ͷ + TThostFtdcLargeVolumeType LongVolumeFrozen; +}; + +///ѯ͹˾ֲ +struct CThostFtdcQryBrokerLimitPosiField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷ֤ȯֲ +struct CThostFtdcLimitPosiSField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; + /// + TThostFtdcVolumeType TotalVolumeFrozen; + ///տ + TThostFtdcVolumeType OpenVolumeFrozen; +}; + +///ѯͶ֤ȯֲ +struct CThostFtdcQryLimitPosiSField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳Ʋ +struct CThostFtdcLimitPosiParamField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///ͷ + TThostFtdcVolumeType LongVolume; + ///նͷ + TThostFtdcVolumeType OpenVolume; + ///ͷֲֽ + TThostFtdcMoneyType LongAmount; +}; + +///͹˾ֲƲ +struct CThostFtdcBrokerLimitPosiParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcLargeVolumeType TotalVolume; + ///ͷ + TThostFtdcLargeVolumeType LongVolume; +}; + +///Ͷ֤ȯֲƲ +struct CThostFtdcLimitPosiParamSField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcVolumeType TotalVolume; + ///տ + TThostFtdcVolumeType OpenVolume; +}; + +///֤ȯò +struct CThostFtdcInputStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///֤ȯò +struct CThostFtdcStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯòѯ +struct CThostFtdcQryStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯò +struct CThostFtdcExchangeStockDisposalActionField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///ִ + TThostFtdcActionTypeType ActionType; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯò +struct CThostFtdcQryExchangeStockDisposalActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯ֤ȯò +struct CThostFtdcQryErrStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///֤ȯò +struct CThostFtdcExchangeStockDisposalActionErrorField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯñ + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ȯò +struct CThostFtdcErrStockDisposalActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯò + TThostFtdcOrderActionRefType StockDisposalActionRef; + ///֤ȯ + TThostFtdcOrderRefType StockDisposalRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ͷ߷ּ +struct CThostFtdcInvestorLevelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷ߷ּ + TThostFtdcLevelTypeType LevelType; +}; + +///ϺԼȫϵ +struct CThostFtdcCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcRatioType GuarantRatio; +}; + +///ϺԼȫϵѯ +struct CThostFtdcQryCombInstrumentGuardField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +/// +struct CThostFtdcInputCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +/// +struct CThostFtdcCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType CombActionRef; + ///û + TThostFtdcUserIDType UserID; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; +}; + +///ϲѯ +struct CThostFtdcQryCombActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ϣ +struct CThostFtdcExchangeCombActionField +{ + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcVolumeType Volume; + ///ָ + TThostFtdcCombDirectionType CombDirection; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + ///ϱ + TThostFtdcOrderLocalIDType ActionLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///״̬ + TThostFtdcOrderActionStatusType ActionStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcSequenceNoType SequenceNo; +}; + +///ϲѯ +struct CThostFtdcQryExchangeCombActionField +{ + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///Ʒۻ +struct CThostFtdcProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + ///۱ + TThostFtdcCurrencyIDType QuoteCurrencyID; + /// + TThostFtdcExchangeRateType ExchangeRate; +}; + +///Ʒۻʲѯ +struct CThostFtdcQryProductExchRateField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; +}; + +///ָ +struct CThostFtdcInputDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָ +struct CThostFtdcDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָǼ + TThostFtdcOrderRefType DesignateRef; + ///û + TThostFtdcUserIDType UserID; + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ָ +struct CThostFtdcQryDesignateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָϢ +struct CThostFtdcExchangeDesignateField +{ + ///ָ + TThostFtdcDesignateTypeType DesignateType; + ///ָ + TThostFtdcOrderLocalIDType DesignateLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ָ״̬ + TThostFtdcOrderActionStatusType DesignateStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///֤ȯ +struct CThostFtdcInputStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯ +struct CThostFtdcStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤ȯõǼ + TThostFtdcOrderRefType StockDisposalRef; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; +}; + +///֤ȯ +struct CThostFtdcQryStockDisposalField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///֤ȯϢ +struct CThostFtdcExchangeStockDisposalField +{ + /// + TThostFtdcVolumeType Volume; + ///֤ȯ÷ + TThostFtdcStockDisposalTypeType StockDisposalType; + ///֤ȯñ + TThostFtdcOrderLocalIDType StockDisposalLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ȯ״̬ + TThostFtdcStockDisposalStatusType StockDisposalStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcDateType InsertDate; + ///ʱ + TThostFtdcTimeType InsertTime; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + ///֤ȯò + TThostFtdcStockDisposalSysIDType StockDisposalSysID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; +}; + +///ѯͶ߷ּ +struct CThostFtdcQryInvestorLevelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯѯۼ۲ +struct CThostFtdcQryForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯۼ۲ +struct CThostFtdcForQuoteParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///¼ + TThostFtdcPriceType LastPrice; + ///۲ + TThostFtdcPriceType PriceInterval; +}; + +///ѯȨ +struct CThostFtdcQryExecFreezeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ȩ +struct CThostFtdcExecFreezeField +{ + ///ĺԼ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ֲֶշ + TThostFtdcPosiDirectionType PosiDirection; + ///Ȩ + TThostFtdcOptionsTypeType OptionsType; + ///_λ + TThostFtdcVolumeType Volume; + /// + TThostFtdcMoneyType FrozenAmount; +}; + +///г +struct CThostFtdcMarketDataField +{ + /// + TThostFtdcDateType TradingDay; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///¼ + TThostFtdcPriceType LastPrice; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; + /// + TThostFtdcPriceType ClosePrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ʵ + TThostFtdcRatioType PreDelta; + ///ʵ + TThostFtdcRatioType CurrDelta; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; +}; + +/// +struct CThostFtdcMarketDataBaseField +{ + /// + TThostFtdcDateType TradingDay; + ///ϴν + TThostFtdcPriceType PreSettlementPrice; + /// + TThostFtdcPriceType PreClosePrice; + ///ֲ + TThostFtdcLargeVolumeType PreOpenInterest; + ///ʵ + TThostFtdcRatioType PreDelta; +}; + +///龲̬ +struct CThostFtdcMarketDataStaticField +{ + /// + TThostFtdcPriceType OpenPrice; + ///߼ + TThostFtdcPriceType HighestPrice; + ///ͼ + TThostFtdcPriceType LowestPrice; + /// + TThostFtdcPriceType ClosePrice; + ///ͣ + TThostFtdcPriceType UpperLimitPrice; + ///ͣ + TThostFtdcPriceType LowerLimitPrice; + ///ν + TThostFtdcPriceType SettlementPrice; + ///ʵ + TThostFtdcRatioType CurrDelta; +}; + +///³ɽ +struct CThostFtdcMarketDataLastMatchField +{ + ///¼ + TThostFtdcPriceType LastPrice; + /// + TThostFtdcVolumeType Volume; + ///ɽ + TThostFtdcMoneyType Turnover; + ///ֲ + TThostFtdcLargeVolumeType OpenInterest; +}; + +///ż +struct CThostFtdcMarketDataBestPriceField +{ + ///һ + TThostFtdcPriceType BidPrice1; + ///һ + TThostFtdcVolumeType BidVolume1; + ///һ + TThostFtdcPriceType AskPrice1; + ///һ + TThostFtdcVolumeType AskVolume1; +}; + +/// +struct CThostFtdcMarketDataBid23Field +{ + ///۶ + TThostFtdcPriceType BidPrice2; + /// + TThostFtdcVolumeType BidVolume2; + /// + TThostFtdcPriceType BidPrice3; + /// + TThostFtdcVolumeType BidVolume3; +}; + +/// +struct CThostFtdcMarketDataAsk23Field +{ + ///۶ + TThostFtdcPriceType AskPrice2; + /// + TThostFtdcVolumeType AskVolume2; + /// + TThostFtdcPriceType AskPrice3; + /// + TThostFtdcVolumeType AskVolume3; +}; + +///ġ +struct CThostFtdcMarketDataBid45Field +{ + /// + TThostFtdcPriceType BidPrice4; + /// + TThostFtdcVolumeType BidVolume4; + /// + TThostFtdcPriceType BidPrice5; + /// + TThostFtdcVolumeType BidVolume5; +}; + +///ġ +struct CThostFtdcMarketDataAsk45Field +{ + /// + TThostFtdcPriceType AskPrice4; + /// + TThostFtdcVolumeType AskVolume4; + /// + TThostFtdcPriceType AskPrice5; + /// + TThostFtdcVolumeType AskVolume5; +}; + +///ʱ +struct CThostFtdcMarketDataUpdateTimeField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///޸ĺ + TThostFtdcMillisecType UpdateMillisec; + ///ҵ + TThostFtdcDateType ActionDay; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///齻 +struct CThostFtdcMarketDataExchangeField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ָĺԼ +struct CThostFtdcSpecificInstrumentField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///Լ״̬ +struct CThostFtdcInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + /// + TThostFtdcSettlementGroupIDType SettlementGroupID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Լ״̬ + TThostFtdcInstrumentStatusType InstrumentStatus; + ///׽׶α + TThostFtdcTradingSegmentSNType TradingSegmentSN; + ///뱾״̬ʱ + TThostFtdcTimeType EnterTime; + ///뱾״̬ԭ + TThostFtdcInstStatusEnterReasonType EnterReason; +}; + +///ѯԼ״̬ +struct CThostFtdcQryInstrumentStatusField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; +}; + +///Ͷ˻ +struct CThostFtdcInvestorAccountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ӯ㷨 +struct CThostFtdcPositionProfitAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///ע + TThostFtdcMemoType Memo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///Աʽۿ +struct CThostFtdcDiscountField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽۿ۱ + TThostFtdcRatioType Discount; +}; + +///ѯת +struct CThostFtdcQryTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ת +struct CThostFtdcTransferBankField +{ + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; + ///ǷԾ + TThostFtdcBoolType IsActive; +}; + +///ѯͶֲ߳ϸ +struct CThostFtdcQryInvestorPositionDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///Ͷֲ߳ϸ +struct CThostFtdcInvestorPositionDetailField +{ + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + /// + TThostFtdcDateType OpenDate; + ///ɽ + TThostFtdcTradeIDType TradeID; + /// + TThostFtdcVolumeType Volume; + ///ּ + TThostFtdcPriceType OpenPrice; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ɽ + TThostFtdcTradeTypeType TradeType; + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///նƽӯ + TThostFtdcMoneyType CloseProfitByDate; + ///ʶԳƽӯ + TThostFtdcMoneyType CloseProfitByTrade; + ///նгֲӯ + TThostFtdcMoneyType PositionProfitByDate; + ///ʶԳֲӯ + TThostFtdcMoneyType PositionProfitByTrade; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + /// + TThostFtdcPriceType LastSettlementPrice; + /// + TThostFtdcPriceType SettlementPrice; + ///ƽ + TThostFtdcVolumeType CloseVolume; + ///ƽֽ + TThostFtdcMoneyType CloseAmount; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///鱨̻ +struct CThostFtdcMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///Ա״̬ + TThostFtdcTraderConnectStatusType TraderConnectStatus; + /// + TThostFtdcDateType ConnectRequestDate; + ///ʱ + TThostFtdcTimeType ConnectRequestTime; + ///ϴα + TThostFtdcDateType LastReportDate; + ///ϴαʱ + TThostFtdcTimeType LastReportTime; + /// + TThostFtdcDateType ConnectDate; + ///ʱ + TThostFtdcTimeType ConnectTime; + /// + TThostFtdcDateType StartDate; + ///ʱ + TThostFtdcTimeType StartTime; + /// + TThostFtdcDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ϯλɽ + TThostFtdcTradeIDType MaxTradeID; + ///ϯλ󱨵 + TThostFtdcReturnCodeType MaxOrderMessageReference; + ///ҵ + TThostFtdcBizTypeType BizType; +}; + +///ѯ鱨̻ +struct CThostFtdcQryMDTraderOfferField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///Ա + TThostFtdcTraderIDType TraderID; +}; + +///ѯͻ֪ͨ +struct CThostFtdcQryNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///ͻ֪ͨ +struct CThostFtdcNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ϣ + TThostFtdcContentType Content; + ///͹˾֪ͨк + TThostFtdcSequenceLabelType SequenceLabel; +}; + +///ûȨ +struct CThostFtdcUserRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ͻȨ + TThostFtdcUserRightTypeType UserRightType; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯϢȷ +struct CThostFtdcQrySettlementInfoConfirmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///װؽϢ +struct CThostFtdcLoadSettlementInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcBrokerWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ʽ㷨 + TThostFtdcAlgorithmType WithdrawAlgorithm; + ///ʽʹ + TThostFtdcRatioType UsingRatio; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType IncludeCloseProfit; + ///޲޳ɽͻǷܿ + TThostFtdcAllWithoutTradeType AllWithoutTrade; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///Ƿû¼ + TThostFtdcBoolType IsBrokerUserEvent; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; + ///Ȩ㷨 + TThostFtdcBalanceAlgorithmType BalanceAlgorithm; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateV1Field +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; +}; + +///ʽ˻ +struct CThostFtdcTradingAccountPasswordUpdateField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ԭĿ + TThostFtdcPasswordType OldPassword; + ///µĿ + TThostFtdcPasswordType NewPassword; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ѯϺԼ +struct CThostFtdcQryCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; +}; + +///ѯϺԼ +struct CThostFtdcQrySyncStatusField +{ + /// + TThostFtdcDateType TradingDay; +}; + +///Ͻ׺Լĵ +struct CThostFtdcCombinationLegField +{ + ///ϺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȺԼ + TThostFtdcInstrumentIDType LegInstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + /// + TThostFtdcImplyLevelType ImplyLevel; +}; + +///ͬ״̬ +struct CThostFtdcSyncStatusField +{ + /// + TThostFtdcDateType TradingDay; + ///ͬ״̬ + TThostFtdcDataSyncStatusType DataSyncStatus; +}; + +///ѯϵ +struct CThostFtdcQryLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ϵ +struct CThostFtdcLinkManField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵ + TThostFtdcPersonTypeType PersonType; + ///֤ + TThostFtdcIdCardTypeType IdentifiedCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + /// + TThostFtdcPartyNameType PersonName; + ///ϵ绰 + TThostFtdcTelephoneType Telephone; + ///ͨѶַ + TThostFtdcAddressType Address; + /// + TThostFtdcZipCodeType ZipCode; + ///ȼ + TThostFtdcPriorityType Priority; + /// + TThostFtdcUOAZipCodeType UOAZipCode; + ///ȫ + TThostFtdcInvestorFullNameType PersonFullName; +}; + +///ѯ͹˾û¼ +struct CThostFtdcQryBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; +}; + +///ѯ͹˾û¼ +struct CThostFtdcBrokerUserEventField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///û¼ + TThostFtdcUserEventTypeType UserEventType; + ///û¼ + TThostFtdcSequenceNoType EventSequenceNo; + ///¼ + TThostFtdcDateType EventDate; + ///¼ʱ + TThostFtdcTimeType EventTime; + ///û¼Ϣ + TThostFtdcUserEventInfoType UserEventInfo; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯǩԼ +struct CThostFtdcQryContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; +}; + +///ѯǩԼӦ +struct CThostFtdcContractBankField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///д + TThostFtdcBankIDType BankID; + ///зĴ + TThostFtdcBankBrchIDType BankBrchID; + /// + TThostFtdcBankNameType BankName; +}; + +///Ͷϳֲϸ +struct CThostFtdcInvestorPositionCombineDetailField +{ + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcDateType OpenDate; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSettlementIDType SettlementID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϱ + TThostFtdcTradeIDType ComTradeID; + ///ϱ + TThostFtdcTradeIDType TradeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcDirectionType Direction; + ///ֲ + TThostFtdcVolumeType TotalAmt; + ///Ͷ֤߱ + TThostFtdcMoneyType Margin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///֤ + TThostFtdcRatioType MarginRateByMoney; + ///֤() + TThostFtdcRatioType MarginRateByVolume; + ///ȱ + TThostFtdcLegIDType LegID; + ///ȳ + TThostFtdcLegMultipleType LegMultiple; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; + ///ɽ + TThostFtdcTradeGroupIDType TradeGroupID; +}; + +///Ԥ +struct CThostFtdcParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; +}; + +///Ԥ񵥲 +struct CThostFtdcParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + ///û + TThostFtdcUserIDType UserID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; + ///û + TThostFtdcUserTypeType UserType; + ///Ԥ񳷵״̬ + TThostFtdcParkedOrderStatusType Status; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯԤ +struct CThostFtdcQryParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯԤ񳷵 +struct CThostFtdcQryParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ɾԤ +struct CThostFtdcRemoveParkedOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񱨵 + TThostFtdcParkedOrderIDType ParkedOrderID; +}; + +///ɾԤ񳷵 +struct CThostFtdcRemoveParkedOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ԥ񳷵 + TThostFtdcParkedOrderActionIDType ParkedOrderActionID; +}; + +///͹˾ʽ㷨 +struct CThostFtdcInvestorWithdrawAlgorithmField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʽ + TThostFtdcRatioType UsingRatio; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///Ѻ + TThostFtdcRatioType FundMortgageRatio; +}; + +///ѯϳֲϸ +struct CThostFtdcQryInvestorPositionCombineDetailField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϳֲֺԼ + TThostFtdcInstrumentIDType CombInstrumentID; +}; + +///ɽ +struct CThostFtdcMarketDataAveragePriceField +{ + ///վ + TThostFtdcPriceType AveragePrice; +}; + +///УͶ +struct CThostFtdcVerifyInvestorPasswordField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcPasswordType Password; +}; + +///ûIP +struct CThostFtdcUserIPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; + ///IPַ + TThostFtdcIPAddressType IPMask; + ///Macַ + TThostFtdcMacAddressType MacAddress; +}; + +///û¼֪ͨϢ +struct CThostFtdcTradingNoticeInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ʱ + TThostFtdcTimeType SendTime; + ///Ϣ + TThostFtdcContentType FieldContent; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///к + TThostFtdcSequenceNoType SequenceNo; +}; + +///û¼֪ͨ +struct CThostFtdcTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷ߷Χ + TThostFtdcInvestorRangeType InvestorRange; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ϵк + TThostFtdcSequenceSeriesType SequenceSeries; + ///û + TThostFtdcUserIDType UserID; + ///ʱ + TThostFtdcTimeType SendTime; + ///к + TThostFtdcSequenceNoType SequenceNo; + ///Ϣ + TThostFtdcContentType FieldContent; +}; + +///ѯ¼֪ͨ +struct CThostFtdcQryTradingNoticeField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ󱨵 +struct CThostFtdcErrorConditionalOrderField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcOrderRefType OrderRef; + ///û + TThostFtdcUserIDType UserID; + ///۸ + TThostFtdcOrderPriceTypeType OrderPriceType; + /// + TThostFtdcDirectionType Direction; + ///Ͽƽ־ + TThostFtdcCombOffsetFlagType CombOffsetFlag; + ///Ͷױ־ + TThostFtdcCombHedgeFlagType CombHedgeFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + /// + TThostFtdcVolumeType VolumeTotalOriginal; + ///Ч + TThostFtdcTimeConditionType TimeCondition; + ///GTD + TThostFtdcDateType GTDDate; + ///ɽ + TThostFtdcVolumeConditionType VolumeCondition; + ///Сɽ + TThostFtdcVolumeType MinVolume; + /// + TThostFtdcContingentConditionType ContingentCondition; + ///ֹ + TThostFtdcPriceType StopPrice; + ///ǿƽԭ + TThostFtdcForceCloseReasonType ForceCloseReason; + ///Զ־ + TThostFtdcBoolType IsAutoSuspend; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + /// + TThostFtdcRequestIDType RequestID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ԼڽĴ + TThostFtdcExchangeInstIDType ExchangeInstID; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ύ״̬ + TThostFtdcOrderSubmitStatusType OrderSubmitStatus; + ///ʾ + TThostFtdcSequenceNoType NotifySequence; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///Դ + TThostFtdcOrderSourceType OrderSource; + ///״̬ + TThostFtdcOrderStatusType OrderStatus; + /// + TThostFtdcOrderTypeType OrderType; + ///ɽ + TThostFtdcVolumeType VolumeTraded; + ///ʣ + TThostFtdcVolumeType VolumeTotal; + /// + TThostFtdcDateType InsertDate; + ///ίʱ + TThostFtdcTimeType InsertTime; + ///ʱ + TThostFtdcTimeType ActiveTime; + ///ʱ + TThostFtdcTimeType SuspendTime; + ///޸ʱ + TThostFtdcTimeType UpdateTime; + ///ʱ + TThostFtdcTimeType CancelTime; + ///޸ĽԱ + TThostFtdcTraderIDType ActiveTraderID; + ///Ա + TThostFtdcParticipantIDType ClearingPartID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + ///û˲ƷϢ + TThostFtdcProductInfoType UserProductInfo; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///ûǿ־ + TThostFtdcBoolType UserForceClose; + ///û + TThostFtdcUserIDType ActiveUserID; + ///͹˾ + TThostFtdcSequenceNoType BrokerOrderSeq; + ///ر + TThostFtdcOrderSysIDType RelativeOrderSysID; + ///֣ɽ + TThostFtdcVolumeType ZCETotalTradedVolume; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///־ + TThostFtdcBoolType IsSwapOrder; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; +}; + +///ѯ󱨵 +struct CThostFtdcQryErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///󱨵 +struct CThostFtdcErrOrderActionField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcOrderActionRefType OrderActionRef; + /// + TThostFtdcOrderRefType OrderRef; + /// + TThostFtdcRequestIDType RequestID; + ///ǰñ + TThostFtdcFrontIDType FrontID; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcOrderSysIDType OrderSysID; + ///־ + TThostFtdcActionFlagType ActionFlag; + ///۸ + TThostFtdcPriceType LimitPrice; + ///仯 + TThostFtdcVolumeType VolumeChange; + /// + TThostFtdcDateType ActionDate; + ///ʱ + TThostFtdcTimeType ActionTime; + ///Ա + TThostFtdcTraderIDType TraderID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ر + TThostFtdcOrderLocalIDType OrderLocalID; + ///ر + TThostFtdcOrderLocalIDType ActionLocalID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + ///ͻ + TThostFtdcClientIDType ClientID; + ///ҵԪ + TThostFtdcBusinessUnitType BusinessUnit; + ///״̬ + TThostFtdcOrderActionStatusType OrderActionStatus; + ///û + TThostFtdcUserIDType UserID; + ///״̬Ϣ + TThostFtdcErrorMsgType StatusMsg; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///Ӫҵ + TThostFtdcBranchIDType BranchID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ״̬ +struct CThostFtdcQryExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///״̬ +struct CThostFtdcExchangeSequenceField +{ + /// + TThostFtdcExchangeIDType ExchangeID; + /// + TThostFtdcSequenceNoType SequenceNo; + ///Լ״̬ + TThostFtdcInstrumentStatusType MarketStatus; +}; + +///ݼ۸ѯ󱨵 +struct CThostFtdcQueryMaxOrderVolumeWithPriceField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///ƽ־ + TThostFtdcOffsetFlagType OffsetFlag; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType MaxVolume; + ///۸ + TThostFtdcPriceType Price; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ѯ͹˾ײ +struct CThostFtdcQryBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///͹˾ײ +struct CThostFtdcBrokerTradingParamsField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///֤۸ + TThostFtdcMarginPriceTypeType MarginPriceType; + ///ӯ㷨 + TThostFtdcAlgorithmType Algorithm; + ///Ƿƽӯ + TThostFtdcIncludeCloseProfitType AvailIncludeCloseProfit; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ȨȨ۸ + TThostFtdcOptionRoyaltyPriceTypeType OptionRoyaltyPriceType; +}; + +///ѯ͹˾㷨 +struct CThostFtdcQryBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///͹˾㷨 +struct CThostFtdcBrokerTradingAlgosField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + ///ֲִ㷨 + TThostFtdcHandlePositionAlgoIDType HandlePositionAlgoID; + ///Ѱұ֤㷨 + TThostFtdcFindMarginRateAlgoIDType FindMarginRateAlgoID; + ///ʽ㷨 + TThostFtdcHandleTradingAccountAlgoIDType HandleTradingAccountAlgoID; +}; + +///ѯ͹˾ʽ +struct CThostFtdcQueryBrokerDepositField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///͹˾ʽ +struct CThostFtdcBrokerDepositField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ա + TThostFtdcParticipantIDType ParticipantID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///ϴν׼ + TThostFtdcMoneyType PreBalance; + ///ǰ֤ܶ + TThostFtdcMoneyType CurrMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + ///ڻ׼ + TThostFtdcMoneyType Balance; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcMoneyType Withdraw; + ///ʽ + TThostFtdcMoneyType Available; + ///׼ + TThostFtdcMoneyType Reserve; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; +}; + +///ѯ֤ϵͳ͹˾Կ +struct CThostFtdcQryCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; +}; + +///֤ϵͳ͹˾Կ +struct CThostFtdcCFMMCBrokerKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Կ + TThostFtdcDateType CreateDate; + ///Կʱ + TThostFtdcTimeType CreateTime; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; + ///̬Կ + TThostFtdcCFMMCKeyKindType KeyKind; +}; + +///֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬Կ + TThostFtdcCFMMCKeyType CurrentKey; +}; + +///ѯ֤ϵͳ͹˾ʽ˻Կ +struct CThostFtdcQryCFMMCTradingAccountKeyField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û̬Ʋ +struct CThostFtdcBrokerUserOTPParamField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ṩ + TThostFtdcOTPVendorsIDType OTPVendorsID; + ///̬к + TThostFtdcSerialNumberType SerialNumber; + ///Կ + TThostFtdcAuthKeyType AuthKey; + ///Ưֵ + TThostFtdcLastDriftType LastDrift; + ///ɹֵ + TThostFtdcLastSuccessType LastSuccess; + ///̬ + TThostFtdcOTPTypeType OTPType; +}; + +///ֹͬû̬ +struct CThostFtdcManualSyncBrokerUserOTPField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///̬ + TThostFtdcOTPTypeType OTPType; + ///һ̬ + TThostFtdcPasswordType FirstOTP; + ///ڶ̬ + TThostFtdcPasswordType SecondOTP; +}; + +///Ͷģ +struct CThostFtdcCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; + ///ģ + TThostFtdcCommModelNameType CommModelName; +}; + +///ѯͶģ +struct CThostFtdcQryCommRateModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///ģ + TThostFtdcInvestorIDType CommModelID; +}; + +///Ͷ֤߱ģ +struct CThostFtdcMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; + ///ģ + TThostFtdcCommModelNameType MarginModelName; +}; + +///ѯͶ֤߱ģ +struct CThostFtdcQryMarginModelField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///֤ģ + TThostFtdcInvestorIDType MarginModelID; +}; + +///ֵ۵Ϣ +struct CThostFtdcEWarrantOffsetField +{ + /// + TThostFtdcTradeDateType TradingDay; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; + /// + TThostFtdcDirectionType Direction; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; + /// + TThostFtdcVolumeType Volume; +}; + +///ѯֵ۵Ϣ +struct CThostFtdcQryEWarrantOffsetField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Լ + TThostFtdcInstrumentIDType InstrumentID; +}; + +///ѯͶƷ/Ʒֱ֤ +struct CThostFtdcQryInvestorProductGroupMarginField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ͶƷ/Ʒֱ֤ +struct CThostFtdcInvestorProductGroupMarginField +{ + ///Ʒ/Ʒֱʾ + TThostFtdcInstrumentIDType ProductGroupID; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcDateType TradingDay; + /// + TThostFtdcSettlementIDType SettlementID; + ///ı֤ + TThostFtdcMoneyType FrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType LongFrozenMargin; + ///ͷı֤ + TThostFtdcMoneyType ShortFrozenMargin; + ///ռõı֤ + TThostFtdcMoneyType UseMargin; + ///ͷ֤ + TThostFtdcMoneyType LongUseMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortUseMargin; + ///֤ + TThostFtdcMoneyType ExchMargin; + ///ͷ֤ + TThostFtdcMoneyType LongExchMargin; + ///ͷ֤ + TThostFtdcMoneyType ShortExchMargin; + ///ƽӯ + TThostFtdcMoneyType CloseProfit; + /// + TThostFtdcMoneyType FrozenCommission; + /// + TThostFtdcMoneyType Commission; + ///ʽ + TThostFtdcMoneyType FrozenCash; + ///ʽ + TThostFtdcMoneyType CashIn; + ///ֲӯ + TThostFtdcMoneyType PositionProfit; + ///۵ܽ + TThostFtdcMoneyType OffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortOffsetAmount; + ///۵ܽ + TThostFtdcMoneyType ExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType LongExchOffsetAmount; + ///ͷ۵ܽ + TThostFtdcMoneyType ShortExchOffsetAmount; + ///Ͷױ־ + TThostFtdcHedgeFlagType HedgeFlag; +}; + +///ѯû +struct CThostFtdcQueryCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; +}; + +///û +struct CThostFtdcCFMMCTradingAccountTokenField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///͹˾ͳһ + TThostFtdcParticipantIDType ParticipantID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Կ + TThostFtdcSequenceNoType KeyID; + ///̬ + TThostFtdcCFMMCTokenType Token; +}; + +///ͶָȨ +struct CThostFtdcInstructionRightField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ָȨ + TThostFtdcInstructionRightTypeType InstructionRight; + ///Ƿֹ + TThostFtdcBoolType IsForbidden; +}; + +///ѯƷ +struct CThostFtdcQryProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; +}; + +///ͶƷ/Ʒֱ֤Ʒ +struct CThostFtdcProductGroupField +{ + ///Ʒ + TThostFtdcInstrumentIDType ProductID; + /// + TThostFtdcExchangeIDType ExchangeID; + ///Ʒ + TThostFtdcInstrumentIDType ProductGroupID; +}; + +///תʿ +struct CThostFtdcReqOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///ת +struct CThostFtdcReqCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; +}; + +///˻ +struct CThostFtdcReqChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ת +struct CThostFtdcReqTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///зʽתڻӦ +struct CThostFtdcRspTransferField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +/// +struct CThostFtdcReqRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; +}; + +///Ӧ +struct CThostFtdcRspRepealField +{ + ///ʱ + TThostFtdcRepealTimeIntervalType RepealTimeInterval; + ///Ѿ + TThostFtdcRepealedTimesType RepealedTimes; + ///г־ + TThostFtdcBankRepealFlagType BankRepealFlag; + ///̳־ + TThostFtdcBrokerRepealFlagType BrokerRepealFlag; + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateRepealSerial; + ///ˮ + TThostFtdcBankSerialType BankRepealSerial; + ///ڻˮ + TThostFtdcFutureSerialType FutureRepealSerial; + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ڻȡ + TThostFtdcTradeAmountType FutureFetchAmount; + ///֧־ + TThostFtdcFeePayFlagType FeePayFlag; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///ͷշϢ + TThostFtdcAddInfoType Message; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///ת˽״̬ + TThostFtdcTransferStatusType TransferStatus; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ +struct CThostFtdcReqQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ѯ˻ϢӦ +struct CThostFtdcRspQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; +}; + +///ǩǩ +struct CThostFtdcFutureSignIOField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ +struct CThostFtdcReqFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///ǩӦ +struct CThostFtdcRspFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯָˮŵĽ׽ +struct CThostFtdcReqQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ѯָˮŵĽ׽Ӧ +struct CThostFtdcRspQueryTradeResultBySerialField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///ˮ + TThostFtdcSerialType Reference; + ///ˮŷߵĻ + TThostFtdcInstitutionTypeType RefrenceIssureType; + ///ˮŷ߻ + TThostFtdcOrganCodeType RefrenceIssure; + ///ԭʼش + TThostFtdcReturnCodeType OriginReturnCode; + ///ԭʼ + TThostFtdcDescrInfoForReturnCodeType OriginDescrInfoForReturnCode; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///תʽ + TThostFtdcTradeAmountType TradeAmount; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ļ +struct CThostFtdcReqDayEndFileReadyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ļҵ + TThostFtdcFileBusinessCodeType FileBusinessCode; + ///ժҪ + TThostFtdcDigestType Digest; +}; + +///ؽ +struct CThostFtdcReturnResultField +{ + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///֤ڻʽ +struct CThostFtdcVerifyFuturePasswordField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///װ + TThostFtdcInstallIDType InstallID; + ///ID + TThostFtdcTIDType TID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ͻϢ +struct CThostFtdcVerifyCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcVerifyFuturePasswordAndCustInfoField +{ + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///֤ڻʽͿͻϢ +struct CThostFtdcDepositResultInformField +{ + ///ˮţˮΪڱ̷صˮ + TThostFtdcDepositSeqNoType DepositSeqNo; + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + /// + TThostFtdcMoneyType Deposit; + /// + TThostFtdcRequestIDType RequestID; + ///ش + TThostFtdcReturnCodeType ReturnCode; + /// + TThostFtdcDescrInfoForReturnCodeType DescrInfoForReturnCode; +}; + +///׺ڱ̷Կͬ +struct CThostFtdcReqSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; +}; + +///׺ڱ̷ԿͬӦ +struct CThostFtdcRspSyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯ˻Ϣ֪ͨ +struct CThostFtdcNotifyQueryAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + ///пý + TThostFtdcTradeAmountType BankUseAmount; + ///пȡ + TThostFtdcTradeAmountType BankFetchAmount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ת˽ˮ +struct CThostFtdcTransferSerialField +{ + ///ƽ̨ˮ + TThostFtdcPlateSerialType PlateSerial; + ///׷ + TThostFtdcTradeDateType TradeDate; + /// + TThostFtdcDateType TradingDay; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///״ + TThostFtdcTradeCodeType TradeCode; + ///Ự + TThostFtdcSessionIDType SessionID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///ڻ˾ʺ + TThostFtdcFutureAccTypeType FutureAccType; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///Ͷߴ + TThostFtdcInvestorIDType InvestorID; + ///ڻ˾ˮ + TThostFtdcFutureSerialType FutureSerial; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///׽ + TThostFtdcTradeAmountType TradeAmount; + ///Ӧտͻ + TThostFtdcCustFeeType CustFee; + ///Ӧڻ˾ + TThostFtdcFutureFeeType BrokerFee; + ///Ч־ + TThostFtdcAvailabilityFlagType AvailabilityFlag; + ///Ա + TThostFtdcOperatorCodeType OperatorCode; + ///ʺ + TThostFtdcBankAccountType BankNewAccount; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯתˮ +struct CThostFtdcQryTransferSerialField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignInField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; + ///PINԿ + TThostFtdcPasswordKeyType PinKey; + ///MACԿ + TThostFtdcPasswordKeyType MacKey; +}; + +///ǩ֪ͨ +struct CThostFtdcNotifyFutureSignOutField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///ժҪ + TThostFtdcDigestType Digest; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///׺ڱ̷Կ֪ͬͨ +struct CThostFtdcNotifySyncKeyField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///װ + TThostFtdcInstallIDType InstallID; + ///ûʶ + TThostFtdcUserIDType UserID; + ///׺ĸڱ̵Ϣ + TThostFtdcAddInfoType Message; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///׹Ա + TThostFtdcOperNoType OperNo; + /// + TThostFtdcRequestIDType RequestID; + ///ID + TThostFtdcTIDType TID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ѯǩԼϵ +struct CThostFtdcQryAccountregisterField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ͻϢ +struct CThostFtdcAccountregisterField +{ + /// + TThostFtdcTradeDateType TradeDay; + ///б + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///ʺ + TThostFtdcBankAccountType BankAccount; + ///ڻ˾ + TThostFtdcBrokerIDType BrokerID; + ///ڻ˾֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + /// + TThostFtdcOpenOrDestroyType OpenOrDestroy; + ///ǩԼ + TThostFtdcTradeDateType RegDate; + ///Լ + TThostFtdcTradeDateType OutDate; + ///ID + TThostFtdcTIDType TID; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; +}; + +///ڿϢ +struct CThostFtdcOpenAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///Ϣ +struct CThostFtdcCancelAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///㳮־ + TThostFtdcCashExchangeCodeType CashExchangeCode; + ///ժҪ + TThostFtdcDigestType Digest; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///־ + TThostFtdcDeviceIDType DeviceID; + ///ڻλʺ + TThostFtdcBankAccTypeType BankSecuAccType; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///ڻλʺ + TThostFtdcBankAccountType BankSecuAcc; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///׹Ա + TThostFtdcOperNoType OperNo; + ///ID + TThostFtdcTIDType TID; + ///ûʶ + TThostFtdcUserIDType UserID; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ڱ˺Ϣ +struct CThostFtdcChangeAccountField +{ + ///ҵ + TThostFtdcTradeCodeType TradeCode; + ///д + TThostFtdcBankIDType BankID; + ///з֧ + TThostFtdcBankBrchIDType BankBranchID; + ///̴ + TThostFtdcBrokerIDType BrokerID; + ///̷֧ + TThostFtdcFutureBranchIDType BrokerBranchID; + /// + TThostFtdcTradeDateType TradeDate; + ///ʱ + TThostFtdcTradeTimeType TradeTime; + ///ˮ + TThostFtdcBankSerialType BankSerial; + ///ϵͳ + TThostFtdcTradeDateType TradingDay; + ///ƽ̨Ϣˮ + TThostFtdcSerialType PlateSerial; + ///Ƭ־ + TThostFtdcLastFragmentType LastFragment; + ///Ự + TThostFtdcSessionIDType SessionID; + ///ͻ + TThostFtdcIndividualNameType CustomerName; + ///֤ + TThostFtdcIdCardTypeType IdCardType; + ///֤ + TThostFtdcIdentifiedCardNoType IdentifiedCardNo; + ///Ա + TThostFtdcGenderType Gender; + ///Ҵ + TThostFtdcCountryCodeType CountryCode; + ///ͻ + TThostFtdcCustTypeType CustType; + ///ַ + TThostFtdcAddressType Address; + ///ʱ + TThostFtdcZipCodeType ZipCode; + ///绰 + TThostFtdcTelephoneType Telephone; + ///ֻ + TThostFtdcMobilePhoneType MobilePhone; + /// + TThostFtdcFaxType Fax; + ///ʼ + TThostFtdcEMailType EMail; + ///ʽ˻״̬ + TThostFtdcMoneyAccountStatusType MoneyAccountStatus; + ///ʺ + TThostFtdcBankAccountType BankAccount; + /// + TThostFtdcPasswordType BankPassWord; + ///ʺ + TThostFtdcBankAccountType NewBankAccount; + /// + TThostFtdcPasswordType NewBankPassWord; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///ڻ + TThostFtdcPasswordType Password; + ///ʺ + TThostFtdcBankAccTypeType BankAccType; + ///װ + TThostFtdcInstallIDType InstallID; + ///֤ͻ֤־ + TThostFtdcYesNoIndicatorType VerifyCertNoFlag; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; + ///ڻ˾б + TThostFtdcBankCodingForFutureType BrokerIDByBank; + ///־ + TThostFtdcPwdFlagType BankPwdFlag; + ///ڻʽ˶Ա־ + TThostFtdcPwdFlagType SecuPwdFlag; + ///ID + TThostFtdcTIDType TID; + ///ժҪ + TThostFtdcDigestType Digest; + /// + TThostFtdcErrorIDType ErrorID; + ///Ϣ + TThostFtdcErrorMsgType ErrorMsg; +}; + +///ԱȨ +struct CThostFtdcSecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; + ///нʽʺ + TThostFtdcAccountIDType BrokerSecAgentID; +}; + +///ԱȨ޲ѯ +struct CThostFtdcQrySecAgentACIDMapField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///ʽ˻ + TThostFtdcAccountIDType AccountID; + /// + TThostFtdcCurrencyIDType CurrencyID; +}; + +///ֱĽȨ +struct CThostFtdcUserRightsAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; +}; + +///ù˾ǷڱʾĽȨ +struct CThostFtdcBrokerUserRightAssignField +{ + ///ӦõԪ + TThostFtdcBrokerIDType BrokerID; + ///Ĵ + TThostFtdcDRIdentityIDType DRIdentityID; + ///ܷ + TThostFtdcBoolType Tradeable; +}; + +///ֱת +struct CThostFtdcDRTransferField +{ + ///ԭĴ + TThostFtdcDRIdentityIDType OrigDRIdentityID; + ///Ŀ꽻Ĵ + TThostFtdcDRIdentityIDType DestDRIdentityID; + ///ԭӦõԪ + TThostFtdcBrokerIDType OrigBrokerID; + ///ĿõԪ + TThostFtdcBrokerIDType DestBrokerID; +}; + +///FensûϢ +struct CThostFtdcFensUserInfoField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///¼ģʽ + TThostFtdcLoginModeType LoginMode; +}; + +///ǰ +struct CThostFtdcCurrTransferIdentityField +{ + ///Ĵ + TThostFtdcDRIdentityIDType IdentityID; +}; + +///ֹ¼û +struct CThostFtdcLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; + ///IPַ + TThostFtdcIPAddressType IPAddress; +}; + +///ѯֹ¼û +struct CThostFtdcQryLoginForbiddenUserField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///û + TThostFtdcUserIDType UserID; +}; + +///UDP鲥Ϣ +struct CThostFtdcMulticastGroupInfoField +{ + ///鲥IPַ + TThostFtdcIPAddressType GroupIP; + ///鲥IP˿ + TThostFtdcIPPortType GroupPort; + ///Դַ + TThostFtdcIPAddressType SourceIP; +}; + +///ʽ˻׼ +struct CThostFtdcTradingAccountReserveField +{ + ///͹˾ + TThostFtdcBrokerIDType BrokerID; + ///Ͷʺ + TThostFtdcAccountIDType AccountID; + ///׼ + TThostFtdcMoneyType Reserve; + ///ִ + TThostFtdcCurrencyIDType CurrencyID; +}; + +///DBF¼ +struct CThostFtdcDBFRecordField +{ + ///DBF + TThostFtdcDBFComdTypeType DBFComdType; + ///DBFʱ + TThostFtdcDBFComTimeType DBFComTime; + ///DBFԭʼˮ + TThostFtdcDBFComNoType DBFOComNo; + ///DBFˮ + TThostFtdcDBFComNoType DBFComNo; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName1; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent1; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName2; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent2; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName3; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent3; + ///DBFֶ + TThostFtdcDBFFdNameType DBFFdName4; + ///DBFֶ + TThostFtdcDBFFdContentType DBFFdContent4; +}; + + + +#endif diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/error.dtd b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/error.dtd new file mode 100644 index 0000000000..15e50b7344 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/error.dtd @@ -0,0 +1,9 @@ + + + + + diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/error.xml b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/error.xml new file mode 100644 index 0000000000..57ef9921eb --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/error.xml @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/libthostmduserapi.so b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/libthostmduserapi.so new file mode 100644 index 0000000000..df013cd307 Binary files /dev/null and b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/libthostmduserapi.so differ diff --git a/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/libthosttraderapi.so b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/libthosttraderapi.so new file mode 100644 index 0000000000..fa76a112c3 Binary files /dev/null and b/vn.how/tick2trade/vn.ctp_t2t/ctpapi/x64_linux/libthosttraderapi.so differ diff --git a/vn.how/tick2trade/vn.ctp_t2t/readme.md b/vn.how/tick2trade/vn.ctp_t2t/readme.md new file mode 100644 index 0000000000..fa7c4b4f4f --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/readme.md @@ -0,0 +1,79 @@ +# vn.ctp + +### +CTP̨APIӿڵPythonװpyscriptĿ¼µĽűԶͷļɷװģ飬ṩԭC++ APIеȫܡ + + +### Ŀ¼˵ +* vnctpmd: API +* vnctptd: API +* pyscript: Զװű +* ctpapiC++ APIļ + +### ʹCMake + +**Windows 7** + +: + +* AnacondaBoostİװʽοwww.vnpy.orgϵĽ̳̣ʹ32λ + +* cmake:װ°汾cmake,ñ뻷 + +* ûBOOST_ROOT = C:\boost_1_57_0 + +* 빤ߣVisual Studio 2013 + + +: + +* vn.ctpĿ¼½ļУΪbuild, ʱļļ + +* й룺cmake-gui .. cmakeý + +* configure + +* generateûдóɹ + +* buildĿ¼˫vn_ctp_api.sln򿪽 + +* 밴ť,release + + +**Linux (Debian jessie, Ubuntu 16.04)** + +ã + +* ο[](http://www.continuum.io/downloads)Ľ̳زװAnacondaLinux 64λ汾 + +* ʹapt-getװصĹߣעijЩϵUbuntuָʹboost 1.58.0汾 + + - apt-get install build-essential + + - apt-get install libboost-all-dev + + - apt-get install python-dev + + - apt-get install cmake + +* ӹµctp api tarv6.3.5_20150803_tradeapi_linux64.tarҪctp api soļԺԸò裩 + + - thostmduserapi.so --> libthostmduserapi.so + + - thosttraderapi.so --> libthosttraderapi.so + + +̣ + +* ǰĿ¼build.shɱ + +### API汾 +ڣ2015-08-04 + +ƣfsopt_traderapi + +ȨAPI + +ӣ[http://www.sfit.com.cn/5_2_DocumentDown.htm](http://www.sfit.com.cn/5_2_DocumentDown.htm) + +˵ctpapiļµWindows32λ汾ļx64_linuxеLinux64λ汾 diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd.sln b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd.sln new file mode 100644 index 0000000000..0b85dc0023 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnctpmd", "vnctpmd\vnctpmd.vcxproj", "{5AFC4FBD-8C3A-4CFB-977D-C94C0E7141AF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AFC4FBD-8C3A-4CFB-977D-C94C0E7141AF}.Debug|Win32.ActiveCfg = Debug|Win32 + {5AFC4FBD-8C3A-4CFB-977D-C94C0E7141AF}.Debug|Win32.Build.0 = Debug|Win32 + {5AFC4FBD-8C3A-4CFB-977D-C94C0E7141AF}.Release|Win32.ActiveCfg = Release|Win32 + {5AFC4FBD-8C3A-4CFB-977D-C94C0E7141AF}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/ReadMe.txt b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/ReadMe.txt new file mode 100644 index 0000000000..a55db891a1 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : vnctpmd Project Overview +======================================================================== + +AppWizard has created this vnctpmd DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your vnctpmd application. + + +vnctpmd.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +vnctpmd.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +vnctpmd.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named vnctpmd.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/dllmain.cpp b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/dllmain.cpp new file mode 100644 index 0000000000..69b58914b3 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#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.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/stdafx.cpp b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/stdafx.cpp new file mode 100644 index 0000000000..2b1fc5c506 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// vnctpmd.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/stdafx.h b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/stdafx.h new file mode 100644 index 0000000000..f3a07375c7 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/targetver.h b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/targetver.h new file mode 100644 index 0000000000..87c0086de7 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.cpp b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.cpp new file mode 100644 index 0000000000..2f6a8f96fe --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.cpp @@ -0,0 +1,935 @@ +// vnctpmd.cpp : DLL Ӧóĵ +// + +#include "vnctpmd.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 getStr(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 +#ifdef _MSC_VER //WIN32 + strcpy_s(value, strlen(buffer) + 1, buffer); +#elif __GNUC__ + strncpy(value, buffer, strlen(buffer) + 1); +#endif + } + } +}; + +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(); + *value = *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::OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGIN; + + if (pRspUserLogin) + { + task.task_data = *pRspUserLogin; + } + else + { + CThostFtdcRspUserLoginField empty_data = CThostFtdcRspUserLoginField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGOUT; + + if (pUserLogout) + { + task.task_data = *pUserLogout; + } + else + { + CThostFtdcUserLogoutField empty_data = CThostFtdcUserLogoutField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPERROR; + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPSUBMARKETDATA; + + if (pSpecificInstrument) + { + task.task_data = *pSpecificInstrument; + } + else + { + CThostFtdcSpecificInstrumentField empty_data = CThostFtdcSpecificInstrumentField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUNSUBMARKETDATA; + + if (pSpecificInstrument) + { + task.task_data = *pSpecificInstrument; + } + else + { + CThostFtdcSpecificInstrumentField empty_data = CThostFtdcSpecificInstrumentField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPSUBFORQUOTERSP; + + if (pSpecificInstrument) + { + task.task_data = *pSpecificInstrument; + } + else + { + CThostFtdcSpecificInstrumentField empty_data = CThostFtdcSpecificInstrumentField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUNSUBFORQUOTERSP; + + if (pSpecificInstrument) + { + task.task_data = *pSpecificInstrument; + } + else + { + CThostFtdcSpecificInstrumentField empty_data = CThostFtdcSpecificInstrumentField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcDepthMarketDataField *pDepthMarketData) +{ + Task task = Task(); + + LARGE_INTEGER t; + QueryPerformanceCounter(&t); + task.task_time = t.QuadPart; + //task.task_time = std::clock(); + + task.task_name = ONRTNDEPTHMARKETDATA; + + if (pDepthMarketData) + { + task.task_data = *pDepthMarketData; + } + else + { + CThostFtdcDepthMarketDataField empty_data = CThostFtdcDepthMarketDataField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void MdApi::OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) +{ + Task task = Task(); + task.task_name = ONRTNFORQUOTERSP; + + if (pForQuoteRsp) + { + task.task_data = *pForQuoteRsp; + } + else + { + CThostFtdcForQuoteRspField empty_data = CThostFtdcForQuoteRspField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + 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 ONRSPUSERLOGIN: + { + this->processRspUserLogin(task); + break; + } + + case ONRSPUSERLOGOUT: + { + this->processRspUserLogout(task); + break; + } + + case ONRSPERROR: + { + this->processRspError(task); + break; + } + + case ONRSPSUBMARKETDATA: + { + this->processRspSubMarketData(task); + break; + } + + case ONRSPUNSUBMARKETDATA: + { + this->processRspUnSubMarketData(task); + break; + } + + case ONRSPSUBFORQUOTERSP: + { + this->processRspSubForQuoteRsp(task); + break; + } + + case ONRSPUNSUBFORQUOTERSP: + { + this->processRspUnSubForQuoteRsp(task); + break; + } + + case ONRTNDEPTHMARKETDATA: + { + this->processRtnDepthMarketData(task); + break; + } + + case ONRTNFORQUOTERSP: + { + this->processRtnForQuoteRsp(task); + break; + } + }; + } +}; + +void MdApi::processFrontConnected(Task task) +{ + PyLock lock; + this->onFrontConnected(); +}; + +void MdApi::processFrontDisconnected(Task task) +{ + PyLock lock; + this->onFrontDisconnected(task.task_id); +}; + +void MdApi::processHeartBeatWarning(Task task) +{ + PyLock lock; + this->onHeartBeatWarning(task.task_id); +}; + +void MdApi::processRspUserLogin(Task task) +{ + PyLock lock; + CThostFtdcRspUserLoginField task_data = any_cast(task.task_data); + dict data; + data["CZCETime"] = task_data.CZCETime; + data["SHFETime"] = task_data.SHFETime; + data["MaxOrderRef"] = task_data.MaxOrderRef; + data["INETime"] = task_data.INETime; + 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["FFEXTime"] = task_data.FFEXTime; + data["BrokerID"] = task_data.BrokerID; + data["DCETime"] = task_data.DCETime; + data["LoginTime"] = task_data.LoginTime; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcUserLogoutField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField 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::processRspError(Task task) +{ + PyLock lock; + CThostFtdcRspInfoField 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::processRspSubMarketData(Task task) +{ + PyLock lock; + CThostFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + + CThostFtdcRspInfoField 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::processRspSubForQuoteRsp(Task task) +{ + PyLock lock; + CThostFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspSubForQuoteRsp(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRspUnSubForQuoteRsp(Task task) +{ + PyLock lock; + CThostFtdcSpecificInstrumentField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspUnSubForQuoteRsp(data, error, task.task_id, task.task_last); +}; + +void MdApi::processRtnDepthMarketData(Task task) +{ + PyLock lock; + CThostFtdcDepthMarketDataField 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; + + //ʱ + data["tick_time"] = task.task_time; + data["frequency_time"] = this->t.QuadPart; + this->onRtnDepthMarketData(data); +}; + +void MdApi::processRtnForQuoteRsp(Task task) +{ + PyLock lock; + CThostFtdcForQuoteRspField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ActionDay"] = task_data.ActionDay; + data["ExchangeID"] = task_data.ExchangeID; + data["TradingDay"] = task_data.TradingDay; + data["ForQuoteSysID"] = task_data.ForQuoteSysID; + data["ForQuoteTime"] = task_data.ForQuoteTime; + + this->onRtnForQuoteRsp(data); +}; + + + +///------------------------------------------------------------------------------------- +/// +///------------------------------------------------------------------------------------- + +void MdApi::createFtdcMdApi(string pszFlowPath) +{ + this->api = CThostFtdcMdApi::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; +}; + +int MdApi::exit() +{ + //úԭAPIûУڰȫ˳APIãԭjoinƺ̫ȶ + this->api->RegisterSpi(NULL); + this->api->Release(); + this->api = NULL; + return 1; +}; + +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(string instrumentID) +{ + char* buffer = (char*) instrumentID.c_str(); + char* myreq[1] = { buffer }; + int i = this->api->SubscribeMarketData(myreq, 1); + return i; +}; + +int MdApi::unSubscribeMarketData(string instrumentID) +{ + char* buffer = (char*)instrumentID.c_str(); + char* myreq[1] = { buffer };; + int i = this->api->UnSubscribeMarketData(myreq, 1); + return i; +}; + +int MdApi::subscribeForQuoteRsp(string instrumentID) +{ + char* buffer = (char*)instrumentID.c_str(); + char* myreq[1] = { buffer }; + int i = this->api->SubscribeForQuoteRsp(myreq, 1); + return i; +}; + +int MdApi::unSubscribeForQuoteRsp(string instrumentID) +{ + char* buffer = (char*)instrumentID.c_str(); + char* myreq[1] = { buffer };; + int i = this->api->UnSubscribeForQuoteRsp(myreq, 1); + return i; +}; + +int MdApi::reqUserLogin(dict req, int nRequestID) +{ + CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "MacAddress", myreq.MacAddress); + getStr(req, "UserProductInfo", myreq.UserProductInfo); + getStr(req, "UserID", myreq.UserID); + getStr(req, "TradingDay", myreq.TradingDay); + getStr(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "ClientIPAddress", myreq.ClientIPAddress); + getStr(req, "OneTimePassword", myreq.OneTimePassword); + getStr(req, "ProtocolInfo", myreq.ProtocolInfo); + getStr(req, "Password", myreq.Password); + int i = this->api->ReqUserLogin(&myreq, nRequestID); + return i; +}; + +int MdApi::reqUserLogout(dict req, int nRequestID) +{ + CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "UserID", myreq.UserID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqUserLogout(&myreq, nRequestID); + return i; +}; + + + +///------------------------------------------------------------------------------------- +///Boost.Pythonװ +///------------------------------------------------------------------------------------- + +struct MdApiWrap : MdApi, wrapper < MdApi > +{ + virtual void onFrontConnected() + { + //µtry...catch...ʵֲ׽pythonдĹܣֹC++ֱӳԭδ֪ı + try + { + this->get_override("onFrontConnected")(); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onFrontDisconnected(int i) + { + try + { + this->get_override("onFrontDisconnected")(i); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onHeartBeatWarning(int i) + { + try + { + this->get_override("onHeartBeatWarning")(i); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspError(dict data, int id, bool last) + { + try + { + this->get_override("onRspError")(data, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUserLogin")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUserLogout")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspSubMarketData(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspSubMarketData")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUnSubMarketData(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUnSubMarketData")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspSubForQuoteRsp(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspSubForQuoteRsp")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUnSubForQuoteRsp(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUnSubForQuoteRsp")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnDepthMarketData(dict data) + { + try + { + this->get_override("onRtnDepthMarketData")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnForQuoteRsp(dict data) + { + try + { + this->get_override("onRtnForQuoteRsp")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; +}; + + +BOOST_PYTHON_MODULE(vnctpmd) +{ + PyEval_InitThreads(); //ʱУ֤ȴGIL + + class_("MdApi") + .def("createFtdcMdApi", &MdApiWrap::createFtdcMdApi) + .def("release", &MdApiWrap::release) + .def("init", &MdApiWrap::init) + .def("join", &MdApiWrap::join) + .def("exit", &MdApiWrap::exit) + .def("getTradingDay", &MdApiWrap::getTradingDay) + .def("registerFront", &MdApiWrap::registerFront) + .def("subscribeMarketData", &MdApiWrap::subscribeMarketData) + .def("unSubscribeMarketData", &MdApiWrap::unSubscribeMarketData) + .def("subscribeForQuoteRsp", &MdApiWrap::subscribeForQuoteRsp) + .def("unSubscribeForQuoteRsp", &MdApiWrap::unSubscribeForQuoteRsp) + .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)) + .def("onRspSubForQuoteRsp", pure_virtual(&MdApiWrap::onRspSubForQuoteRsp)) + .def("onRspUnSubForQuoteRsp", pure_virtual(&MdApiWrap::onRspUnSubForQuoteRsp)) + .def("onRtnForQuoteRsp", pure_virtual(&MdApiWrap::onRtnForQuoteRsp)) + ; +}; diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.h b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.h new file mode 100644 index 0000000000..2ad040d699 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.h @@ -0,0 +1,315 @@ +//˵ + +//ϵͳ +#ifdef WIN32 +#include "stdafx.h" +#endif +#include +#include + +//Boost +#define BOOST_PYTHON_STATIC_LIB +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //е̹߳ +#include //е̹߳ +#include //еʵ + +//API +#include "ThostFtdcMdApi.h" + +//ʱ +#include "windows.h" + +//ռ +using namespace std; +using namespace boost::python; +using namespace boost; + +// +#define ONFRONTCONNECTED 1 +#define ONFRONTDISCONNECTED 2 +#define ONHEARTBEATWARNING 3 +#define ONRSPUSERLOGIN 4 +#define ONRSPUSERLOGOUT 5 +#define ONRSPERROR 6 +#define ONRSPSUBMARKETDATA 7 +#define ONRSPUNSUBMARKETDATA 8 +#define ONRSPSUBFORQUOTERSP 9 +#define ONRSPUNSUBFORQUOTERSP 10 +#define ONRTNDEPTHMARKETDATA 11 +#define ONRTNFORQUOTERSP 12 + + + +///------------------------------------------------------------------------------------- +///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; //ǷΪ󷵻 + + LONGLONG task_time; //ʱõʱ +}; + + +///̰߳ȫĶ +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); + + +//ֵлȡijֵӦֵַṹֵ +void getStr(dict d, string key, char* value); + + +///------------------------------------------------------------------------------------- +///C++ SPIĻصʵ +///------------------------------------------------------------------------------------- + +//APIļ̳ʵ +class MdApi : public CThostFtdcMdSpi +{ +private: + CThostFtdcMdApi* api; //API + thread *task_thread; //ָ߳루pythonݣ + ConcurrentQueue task_queue; // + + LARGE_INTEGER t; + +public: + MdApi() + { + function0 f = boost::bind(&MdApi::processTask, this); + thread t(f); + this->task_thread = &t; + + QueryPerformanceFrequency(&this->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 OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///Ӧ + virtual void OnRspSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ȡӦ + virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ѯӦ + virtual void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///ȡѯӦ + virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField *pSpecificInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast); + + ///֪ͨ + virtual void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData); + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp); + + //------------------------------------------------------------------------------------- + //task + //------------------------------------------------------------------------------------- + + void processTask(); + + void processFrontConnected(Task task); + + void processFrontDisconnected(Task task); + + void processHeartBeatWarning(Task task); + + void processRspUserLogin(Task task); + + void processRspUserLogout(Task task); + + void processRspError(Task task); + + void processRspSubMarketData(Task task); + + void processRspUnSubMarketData(Task task); + + void processRspSubForQuoteRsp(Task task); + + void processRspUnSubForQuoteRsp(Task task); + + void processRtnDepthMarketData(Task task); + + void processRtnForQuoteRsp(Task task); + + //------------------------------------------------------------------------------------- + //dataصֵ + //errorصĴֵ + //idid + //lastǷΪ󷵻 + //i + //------------------------------------------------------------------------------------- + + virtual void onFrontConnected(){}; + + virtual void onFrontDisconnected(int i){}; + + virtual void onHeartBeatWarning(int i){}; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) {}; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) {}; + + virtual void onRspError(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 onRspSubForQuoteRsp(dict data, dict error, int id, bool last) {}; + + virtual void onRspUnSubForQuoteRsp(dict data, dict error, int id, bool last) {}; + + virtual void onRtnDepthMarketData(dict data) {}; + + virtual void onRtnForQuoteRsp(dict data) {}; + + //------------------------------------------------------------------------------------- + //req:ֵ + //------------------------------------------------------------------------------------- + + void createFtdcMdApi(string pszFlowPath = ""); + + void release(); + + void init(); + + int join(); + + int exit(); + + string getTradingDay(); + + void registerFront(string pszFrontAddress); + + int subscribeMarketData(string instrumentID); + + int unSubscribeMarketData(string instrumentID); + + int subscribeForQuoteRsp(string instrumentID); + + int unSubscribeForQuoteRsp(string instrumentID); + + int reqUserLogin(dict req, int nRequestID); + + int reqUserLogout(dict req, int nRequestID); +}; diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj new file mode 100644 index 0000000000..3aa7fc31a3 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj @@ -0,0 +1,120 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {5AFC4FBD-8C3A-4CFB-977D-C94C0E7141AF} + Win32Proj + vnctpmd + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + D:\Anaconda2\include;D:\boost_1_57_0;X:\GithubProject\vnpy\vn.ctp\ctpapi;$(IncludePath) + D:\boost_1_57_0\libs;D:\Anaconda2\libs;X:\GithubProject\vnpy\vn.ctp\ctpapi;$(ReferencePath) + .pyd + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;VNCTPMD_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;VNCTPMD_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + D:\boost_1_57_0\stage\lib;D:\Anaconda2\libs;X:\GithubProject\vnpy\vn.ctp\ctpapi;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + false + + + false + + + + + Create + Create + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj.filters b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj.filters new file mode 100644 index 0000000000..329899c11d --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj.filters @@ -0,0 +1,62 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + + + + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj.user b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj.user new file mode 100644 index 0000000000..ef5ff2a1fa --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctpmd/vnctpmd/vnctpmd.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd.sln b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd.sln new file mode 100644 index 0000000000..62f18e2514 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.40629.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnctptd", "vnctptd\vnctptd.vcxproj", "{9C81A42B-56A6-4E46-9F2E-8243061AAD25}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9C81A42B-56A6-4E46-9F2E-8243061AAD25}.Debug|Win32.ActiveCfg = Debug|Win32 + {9C81A42B-56A6-4E46-9F2E-8243061AAD25}.Debug|Win32.Build.0 = Debug|Win32 + {9C81A42B-56A6-4E46-9F2E-8243061AAD25}.Release|Win32.ActiveCfg = Release|Win32 + {9C81A42B-56A6-4E46-9F2E-8243061AAD25}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/ReadMe.txt b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/ReadMe.txt new file mode 100644 index 0000000000..2282768fbc --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : vnctptd Project Overview +======================================================================== + +AppWizard has created this vnctptd DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your vnctptd application. + + +vnctptd.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +vnctptd.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +vnctptd.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named vnctptd.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/dllmain.cpp b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/dllmain.cpp new file mode 100644 index 0000000000..69b58914b3 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#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.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/stdafx.cpp b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/stdafx.cpp new file mode 100644 index 0000000000..fe15b80540 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// vnctptd.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/stdafx.h b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/stdafx.h new file mode 100644 index 0000000000..f3a07375c7 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/targetver.h b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/targetver.h new file mode 100644 index 0000000000..87c0086de7 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.cpp b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.cpp new file mode 100644 index 0000000000..99408e3cbc --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.cpp @@ -0,0 +1,10525 @@ +// vnctptd.cpp : DLL Ӧóĵ +// + +#include "vnctptd.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 getLong(dict d, string key, LONG *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 getStr(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 +#ifdef _MSC_VER //WIN32 + strcpy_s(value, strlen(buffer) + 1, buffer); +#elif __GNUC__ + strncpy(value, buffer, strlen(buffer) + 1); +#endif + } + } +} + +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(); + *value = *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::OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPAUTHENTICATE; + + if (pRspAuthenticateField) + { + task.task_data = *pRspAuthenticateField; + } + else + { + CThostFtdcRspAuthenticateField empty_data = CThostFtdcRspAuthenticateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGIN; + + if (pRspUserLogin) + { + task.task_data = *pRspUserLogin; + } + else + { + CThostFtdcRspUserLoginField empty_data = CThostFtdcRspUserLoginField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERLOGOUT; + + if (pUserLogout) + { + task.task_data = *pUserLogout; + } + else + { + CThostFtdcUserLogoutField empty_data = CThostFtdcUserLogoutField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPUSERPASSWORDUPDATE; + + if (pUserPasswordUpdate) + { + task.task_data = *pUserPasswordUpdate; + } + else + { + CThostFtdcUserPasswordUpdateField empty_data = CThostFtdcUserPasswordUpdateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPTRADINGACCOUNTPASSWORDUPDATE; + + if (pTradingAccountPasswordUpdate) + { + task.task_data = *pTradingAccountPasswordUpdate; + } + else + { + CThostFtdcTradingAccountPasswordUpdateField empty_data = CThostFtdcTradingAccountPasswordUpdateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPORDERINSERT; + + if (pInputOrder) + { + task.task_data = *pInputOrder; + } + else + { + CThostFtdcInputOrderField empty_data = CThostFtdcInputOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPPARKEDORDERINSERT; + + if (pParkedOrder) + { + task.task_data = *pParkedOrder; + } + else + { + CThostFtdcParkedOrderField empty_data = CThostFtdcParkedOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPPARKEDORDERACTION; + + if (pParkedOrderAction) + { + task.task_data = *pParkedOrderAction; + } + else + { + CThostFtdcParkedOrderActionField empty_data = CThostFtdcParkedOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPORDERACTION; + + if (pInputOrderAction) + { + task.task_data = *pInputOrderAction; + } + else + { + CThostFtdcInputOrderActionField empty_data = CThostFtdcInputOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQUERYMAXORDERVOLUME; + + if (pQueryMaxOrderVolume) + { + task.task_data = *pQueryMaxOrderVolume; + } + else + { + CThostFtdcQueryMaxOrderVolumeField empty_data = CThostFtdcQueryMaxOrderVolumeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPSETTLEMENTINFOCONFIRM; + + if (pSettlementInfoConfirm) + { + task.task_data = *pSettlementInfoConfirm; + } + else + { + CThostFtdcSettlementInfoConfirmField empty_data = CThostFtdcSettlementInfoConfirmField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPREMOVEPARKEDORDER; + + if (pRemoveParkedOrder) + { + task.task_data = *pRemoveParkedOrder; + } + else + { + CThostFtdcRemoveParkedOrderField empty_data = CThostFtdcRemoveParkedOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPREMOVEPARKEDORDERACTION; + + if (pRemoveParkedOrderAction) + { + task.task_data = *pRemoveParkedOrderAction; + } + else + { + CThostFtdcRemoveParkedOrderActionField empty_data = CThostFtdcRemoveParkedOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPEXECORDERINSERT; + + if (pInputExecOrder) + { + task.task_data = *pInputExecOrder; + } + else + { + CThostFtdcInputExecOrderField empty_data = CThostFtdcInputExecOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPEXECORDERACTION; + + if (pInputExecOrderAction) + { + task.task_data = *pInputExecOrderAction; + } + else + { + CThostFtdcInputExecOrderActionField empty_data = CThostFtdcInputExecOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFORQUOTEINSERT; + + if (pInputForQuote) + { + task.task_data = *pInputForQuote; + } + else + { + CThostFtdcInputForQuoteField empty_data = CThostFtdcInputForQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQUOTEINSERT; + + if (pInputQuote) + { + task.task_data = *pInputQuote; + } + else + { + CThostFtdcInputQuoteField empty_data = CThostFtdcInputQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQUOTEACTION; + + if (pInputQuoteAction) + { + task.task_data = *pInputQuoteAction; + } + else + { + CThostFtdcInputQuoteActionField empty_data = CThostFtdcInputQuoteActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPLOCKINSERT; + + if (pInputLock) + { + task.task_data = *pInputLock; + } + else + { + CThostFtdcInputLockField empty_data = CThostFtdcInputLockField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPCOMBACTIONINSERT; + + if (pInputCombAction) + { + task.task_data = *pInputCombAction; + } + else + { + CThostFtdcInputCombActionField empty_data = CThostFtdcInputCombActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYORDER; + + if (pOrder) + { + task.task_data = *pOrder; + } + else + { + CThostFtdcOrderField empty_data = CThostFtdcOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADE; + + if (pTrade) + { + task.task_data = *pTrade; + } + else + { + CThostFtdcTradeField empty_data = CThostFtdcTradeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORPOSITION; + + if (pInvestorPosition) + { + task.task_data = *pInvestorPosition; + } + else + { + CThostFtdcInvestorPositionField empty_data = CThostFtdcInvestorPositionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGACCOUNT; + + if (pTradingAccount) + { + task.task_data = *pTradingAccount; + } + else + { + CThostFtdcTradingAccountField empty_data = CThostFtdcTradingAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTOR; + + if (pInvestor) + { + task.task_data = *pInvestor; + } + else + { + CThostFtdcInvestorField empty_data = CThostFtdcInvestorField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGCODE; + + if (pTradingCode) + { + task.task_data = *pTradingCode; + } + else + { + CThostFtdcTradingCodeField empty_data = CThostFtdcTradingCodeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENTMARGINRATE; + + if (pInstrumentMarginRate) + { + task.task_data = *pInstrumentMarginRate; + } + else + { + CThostFtdcInstrumentMarginRateField empty_data = CThostFtdcInstrumentMarginRateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENTCOMMISSIONRATE; + + if (pInstrumentCommissionRate) + { + task.task_data = *pInstrumentCommissionRate; + } + else + { + CThostFtdcInstrumentCommissionRateField empty_data = CThostFtdcInstrumentCommissionRateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXCHANGE; + + if (pExchange) + { + task.task_data = *pExchange; + } + else + { + CThostFtdcExchangeField empty_data = CThostFtdcExchangeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYPRODUCT; + + if (pProduct) + { + task.task_data = *pProduct; + } + else + { + CThostFtdcProductField empty_data = CThostFtdcProductField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINSTRUMENT; + + if (pInstrument) + { + task.task_data = *pInstrument; + } + else + { + CThostFtdcInstrumentField empty_data = CThostFtdcInstrumentField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYDEPTHMARKETDATA; + + if (pDepthMarketData) + { + task.task_data = *pDepthMarketData; + } + else + { + CThostFtdcDepthMarketDataField empty_data = CThostFtdcDepthMarketDataField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYSETTLEMENTINFO; + + if (pSettlementInfo) + { + task.task_data = *pSettlementInfo; + } + else + { + CThostFtdcSettlementInfoField empty_data = CThostFtdcSettlementInfoField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRANSFERBANK; + + if (pTransferBank) + { + task.task_data = *pTransferBank; + } + else + { + CThostFtdcTransferBankField empty_data = CThostFtdcTransferBankField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORPOSITIONDETAIL; + + if (pInvestorPositionDetail) + { + task.task_data = *pInvestorPositionDetail; + } + else + { + CThostFtdcInvestorPositionDetailField empty_data = CThostFtdcInvestorPositionDetailField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYNOTICE; + + if (pNotice) + { + task.task_data = *pNotice; + } + else + { + CThostFtdcNoticeField empty_data = CThostFtdcNoticeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYSETTLEMENTINFOCONFIRM; + + if (pSettlementInfoConfirm) + { + task.task_data = *pSettlementInfoConfirm; + } + else + { + CThostFtdcSettlementInfoConfirmField empty_data = CThostFtdcSettlementInfoConfirmField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORPOSITIONCOMBINEDETAIL; + + if (pInvestorPositionCombineDetail) + { + task.task_data = *pInvestorPositionCombineDetail; + } + else + { + CThostFtdcInvestorPositionCombineDetailField empty_data = CThostFtdcInvestorPositionCombineDetailField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYCFMMCTRADINGACCOUNTKEY; + + if (pCFMMCTradingAccountKey) + { + task.task_data = *pCFMMCTradingAccountKey; + } + else + { + CThostFtdcCFMMCTradingAccountKeyField empty_data = CThostFtdcCFMMCTradingAccountKeyField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEWARRANTOFFSET; + + if (pEWarrantOffset) + { + task.task_data = *pEWarrantOffset; + } + else + { + CThostFtdcEWarrantOffsetField empty_data = CThostFtdcEWarrantOffsetField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORPRODUCTGROUPMARGIN; + + if (pInvestorProductGroupMargin) + { + task.task_data = *pInvestorProductGroupMargin; + } + else + { + CThostFtdcInvestorProductGroupMarginField empty_data = CThostFtdcInvestorProductGroupMarginField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXCHANGEMARGINRATE; + + if (pExchangeMarginRate) + { + task.task_data = *pExchangeMarginRate; + } + else + { + CThostFtdcExchangeMarginRateField empty_data = CThostFtdcExchangeMarginRateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXCHANGEMARGINRATEADJUST; + + if (pExchangeMarginRateAdjust) + { + task.task_data = *pExchangeMarginRateAdjust; + } + else + { + CThostFtdcExchangeMarginRateAdjustField empty_data = CThostFtdcExchangeMarginRateAdjustField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXCHANGERATE; + + if (pExchangeRate) + { + task.task_data = *pExchangeRate; + } + else + { + CThostFtdcExchangeRateField empty_data = CThostFtdcExchangeRateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYSECAGENTACIDMAP; + + if (pSecAgentACIDMap) + { + task.task_data = *pSecAgentACIDMap; + } + else + { + CThostFtdcSecAgentACIDMapField empty_data = CThostFtdcSecAgentACIDMapField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYPRODUCTEXCHRATE; + + if (pProductExchRate) + { + task.task_data = *pProductExchRate; + } + else + { + CThostFtdcProductExchRateField empty_data = CThostFtdcProductExchRateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYPRODUCTGROUP; + + if (pProductGroup) + { + task.task_data = *pProductGroup; + } + else + { + CThostFtdcProductGroupField empty_data = CThostFtdcProductGroupField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYOPTIONINSTRTRADECOST; + + if (pOptionInstrTradeCost) + { + task.task_data = *pOptionInstrTradeCost; + } + else + { + CThostFtdcOptionInstrTradeCostField empty_data = CThostFtdcOptionInstrTradeCostField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYOPTIONINSTRCOMMRATE; + + if (pOptionInstrCommRate) + { + task.task_data = *pOptionInstrCommRate; + } + else + { + CThostFtdcOptionInstrCommRateField empty_data = CThostFtdcOptionInstrCommRateField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXECORDER; + + if (pExecOrder) + { + task.task_data = *pExecOrder; + } + else + { + CThostFtdcExecOrderField empty_data = CThostFtdcExecOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYFORQUOTE; + + if (pForQuote) + { + task.task_data = *pForQuote; + } + else + { + CThostFtdcForQuoteField empty_data = CThostFtdcForQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYQUOTE; + + if (pQuote) + { + task.task_data = *pQuote; + } + else + { + CThostFtdcQuoteField empty_data = CThostFtdcQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYLOCK; + + if (pLock) + { + task.task_data = *pLock; + } + else + { + CThostFtdcLockField empty_data = CThostFtdcLockField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYLOCKPOSITION; + + if (pLockPosition) + { + task.task_data = *pLockPosition; + } + else + { + CThostFtdcLockPositionField empty_data = CThostFtdcLockPositionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryInvestorLevel(CThostFtdcInvestorLevelField *pInvestorLevel, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYINVESTORLEVEL; + + if (pInvestorLevel) + { + task.task_data = *pInvestorLevel; + } + else + { + CThostFtdcInvestorLevelField empty_data = CThostFtdcInvestorLevelField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryExecFreeze(CThostFtdcExecFreezeField *pExecFreeze, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYEXECFREEZE; + + if (pExecFreeze) + { + task.task_data = *pExecFreeze; + } + else + { + CThostFtdcExecFreezeField empty_data = CThostFtdcExecFreezeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYCOMBINSTRUMENTGUARD; + + if (pCombInstrumentGuard) + { + task.task_data = *pCombInstrumentGuard; + } + else + { + CThostFtdcCombInstrumentGuardField empty_data = CThostFtdcCombInstrumentGuardField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYCOMBACTION; + + if (pCombAction) + { + task.task_data = *pCombAction; + } + else + { + CThostFtdcCombActionField empty_data = CThostFtdcCombActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRANSFERSERIAL; + + if (pTransferSerial) + { + task.task_data = *pTransferSerial; + } + else + { + CThostFtdcTransferSerialField empty_data = CThostFtdcTransferSerialField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYACCOUNTREGISTER; + + if (pAccountregister) + { + task.task_data = *pAccountregister; + } + else + { + CThostFtdcAccountregisterField empty_data = CThostFtdcAccountregisterField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPERROR; + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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(CThostFtdcOrderField *pOrder) +{ + Task task = Task(); + task.task_name = ONRTNORDER; + + if (pOrder) + { + task.task_data = *pOrder; + } + else + { + CThostFtdcOrderField empty_data = CThostFtdcOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnTrade(CThostFtdcTradeField *pTrade) +{ + Task task = Task(); + task.task_name = ONRTNTRADE; + + if (pTrade) + { + task.task_data = *pTrade; + } + else + { + CThostFtdcTradeField empty_data = CThostFtdcTradeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNORDERINSERT; + + if (pInputOrder) + { + task.task_data = *pInputOrder; + } + else + { + CThostFtdcInputOrderField empty_data = CThostFtdcInputOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNORDERACTION; + + if (pOrderAction) + { + task.task_data = *pOrderAction; + } + else + { + CThostFtdcOrderActionField empty_data = CThostFtdcOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) +{ + Task task = Task(); + task.task_name = ONRTNINSTRUMENTSTATUS; + + if (pInstrumentStatus) + { + task.task_data = *pInstrumentStatus; + } + else + { + CThostFtdcInstrumentStatusField empty_data = CThostFtdcInstrumentStatusField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) +{ + Task task = Task(); + task.task_name = ONRTNTRADINGNOTICE; + + if (pTradingNoticeInfo) + { + task.task_data = *pTradingNoticeInfo; + } + else + { + CThostFtdcTradingNoticeInfoField empty_data = CThostFtdcTradingNoticeInfoField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) +{ + Task task = Task(); + task.task_name = ONRTNERRORCONDITIONALORDER; + + if (pErrorConditionalOrder) + { + task.task_data = *pErrorConditionalOrder; + } + else + { + CThostFtdcErrorConditionalOrderField empty_data = CThostFtdcErrorConditionalOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) +{ + Task task = Task(); + task.task_name = ONRTNEXECORDER; + + if (pExecOrder) + { + task.task_data = *pExecOrder; + } + else + { + CThostFtdcExecOrderField empty_data = CThostFtdcExecOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNEXECORDERINSERT; + + if (pInputExecOrder) + { + task.task_data = *pInputExecOrder; + } + else + { + CThostFtdcInputExecOrderField empty_data = CThostFtdcInputExecOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNEXECORDERACTION; + + if (pExecOrderAction) + { + task.task_data = *pExecOrderAction; + } + else + { + CThostFtdcExecOrderActionField empty_data = CThostFtdcExecOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNFORQUOTEINSERT; + + if (pInputForQuote) + { + task.task_data = *pInputForQuote; + } + else + { + CThostFtdcInputForQuoteField empty_data = CThostFtdcInputForQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnQuote(CThostFtdcQuoteField *pQuote) +{ + Task task = Task(); + task.task_name = ONRTNQUOTE; + + if (pQuote) + { + task.task_data = *pQuote; + } + else + { + CThostFtdcQuoteField empty_data = CThostFtdcQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNQUOTEINSERT; + + if (pInputQuote) + { + task.task_data = *pInputQuote; + } + else + { + CThostFtdcInputQuoteField empty_data = CThostFtdcInputQuoteField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNQUOTEACTION; + + if (pQuoteAction) + { + task.task_data = *pQuoteAction; + } + else + { + CThostFtdcQuoteActionField empty_data = CThostFtdcQuoteActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) +{ + Task task = Task(); + task.task_name = ONRTNFORQUOTERSP; + + if (pForQuoteRsp) + { + task.task_data = *pForQuoteRsp; + } + else + { + CThostFtdcForQuoteRspField empty_data = CThostFtdcForQuoteRspField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) +{ + Task task = Task(); + task.task_name = ONRTNCFMMCTRADINGACCOUNTTOKEN; + + if (pCFMMCTradingAccountToken) + { + task.task_data = *pCFMMCTradingAccountToken; + } + else + { + CThostFtdcCFMMCTradingAccountTokenField empty_data = CThostFtdcCFMMCTradingAccountTokenField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnLock(CThostFtdcLockField *pLock) +{ + Task task = Task(); + task.task_name = ONRTNLOCK; + + if (pLock) + { + task.task_data = *pLock; + } + else + { + CThostFtdcLockField empty_data = CThostFtdcLockField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNLOCKINSERT; + + if (pInputLock) + { + task.task_data = *pInputLock; + } + else + { + CThostFtdcInputLockField empty_data = CThostFtdcInputLockField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnCombAction(CThostFtdcCombActionField *pCombAction) +{ + Task task = Task(); + task.task_name = ONRTNCOMBACTION; + + if (pCombAction) + { + task.task_data = *pCombAction; + } + else + { + CThostFtdcCombActionField empty_data = CThostFtdcCombActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNCOMBACTIONINSERT; + + if (pInputCombAction) + { + task.task_data = *pInputCombAction; + } + else + { + CThostFtdcInputCombActionField empty_data = CThostFtdcInputCombActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYCONTRACTBANK; + + if (pContractBank) + { + task.task_data = *pContractBank; + } + else + { + CThostFtdcContractBankField empty_data = CThostFtdcContractBankField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYPARKEDORDER; + + if (pParkedOrder) + { + task.task_data = *pParkedOrder; + } + else + { + CThostFtdcParkedOrderField empty_data = CThostFtdcParkedOrderField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYPARKEDORDERACTION; + + if (pParkedOrderAction) + { + task.task_data = *pParkedOrderAction; + } + else + { + CThostFtdcParkedOrderActionField empty_data = CThostFtdcParkedOrderActionField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYTRADINGNOTICE; + + if (pTradingNotice) + { + task.task_data = *pTradingNotice; + } + else + { + CThostFtdcTradingNoticeField empty_data = CThostFtdcTradingNoticeField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYBROKERTRADINGPARAMS; + + if (pBrokerTradingParams) + { + task.task_data = *pBrokerTradingParams; + } + else + { + CThostFtdcBrokerTradingParamsField empty_data = CThostFtdcBrokerTradingParamsField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQRYBROKERTRADINGALGOS; + + if (pBrokerTradingAlgos) + { + task.task_data = *pBrokerTradingAlgos; + } + else + { + CThostFtdcBrokerTradingAlgosField empty_data = CThostFtdcBrokerTradingAlgosField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQUERYCFMMCTRADINGACCOUNTTOKEN; + + if (pQueryCFMMCTradingAccountToken) + { + task.task_data = *pQueryCFMMCTradingAccountToken; + } + else + { + CThostFtdcQueryCFMMCTradingAccountTokenField empty_data = CThostFtdcQueryCFMMCTradingAccountTokenField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFROMBANKTOFUTUREBYBANK; + + if (pRspTransfer) + { + task.task_data = *pRspTransfer; + } + else + { + CThostFtdcRspTransferField empty_data = CThostFtdcRspTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFROMFUTURETOBANKBYBANK; + + if (pRspTransfer) + { + task.task_data = *pRspTransfer; + } + else + { + CThostFtdcRspTransferField empty_data = CThostFtdcRspTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) +{ + Task task = Task(); + task.task_name = ONRTNREPEALFROMBANKTOFUTUREBYBANK; + + if (pRspRepeal) + { + task.task_data = *pRspRepeal; + } + else + { + CThostFtdcRspRepealField empty_data = CThostFtdcRspRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) +{ + Task task = Task(); + task.task_name = ONRTNREPEALFROMFUTURETOBANKBYBANK; + + if (pRspRepeal) + { + task.task_data = *pRspRepeal; + } + else + { + CThostFtdcRspRepealField empty_data = CThostFtdcRspRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFROMBANKTOFUTUREBYFUTURE; + + if (pRspTransfer) + { + task.task_data = *pRspTransfer; + } + else + { + CThostFtdcRspTransferField empty_data = CThostFtdcRspTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) +{ + Task task = Task(); + task.task_name = ONRTNFROMFUTURETOBANKBYFUTURE; + + if (pRspTransfer) + { + task.task_data = *pRspTransfer; + } + else + { + CThostFtdcRspTransferField empty_data = CThostFtdcRspTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) +{ + Task task = Task(); + task.task_name = ONRTNREPEALFROMBANKTOFUTUREBYFUTUREMANUAL; + + if (pRspRepeal) + { + task.task_data = *pRspRepeal; + } + else + { + CThostFtdcRspRepealField empty_data = CThostFtdcRspRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) +{ + Task task = Task(); + task.task_name = ONRTNREPEALFROMFUTURETOBANKBYFUTUREMANUAL; + + if (pRspRepeal) + { + task.task_data = *pRspRepeal; + } + else + { + CThostFtdcRspRepealField empty_data = CThostFtdcRspRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) +{ + Task task = Task(); + task.task_name = ONRTNQUERYBANKBALANCEBYFUTURE; + + if (pNotifyQueryAccount) + { + task.task_data = *pNotifyQueryAccount; + } + else + { + CThostFtdcNotifyQueryAccountField empty_data = CThostFtdcNotifyQueryAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNBANKTOFUTUREBYFUTURE; + + if (pReqTransfer) + { + task.task_data = *pReqTransfer; + } + else + { + CThostFtdcReqTransferField empty_data = CThostFtdcReqTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNFUTURETOBANKBYFUTURE; + + if (pReqTransfer) + { + task.task_data = *pReqTransfer; + } + else + { + CThostFtdcReqTransferField empty_data = CThostFtdcReqTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNREPEALBANKTOFUTUREBYFUTUREMANUAL; + + if (pReqRepeal) + { + task.task_data = *pReqRepeal; + } + else + { + CThostFtdcReqRepealField empty_data = CThostFtdcReqRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNREPEALFUTURETOBANKBYFUTUREMANUAL; + + if (pReqRepeal) + { + task.task_data = *pReqRepeal; + } + else + { + CThostFtdcReqRepealField empty_data = CThostFtdcReqRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) +{ + Task task = Task(); + task.task_name = ONERRRTNQUERYBANKBALANCEBYFUTURE; + + if (pReqQueryAccount) + { + task.task_data = *pReqQueryAccount; + } + else + { + CThostFtdcReqQueryAccountField empty_data = CThostFtdcReqQueryAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + memset(&empty_error, 0, sizeof(empty_error)); + task.task_error = empty_error; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) +{ + Task task = Task(); + task.task_name = ONRTNREPEALFROMBANKTOFUTUREBYFUTURE; + + if (pRspRepeal) + { + task.task_data = *pRspRepeal; + } + else + { + CThostFtdcRspRepealField empty_data = CThostFtdcRspRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) +{ + Task task = Task(); + task.task_name = ONRTNREPEALFROMFUTURETOBANKBYFUTURE; + + if (pRspRepeal) + { + task.task_data = *pRspRepeal; + } + else + { + CThostFtdcRspRepealField empty_data = CThostFtdcRspRepealField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFROMBANKTOFUTUREBYFUTURE; + + if (pReqTransfer) + { + task.task_data = *pReqTransfer; + } + else + { + CThostFtdcReqTransferField empty_data = CThostFtdcReqTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPFROMFUTURETOBANKBYFUTURE; + + if (pReqTransfer) + { + task.task_data = *pReqTransfer; + } + else + { + CThostFtdcReqTransferField empty_data = CThostFtdcReqTransferField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) +{ + Task task = Task(); + task.task_name = ONRSPQUERYBANKACCOUNTMONEYBYFUTURE; + + if (pReqQueryAccount) + { + task.task_data = *pReqQueryAccount; + } + else + { + CThostFtdcReqQueryAccountField empty_data = CThostFtdcReqQueryAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + + if (pRspInfo) + { + task.task_error = *pRspInfo; + } + else + { + CThostFtdcRspInfoField empty_error = CThostFtdcRspInfoField(); + 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::OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) +{ + Task task = Task(); + task.task_name = ONRTNOPENACCOUNTBYBANK; + + if (pOpenAccount) + { + task.task_data = *pOpenAccount; + } + else + { + CThostFtdcOpenAccountField empty_data = CThostFtdcOpenAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) +{ + Task task = Task(); + task.task_name = ONRTNCANCELACCOUNTBYBANK; + + if (pCancelAccount) + { + task.task_data = *pCancelAccount; + } + else + { + CThostFtdcCancelAccountField empty_data = CThostFtdcCancelAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + this->task_queue.push(task); +}; + +void TdApi::OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) +{ + Task task = Task(); + task.task_name = ONRTNCHANGEACCOUNTBYBANK; + + if (pChangeAccount) + { + task.task_data = *pChangeAccount; + } + else + { + CThostFtdcChangeAccountField empty_data = CThostFtdcChangeAccountField(); + memset(&empty_data, 0, sizeof(empty_data)); + task.task_data = empty_data; + } + 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 ONRSPAUTHENTICATE: + { + this->processRspAuthenticate(task); + break; + } + + case ONRSPUSERLOGIN: + { + this->processRspUserLogin(task); + break; + } + + case ONRSPUSERLOGOUT: + { + this->processRspUserLogout(task); + break; + } + + case ONRSPUSERPASSWORDUPDATE: + { + this->processRspUserPasswordUpdate(task); + break; + } + + case ONRSPTRADINGACCOUNTPASSWORDUPDATE: + { + this->processRspTradingAccountPasswordUpdate(task); + break; + } + + case ONRSPORDERINSERT: + { + this->processRspOrderInsert(task); + break; + } + + case ONRSPPARKEDORDERINSERT: + { + this->processRspParkedOrderInsert(task); + break; + } + + case ONRSPPARKEDORDERACTION: + { + this->processRspParkedOrderAction(task); + break; + } + + case ONRSPORDERACTION: + { + this->processRspOrderAction(task); + break; + } + + case ONRSPQUERYMAXORDERVOLUME: + { + this->processRspQueryMaxOrderVolume(task); + break; + } + + case ONRSPSETTLEMENTINFOCONFIRM: + { + this->processRspSettlementInfoConfirm(task); + break; + } + + case ONRSPREMOVEPARKEDORDER: + { + this->processRspRemoveParkedOrder(task); + break; + } + + case ONRSPREMOVEPARKEDORDERACTION: + { + this->processRspRemoveParkedOrderAction(task); + break; + } + + case ONRSPEXECORDERINSERT: + { + this->processRspExecOrderInsert(task); + break; + } + + case ONRSPEXECORDERACTION: + { + this->processRspExecOrderAction(task); + break; + } + + case ONRSPFORQUOTEINSERT: + { + this->processRspForQuoteInsert(task); + break; + } + + case ONRSPQUOTEINSERT: + { + this->processRspQuoteInsert(task); + break; + } + + case ONRSPQUOTEACTION: + { + this->processRspQuoteAction(task); + break; + } + + case ONRSPLOCKINSERT: + { + this->processRspLockInsert(task); + break; + } + + case ONRSPCOMBACTIONINSERT: + { + this->processRspCombActionInsert(task); + break; + } + + case ONRSPQRYORDER: + { + this->processRspQryOrder(task); + break; + } + + case ONRSPQRYTRADE: + { + this->processRspQryTrade(task); + break; + } + + case ONRSPQRYINVESTORPOSITION: + { + this->processRspQryInvestorPosition(task); + break; + } + + case ONRSPQRYTRADINGACCOUNT: + { + this->processRspQryTradingAccount(task); + break; + } + + case ONRSPQRYINVESTOR: + { + this->processRspQryInvestor(task); + break; + } + + case ONRSPQRYTRADINGCODE: + { + this->processRspQryTradingCode(task); + break; + } + + case ONRSPQRYINSTRUMENTMARGINRATE: + { + this->processRspQryInstrumentMarginRate(task); + break; + } + + case ONRSPQRYINSTRUMENTCOMMISSIONRATE: + { + this->processRspQryInstrumentCommissionRate(task); + break; + } + + case ONRSPQRYEXCHANGE: + { + this->processRspQryExchange(task); + break; + } + + case ONRSPQRYPRODUCT: + { + this->processRspQryProduct(task); + break; + } + + case ONRSPQRYINSTRUMENT: + { + this->processRspQryInstrument(task); + break; + } + + case ONRSPQRYDEPTHMARKETDATA: + { + this->processRspQryDepthMarketData(task); + break; + } + + case ONRSPQRYSETTLEMENTINFO: + { + this->processRspQrySettlementInfo(task); + break; + } + + case ONRSPQRYTRANSFERBANK: + { + this->processRspQryTransferBank(task); + break; + } + + case ONRSPQRYINVESTORPOSITIONDETAIL: + { + this->processRspQryInvestorPositionDetail(task); + break; + } + + case ONRSPQRYNOTICE: + { + this->processRspQryNotice(task); + break; + } + + case ONRSPQRYSETTLEMENTINFOCONFIRM: + { + this->processRspQrySettlementInfoConfirm(task); + break; + } + + case ONRSPQRYINVESTORPOSITIONCOMBINEDETAIL: + { + this->processRspQryInvestorPositionCombineDetail(task); + break; + } + + case ONRSPQRYCFMMCTRADINGACCOUNTKEY: + { + this->processRspQryCFMMCTradingAccountKey(task); + break; + } + + case ONRSPQRYEWARRANTOFFSET: + { + this->processRspQryEWarrantOffset(task); + break; + } + + case ONRSPQRYINVESTORPRODUCTGROUPMARGIN: + { + this->processRspQryInvestorProductGroupMargin(task); + break; + } + + case ONRSPQRYEXCHANGEMARGINRATE: + { + this->processRspQryExchangeMarginRate(task); + break; + } + + case ONRSPQRYEXCHANGEMARGINRATEADJUST: + { + this->processRspQryExchangeMarginRateAdjust(task); + break; + } + + case ONRSPQRYEXCHANGERATE: + { + this->processRspQryExchangeRate(task); + break; + } + + case ONRSPQRYSECAGENTACIDMAP: + { + this->processRspQrySecAgentACIDMap(task); + break; + } + + case ONRSPQRYPRODUCTEXCHRATE: + { + this->processRspQryProductExchRate(task); + break; + } + + case ONRSPQRYPRODUCTGROUP: + { + this->processRspQryProductGroup(task); + break; + } + + case ONRSPQRYOPTIONINSTRTRADECOST: + { + this->processRspQryOptionInstrTradeCost(task); + break; + } + + case ONRSPQRYOPTIONINSTRCOMMRATE: + { + this->processRspQryOptionInstrCommRate(task); + break; + } + + case ONRSPQRYEXECORDER: + { + this->processRspQryExecOrder(task); + break; + } + + case ONRSPQRYFORQUOTE: + { + this->processRspQryForQuote(task); + break; + } + + case ONRSPQRYQUOTE: + { + this->processRspQryQuote(task); + break; + } + + case ONRSPQRYLOCK: + { + this->processRspQryLock(task); + break; + } + + case ONRSPQRYLOCKPOSITION: + { + this->processRspQryLockPosition(task); + break; + } + + case ONRSPQRYINVESTORLEVEL: + { + this->processRspQryInvestorLevel(task); + break; + } + + case ONRSPQRYEXECFREEZE: + { + this->processRspQryExecFreeze(task); + break; + } + + case ONRSPQRYCOMBINSTRUMENTGUARD: + { + this->processRspQryCombInstrumentGuard(task); + break; + } + + case ONRSPQRYCOMBACTION: + { + this->processRspQryCombAction(task); + break; + } + + case ONRSPQRYTRANSFERSERIAL: + { + this->processRspQryTransferSerial(task); + break; + } + + case ONRSPQRYACCOUNTREGISTER: + { + this->processRspQryAccountregister(task); + break; + } + + case ONRSPERROR: + { + this->processRspError(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 ONRTNINSTRUMENTSTATUS: + { + this->processRtnInstrumentStatus(task); + break; + } + + case ONRTNTRADINGNOTICE: + { + this->processRtnTradingNotice(task); + break; + } + + case ONRTNERRORCONDITIONALORDER: + { + this->processRtnErrorConditionalOrder(task); + break; + } + + case ONRTNEXECORDER: + { + this->processRtnExecOrder(task); + break; + } + + case ONERRRTNEXECORDERINSERT: + { + this->processErrRtnExecOrderInsert(task); + break; + } + + case ONERRRTNEXECORDERACTION: + { + this->processErrRtnExecOrderAction(task); + break; + } + + case ONERRRTNFORQUOTEINSERT: + { + this->processErrRtnForQuoteInsert(task); + break; + } + + case ONRTNQUOTE: + { + this->processRtnQuote(task); + break; + } + + case ONERRRTNQUOTEINSERT: + { + this->processErrRtnQuoteInsert(task); + break; + } + + case ONERRRTNQUOTEACTION: + { + this->processErrRtnQuoteAction(task); + break; + } + + case ONRTNFORQUOTERSP: + { + this->processRtnForQuoteRsp(task); + break; + } + + case ONRTNCFMMCTRADINGACCOUNTTOKEN: + { + this->processRtnCFMMCTradingAccountToken(task); + break; + } + + case ONRTNLOCK: + { + this->processRtnLock(task); + break; + } + + case ONERRRTNLOCKINSERT: + { + this->processErrRtnLockInsert(task); + break; + } + + case ONRTNCOMBACTION: + { + this->processRtnCombAction(task); + break; + } + + case ONERRRTNCOMBACTIONINSERT: + { + this->processErrRtnCombActionInsert(task); + break; + } + + case ONRSPQRYCONTRACTBANK: + { + this->processRspQryContractBank(task); + break; + } + + case ONRSPQRYPARKEDORDER: + { + this->processRspQryParkedOrder(task); + break; + } + + case ONRSPQRYPARKEDORDERACTION: + { + this->processRspQryParkedOrderAction(task); + break; + } + + case ONRSPQRYTRADINGNOTICE: + { + this->processRspQryTradingNotice(task); + break; + } + + case ONRSPQRYBROKERTRADINGPARAMS: + { + this->processRspQryBrokerTradingParams(task); + break; + } + + case ONRSPQRYBROKERTRADINGALGOS: + { + this->processRspQryBrokerTradingAlgos(task); + break; + } + + case ONRSPQUERYCFMMCTRADINGACCOUNTTOKEN: + { + this->processRspQueryCFMMCTradingAccountToken(task); + break; + } + + case ONRTNFROMBANKTOFUTUREBYBANK: + { + this->processRtnFromBankToFutureByBank(task); + break; + } + + case ONRTNFROMFUTURETOBANKBYBANK: + { + this->processRtnFromFutureToBankByBank(task); + break; + } + + case ONRTNREPEALFROMBANKTOFUTUREBYBANK: + { + this->processRtnRepealFromBankToFutureByBank(task); + break; + } + + case ONRTNREPEALFROMFUTURETOBANKBYBANK: + { + this->processRtnRepealFromFutureToBankByBank(task); + break; + } + + case ONRTNFROMBANKTOFUTUREBYFUTURE: + { + this->processRtnFromBankToFutureByFuture(task); + break; + } + + case ONRTNFROMFUTURETOBANKBYFUTURE: + { + this->processRtnFromFutureToBankByFuture(task); + break; + } + + case ONRTNREPEALFROMBANKTOFUTUREBYFUTUREMANUAL: + { + this->processRtnRepealFromBankToFutureByFutureManual(task); + break; + } + + case ONRTNREPEALFROMFUTURETOBANKBYFUTUREMANUAL: + { + this->processRtnRepealFromFutureToBankByFutureManual(task); + break; + } + + case ONRTNQUERYBANKBALANCEBYFUTURE: + { + this->processRtnQueryBankBalanceByFuture(task); + break; + } + + case ONERRRTNBANKTOFUTUREBYFUTURE: + { + this->processErrRtnBankToFutureByFuture(task); + break; + } + + case ONERRRTNFUTURETOBANKBYFUTURE: + { + this->processErrRtnFutureToBankByFuture(task); + break; + } + + case ONERRRTNREPEALBANKTOFUTUREBYFUTUREMANUAL: + { + this->processErrRtnRepealBankToFutureByFutureManual(task); + break; + } + + case ONERRRTNREPEALFUTURETOBANKBYFUTUREMANUAL: + { + this->processErrRtnRepealFutureToBankByFutureManual(task); + break; + } + + case ONERRRTNQUERYBANKBALANCEBYFUTURE: + { + this->processErrRtnQueryBankBalanceByFuture(task); + break; + } + + case ONRTNREPEALFROMBANKTOFUTUREBYFUTURE: + { + this->processRtnRepealFromBankToFutureByFuture(task); + break; + } + + case ONRTNREPEALFROMFUTURETOBANKBYFUTURE: + { + this->processRtnRepealFromFutureToBankByFuture(task); + break; + } + + case ONRSPFROMBANKTOFUTUREBYFUTURE: + { + this->processRspFromBankToFutureByFuture(task); + break; + } + + case ONRSPFROMFUTURETOBANKBYFUTURE: + { + this->processRspFromFutureToBankByFuture(task); + break; + } + + case ONRSPQUERYBANKACCOUNTMONEYBYFUTURE: + { + this->processRspQueryBankAccountMoneyByFuture(task); + break; + } + + case ONRTNOPENACCOUNTBYBANK: + { + this->processRtnOpenAccountByBank(task); + break; + } + + case ONRTNCANCELACCOUNTBYBANK: + { + this->processRtnCancelAccountByBank(task); + break; + } + + case ONRTNCHANGEACCOUNTBYBANK: + { + this->processRtnChangeAccountByBank(task); + break; + } + } + } +} + +void TdApi::processFrontConnected(Task task) +{ + PyLock lock; + this->onFrontConnected(); +}; + +void TdApi::processFrontDisconnected(Task task) +{ + PyLock lock; + this->onFrontDisconnected(task.task_id); +}; + +void TdApi::processHeartBeatWarning(Task task) +{ + PyLock lock; + this->onHeartBeatWarning(task.task_id); +}; + +void TdApi::processRspAuthenticate(Task task) +{ + PyLock lock; + CThostFtdcRspAuthenticateField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + data["UserProductInfo"] = task_data.UserProductInfo; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspAuthenticate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspUserLogin(Task task) +{ + PyLock lock; + CThostFtdcRspUserLoginField task_data = any_cast(task.task_data); + dict data; + data["CZCETime"] = task_data.CZCETime; + data["SHFETime"] = task_data.SHFETime; + data["MaxOrderRef"] = task_data.MaxOrderRef; + data["INETime"] = task_data.INETime; + 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["FFEXTime"] = task_data.FFEXTime; + data["BrokerID"] = task_data.BrokerID; + data["DCETime"] = task_data.DCETime; + data["LoginTime"] = task_data.LoginTime; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcUserLogoutField task_data = any_cast(task.task_data); + dict data; + data["UserID"] = task_data.UserID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField 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::processRspUserPasswordUpdate(Task task) +{ + PyLock lock; + CThostFtdcUserPasswordUpdateField 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; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcTradingAccountPasswordUpdateField task_data = any_cast(task.task_data); + dict data; + data["CurrencyID"] = task_data.CurrencyID; + data["NewPassword"] = task_data.NewPassword; + data["OldPassword"] = task_data.OldPassword; + data["BrokerID"] = task_data.BrokerID; + data["AccountID"] = task_data.AccountID; + + CThostFtdcRspInfoField 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::processRspOrderInsert(Task task) +{ + PyLock lock; + CThostFtdcInputOrderField 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["IsSwapOrder"] = task_data.IsSwapOrder; + 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; + + CThostFtdcRspInfoField 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::processRspParkedOrderInsert(Task task) +{ + PyLock lock; + CThostFtdcParkedOrderField 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["Status"] = task_data.Status; + data["Direction"] = task_data.Direction; + data["IsSwapOrder"] = task_data.IsSwapOrder; + data["UserType"] = task_data.UserType; + 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["ErrorID"] = task_data.ErrorID; + data["ParkedOrderID"] = task_data.ParkedOrderID; + data["BrokerID"] = task_data.BrokerID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["GTDDate"] = task_data.GTDDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["ErrorMsg"] = task_data.ErrorMsg; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspParkedOrderInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspParkedOrderAction(Task task) +{ + PyLock lock; + CThostFtdcParkedOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["Status"] = task_data.Status; + data["ExchangeID"] = task_data.ExchangeID; + data["ActionFlag"] = task_data.ActionFlag; + data["OrderActionRef"] = task_data.OrderActionRef; + data["UserType"] = task_data.UserType; + data["ErrorMsg"] = task_data.ErrorMsg; + 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["OrderSysID"] = task_data.OrderSysID; + data["ParkedOrderActionID"] = task_data.ParkedOrderActionID; + data["FrontID"] = task_data.FrontID; + data["ErrorID"] = task_data.ErrorID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspParkedOrderAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspOrderAction(Task task) +{ + PyLock lock; + CThostFtdcInputOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["ActionFlag"] = task_data.ActionFlag; + 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["OrderSysID"] = task_data.OrderSysID; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField 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::processRspQueryMaxOrderVolume(Task task) +{ + PyLock lock; + CThostFtdcQueryMaxOrderVolumeField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["Direction"] = task_data.Direction; + data["OffsetFlag"] = task_data.OffsetFlag; + data["HedgeFlag"] = task_data.HedgeFlag; + data["ExchangeID"] = task_data.ExchangeID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["MaxVolume"] = task_data.MaxVolume; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQueryMaxOrderVolume(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspSettlementInfoConfirm(Task task) +{ + PyLock lock; + CThostFtdcSettlementInfoConfirmField task_data = any_cast(task.task_data); + dict data; + data["ConfirmTime"] = task_data.ConfirmTime; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["ConfirmDate"] = task_data.ConfirmDate; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspSettlementInfoConfirm(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspRemoveParkedOrder(Task task) +{ + PyLock lock; + CThostFtdcRemoveParkedOrderField task_data = any_cast(task.task_data); + dict data; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["ParkedOrderID"] = task_data.ParkedOrderID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspRemoveParkedOrder(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspRemoveParkedOrderAction(Task task) +{ + PyLock lock; + CThostFtdcRemoveParkedOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["ParkedOrderActionID"] = task_data.ParkedOrderActionID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspRemoveParkedOrderAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspExecOrderInsert(Task task) +{ + PyLock lock; + CThostFtdcInputExecOrderField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExecOrderRef"] = task_data.ExecOrderRef; + data["ExchangeID"] = task_data.ExchangeID; + data["CloseFlag"] = task_data.CloseFlag; + data["OffsetFlag"] = task_data.OffsetFlag; + data["PosiDirection"] = task_data.PosiDirection; + data["BusinessUnit"] = task_data.BusinessUnit; + data["HedgeFlag"] = task_data.HedgeFlag; + data["UserID"] = task_data.UserID; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ActionType"] = task_data.ActionType; + data["ReservePositionFlag"] = task_data.ReservePositionFlag; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspExecOrderInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspExecOrderAction(Task task) +{ + PyLock lock; + CThostFtdcInputExecOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExecOrderSysID"] = task_data.ExecOrderSysID; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["ExecOrderRef"] = task_data.ExecOrderRef; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ActionFlag"] = task_data.ActionFlag; + data["ExecOrderActionRef"] = task_data.ExecOrderActionRef; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspExecOrderAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspForQuoteInsert(Task task) +{ + PyLock lock; + CThostFtdcInputForQuoteField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ForQuoteRef"] = task_data.ForQuoteRef; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspForQuoteInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQuoteInsert(Task task) +{ + PyLock lock; + CThostFtdcInputQuoteField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["AskHedgeFlag"] = task_data.AskHedgeFlag; + data["BusinessUnit"] = task_data.BusinessUnit; + data["AskPrice"] = task_data.AskPrice; + data["UserID"] = task_data.UserID; + data["AskOffsetFlag"] = task_data.AskOffsetFlag; + data["BidVolume"] = task_data.BidVolume; + data["AskOrderRef"] = task_data.AskOrderRef; + data["AskVolume"] = task_data.AskVolume; + data["InvestorID"] = task_data.InvestorID; + data["BidOffsetFlag"] = task_data.BidOffsetFlag; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ForQuoteSysID"] = task_data.ForQuoteSysID; + data["BidPrice"] = task_data.BidPrice; + data["BidHedgeFlag"] = task_data.BidHedgeFlag; + data["QuoteRef"] = task_data.QuoteRef; + data["BidOrderRef"] = task_data.BidOrderRef; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQuoteInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQuoteAction(Task task) +{ + PyLock lock; + CThostFtdcInputQuoteActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["QuoteActionRef"] = task_data.QuoteActionRef; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["SessionID"] = task_data.SessionID; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ActionFlag"] = task_data.ActionFlag; + data["FrontID"] = task_data.FrontID; + data["QuoteSysID"] = task_data.QuoteSysID; + data["QuoteRef"] = task_data.QuoteRef; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQuoteAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspLockInsert(Task task) +{ + PyLock lock; + CThostFtdcInputLockField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["UserID"] = task_data.UserID; + data["LockRef"] = task_data.LockRef; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["LockType"] = task_data.LockType; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspLockInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspCombActionInsert(Task task) +{ + PyLock lock; + CThostFtdcInputCombActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["Direction"] = task_data.Direction; + data["CombActionRef"] = task_data.CombActionRef; + data["HedgeFlag"] = task_data.HedgeFlag; + data["UserID"] = task_data.UserID; + data["ExchangeID"] = task_data.ExchangeID; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["CombDirection"] = task_data.CombDirection; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspCombActionInsert(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOrder(Task task) +{ + PyLock lock; + CThostFtdcOrderField 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["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["IsSwapOrder"] = task_data.IsSwapOrder; + 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["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["SettlementID"] = task_data.SettlementID; + 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["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["ZCETotalTradedVolume"] = task_data.ZCETotalTradedVolume; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcTradeField task_data = any_cast(task.task_data); + dict data; + data["TradeType"] = task_data.TradeType; + data["TraderID"] = task_data.TraderID; + 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["SettlementID"] = task_data.SettlementID; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + 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["TradeSource"] = task_data.TradeSource; + data["PriceSource"] = task_data.PriceSource; + data["TradingRole"] = task_data.TradingRole; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcInvestorPositionField task_data = any_cast(task.task_data); + dict data; + data["ShortFrozenAmount"] = task_data.ShortFrozenAmount; + data["FrozenMargin"] = task_data.FrozenMargin; + data["HedgeFlag"] = task_data.HedgeFlag; + data["PositionProfit"] = task_data.PositionProfit; + data["Commission"] = task_data.Commission; + data["MarginRateByVolume"] = task_data.MarginRateByVolume; + data["StrikeFrozen"] = task_data.StrikeFrozen; + data["CombPosition"] = task_data.CombPosition; + data["CashIn"] = task_data.CashIn; + data["PreSettlementPrice"] = task_data.PreSettlementPrice; + data["CombLongFrozen"] = task_data.CombLongFrozen; + data["CloseAmount"] = task_data.CloseAmount; + data["PosiDirection"] = task_data.PosiDirection; + data["YdPosition"] = task_data.YdPosition; + data["MarginRateByMoney"] = task_data.MarginRateByMoney; + data["AbandonFrozen"] = task_data.AbandonFrozen; + data["OpenVolume"] = task_data.OpenVolume; + data["CloseVolume"] = task_data.CloseVolume; + data["ExchangeMargin"] = task_data.ExchangeMargin; + data["YdStrikeFrozen"] = task_data.YdStrikeFrozen; + data["InstrumentID"] = task_data.InstrumentID; + data["PositionDate"] = task_data.PositionDate; + data["ExchangeID"] = task_data.ExchangeID; + data["CloseProfitByTrade"] = task_data.CloseProfitByTrade; + data["PreMargin"] = task_data.PreMargin; + data["SettlementID"] = task_data.SettlementID; + 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["Position"] = task_data.Position; + data["FrozenCommission"] = task_data.FrozenCommission; + data["CombShortFrozen"] = task_data.CombShortFrozen; + data["CloseProfitByDate"] = task_data.CloseProfitByDate; + data["SettlementPrice"] = task_data.SettlementPrice; + data["LongFrozenAmount"] = task_data.LongFrozenAmount; + data["InvestorID"] = task_data.InvestorID; + data["StrikeFrozenAmount"] = task_data.StrikeFrozenAmount; + data["CloseProfit"] = task_data.CloseProfit; + data["UseMargin"] = task_data.UseMargin; + + CThostFtdcRspInfoField 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::processRspQryTradingAccount(Task task) +{ + PyLock lock; + CThostFtdcTradingAccountField task_data = any_cast(task.task_data); + dict data; + data["SpecProductFrozenCommission"] = task_data.SpecProductFrozenCommission; + data["FundMortgageOut"] = task_data.FundMortgageOut; + data["Mortgage"] = task_data.Mortgage; + data["ExchangeDeliveryMargin"] = task_data.ExchangeDeliveryMargin; + data["FrozenMargin"] = task_data.FrozenMargin; + data["WithdrawQuota"] = task_data.WithdrawQuota; + data["PositionProfit"] = task_data.PositionProfit; + data["Commission"] = task_data.Commission; + data["SpecProductCloseProfit"] = task_data.SpecProductCloseProfit; + data["Interest"] = task_data.Interest; + data["SpecProductCommission"] = task_data.SpecProductCommission; + data["CashIn"] = task_data.CashIn; + data["AccountID"] = task_data.AccountID; + data["Available"] = task_data.Available; + data["FundMortgageAvailable"] = task_data.FundMortgageAvailable; + data["PreCredit"] = task_data.PreCredit; + data["PreMortgage"] = task_data.PreMortgage; + data["InterestBase"] = task_data.InterestBase; + data["ExchangeMargin"] = task_data.ExchangeMargin; + data["MortgageableFund"] = task_data.MortgageableFund; + data["PreFundMortgageIn"] = task_data.PreFundMortgageIn; + data["PreMargin"] = task_data.PreMargin; + data["SettlementID"] = task_data.SettlementID; + data["BizType"] = task_data.BizType; + data["FundMortgageIn"] = task_data.FundMortgageIn; + data["DeliveryMargin"] = task_data.DeliveryMargin; + data["SpecProductFrozenMargin"] = task_data.SpecProductFrozenMargin; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["FrozenCash"] = task_data.FrozenCash; + data["Withdraw"] = task_data.Withdraw; + data["Balance"] = task_data.Balance; + data["SpecProductMargin"] = task_data.SpecProductMargin; + data["SpecProductPositionProfitByAlg"] = task_data.SpecProductPositionProfitByAlg; + data["Reserve"] = task_data.Reserve; + data["PreDeposit"] = task_data.PreDeposit; + data["Credit"] = task_data.Credit; + data["CurrencyID"] = task_data.CurrencyID; + data["ReserveBalance"] = task_data.ReserveBalance; + data["SpecProductPositionProfit"] = task_data.SpecProductPositionProfit; + data["SpecProductExchangeMargin"] = task_data.SpecProductExchangeMargin; + data["PreBalance"] = task_data.PreBalance; + data["CurrMargin"] = task_data.CurrMargin; + data["FrozenCommission"] = task_data.FrozenCommission; + data["CloseProfit"] = task_data.CloseProfit; + data["PreFundMortgageOut"] = task_data.PreFundMortgageOut; + data["Deposit"] = task_data.Deposit; + + CThostFtdcRspInfoField 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::processRspQryInvestor(Task task) +{ + PyLock lock; + CThostFtdcInvestorField task_data = any_cast(task.task_data); + dict data; + data["CommModelID"] = task_data.CommModelID; + data["InvestorName"] = task_data.InvestorName; + data["Mobile"] = task_data.Mobile; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["Telephone"] = task_data.Telephone; + data["MarginModelID"] = task_data.MarginModelID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["Address"] = task_data.Address; + data["InvestorGroupID"] = task_data.InvestorGroupID; + data["OpenDate"] = task_data.OpenDate; + data["IsActive"] = task_data.IsActive; + data["IdentifiedCardType"] = task_data.IdentifiedCardType; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcTradingCodeField task_data = any_cast(task.task_data); + dict data; + data["ExchangeID"] = task_data.ExchangeID; + data["BranchID"] = task_data.BranchID; + data["BizType"] = task_data.BizType; + data["ClientID"] = task_data.ClientID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["ClientIDType"] = task_data.ClientIDType; + data["IsActive"] = task_data.IsActive; + + CThostFtdcRspInfoField 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::processRspQryInstrumentMarginRate(Task task) +{ + PyLock lock; + CThostFtdcInstrumentMarginRateField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ShortMarginRatioByMoney"] = task_data.ShortMarginRatioByMoney; + data["LongMarginRatioByMoney"] = task_data.LongMarginRatioByMoney; + data["IsRelative"] = task_data.IsRelative; + data["HedgeFlag"] = task_data.HedgeFlag; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["InvestorRange"] = task_data.InvestorRange; + data["ShortMarginRatioByVolume"] = task_data.ShortMarginRatioByVolume; + data["LongMarginRatioByVolume"] = task_data.LongMarginRatioByVolume; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInstrumentMarginRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInstrumentCommissionRate(Task task) +{ + PyLock lock; + CThostFtdcInstrumentCommissionRateField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["OpenRatioByMoney"] = task_data.OpenRatioByMoney; + data["CloseRatioByVolume"] = task_data.CloseRatioByVolume; + data["BizType"] = task_data.BizType; + data["CloseTodayRatioByMoney"] = task_data.CloseTodayRatioByMoney; + data["ExchangeID"] = task_data.ExchangeID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["InvestorRange"] = task_data.InvestorRange; + data["CloseRatioByMoney"] = task_data.CloseRatioByMoney; + data["OpenRatioByVolume"] = task_data.OpenRatioByVolume; + data["CloseTodayRatioByVolume"] = task_data.CloseTodayRatioByVolume; + + CThostFtdcRspInfoField 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::processRspQryExchange(Task task) +{ + PyLock lock; + CThostFtdcExchangeField task_data = any_cast(task.task_data); + dict data; + data["ExchangeProperty"] = task_data.ExchangeProperty; + data["ExchangeID"] = task_data.ExchangeID; + data["ExchangeName"] = task_data.ExchangeName; + + CThostFtdcRspInfoField 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::processRspQryProduct(Task task) +{ + PyLock lock; + CThostFtdcProductField task_data = any_cast(task.task_data); + dict data; + data["MaxLimitOrderVolume"] = task_data.MaxLimitOrderVolume; + data["ExchangeID"] = task_data.ExchangeID; + data["MortgageFundUseRange"] = task_data.MortgageFundUseRange; + data["PositionDateType"] = task_data.PositionDateType; + data["MinLimitOrderVolume"] = task_data.MinLimitOrderVolume; + data["CloseDealType"] = task_data.CloseDealType; + data["MaxMarketOrderVolume"] = task_data.MaxMarketOrderVolume; + data["PriceTick"] = task_data.PriceTick; + data["ProductName"] = task_data.ProductName; + data["ExchangeProductID"] = task_data.ExchangeProductID; + data["VolumeMultiple"] = task_data.VolumeMultiple; + data["PositionType"] = task_data.PositionType; + data["MinMarketOrderVolume"] = task_data.MinMarketOrderVolume; + data["ProductClass"] = task_data.ProductClass; + data["UnderlyingMultiple"] = task_data.UnderlyingMultiple; + data["TradeCurrencyID"] = task_data.TradeCurrencyID; + data["ProductID"] = task_data.ProductID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryProduct(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInstrument(Task task) +{ + PyLock lock; + CThostFtdcInstrumentField task_data = any_cast(task.task_data); + dict data; + data["IsTrading"] = task_data.IsTrading; + data["ExpireDate"] = task_data.ExpireDate; + data["PositionDateType"] = task_data.PositionDateType; + data["LongMarginRatio"] = task_data.LongMarginRatio; + data["StrikePrice"] = task_data.StrikePrice; + data["UnderlyingMultiple"] = task_data.UnderlyingMultiple; + data["PositionType"] = task_data.PositionType; + data["ProductClass"] = task_data.ProductClass; + data["MinSellVolume"] = task_data.MinSellVolume; + data["InstrumentName"] = task_data.InstrumentName; + data["ShortMarginRatio"] = task_data.ShortMarginRatio; + data["VolumeMultiple"] = task_data.VolumeMultiple; + data["MaxMarginSideAlgorithm"] = task_data.MaxMarginSideAlgorithm; + data["DeliveryYear"] = task_data.DeliveryYear; + data["CombinationType"] = task_data.CombinationType; + 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["OptionsType"] = task_data.OptionsType; + data["StartDelivDate"] = task_data.StartDelivDate; + data["DeliveryMonth"] = task_data.DeliveryMonth; + data["InstrumentCode"] = task_data.InstrumentCode; + data["MinBuyVolume"] = task_data.MinBuyVolume; + data["PriceTick"] = task_data.PriceTick; + data["InstLifePhase"] = task_data.InstLifePhase; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["MinMarketOrderVolume"] = task_data.MinMarketOrderVolume; + data["EndDelivDate"] = task_data.EndDelivDate; + data["UnderlyingInstrID"] = task_data.UnderlyingInstrID; + data["OpenDate"] = task_data.OpenDate; + data["ProductID"] = task_data.ProductID; + + CThostFtdcRspInfoField 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::processRspQryDepthMarketData(Task task) +{ + PyLock lock; + CThostFtdcDepthMarketDataField 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; + + CThostFtdcRspInfoField 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::processRspQrySettlementInfo(Task task) +{ + PyLock lock; + CThostFtdcSettlementInfoField task_data = any_cast(task.task_data); + dict data; + data["SettlementID"] = task_data.SettlementID; + data["InvestorID"] = task_data.InvestorID; + data["SequenceNo"] = task_data.SequenceNo; + data["Content"] = task_data.Content; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQrySettlementInfo(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTransferBank(Task task) +{ + PyLock lock; + CThostFtdcTransferBankField task_data = any_cast(task.task_data); + dict data; + data["BankName"] = task_data.BankName; + data["IsActive"] = task_data.IsActive; + data["BankBrchID"] = task_data.BankBrchID; + data["BankID"] = task_data.BankID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTransferBank(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestorPositionDetail(Task task) +{ + PyLock lock; + CThostFtdcInvestorPositionDetailField task_data = any_cast(task.task_data); + dict data; + data["PositionProfitByDate"] = task_data.PositionProfitByDate; + data["ExchMargin"] = task_data.ExchMargin; + data["TradeType"] = task_data.TradeType; + data["MarginRateByMoney"] = task_data.MarginRateByMoney; + data["HedgeFlag"] = task_data.HedgeFlag; + data["MarginRateByVolume"] = task_data.MarginRateByVolume; + data["Direction"] = task_data.Direction; + data["CloseAmount"] = task_data.CloseAmount; + data["OpenPrice"] = task_data.OpenPrice; + data["Volume"] = task_data.Volume; + data["LastSettlementPrice"] = task_data.LastSettlementPrice; + data["CloseVolume"] = task_data.CloseVolume; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["CloseProfitByTrade"] = task_data.CloseProfitByTrade; + data["SettlementID"] = task_data.SettlementID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["Margin"] = task_data.Margin; + data["TradeID"] = task_data.TradeID; + data["PositionProfitByTrade"] = task_data.PositionProfitByTrade; + data["CloseProfitByDate"] = task_data.CloseProfitByDate; + data["SettlementPrice"] = task_data.SettlementPrice; + data["InvestorID"] = task_data.InvestorID; + data["CombInstrumentID"] = task_data.CombInstrumentID; + data["OpenDate"] = task_data.OpenDate; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestorPositionDetail(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryNotice(Task task) +{ + PyLock lock; + CThostFtdcNoticeField task_data = any_cast(task.task_data); + dict data; + data["Content"] = task_data.Content; + data["SequenceLabel"] = task_data.SequenceLabel; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryNotice(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQrySettlementInfoConfirm(Task task) +{ + PyLock lock; + CThostFtdcSettlementInfoConfirmField task_data = any_cast(task.task_data); + dict data; + data["ConfirmTime"] = task_data.ConfirmTime; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["ConfirmDate"] = task_data.ConfirmDate; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQrySettlementInfoConfirm(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestorPositionCombineDetail(Task task) +{ + PyLock lock; + CThostFtdcInvestorPositionCombineDetailField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["TradeGroupID"] = task_data.TradeGroupID; + data["ExchangeID"] = task_data.ExchangeID; + data["MarginRateByVolume"] = task_data.MarginRateByVolume; + data["ComTradeID"] = task_data.ComTradeID; + data["SettlementID"] = task_data.SettlementID; + data["InvestorID"] = task_data.InvestorID; + data["TotalAmt"] = task_data.TotalAmt; + data["Margin"] = task_data.Margin; + data["ExchMargin"] = task_data.ExchMargin; + data["LegMultiple"] = task_data.LegMultiple; + data["HedgeFlag"] = task_data.HedgeFlag; + data["TradeID"] = task_data.TradeID; + data["LegID"] = task_data.LegID; + data["TradingDay"] = task_data.TradingDay; + data["MarginRateByMoney"] = task_data.MarginRateByMoney; + data["Direction"] = task_data.Direction; + data["BrokerID"] = task_data.BrokerID; + data["CombInstrumentID"] = task_data.CombInstrumentID; + data["OpenDate"] = task_data.OpenDate; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestorPositionCombineDetail(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryCFMMCTradingAccountKey(Task task) +{ + PyLock lock; + CThostFtdcCFMMCTradingAccountKeyField task_data = any_cast(task.task_data); + dict data; + data["KeyID"] = task_data.KeyID; + data["BrokerID"] = task_data.BrokerID; + data["ParticipantID"] = task_data.ParticipantID; + data["CurrentKey"] = task_data.CurrentKey; + data["AccountID"] = task_data.AccountID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryCFMMCTradingAccountKey(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryEWarrantOffset(Task task) +{ + PyLock lock; + CThostFtdcEWarrantOffsetField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["InvestorID"] = task_data.InvestorID; + data["HedgeFlag"] = task_data.HedgeFlag; + data["Direction"] = task_data.Direction; + data["Volume"] = task_data.Volume; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryEWarrantOffset(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestorProductGroupMargin(Task task) +{ + PyLock lock; + CThostFtdcInvestorProductGroupMarginField task_data = any_cast(task.task_data); + dict data; + data["ExchMargin"] = task_data.ExchMargin; + data["ShortExchOffsetAmount"] = task_data.ShortExchOffsetAmount; + data["FrozenMargin"] = task_data.FrozenMargin; + data["ShortFrozenMargin"] = task_data.ShortFrozenMargin; + data["HedgeFlag"] = task_data.HedgeFlag; + data["PositionProfit"] = task_data.PositionProfit; + data["Commission"] = task_data.Commission; + data["LongOffsetAmount"] = task_data.LongOffsetAmount; + data["CashIn"] = task_data.CashIn; + data["ShortUseMargin"] = task_data.ShortUseMargin; + data["ShortOffsetAmount"] = task_data.ShortOffsetAmount; + data["SettlementID"] = task_data.SettlementID; + data["LongExchOffsetAmount"] = task_data.LongExchOffsetAmount; + data["LongUseMargin"] = task_data.LongUseMargin; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["FrozenCash"] = task_data.FrozenCash; + data["LongFrozenMargin"] = task_data.LongFrozenMargin; + data["ShortExchMargin"] = task_data.ShortExchMargin; + data["FrozenCommission"] = task_data.FrozenCommission; + data["ProductGroupID"] = task_data.ProductGroupID; + data["ExchOffsetAmount"] = task_data.ExchOffsetAmount; + data["InvestorID"] = task_data.InvestorID; + data["LongExchMargin"] = task_data.LongExchMargin; + data["CloseProfit"] = task_data.CloseProfit; + data["OffsetAmount"] = task_data.OffsetAmount; + data["UseMargin"] = task_data.UseMargin; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestorProductGroupMargin(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExchangeMarginRate(Task task) +{ + PyLock lock; + CThostFtdcExchangeMarginRateField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ShortMarginRatioByMoney"] = task_data.ShortMarginRatioByMoney; + data["LongMarginRatioByMoney"] = task_data.LongMarginRatioByMoney; + data["HedgeFlag"] = task_data.HedgeFlag; + data["BrokerID"] = task_data.BrokerID; + data["ShortMarginRatioByVolume"] = task_data.ShortMarginRatioByVolume; + data["LongMarginRatioByVolume"] = task_data.LongMarginRatioByVolume; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExchangeMarginRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExchangeMarginRateAdjust(Task task) +{ + PyLock lock; + CThostFtdcExchangeMarginRateAdjustField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ShortMarginRatioByMoney"] = task_data.ShortMarginRatioByMoney; + data["ExchLongMarginRatioByMoney"] = task_data.ExchLongMarginRatioByMoney; + data["ExchShortMarginRatioByMoney"] = task_data.ExchShortMarginRatioByMoney; + data["LongMarginRatioByMoney"] = task_data.LongMarginRatioByMoney; + data["ExchShortMarginRatioByVolume"] = task_data.ExchShortMarginRatioByVolume; + data["ExchLongMarginRatioByVolume"] = task_data.ExchLongMarginRatioByVolume; + data["NoShortMarginRatioByMoney"] = task_data.NoShortMarginRatioByMoney; + data["NoLongMarginRatioByMoney"] = task_data.NoLongMarginRatioByMoney; + data["HedgeFlag"] = task_data.HedgeFlag; + data["NoLongMarginRatioByVolume"] = task_data.NoLongMarginRatioByVolume; + data["NoShortMarginRatioByVolume"] = task_data.NoShortMarginRatioByVolume; + data["BrokerID"] = task_data.BrokerID; + data["ShortMarginRatioByVolume"] = task_data.ShortMarginRatioByVolume; + data["LongMarginRatioByVolume"] = task_data.LongMarginRatioByVolume; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExchangeMarginRateAdjust(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExchangeRate(Task task) +{ + PyLock lock; + CThostFtdcExchangeRateField task_data = any_cast(task.task_data); + dict data; + data["FromCurrencyID"] = task_data.FromCurrencyID; + data["FromCurrencyUnit"] = task_data.FromCurrencyUnit; + data["BrokerID"] = task_data.BrokerID; + data["ExchangeRate"] = task_data.ExchangeRate; + data["ToCurrencyID"] = task_data.ToCurrencyID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExchangeRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQrySecAgentACIDMap(Task task) +{ + PyLock lock; + CThostFtdcSecAgentACIDMapField task_data = any_cast(task.task_data); + dict data; + data["CurrencyID"] = task_data.CurrencyID; + data["UserID"] = task_data.UserID; + data["BrokerSecAgentID"] = task_data.BrokerSecAgentID; + data["BrokerID"] = task_data.BrokerID; + data["AccountID"] = task_data.AccountID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQrySecAgentACIDMap(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryProductExchRate(Task task) +{ + PyLock lock; + CThostFtdcProductExchRateField task_data = any_cast(task.task_data); + dict data; + data["QuoteCurrencyID"] = task_data.QuoteCurrencyID; + data["ExchangeRate"] = task_data.ExchangeRate; + data["ProductID"] = task_data.ProductID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryProductExchRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryProductGroup(Task task) +{ + PyLock lock; + CThostFtdcProductGroupField task_data = any_cast(task.task_data); + dict data; + data["ExchangeID"] = task_data.ExchangeID; + data["ProductGroupID"] = task_data.ProductGroupID; + data["ProductID"] = task_data.ProductID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryProductGroup(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOptionInstrTradeCost(Task task) +{ + PyLock lock; + CThostFtdcOptionInstrTradeCostField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["ExchMiniMargin"] = task_data.ExchMiniMargin; + data["HedgeFlag"] = task_data.HedgeFlag; + data["InvestorID"] = task_data.InvestorID; + data["Royalty"] = task_data.Royalty; + data["BrokerID"] = task_data.BrokerID; + data["MiniMargin"] = task_data.MiniMargin; + data["ExchFixedMargin"] = task_data.ExchFixedMargin; + data["FixedMargin"] = task_data.FixedMargin; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryOptionInstrTradeCost(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryOptionInstrCommRate(Task task) +{ + PyLock lock; + CThostFtdcOptionInstrCommRateField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["OpenRatioByMoney"] = task_data.OpenRatioByMoney; + data["StrikeRatioByMoney"] = task_data.StrikeRatioByMoney; + data["CloseRatioByVolume"] = task_data.CloseRatioByVolume; + data["CloseTodayRatioByMoney"] = task_data.CloseTodayRatioByMoney; + data["ExchangeID"] = task_data.ExchangeID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["InvestorRange"] = task_data.InvestorRange; + data["CloseRatioByMoney"] = task_data.CloseRatioByMoney; + data["OpenRatioByVolume"] = task_data.OpenRatioByVolume; + data["StrikeRatioByVolume"] = task_data.StrikeRatioByVolume; + data["CloseTodayRatioByVolume"] = task_data.CloseTodayRatioByVolume; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryOptionInstrCommRate(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExecOrder(Task task) +{ + PyLock lock; + CThostFtdcExecOrderField task_data = any_cast(task.task_data); + dict data; + data["NotifySequence"] = task_data.NotifySequence; + data["CloseFlag"] = task_data.CloseFlag; + data["ActiveUserID"] = task_data.ActiveUserID; + data["UserProductInfo"] = task_data.UserProductInfo; + data["TraderID"] = task_data.TraderID; + data["HedgeFlag"] = task_data.HedgeFlag; + data["ExecResult"] = task_data.ExecResult; + data["ReservePositionFlag"] = task_data.ReservePositionFlag; + data["Volume"] = task_data.Volume; + data["InstallID"] = task_data.InstallID; + data["OffsetFlag"] = task_data.OffsetFlag; + data["PosiDirection"] = task_data.PosiDirection; + data["ClientID"] = task_data.ClientID; + data["ExecOrderRef"] = task_data.ExecOrderRef; + data["SessionID"] = task_data.SessionID; + data["ActionType"] = task_data.ActionType; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["ClearingPartID"] = task_data.ClearingPartID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExecOrderSysID"] = task_data.ExecOrderSysID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["ExecOrderLocalID"] = task_data.ExecOrderLocalID; + data["ParticipantID"] = task_data.ParticipantID; + data["CancelTime"] = task_data.CancelTime; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["SequenceNo"] = task_data.SequenceNo; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["RequestID"] = task_data.RequestID; + data["BrokerExecOrderSeq"] = task_data.BrokerExecOrderSeq; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExecOrder(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryForQuote(Task task) +{ + PyLock lock; + CThostFtdcForQuoteField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ForQuoteRef"] = task_data.ForQuoteRef; + data["ExchangeID"] = task_data.ExchangeID; + data["InstallID"] = task_data.InstallID; + data["ForQuoteLocalID"] = task_data.ForQuoteLocalID; + data["ParticipantID"] = task_data.ParticipantID; + data["ActiveUserID"] = task_data.ActiveUserID; + data["InsertDate"] = task_data.InsertDate; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["SessionID"] = task_data.SessionID; + data["ClientID"] = task_data.ClientID; + data["StatusMsg"] = task_data.StatusMsg; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["ForQuoteStatus"] = task_data.ForQuoteStatus; + data["FrontID"] = task_data.FrontID; + data["BrokerForQutoSeq"] = task_data.BrokerForQutoSeq; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryForQuote(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryQuote(Task task) +{ + PyLock lock; + CThostFtdcQuoteField task_data = any_cast(task.task_data); + dict data; + data["NotifySequence"] = task_data.NotifySequence; + data["AskHedgeFlag"] = task_data.AskHedgeFlag; + data["BidOrderSysID"] = task_data.BidOrderSysID; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["AskVolume"] = task_data.AskVolume; + data["BidOrderRef"] = task_data.BidOrderRef; + data["ActiveUserID"] = task_data.ActiveUserID; + data["BidHedgeFlag"] = task_data.BidHedgeFlag; + data["QuoteRef"] = task_data.QuoteRef; + data["AskOrderSysID"] = task_data.AskOrderSysID; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["UserProductInfo"] = task_data.UserProductInfo; + data["AskOffsetFlag"] = task_data.AskOffsetFlag; + data["ClientID"] = task_data.ClientID; + data["SessionID"] = task_data.SessionID; + data["BidOffsetFlag"] = task_data.BidOffsetFlag; + data["BidPrice"] = task_data.BidPrice; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["InstrumentID"] = task_data.InstrumentID; + data["QuoteStatus"] = task_data.QuoteStatus; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["QuoteLocalID"] = task_data.QuoteLocalID; + data["BidVolume"] = task_data.BidVolume; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["QuoteSysID"] = task_data.QuoteSysID; + data["ClearingPartID"] = task_data.ClearingPartID; + data["ForQuoteSysID"] = task_data.ForQuoteSysID; + data["CancelTime"] = task_data.CancelTime; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["AskPrice"] = task_data.AskPrice; + data["SequenceNo"] = task_data.SequenceNo; + data["AskOrderRef"] = task_data.AskOrderRef; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["RequestID"] = task_data.RequestID; + data["BrokerQuoteSeq"] = task_data.BrokerQuoteSeq; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryQuote(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryLock(Task task) +{ + PyLock lock; + CThostFtdcLockField task_data = any_cast(task.task_data); + dict data; + data["LockStatus"] = task_data.LockStatus; + data["NotifySequence"] = task_data.NotifySequence; + data["ActiveUserID"] = task_data.ActiveUserID; + data["UserProductInfo"] = task_data.UserProductInfo; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["LockLocalID"] = task_data.LockLocalID; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["SessionID"] = task_data.SessionID; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["ClearingPartID"] = task_data.ClearingPartID; + data["CancelTime"] = task_data.CancelTime; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["BrokerLockSeq"] = task_data.BrokerLockSeq; + data["SequenceNo"] = task_data.SequenceNo; + data["LockRef"] = task_data.LockRef; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["RequestID"] = task_data.RequestID; + data["FrontID"] = task_data.FrontID; + data["LockSysID"] = task_data.LockSysID; + data["LockType"] = task_data.LockType; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryLock(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryLockPosition(Task task) +{ + PyLock lock; + CThostFtdcLockPositionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["FrozenVolume"] = task_data.FrozenVolume; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryLockPosition(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryInvestorLevel(Task task) +{ + PyLock lock; + CThostFtdcInvestorLevelField task_data = any_cast(task.task_data); + dict data; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeID"] = task_data.ExchangeID; + data["LevelType"] = task_data.LevelType; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryInvestorLevel(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryExecFreeze(Task task) +{ + PyLock lock; + CThostFtdcExecFreezeField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["OptionsType"] = task_data.OptionsType; + data["PosiDirection"] = task_data.PosiDirection; + data["FrozenAmount"] = task_data.FrozenAmount; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryExecFreeze(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryCombInstrumentGuard(Task task) +{ + PyLock lock; + CThostFtdcCombInstrumentGuardField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["GuarantRatio"] = task_data.GuarantRatio; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryCombInstrumentGuard(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryCombAction(Task task) +{ + PyLock lock; + CThostFtdcCombActionField task_data = any_cast(task.task_data); + dict data; + data["NotifySequence"] = task_data.NotifySequence; + data["UserProductInfo"] = task_data.UserProductInfo; + data["TraderID"] = task_data.TraderID; + data["HedgeFlag"] = task_data.HedgeFlag; + data["ActionStatus"] = task_data.ActionStatus; + data["CombDirection"] = task_data.CombDirection; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["InvestorID"] = task_data.InvestorID; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["SessionID"] = task_data.SessionID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["CombActionRef"] = task_data.CombActionRef; + data["SequenceNo"] = task_data.SequenceNo; + data["ActionLocalID"] = task_data.ActionLocalID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryCombAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTransferSerial(Task task) +{ + PyLock lock; + CThostFtdcTransferSerialField task_data = any_cast(task.task_data); + dict data; + data["BankNewAccount"] = task_data.BankNewAccount; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["TradeTime"] = task_data.TradeTime; + data["OperatorCode"] = task_data.OperatorCode; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureAccType"] = task_data.FutureAccType; + data["ErrorID"] = task_data.ErrorID; + data["BankSerial"] = task_data.BankSerial; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["IdCardType"] = task_data.IdCardType; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["FutureSerial"] = task_data.FutureSerial; + data["InvestorID"] = task_data.InvestorID; + data["ErrorMsg"] = task_data.ErrorMsg; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["AvailabilityFlag"] = task_data.AvailabilityFlag; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTransferSerial(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryAccountregister(Task task) +{ + PyLock lock; + CThostFtdcAccountregisterField task_data = any_cast(task.task_data); + dict data; + data["BankAccount"] = task_data.BankAccount; + data["CustType"] = task_data.CustType; + data["CustomerName"] = task_data.CustomerName; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["OutDate"] = task_data.OutDate; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["BankBranchID"] = task_data.BankBranchID; + data["RegDate"] = task_data.RegDate; + data["BrokerID"] = task_data.BrokerID; + data["BankID"] = task_data.BankID; + data["TID"] = task_data.TID; + data["OpenOrDestroy"] = task_data.OpenOrDestroy; + data["IdCardType"] = task_data.IdCardType; + data["TradeDay"] = task_data.TradeDay; + data["BankAccType"] = task_data.BankAccType; + data["AccountID"] = task_data.AccountID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryAccountregister(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspError(Task task) +{ + PyLock lock; + CThostFtdcRspInfoField 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::processRtnOrder(Task task) +{ + PyLock lock; + CThostFtdcOrderField 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["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["IsSwapOrder"] = task_data.IsSwapOrder; + 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["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["SettlementID"] = task_data.SettlementID; + 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["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["ZCETotalTradedVolume"] = task_data.ZCETotalTradedVolume; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + this->onRtnOrder(data); +}; + +void TdApi::processRtnTrade(Task task) +{ + PyLock lock; + CThostFtdcTradeField task_data = any_cast(task.task_data); + dict data; + data["TradeType"] = task_data.TradeType; + data["TraderID"] = task_data.TraderID; + 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["SettlementID"] = task_data.SettlementID; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + 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["TradeSource"] = task_data.TradeSource; + data["PriceSource"] = task_data.PriceSource; + data["TradingRole"] = task_data.TradingRole; + + this->onRtnTrade(data); +}; + +void TdApi::processErrRtnOrderInsert(Task task) +{ + PyLock lock; + CThostFtdcInputOrderField 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["IsSwapOrder"] = task_data.IsSwapOrder; + 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; + + CThostFtdcRspInfoField 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) +{ + PyLock lock; + CThostFtdcOrderActionField task_data = any_cast(task.task_data); + dict data; + data["ActionTime"] = task_data.ActionTime; + data["InvestorID"] = task_data.InvestorID; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["OrderActionStatus"] = task_data.OrderActionStatus; + 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["OrderSysID"] = task_data.OrderSysID; + data["BrokerID"] = task_data.BrokerID; + data["ClientID"] = task_data.ClientID; + 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; + + CThostFtdcRspInfoField 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::processRtnInstrumentStatus(Task task) +{ + PyLock lock; + CThostFtdcInstrumentStatusField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["EnterTime"] = task_data.EnterTime; + data["SettlementGroupID"] = task_data.SettlementGroupID; + data["TradingSegmentSN"] = task_data.TradingSegmentSN; + data["EnterReason"] = task_data.EnterReason; + data["InstrumentStatus"] = task_data.InstrumentStatus; + data["ExchangeInstID"] = task_data.ExchangeInstID; + + this->onRtnInstrumentStatus(data); +}; + +void TdApi::processRtnTradingNotice(Task task) +{ + PyLock lock; + CThostFtdcTradingNoticeInfoField task_data = any_cast(task.task_data); + dict data; + data["SequenceSeries"] = task_data.SequenceSeries; + data["SequenceNo"] = task_data.SequenceNo; + data["FieldContent"] = task_data.FieldContent; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["SendTime"] = task_data.SendTime; + + this->onRtnTradingNotice(data); +}; + +void TdApi::processRtnErrorConditionalOrder(Task task) +{ + PyLock lock; + CThostFtdcErrorConditionalOrderField 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["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["LimitPrice"] = task_data.LimitPrice; + data["UserForceClose"] = task_data.UserForceClose; + data["RelativeOrderSysID"] = task_data.RelativeOrderSysID; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["IsSwapOrder"] = task_data.IsSwapOrder; + 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["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["SettlementID"] = task_data.SettlementID; + data["ForceCloseReason"] = task_data.ForceCloseReason; + data["OrderType"] = task_data.OrderType; + data["ErrorID"] = task_data.ErrorID; + 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["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["ErrorMsg"] = task_data.ErrorMsg; + data["OrderSource"] = task_data.OrderSource; + data["ZCETotalTradedVolume"] = task_data.ZCETotalTradedVolume; + data["ActiveTraderID"] = task_data.ActiveTraderID; + + this->onRtnErrorConditionalOrder(data); +}; + +void TdApi::processRtnExecOrder(Task task) +{ + PyLock lock; + CThostFtdcExecOrderField task_data = any_cast(task.task_data); + dict data; + data["NotifySequence"] = task_data.NotifySequence; + data["CloseFlag"] = task_data.CloseFlag; + data["ActiveUserID"] = task_data.ActiveUserID; + data["UserProductInfo"] = task_data.UserProductInfo; + data["TraderID"] = task_data.TraderID; + data["HedgeFlag"] = task_data.HedgeFlag; + data["ExecResult"] = task_data.ExecResult; + data["ReservePositionFlag"] = task_data.ReservePositionFlag; + data["Volume"] = task_data.Volume; + data["InstallID"] = task_data.InstallID; + data["OffsetFlag"] = task_data.OffsetFlag; + data["PosiDirection"] = task_data.PosiDirection; + data["ClientID"] = task_data.ClientID; + data["ExecOrderRef"] = task_data.ExecOrderRef; + data["SessionID"] = task_data.SessionID; + data["ActionType"] = task_data.ActionType; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["ClearingPartID"] = task_data.ClearingPartID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExecOrderSysID"] = task_data.ExecOrderSysID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["ExecOrderLocalID"] = task_data.ExecOrderLocalID; + data["ParticipantID"] = task_data.ParticipantID; + data["CancelTime"] = task_data.CancelTime; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["SequenceNo"] = task_data.SequenceNo; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["RequestID"] = task_data.RequestID; + data["BrokerExecOrderSeq"] = task_data.BrokerExecOrderSeq; + data["FrontID"] = task_data.FrontID; + + this->onRtnExecOrder(data); +}; + +void TdApi::processErrRtnExecOrderInsert(Task task) +{ + PyLock lock; + CThostFtdcInputExecOrderField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExecOrderRef"] = task_data.ExecOrderRef; + data["ExchangeID"] = task_data.ExchangeID; + data["CloseFlag"] = task_data.CloseFlag; + data["OffsetFlag"] = task_data.OffsetFlag; + data["PosiDirection"] = task_data.PosiDirection; + data["BusinessUnit"] = task_data.BusinessUnit; + data["HedgeFlag"] = task_data.HedgeFlag; + data["UserID"] = task_data.UserID; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ActionType"] = task_data.ActionType; + data["ReservePositionFlag"] = task_data.ReservePositionFlag; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnExecOrderInsert(data, error); +}; + +void TdApi::processErrRtnExecOrderAction(Task task) +{ + PyLock lock; + CThostFtdcExecOrderActionField task_data = any_cast(task.task_data); + dict data; + data["ActionTime"] = task_data.ActionTime; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["OrderActionStatus"] = task_data.OrderActionStatus; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["InvestorID"] = task_data.InvestorID; + data["ClientID"] = task_data.ClientID; + data["ExecOrderRef"] = task_data.ExecOrderRef; + data["SessionID"] = task_data.SessionID; + data["ActionType"] = task_data.ActionType; + data["ActionFlag"] = task_data.ActionFlag; + data["InstrumentID"] = task_data.InstrumentID; + data["ExecOrderSysID"] = task_data.ExecOrderSysID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["BrokerID"] = task_data.BrokerID; + data["ExecOrderLocalID"] = task_data.ExecOrderLocalID; + data["ActionDate"] = task_data.ActionDate; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["ActionLocalID"] = task_data.ActionLocalID; + data["RequestID"] = task_data.RequestID; + data["ExecOrderActionRef"] = task_data.ExecOrderActionRef; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnExecOrderAction(data, error); +}; + +void TdApi::processErrRtnForQuoteInsert(Task task) +{ + PyLock lock; + CThostFtdcInputForQuoteField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ForQuoteRef"] = task_data.ForQuoteRef; + data["ExchangeID"] = task_data.ExchangeID; + data["UserID"] = task_data.UserID; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnForQuoteInsert(data, error); +}; + +void TdApi::processRtnQuote(Task task) +{ + PyLock lock; + CThostFtdcQuoteField task_data = any_cast(task.task_data); + dict data; + data["NotifySequence"] = task_data.NotifySequence; + data["AskHedgeFlag"] = task_data.AskHedgeFlag; + data["BidOrderSysID"] = task_data.BidOrderSysID; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["AskVolume"] = task_data.AskVolume; + data["BidOrderRef"] = task_data.BidOrderRef; + data["ActiveUserID"] = task_data.ActiveUserID; + data["BidHedgeFlag"] = task_data.BidHedgeFlag; + data["QuoteRef"] = task_data.QuoteRef; + data["AskOrderSysID"] = task_data.AskOrderSysID; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["UserProductInfo"] = task_data.UserProductInfo; + data["AskOffsetFlag"] = task_data.AskOffsetFlag; + data["ClientID"] = task_data.ClientID; + data["SessionID"] = task_data.SessionID; + data["BidOffsetFlag"] = task_data.BidOffsetFlag; + data["BidPrice"] = task_data.BidPrice; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["InstrumentID"] = task_data.InstrumentID; + data["QuoteStatus"] = task_data.QuoteStatus; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["QuoteLocalID"] = task_data.QuoteLocalID; + data["BidVolume"] = task_data.BidVolume; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["QuoteSysID"] = task_data.QuoteSysID; + data["ClearingPartID"] = task_data.ClearingPartID; + data["ForQuoteSysID"] = task_data.ForQuoteSysID; + data["CancelTime"] = task_data.CancelTime; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["AskPrice"] = task_data.AskPrice; + data["SequenceNo"] = task_data.SequenceNo; + data["AskOrderRef"] = task_data.AskOrderRef; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["RequestID"] = task_data.RequestID; + data["BrokerQuoteSeq"] = task_data.BrokerQuoteSeq; + data["FrontID"] = task_data.FrontID; + + this->onRtnQuote(data); +}; + +void TdApi::processErrRtnQuoteInsert(Task task) +{ + PyLock lock; + CThostFtdcInputQuoteField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["AskHedgeFlag"] = task_data.AskHedgeFlag; + data["BusinessUnit"] = task_data.BusinessUnit; + data["AskPrice"] = task_data.AskPrice; + data["UserID"] = task_data.UserID; + data["AskOffsetFlag"] = task_data.AskOffsetFlag; + data["BidVolume"] = task_data.BidVolume; + data["AskOrderRef"] = task_data.AskOrderRef; + data["AskVolume"] = task_data.AskVolume; + data["InvestorID"] = task_data.InvestorID; + data["BidOffsetFlag"] = task_data.BidOffsetFlag; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["ForQuoteSysID"] = task_data.ForQuoteSysID; + data["BidPrice"] = task_data.BidPrice; + data["BidHedgeFlag"] = task_data.BidHedgeFlag; + data["QuoteRef"] = task_data.QuoteRef; + data["BidOrderRef"] = task_data.BidOrderRef; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnQuoteInsert(data, error); +}; + +void TdApi::processErrRtnQuoteAction(Task task) +{ + PyLock lock; + CThostFtdcQuoteActionField task_data = any_cast(task.task_data); + dict data; + data["ActionTime"] = task_data.ActionTime; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["OrderActionStatus"] = task_data.OrderActionStatus; + data["QuoteRef"] = task_data.QuoteRef; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["InvestorID"] = task_data.InvestorID; + data["ClientID"] = task_data.ClientID; + data["SessionID"] = task_data.SessionID; + data["ActionFlag"] = task_data.ActionFlag; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["QuoteActionRef"] = task_data.QuoteActionRef; + data["StatusMsg"] = task_data.StatusMsg; + data["QuoteLocalID"] = task_data.QuoteLocalID; + data["BrokerID"] = task_data.BrokerID; + data["QuoteSysID"] = task_data.QuoteSysID; + data["ActionDate"] = task_data.ActionDate; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["ActionLocalID"] = task_data.ActionLocalID; + data["RequestID"] = task_data.RequestID; + data["FrontID"] = task_data.FrontID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnQuoteAction(data, error); +}; + +void TdApi::processRtnForQuoteRsp(Task task) +{ + PyLock lock; + CThostFtdcForQuoteRspField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ActionDay"] = task_data.ActionDay; + data["ExchangeID"] = task_data.ExchangeID; + data["TradingDay"] = task_data.TradingDay; + data["ForQuoteSysID"] = task_data.ForQuoteSysID; + data["ForQuoteTime"] = task_data.ForQuoteTime; + + this->onRtnForQuoteRsp(data); +}; + +void TdApi::processRtnCFMMCTradingAccountToken(Task task) +{ + PyLock lock; + CThostFtdcCFMMCTradingAccountTokenField task_data = any_cast(task.task_data); + dict data; + data["Token"] = task_data.Token; + data["KeyID"] = task_data.KeyID; + data["BrokerID"] = task_data.BrokerID; + data["ParticipantID"] = task_data.ParticipantID; + data["AccountID"] = task_data.AccountID; + + this->onRtnCFMMCTradingAccountToken(data); +}; + +void TdApi::processRtnLock(Task task) +{ + PyLock lock; + CThostFtdcLockField task_data = any_cast(task.task_data); + dict data; + data["LockStatus"] = task_data.LockStatus; + data["NotifySequence"] = task_data.NotifySequence; + data["ActiveUserID"] = task_data.ActiveUserID; + data["UserProductInfo"] = task_data.UserProductInfo; + data["TraderID"] = task_data.TraderID; + data["UserID"] = task_data.UserID; + data["LockLocalID"] = task_data.LockLocalID; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["SessionID"] = task_data.SessionID; + data["OrderSubmitStatus"] = task_data.OrderSubmitStatus; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["InsertTime"] = task_data.InsertTime; + data["ClearingPartID"] = task_data.ClearingPartID; + data["CancelTime"] = task_data.CancelTime; + data["BranchID"] = task_data.BranchID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["InsertDate"] = task_data.InsertDate; + data["BrokerLockSeq"] = task_data.BrokerLockSeq; + data["SequenceNo"] = task_data.SequenceNo; + data["LockRef"] = task_data.LockRef; + data["InvestorID"] = task_data.InvestorID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["RequestID"] = task_data.RequestID; + data["FrontID"] = task_data.FrontID; + data["LockSysID"] = task_data.LockSysID; + data["LockType"] = task_data.LockType; + + this->onRtnLock(data); +}; + +void TdApi::processErrRtnLockInsert(Task task) +{ + PyLock lock; + CThostFtdcInputLockField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["BusinessUnit"] = task_data.BusinessUnit; + data["UserID"] = task_data.UserID; + data["LockRef"] = task_data.LockRef; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["RequestID"] = task_data.RequestID; + data["LockType"] = task_data.LockType; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnLockInsert(data, error); +}; + +void TdApi::processRtnCombAction(Task task) +{ + PyLock lock; + CThostFtdcCombActionField task_data = any_cast(task.task_data); + dict data; + data["NotifySequence"] = task_data.NotifySequence; + data["UserProductInfo"] = task_data.UserProductInfo; + data["TraderID"] = task_data.TraderID; + data["HedgeFlag"] = task_data.HedgeFlag; + data["ActionStatus"] = task_data.ActionStatus; + data["CombDirection"] = task_data.CombDirection; + data["Direction"] = task_data.Direction; + data["InstallID"] = task_data.InstallID; + data["ParticipantID"] = task_data.ParticipantID; + data["InvestorID"] = task_data.InvestorID; + data["ClientID"] = task_data.ClientID; + data["Volume"] = task_data.Volume; + data["SessionID"] = task_data.SessionID; + data["InstrumentID"] = task_data.InstrumentID; + data["ExchangeID"] = task_data.ExchangeID; + data["StatusMsg"] = task_data.StatusMsg; + data["SettlementID"] = task_data.SettlementID; + data["UserID"] = task_data.UserID; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["CombActionRef"] = task_data.CombActionRef; + data["SequenceNo"] = task_data.SequenceNo; + data["ActionLocalID"] = task_data.ActionLocalID; + data["ExchangeInstID"] = task_data.ExchangeInstID; + data["FrontID"] = task_data.FrontID; + + this->onRtnCombAction(data); +}; + +void TdApi::processErrRtnCombActionInsert(Task task) +{ + PyLock lock; + CThostFtdcInputCombActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["Direction"] = task_data.Direction; + data["CombActionRef"] = task_data.CombActionRef; + data["HedgeFlag"] = task_data.HedgeFlag; + data["UserID"] = task_data.UserID; + data["ExchangeID"] = task_data.ExchangeID; + data["Volume"] = task_data.Volume; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["CombDirection"] = task_data.CombDirection; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnCombActionInsert(data, error); +}; + +void TdApi::processRspQryContractBank(Task task) +{ + PyLock lock; + CThostFtdcContractBankField task_data = any_cast(task.task_data); + dict data; + data["BankName"] = task_data.BankName; + data["BrokerID"] = task_data.BrokerID; + data["BankBrchID"] = task_data.BankBrchID; + data["BankID"] = task_data.BankID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryContractBank(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryParkedOrder(Task task) +{ + PyLock lock; + CThostFtdcParkedOrderField 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["Status"] = task_data.Status; + data["Direction"] = task_data.Direction; + data["IsSwapOrder"] = task_data.IsSwapOrder; + data["UserType"] = task_data.UserType; + 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["ErrorID"] = task_data.ErrorID; + data["ParkedOrderID"] = task_data.ParkedOrderID; + data["BrokerID"] = task_data.BrokerID; + data["CombHedgeFlag"] = task_data.CombHedgeFlag; + data["GTDDate"] = task_data.GTDDate; + data["BusinessUnit"] = task_data.BusinessUnit; + data["ErrorMsg"] = task_data.ErrorMsg; + data["OrderRef"] = task_data.OrderRef; + data["InvestorID"] = task_data.InvestorID; + data["VolumeCondition"] = task_data.VolumeCondition; + data["RequestID"] = task_data.RequestID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryParkedOrder(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryParkedOrderAction(Task task) +{ + PyLock lock; + CThostFtdcParkedOrderActionField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["Status"] = task_data.Status; + data["ExchangeID"] = task_data.ExchangeID; + data["ActionFlag"] = task_data.ActionFlag; + data["OrderActionRef"] = task_data.OrderActionRef; + data["UserType"] = task_data.UserType; + data["ErrorMsg"] = task_data.ErrorMsg; + 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["OrderSysID"] = task_data.OrderSysID; + data["ParkedOrderActionID"] = task_data.ParkedOrderActionID; + data["FrontID"] = task_data.FrontID; + data["ErrorID"] = task_data.ErrorID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryParkedOrderAction(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryTradingNotice(Task task) +{ + PyLock lock; + CThostFtdcTradingNoticeField task_data = any_cast(task.task_data); + dict data; + data["SequenceSeries"] = task_data.SequenceSeries; + data["SequenceNo"] = task_data.SequenceNo; + data["UserID"] = task_data.UserID; + data["FieldContent"] = task_data.FieldContent; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["SendTime"] = task_data.SendTime; + data["InvestorRange"] = task_data.InvestorRange; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryTradingNotice(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryBrokerTradingParams(Task task) +{ + PyLock lock; + CThostFtdcBrokerTradingParamsField task_data = any_cast(task.task_data); + dict data; + data["MarginPriceType"] = task_data.MarginPriceType; + data["Algorithm"] = task_data.Algorithm; + data["CurrencyID"] = task_data.CurrencyID; + data["OptionRoyaltyPriceType"] = task_data.OptionRoyaltyPriceType; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + data["AvailIncludeCloseProfit"] = task_data.AvailIncludeCloseProfit; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryBrokerTradingParams(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQryBrokerTradingAlgos(Task task) +{ + PyLock lock; + CThostFtdcBrokerTradingAlgosField task_data = any_cast(task.task_data); + dict data; + data["InstrumentID"] = task_data.InstrumentID; + data["HandlePositionAlgoID"] = task_data.HandlePositionAlgoID; + data["ExchangeID"] = task_data.ExchangeID; + data["FindMarginRateAlgoID"] = task_data.FindMarginRateAlgoID; + data["BrokerID"] = task_data.BrokerID; + data["HandleTradingAccountAlgoID"] = task_data.HandleTradingAccountAlgoID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQryBrokerTradingAlgos(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQueryCFMMCTradingAccountToken(Task task) +{ + PyLock lock; + CThostFtdcQueryCFMMCTradingAccountTokenField task_data = any_cast(task.task_data); + dict data; + data["InvestorID"] = task_data.InvestorID; + data["BrokerID"] = task_data.BrokerID; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQueryCFMMCTradingAccountToken(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnFromBankToFutureByBank(Task task) +{ + PyLock lock; + CThostFtdcRspTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnFromBankToFutureByBank(data); +}; + +void TdApi::processRtnFromFutureToBankByBank(Task task) +{ + PyLock lock; + CThostFtdcRspTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnFromFutureToBankByBank(data); +}; + +void TdApi::processRtnRepealFromBankToFutureByBank(Task task) +{ + PyLock lock; + CThostFtdcRspRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnRepealFromBankToFutureByBank(data); +}; + +void TdApi::processRtnRepealFromFutureToBankByBank(Task task) +{ + PyLock lock; + CThostFtdcRspRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnRepealFromFutureToBankByBank(data); +}; + +void TdApi::processRtnFromBankToFutureByFuture(Task task) +{ + PyLock lock; + CThostFtdcRspTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnFromBankToFutureByFuture(data); +}; + +void TdApi::processRtnFromFutureToBankByFuture(Task task) +{ + PyLock lock; + CThostFtdcRspTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnFromFutureToBankByFuture(data); +}; + +void TdApi::processRtnRepealFromBankToFutureByFutureManual(Task task) +{ + PyLock lock; + CThostFtdcRspRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnRepealFromBankToFutureByFutureManual(data); +}; + +void TdApi::processRtnRepealFromFutureToBankByFutureManual(Task task) +{ + PyLock lock; + CThostFtdcRspRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnRepealFromFutureToBankByFutureManual(data); +}; + +void TdApi::processRtnQueryBankBalanceByFuture(Task task) +{ + PyLock lock; + CThostFtdcNotifyQueryAccountField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["BankUseAmount"] = task_data.BankUseAmount; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Digest"] = task_data.Digest; + data["BankFetchAmount"] = task_data.BankFetchAmount; + + this->onRtnQueryBankBalanceByFuture(data); +}; + +void TdApi::processErrRtnBankToFutureByFuture(Task task) +{ + PyLock lock; + CThostFtdcReqTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnBankToFutureByFuture(data, error); +}; + +void TdApi::processErrRtnFutureToBankByFuture(Task task) +{ + PyLock lock; + CThostFtdcReqTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnFutureToBankByFuture(data, error); +}; + +void TdApi::processErrRtnRepealBankToFutureByFutureManual(Task task) +{ + PyLock lock; + CThostFtdcReqRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnRepealBankToFutureByFutureManual(data, error); +}; + +void TdApi::processErrRtnRepealFutureToBankByFutureManual(Task task) +{ + PyLock lock; + CThostFtdcReqRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnRepealFutureToBankByFutureManual(data, error); +}; + +void TdApi::processErrRtnQueryBankBalanceByFuture(Task task) +{ + PyLock lock; + CThostFtdcReqQueryAccountField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onErrRtnQueryBankBalanceByFuture(data, error); +}; + +void TdApi::processRtnRepealFromBankToFutureByFuture(Task task) +{ + PyLock lock; + CThostFtdcRspRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnRepealFromBankToFutureByFuture(data); +}; + +void TdApi::processRtnRepealFromFutureToBankByFuture(Task task) +{ + PyLock lock; + CThostFtdcRspRepealField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["BankRepealFlag"] = task_data.BankRepealFlag; + data["RepealedTimes"] = task_data.RepealedTimes; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["FutureRepealSerial"] = task_data.FutureRepealSerial; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["BrokerRepealFlag"] = task_data.BrokerRepealFlag; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankRepealSerial"] = task_data.BankRepealSerial; + data["ErrorMsg"] = task_data.ErrorMsg; + data["RepealTimeInterval"] = task_data.RepealTimeInterval; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["PlateRepealSerial"] = task_data.PlateRepealSerial; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + this->onRtnRepealFromFutureToBankByFuture(data); +}; + +void TdApi::processRspFromBankToFutureByFuture(Task task) +{ + PyLock lock; + CThostFtdcReqTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspFromBankToFutureByFuture(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspFromFutureToBankByFuture(Task task) +{ + PyLock lock; + CThostFtdcReqTransferField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["FeePayFlag"] = task_data.FeePayFlag; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["TransferStatus"] = task_data.TransferStatus; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["FutureFetchAmount"] = task_data.FutureFetchAmount; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BrokerFee"] = task_data.BrokerFee; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Message"] = task_data.Message; + data["CustFee"] = task_data.CustFee; + data["TradeAmount"] = task_data.TradeAmount; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspFromFutureToBankByFuture(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRspQueryBankAccountMoneyByFuture(Task task) +{ + PyLock lock; + CThostFtdcReqQueryAccountField task_data = any_cast(task.task_data); + dict data; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["TradeTime"] = task_data.TradeTime; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["InstallID"] = task_data.InstallID; + data["CustomerName"] = task_data.CustomerName; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["BankID"] = task_data.BankID; + data["Password"] = task_data.Password; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["RequestID"] = task_data.RequestID; + data["CustType"] = task_data.CustType; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["DeviceID"] = task_data.DeviceID; + data["IdCardType"] = task_data.IdCardType; + data["PlateSerial"] = task_data.PlateSerial; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["FutureSerial"] = task_data.FutureSerial; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["Digest"] = task_data.Digest; + + CThostFtdcRspInfoField task_error = any_cast(task.task_error); + dict error; + error["ErrorMsg"] = task_error.ErrorMsg; + error["ErrorID"] = task_error.ErrorID; + + this->onRspQueryBankAccountMoneyByFuture(data, error, task.task_id, task.task_last); +}; + +void TdApi::processRtnOpenAccountByBank(Task task) +{ + PyLock lock; + CThostFtdcOpenAccountField task_data = any_cast(task.task_data); + dict data; + data["MoneyAccountStatus"] = task_data.MoneyAccountStatus; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["Telephone"] = task_data.Telephone; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["Fax"] = task_data.Fax; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["CountryCode"] = task_data.CountryCode; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["Address"] = task_data.Address; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["CustType"] = task_data.CustType; + data["Gender"] = task_data.Gender; + data["BankID"] = task_data.BankID; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["CashExchangeCode"] = task_data.CashExchangeCode; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["MobilePhone"] = task_data.MobilePhone; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["ZipCode"] = task_data.ZipCode; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["TradeTime"] = task_data.TradeTime; + data["EMail"] = task_data.EMail; + data["Digest"] = task_data.Digest; + data["DeviceID"] = task_data.DeviceID; + + this->onRtnOpenAccountByBank(data); +}; + +void TdApi::processRtnCancelAccountByBank(Task task) +{ + PyLock lock; + CThostFtdcCancelAccountField task_data = any_cast(task.task_data); + dict data; + data["MoneyAccountStatus"] = task_data.MoneyAccountStatus; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["UserID"] = task_data.UserID; + data["BankPassWord"] = task_data.BankPassWord; + data["Telephone"] = task_data.Telephone; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["Fax"] = task_data.Fax; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["CountryCode"] = task_data.CountryCode; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["Address"] = task_data.Address; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["CustType"] = task_data.CustType; + data["Gender"] = task_data.Gender; + data["BankID"] = task_data.BankID; + data["BankSerial"] = task_data.BankSerial; + data["OperNo"] = task_data.OperNo; + data["TradingDay"] = task_data.TradingDay; + data["BankSecuAcc"] = task_data.BankSecuAcc; + data["BrokerID"] = task_data.BrokerID; + data["CashExchangeCode"] = task_data.CashExchangeCode; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["MobilePhone"] = task_data.MobilePhone; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["ZipCode"] = task_data.ZipCode; + data["BankSecuAccType"] = task_data.BankSecuAccType; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["TradeTime"] = task_data.TradeTime; + data["EMail"] = task_data.EMail; + data["Digest"] = task_data.Digest; + data["DeviceID"] = task_data.DeviceID; + + this->onRtnCancelAccountByBank(data); +}; + +void TdApi::processRtnChangeAccountByBank(Task task) +{ + PyLock lock; + CThostFtdcChangeAccountField task_data = any_cast(task.task_data); + dict data; + data["MoneyAccountStatus"] = task_data.MoneyAccountStatus; + data["NewBankPassWord"] = task_data.NewBankPassWord; + data["BrokerBranchID"] = task_data.BrokerBranchID; + data["BankPassWord"] = task_data.BankPassWord; + data["Telephone"] = task_data.Telephone; + data["IdentifiedCardNo"] = task_data.IdentifiedCardNo; + data["VerifyCertNoFlag"] = task_data.VerifyCertNoFlag; + data["TID"] = task_data.TID; + data["AccountID"] = task_data.AccountID; + data["BankAccount"] = task_data.BankAccount; + data["Fax"] = task_data.Fax; + data["InstallID"] = task_data.InstallID; + data["SecuPwdFlag"] = task_data.SecuPwdFlag; + data["CustomerName"] = task_data.CustomerName; + data["CountryCode"] = task_data.CountryCode; + data["TradeCode"] = task_data.TradeCode; + data["BankBranchID"] = task_data.BankBranchID; + data["SessionID"] = task_data.SessionID; + data["NewBankAccount"] = task_data.NewBankAccount; + data["Address"] = task_data.Address; + data["PlateSerial"] = task_data.PlateSerial; + data["BankPwdFlag"] = task_data.BankPwdFlag; + data["ErrorID"] = task_data.ErrorID; + data["CustType"] = task_data.CustType; + data["Gender"] = task_data.Gender; + data["BankID"] = task_data.BankID; + data["BankSerial"] = task_data.BankSerial; + data["TradingDay"] = task_data.TradingDay; + data["BrokerID"] = task_data.BrokerID; + data["IdCardType"] = task_data.IdCardType; + data["Password"] = task_data.Password; + data["MobilePhone"] = task_data.MobilePhone; + data["TradeDate"] = task_data.TradeDate; + data["CurrencyID"] = task_data.CurrencyID; + data["ErrorMsg"] = task_data.ErrorMsg; + data["BankAccType"] = task_data.BankAccType; + data["LastFragment"] = task_data.LastFragment; + data["ZipCode"] = task_data.ZipCode; + data["BrokerIDByBank"] = task_data.BrokerIDByBank; + data["TradeTime"] = task_data.TradeTime; + data["EMail"] = task_data.EMail; + data["Digest"] = task_data.Digest; + + this->onRtnChangeAccountByBank(data); +}; + + + +///------------------------------------------------------------------------------------- +/// +///------------------------------------------------------------------------------------- + +void TdApi::createFtdcTraderApi(string pszFlowPath) +{ + this->api = CThostFtdcTraderApi::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; +}; + +int TdApi::exit() +{ + //úԭAPIûУڰȫ˳APIãԭjoinƺ̫ȶ + this->api->RegisterSpi(NULL); + this->api->Release(); + this->api = NULL; + return 1; +}; + +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) +{ + //úΪֶд + THOST_TE_RESUME_TYPE type; + + switch (nType) + { + case 0: + { + type = THOST_TERT_RESTART; + break; + }; + + case 1: + { + type = THOST_TERT_RESUME; + break; + }; + + case 2: + { + type = THOST_TERT_QUICK; + break; + }; + } + + this->api->SubscribePrivateTopic(type); +}; + +void TdApi::subscribePublicTopic(int nType) +{ + //úΪֶд + THOST_TE_RESUME_TYPE type; + + switch (nType) + { + case 0: + { + type = THOST_TERT_RESTART; + break; + }; + + case 1: + { + type = THOST_TERT_RESUME; + break; + }; + + case 2: + { + type = THOST_TERT_QUICK; + break; + }; + } + + this->api->SubscribePublicTopic(type); +}; + +int TdApi::reqAuthenticate(dict req, int nRequestID) +{ + CThostFtdcReqAuthenticateField myreq = CThostFtdcReqAuthenticateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "UserID", myreq.UserID); + getStr(req, "AuthCode", myreq.AuthCode); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "UserProductInfo", myreq.UserProductInfo); + int i = this->api->ReqAuthenticate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqUserLogin(dict req, int nRequestID) +{ + CThostFtdcReqUserLoginField myreq = CThostFtdcReqUserLoginField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "MacAddress", myreq.MacAddress); + getStr(req, "UserProductInfo", myreq.UserProductInfo); + getStr(req, "UserID", myreq.UserID); + getStr(req, "TradingDay", myreq.TradingDay); + getStr(req, "InterfaceProductInfo", myreq.InterfaceProductInfo); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "ClientIPAddress", myreq.ClientIPAddress); + getStr(req, "OneTimePassword", myreq.OneTimePassword); + getStr(req, "ProtocolInfo", myreq.ProtocolInfo); + getStr(req, "Password", myreq.Password); + int i = this->api->ReqUserLogin(&myreq, nRequestID); + return i; +}; + +int TdApi::reqUserLogout(dict req, int nRequestID) +{ + CThostFtdcUserLogoutField myreq = CThostFtdcUserLogoutField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "UserID", myreq.UserID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqUserLogout(&myreq, nRequestID); + return i; +}; + +int TdApi::reqUserPasswordUpdate(dict req, int nRequestID) +{ + CThostFtdcUserPasswordUpdateField myreq = CThostFtdcUserPasswordUpdateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "UserID", myreq.UserID); + getStr(req, "NewPassword", myreq.NewPassword); + getStr(req, "OldPassword", myreq.OldPassword); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqUserPasswordUpdate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqTradingAccountPasswordUpdate(dict req, int nRequestID) +{ + CThostFtdcTradingAccountPasswordUpdateField myreq = CThostFtdcTradingAccountPasswordUpdateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "CurrencyID", myreq.CurrencyID); + getStr(req, "NewPassword", myreq.NewPassword); + getStr(req, "OldPassword", myreq.OldPassword); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "AccountID", myreq.AccountID); + int i = this->api->ReqTradingAccountPasswordUpdate(&myreq, nRequestID); + return i; +}; + +LONGLONG TdApi::reqOrderInsert(dict req, int nRequestID) +{ + CThostFtdcInputOrderField myreq = CThostFtdcInputOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "ContingentCondition", &myreq.ContingentCondition); + getStr(req, "CombOffsetFlag", myreq.CombOffsetFlag); + getStr(req, "UserID", myreq.UserID); + getDouble(req, "LimitPrice", &myreq.LimitPrice); + getInt(req, "UserForceClose", &myreq.UserForceClose); + getChar(req, "Direction", &myreq.Direction); + getInt(req, "IsSwapOrder", &myreq.IsSwapOrder); + getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal); + getChar(req, "OrderPriceType", &myreq.OrderPriceType); + getChar(req, "TimeCondition", &myreq.TimeCondition); + getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); + getDouble(req, "StopPrice", &myreq.StopPrice); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getInt(req, "MinVolume", &myreq.MinVolume); + getChar(req, "ForceCloseReason", &myreq.ForceCloseReason); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "CombHedgeFlag", myreq.CombHedgeFlag); + getStr(req, "GTDDate", myreq.GTDDate); + getStr(req, "BusinessUnit", myreq.BusinessUnit); + getStr(req, "OrderRef", myreq.OrderRef); + getStr(req, "InvestorID", myreq.InvestorID); + getChar(req, "VolumeCondition", &myreq.VolumeCondition); + getInt(req, "RequestID", &myreq.RequestID); + + int i = this->api->ReqOrderInsert(&myreq, nRequestID); + + //ʱ + LARGE_INTEGER order_time; + QueryPerformanceCounter(&order_time); + return order_time.QuadPart; +}; + +int TdApi::reqParkedOrderInsert(dict req, int nRequestID) +{ + CThostFtdcParkedOrderField myreq = CThostFtdcParkedOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getChar(req, "ContingentCondition", &myreq.ContingentCondition); + getStr(req, "CombOffsetFlag", myreq.CombOffsetFlag); + getStr(req, "UserID", myreq.UserID); + getDouble(req, "LimitPrice", &myreq.LimitPrice); + getInt(req, "UserForceClose", &myreq.UserForceClose); + getChar(req, "Status", &myreq.Status); + getChar(req, "Direction", &myreq.Direction); + getInt(req, "IsSwapOrder", &myreq.IsSwapOrder); + getChar(req, "UserType", &myreq.UserType); + getInt(req, "VolumeTotalOriginal", &myreq.VolumeTotalOriginal); + getChar(req, "OrderPriceType", &myreq.OrderPriceType); + getChar(req, "TimeCondition", &myreq.TimeCondition); + getInt(req, "IsAutoSuspend", &myreq.IsAutoSuspend); + getDouble(req, "StopPrice", &myreq.StopPrice); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getInt(req, "MinVolume", &myreq.MinVolume); + getChar(req, "ForceCloseReason", &myreq.ForceCloseReason); + getInt(req, "ErrorID", &myreq.ErrorID); + getStr(req, "ParkedOrderID", myreq.ParkedOrderID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "CombHedgeFlag", myreq.CombHedgeFlag); + getStr(req, "GTDDate", myreq.GTDDate); + getStr(req, "BusinessUnit", myreq.BusinessUnit); + getStr(req, "ErrorMsg", myreq.ErrorMsg); + getStr(req, "OrderRef", myreq.OrderRef); + getStr(req, "InvestorID", myreq.InvestorID); + getChar(req, "VolumeCondition", &myreq.VolumeCondition); + getInt(req, "RequestID", &myreq.RequestID); + int i = this->api->ReqParkedOrderInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqParkedOrderAction(dict req, int nRequestID) +{ + CThostFtdcParkedOrderActionField myreq = CThostFtdcParkedOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "Status", &myreq.Status); + getStr(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "ActionFlag", &myreq.ActionFlag); + getInt(req, "OrderActionRef", &myreq.OrderActionRef); + getChar(req, "UserType", &myreq.UserType); + getStr(req, "ErrorMsg", myreq.ErrorMsg); + getStr(req, "UserID", myreq.UserID); + getDouble(req, "LimitPrice", &myreq.LimitPrice); + getStr(req, "OrderRef", myreq.OrderRef); + getStr(req, "InvestorID", myreq.InvestorID); + getInt(req, "SessionID", &myreq.SessionID); + getInt(req, "VolumeChange", &myreq.VolumeChange); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getStr(req, "OrderSysID", myreq.OrderSysID); + getStr(req, "ParkedOrderActionID", myreq.ParkedOrderActionID); + getInt(req, "FrontID", &myreq.FrontID); + getInt(req, "ErrorID", &myreq.ErrorID); + int i = this->api->ReqParkedOrderAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqOrderAction(dict req, int nRequestID) +{ + CThostFtdcInputOrderActionField myreq = CThostFtdcInputOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "ActionFlag", &myreq.ActionFlag); + getInt(req, "OrderActionRef", &myreq.OrderActionRef); + getStr(req, "UserID", myreq.UserID); + getDouble(req, "LimitPrice", &myreq.LimitPrice); + getStr(req, "OrderRef", myreq.OrderRef); + getStr(req, "InvestorID", myreq.InvestorID); + getInt(req, "SessionID", &myreq.SessionID); + getInt(req, "VolumeChange", &myreq.VolumeChange); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getStr(req, "OrderSysID", myreq.OrderSysID); + getInt(req, "FrontID", &myreq.FrontID); + int i = this->api->ReqOrderAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQueryMaxOrderVolume(dict req, int nRequestID) +{ + CThostFtdcQueryMaxOrderVolumeField myreq = CThostFtdcQueryMaxOrderVolumeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "Direction", &myreq.Direction); + getChar(req, "OffsetFlag", &myreq.OffsetFlag); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "MaxVolume", &myreq.MaxVolume); + int i = this->api->ReqQueryMaxOrderVolume(&myreq, nRequestID); + return i; +}; + +int TdApi::reqSettlementInfoConfirm(dict req, int nRequestID) +{ + CThostFtdcSettlementInfoConfirmField myreq = CThostFtdcSettlementInfoConfirmField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "ConfirmTime", myreq.ConfirmTime); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "ConfirmDate", myreq.ConfirmDate); + int i = this->api->ReqSettlementInfoConfirm(&myreq, nRequestID); + return i; +}; + +int TdApi::reqRemoveParkedOrder(dict req, int nRequestID) +{ + CThostFtdcRemoveParkedOrderField myreq = CThostFtdcRemoveParkedOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "ParkedOrderID", myreq.ParkedOrderID); + int i = this->api->ReqRemoveParkedOrder(&myreq, nRequestID); + return i; +}; + +int TdApi::reqRemoveParkedOrderAction(dict req, int nRequestID) +{ + CThostFtdcRemoveParkedOrderActionField myreq = CThostFtdcRemoveParkedOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "ParkedOrderActionID", myreq.ParkedOrderActionID); + int i = this->api->ReqRemoveParkedOrderAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqExecOrderInsert(dict req, int nRequestID) +{ + CThostFtdcInputExecOrderField myreq = CThostFtdcInputExecOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExecOrderRef", myreq.ExecOrderRef); + getStr(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "CloseFlag", &myreq.CloseFlag); + getChar(req, "OffsetFlag", &myreq.OffsetFlag); + getChar(req, "PosiDirection", &myreq.PosiDirection); + getStr(req, "BusinessUnit", myreq.BusinessUnit); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "UserID", myreq.UserID); + getInt(req, "Volume", &myreq.Volume); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "ActionType", &myreq.ActionType); + getChar(req, "ReservePositionFlag", &myreq.ReservePositionFlag); + int i = this->api->ReqExecOrderInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqExecOrderAction(dict req, int nRequestID) +{ + CThostFtdcInputExecOrderActionField myreq = CThostFtdcInputExecOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExecOrderSysID", myreq.ExecOrderSysID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "UserID", myreq.UserID); + getStr(req, "ExecOrderRef", myreq.ExecOrderRef); + getStr(req, "InvestorID", myreq.InvestorID); + getInt(req, "SessionID", &myreq.SessionID); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "ActionFlag", &myreq.ActionFlag); + getInt(req, "ExecOrderActionRef", &myreq.ExecOrderActionRef); + getInt(req, "FrontID", &myreq.FrontID); + int i = this->api->ReqExecOrderAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqForQuoteInsert(dict req, int nRequestID) +{ + CThostFtdcInputForQuoteField myreq = CThostFtdcInputForQuoteField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ForQuoteRef", myreq.ForQuoteRef); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "UserID", myreq.UserID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqForQuoteInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQuoteInsert(dict req, int nRequestID) +{ + CThostFtdcInputQuoteField myreq = CThostFtdcInputQuoteField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "AskHedgeFlag", &myreq.AskHedgeFlag); + getStr(req, "BusinessUnit", myreq.BusinessUnit); + getDouble(req, "AskPrice", &myreq.AskPrice); + getStr(req, "UserID", myreq.UserID); + getChar(req, "AskOffsetFlag", &myreq.AskOffsetFlag); + getInt(req, "BidVolume", &myreq.BidVolume); + getStr(req, "AskOrderRef", myreq.AskOrderRef); + getInt(req, "AskVolume", &myreq.AskVolume); + getStr(req, "InvestorID", myreq.InvestorID); + getChar(req, "BidOffsetFlag", &myreq.BidOffsetFlag); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getStr(req, "ForQuoteSysID", myreq.ForQuoteSysID); + getDouble(req, "BidPrice", &myreq.BidPrice); + getChar(req, "BidHedgeFlag", &myreq.BidHedgeFlag); + getStr(req, "QuoteRef", myreq.QuoteRef); + getStr(req, "BidOrderRef", myreq.BidOrderRef); + int i = this->api->ReqQuoteInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQuoteAction(dict req, int nRequestID) +{ + CThostFtdcInputQuoteActionField myreq = CThostFtdcInputQuoteActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getInt(req, "QuoteActionRef", &myreq.QuoteActionRef); + getStr(req, "UserID", myreq.UserID); + getStr(req, "InvestorID", myreq.InvestorID); + getInt(req, "SessionID", &myreq.SessionID); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "ActionFlag", &myreq.ActionFlag); + getInt(req, "FrontID", &myreq.FrontID); + getStr(req, "QuoteSysID", myreq.QuoteSysID); + getStr(req, "QuoteRef", myreq.QuoteRef); + int i = this->api->ReqQuoteAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqLockInsert(dict req, int nRequestID) +{ + CThostFtdcInputLockField myreq = CThostFtdcInputLockField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BusinessUnit", myreq.BusinessUnit); + getStr(req, "UserID", myreq.UserID); + getStr(req, "LockRef", myreq.LockRef); + getInt(req, "Volume", &myreq.Volume); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "LockType", &myreq.LockType); + int i = this->api->ReqLockInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqCombActionInsert(dict req, int nRequestID) +{ + CThostFtdcInputCombActionField myreq = CThostFtdcInputCombActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "Direction", &myreq.Direction); + getStr(req, "CombActionRef", myreq.CombActionRef); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "UserID", myreq.UserID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getInt(req, "Volume", &myreq.Volume); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getChar(req, "CombDirection", &myreq.CombDirection); + int i = this->api->ReqCombActionInsert(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryOrder(dict req, int nRequestID) +{ + CThostFtdcQryOrderField myreq = CThostFtdcQryOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "InsertTimeStart", myreq.InsertTimeStart); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "OrderSysID", myreq.OrderSysID); + getStr(req, "InsertTimeEnd", myreq.InsertTimeEnd); + int i = this->api->ReqQryOrder(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryTrade(dict req, int nRequestID) +{ + CThostFtdcQryTradeField myreq = CThostFtdcQryTradeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "TradeTimeStart", myreq.TradeTimeStart); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "TradeID", myreq.TradeID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "TradeTimeEnd", myreq.TradeTimeEnd); + int i = this->api->ReqQryTrade(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInvestorPosition(dict req, int nRequestID) +{ + CThostFtdcQryInvestorPositionField myreq = CThostFtdcQryInvestorPositionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryInvestorPosition(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryTradingAccount(dict req, int nRequestID) +{ + CThostFtdcQryTradingAccountField myreq = CThostFtdcQryTradingAccountField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "CurrencyID", myreq.CurrencyID); + getStr(req, "InvestorID", myreq.InvestorID); + getChar(req, "BizType", &myreq.BizType); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryTradingAccount(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInvestor(dict req, int nRequestID) +{ + CThostFtdcQryInvestorField myreq = CThostFtdcQryInvestorField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryInvestor(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryTradingCode(dict req, int nRequestID) +{ + CThostFtdcQryTradingCodeField myreq = CThostFtdcQryTradingCodeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + getChar(req, "ClientIDType", &myreq.ClientIDType); + getStr(req, "ClientID", myreq.ClientID); + int i = this->api->ReqQryTradingCode(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInstrumentMarginRate(dict req, int nRequestID) +{ + CThostFtdcQryInstrumentMarginRateField myreq = CThostFtdcQryInstrumentMarginRateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + int i = this->api->ReqQryInstrumentMarginRate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInstrumentCommissionRate(dict req, int nRequestID) +{ + CThostFtdcQryInstrumentCommissionRateField myreq = CThostFtdcQryInstrumentCommissionRateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryInstrumentCommissionRate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryExchange(dict req, int nRequestID) +{ + CThostFtdcQryExchangeField myreq = CThostFtdcQryExchangeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "ExchangeID", myreq.ExchangeID); + int i = this->api->ReqQryExchange(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryProduct(dict req, int nRequestID) +{ + CThostFtdcQryProductField myreq = CThostFtdcQryProductField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "ExchangeID", myreq.ExchangeID); + getChar(req, "ProductClass", &myreq.ProductClass); + getStr(req, "ProductID", myreq.ProductID); + int i = this->api->ReqQryProduct(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInstrument(dict req, int nRequestID) +{ + CThostFtdcQryInstrumentField myreq = CThostFtdcQryInstrumentField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "ExchangeInstID", myreq.ExchangeInstID); + getStr(req, "ProductID", myreq.ProductID); + int i = this->api->ReqQryInstrument(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryDepthMarketData(dict req, int nRequestID) +{ + CThostFtdcQryDepthMarketDataField myreq = CThostFtdcQryDepthMarketDataField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + int i = this->api->ReqQryDepthMarketData(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQrySettlementInfo(dict req, int nRequestID) +{ + CThostFtdcQrySettlementInfoField myreq = CThostFtdcQrySettlementInfoField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "TradingDay", myreq.TradingDay); + int i = this->api->ReqQrySettlementInfo(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryTransferBank(dict req, int nRequestID) +{ + CThostFtdcQryTransferBankField myreq = CThostFtdcQryTransferBankField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "BankBrchID", myreq.BankBrchID); + getStr(req, "BankID", myreq.BankID); + int i = this->api->ReqQryTransferBank(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInvestorPositionDetail(dict req, int nRequestID) +{ + CThostFtdcQryInvestorPositionDetailField myreq = CThostFtdcQryInvestorPositionDetailField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryInvestorPositionDetail(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryNotice(dict req, int nRequestID) +{ + CThostFtdcQryNoticeField myreq = CThostFtdcQryNoticeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryNotice(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQrySettlementInfoConfirm(dict req, int nRequestID) +{ + CThostFtdcQrySettlementInfoConfirmField myreq = CThostFtdcQrySettlementInfoConfirmField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQrySettlementInfoConfirm(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInvestorPositionCombineDetail(dict req, int nRequestID) +{ + CThostFtdcQryInvestorPositionCombineDetailField myreq = CThostFtdcQryInvestorPositionCombineDetailField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "CombInstrumentID", myreq.CombInstrumentID); + int i = this->api->ReqQryInvestorPositionCombineDetail(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryCFMMCTradingAccountKey(dict req, int nRequestID) +{ + CThostFtdcQryCFMMCTradingAccountKeyField myreq = CThostFtdcQryCFMMCTradingAccountKeyField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryCFMMCTradingAccountKey(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryEWarrantOffset(dict req, int nRequestID) +{ + CThostFtdcQryEWarrantOffsetField myreq = CThostFtdcQryEWarrantOffsetField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryEWarrantOffset(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInvestorProductGroupMargin(dict req, int nRequestID) +{ + CThostFtdcQryInvestorProductGroupMarginField myreq = CThostFtdcQryInvestorProductGroupMarginField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "ProductGroupID", myreq.ProductGroupID); + int i = this->api->ReqQryInvestorProductGroupMargin(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryExchangeMarginRate(dict req, int nRequestID) +{ + CThostFtdcQryExchangeMarginRateField myreq = CThostFtdcQryExchangeMarginRateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryExchangeMarginRate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryExchangeMarginRateAdjust(dict req, int nRequestID) +{ + CThostFtdcQryExchangeMarginRateAdjustField myreq = CThostFtdcQryExchangeMarginRateAdjustField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryExchangeMarginRateAdjust(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryExchangeRate(dict req, int nRequestID) +{ + CThostFtdcQryExchangeRateField myreq = CThostFtdcQryExchangeRateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "FromCurrencyID", myreq.FromCurrencyID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "ToCurrencyID", myreq.ToCurrencyID); + int i = this->api->ReqQryExchangeRate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQrySecAgentACIDMap(dict req, int nRequestID) +{ + CThostFtdcQrySecAgentACIDMapField myreq = CThostFtdcQrySecAgentACIDMapField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "CurrencyID", myreq.CurrencyID); + getStr(req, "UserID", myreq.UserID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "AccountID", myreq.AccountID); + int i = this->api->ReqQrySecAgentACIDMap(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryProductExchRate(dict req, int nRequestID) +{ + CThostFtdcQryProductExchRateField myreq = CThostFtdcQryProductExchRateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "ProductID", myreq.ProductID); + int i = this->api->ReqQryProductExchRate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryProductGroup(dict req, int nRequestID) +{ + CThostFtdcQryProductGroupField myreq = CThostFtdcQryProductGroupField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "ProductID", myreq.ProductID); + int i = this->api->ReqQryProductGroup(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryOptionInstrTradeCost(dict req, int nRequestID) +{ + CThostFtdcQryOptionInstrTradeCostField myreq = CThostFtdcQryOptionInstrTradeCostField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getDouble(req, "InputPrice", &myreq.InputPrice); + getStr(req, "ExchangeID", myreq.ExchangeID); + getDouble(req, "UnderlyingPrice", &myreq.UnderlyingPrice); + getChar(req, "HedgeFlag", &myreq.HedgeFlag); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryOptionInstrTradeCost(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryOptionInstrCommRate(dict req, int nRequestID) +{ + CThostFtdcQryOptionInstrCommRateField myreq = CThostFtdcQryOptionInstrCommRateField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryOptionInstrCommRate(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryExecOrder(dict req, int nRequestID) +{ + CThostFtdcQryExecOrderField myreq = CThostFtdcQryExecOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExecOrderSysID", myreq.ExecOrderSysID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "InsertTimeStart", myreq.InsertTimeStart); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "InsertTimeEnd", myreq.InsertTimeEnd); + int i = this->api->ReqQryExecOrder(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryForQuote(dict req, int nRequestID) +{ + CThostFtdcQryForQuoteField myreq = CThostFtdcQryForQuoteField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "InsertTimeStart", myreq.InsertTimeStart); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "InsertTimeEnd", myreq.InsertTimeEnd); + int i = this->api->ReqQryForQuote(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryQuote(dict req, int nRequestID) +{ + CThostFtdcQryQuoteField myreq = CThostFtdcQryQuoteField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "InsertTimeStart", myreq.InsertTimeStart); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "QuoteSysID", myreq.QuoteSysID); + getStr(req, "InsertTimeEnd", myreq.InsertTimeEnd); + int i = this->api->ReqQryQuote(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryLock(dict req, int nRequestID) +{ + CThostFtdcQryLockField myreq = CThostFtdcQryLockField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "InsertTimeStart", myreq.InsertTimeStart); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "LockSysID", myreq.LockSysID); + getStr(req, "InsertTimeEnd", myreq.InsertTimeEnd); + int i = this->api->ReqQryLock(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryLockPosition(dict req, int nRequestID) +{ + CThostFtdcQryLockPositionField myreq = CThostFtdcQryLockPositionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryLockPosition(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryInvestorLevel(dict req, int nRequestID) +{ + CThostFtdcQryInvestorLevelField myreq = CThostFtdcQryInvestorLevelField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryInvestorLevel(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryExecFreeze(dict req, int nRequestID) +{ + CThostFtdcQryExecFreezeField myreq = CThostFtdcQryExecFreezeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryExecFreeze(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryCombInstrumentGuard(dict req, int nRequestID) +{ + CThostFtdcQryCombInstrumentGuardField myreq = CThostFtdcQryCombInstrumentGuardField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryCombInstrumentGuard(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryCombAction(dict req, int nRequestID) +{ + CThostFtdcQryCombActionField myreq = CThostFtdcQryCombActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryCombAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryTransferSerial(dict req, int nRequestID) +{ + CThostFtdcQryTransferSerialField myreq = CThostFtdcQryTransferSerialField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "CurrencyID", myreq.CurrencyID); + getStr(req, "BankID", myreq.BankID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "AccountID", myreq.AccountID); + int i = this->api->ReqQryTransferSerial(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryAccountregister(dict req, int nRequestID) +{ + CThostFtdcQryAccountregisterField myreq = CThostFtdcQryAccountregisterField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "CurrencyID", myreq.CurrencyID); + getStr(req, "BankID", myreq.BankID); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "BankBranchID", myreq.BankBranchID); + getStr(req, "AccountID", myreq.AccountID); + int i = this->api->ReqQryAccountregister(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryContractBank(dict req, int nRequestID) +{ + CThostFtdcQryContractBankField myreq = CThostFtdcQryContractBankField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "BankBrchID", myreq.BankBrchID); + getStr(req, "BankID", myreq.BankID); + int i = this->api->ReqQryContractBank(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryParkedOrder(dict req, int nRequestID) +{ + CThostFtdcQryParkedOrderField myreq = CThostFtdcQryParkedOrderField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryParkedOrder(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryParkedOrderAction(dict req, int nRequestID) +{ + CThostFtdcQryParkedOrderActionField myreq = CThostFtdcQryParkedOrderActionField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryParkedOrderAction(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryTradingNotice(dict req, int nRequestID) +{ + CThostFtdcQryTradingNoticeField myreq = CThostFtdcQryTradingNoticeField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryTradingNotice(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryBrokerTradingParams(dict req, int nRequestID) +{ + CThostFtdcQryBrokerTradingParamsField myreq = CThostFtdcQryBrokerTradingParamsField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "CurrencyID", myreq.CurrencyID); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryBrokerTradingParams(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQryBrokerTradingAlgos(dict req, int nRequestID) +{ + CThostFtdcQryBrokerTradingAlgosField myreq = CThostFtdcQryBrokerTradingAlgosField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InstrumentID", myreq.InstrumentID); + getStr(req, "ExchangeID", myreq.ExchangeID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQryBrokerTradingAlgos(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQueryCFMMCTradingAccountToken(dict req, int nRequestID) +{ + CThostFtdcQueryCFMMCTradingAccountTokenField myreq = CThostFtdcQueryCFMMCTradingAccountTokenField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "InvestorID", myreq.InvestorID); + getStr(req, "BrokerID", myreq.BrokerID); + int i = this->api->ReqQueryCFMMCTradingAccountToken(&myreq, nRequestID); + return i; +}; + +int TdApi::reqFromBankToFutureByFuture(dict req, int nRequestID) +{ + CThostFtdcReqTransferField myreq = CThostFtdcReqTransferField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "BrokerBranchID", myreq.BrokerBranchID); + getStr(req, "UserID", myreq.UserID); + getStr(req, "BankPassWord", myreq.BankPassWord); + getStr(req, "TradeTime", myreq.TradeTime); + getChar(req, "VerifyCertNoFlag", &myreq.VerifyCertNoFlag); + getInt(req, "TID", &myreq.TID); + getStr(req, "AccountID", myreq.AccountID); + getStr(req, "BankAccount", myreq.BankAccount); + getInt(req, "InstallID", &myreq.InstallID); + getStr(req, "CustomerName", myreq.CustomerName); + getStr(req, "TradeCode", myreq.TradeCode); + getStr(req, "BankBranchID", myreq.BankBranchID); + getInt(req, "SessionID", &myreq.SessionID); + getStr(req, "BankID", myreq.BankID); + getStr(req, "Password", myreq.Password); + getChar(req, "BankPwdFlag", &myreq.BankPwdFlag); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "CustType", &myreq.CustType); + getStr(req, "IdentifiedCardNo", myreq.IdentifiedCardNo); + getChar(req, "FeePayFlag", &myreq.FeePayFlag); + getStr(req, "BankSerial", myreq.BankSerial); + getStr(req, "OperNo", myreq.OperNo); + getStr(req, "TradingDay", myreq.TradingDay); + getStr(req, "BankSecuAcc", myreq.BankSecuAcc); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "DeviceID", myreq.DeviceID); + getChar(req, "TransferStatus", &myreq.TransferStatus); + getChar(req, "IdCardType", &myreq.IdCardType); + getInt(req, "PlateSerial", &myreq.PlateSerial); + getDouble(req, "FutureFetchAmount", &myreq.FutureFetchAmount); + getStr(req, "TradeDate", myreq.TradeDate); + getStr(req, "CurrencyID", myreq.CurrencyID); + getDouble(req, "BrokerFee", &myreq.BrokerFee); + getChar(req, "BankAccType", &myreq.BankAccType); + getChar(req, "LastFragment", &myreq.LastFragment); + getInt(req, "FutureSerial", &myreq.FutureSerial); + getChar(req, "BankSecuAccType", &myreq.BankSecuAccType); + getStr(req, "BrokerIDByBank", myreq.BrokerIDByBank); + getChar(req, "SecuPwdFlag", &myreq.SecuPwdFlag); + getStr(req, "Message", myreq.Message); + getDouble(req, "CustFee", &myreq.CustFee); + getDouble(req, "TradeAmount", &myreq.TradeAmount); + getStr(req, "Digest", myreq.Digest); + int i = this->api->ReqFromBankToFutureByFuture(&myreq, nRequestID); + return i; +}; + +int TdApi::reqFromFutureToBankByFuture(dict req, int nRequestID) +{ + CThostFtdcReqTransferField myreq = CThostFtdcReqTransferField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "BrokerBranchID", myreq.BrokerBranchID); + getStr(req, "UserID", myreq.UserID); + getStr(req, "BankPassWord", myreq.BankPassWord); + getStr(req, "TradeTime", myreq.TradeTime); + getChar(req, "VerifyCertNoFlag", &myreq.VerifyCertNoFlag); + getInt(req, "TID", &myreq.TID); + getStr(req, "AccountID", myreq.AccountID); + getStr(req, "BankAccount", myreq.BankAccount); + getInt(req, "InstallID", &myreq.InstallID); + getStr(req, "CustomerName", myreq.CustomerName); + getStr(req, "TradeCode", myreq.TradeCode); + getStr(req, "BankBranchID", myreq.BankBranchID); + getInt(req, "SessionID", &myreq.SessionID); + getStr(req, "BankID", myreq.BankID); + getStr(req, "Password", myreq.Password); + getChar(req, "BankPwdFlag", &myreq.BankPwdFlag); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "CustType", &myreq.CustType); + getStr(req, "IdentifiedCardNo", myreq.IdentifiedCardNo); + getChar(req, "FeePayFlag", &myreq.FeePayFlag); + getStr(req, "BankSerial", myreq.BankSerial); + getStr(req, "OperNo", myreq.OperNo); + getStr(req, "TradingDay", myreq.TradingDay); + getStr(req, "BankSecuAcc", myreq.BankSecuAcc); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "DeviceID", myreq.DeviceID); + getChar(req, "TransferStatus", &myreq.TransferStatus); + getChar(req, "IdCardType", &myreq.IdCardType); + getInt(req, "PlateSerial", &myreq.PlateSerial); + getDouble(req, "FutureFetchAmount", &myreq.FutureFetchAmount); + getStr(req, "TradeDate", myreq.TradeDate); + getStr(req, "CurrencyID", myreq.CurrencyID); + getDouble(req, "BrokerFee", &myreq.BrokerFee); + getChar(req, "BankAccType", &myreq.BankAccType); + getChar(req, "LastFragment", &myreq.LastFragment); + getInt(req, "FutureSerial", &myreq.FutureSerial); + getChar(req, "BankSecuAccType", &myreq.BankSecuAccType); + getStr(req, "BrokerIDByBank", myreq.BrokerIDByBank); + getChar(req, "SecuPwdFlag", &myreq.SecuPwdFlag); + getStr(req, "Message", myreq.Message); + getDouble(req, "CustFee", &myreq.CustFee); + getDouble(req, "TradeAmount", &myreq.TradeAmount); + getStr(req, "Digest", myreq.Digest); + int i = this->api->ReqFromFutureToBankByFuture(&myreq, nRequestID); + return i; +}; + +int TdApi::reqQueryBankAccountMoneyByFuture(dict req, int nRequestID) +{ + CThostFtdcReqQueryAccountField myreq = CThostFtdcReqQueryAccountField(); + memset(&myreq, 0, sizeof(myreq)); + getStr(req, "BrokerBranchID", myreq.BrokerBranchID); + getStr(req, "UserID", myreq.UserID); + getStr(req, "BankPassWord", myreq.BankPassWord); + getStr(req, "TradeTime", myreq.TradeTime); + getChar(req, "VerifyCertNoFlag", &myreq.VerifyCertNoFlag); + getInt(req, "TID", &myreq.TID); + getStr(req, "AccountID", myreq.AccountID); + getStr(req, "BankAccount", myreq.BankAccount); + getInt(req, "InstallID", &myreq.InstallID); + getStr(req, "CustomerName", myreq.CustomerName); + getStr(req, "TradeCode", myreq.TradeCode); + getStr(req, "BankBranchID", myreq.BankBranchID); + getInt(req, "SessionID", &myreq.SessionID); + getStr(req, "BankID", myreq.BankID); + getStr(req, "Password", myreq.Password); + getChar(req, "BankPwdFlag", &myreq.BankPwdFlag); + getInt(req, "RequestID", &myreq.RequestID); + getChar(req, "CustType", &myreq.CustType); + getStr(req, "IdentifiedCardNo", myreq.IdentifiedCardNo); + getStr(req, "BankSerial", myreq.BankSerial); + getStr(req, "OperNo", myreq.OperNo); + getStr(req, "TradingDay", myreq.TradingDay); + getStr(req, "BankSecuAcc", myreq.BankSecuAcc); + getStr(req, "BrokerID", myreq.BrokerID); + getStr(req, "DeviceID", myreq.DeviceID); + getChar(req, "IdCardType", &myreq.IdCardType); + getInt(req, "PlateSerial", &myreq.PlateSerial); + getStr(req, "TradeDate", myreq.TradeDate); + getStr(req, "CurrencyID", myreq.CurrencyID); + getChar(req, "BankAccType", &myreq.BankAccType); + getChar(req, "LastFragment", &myreq.LastFragment); + getInt(req, "FutureSerial", &myreq.FutureSerial); + getChar(req, "BankSecuAccType", &myreq.BankSecuAccType); + getStr(req, "BrokerIDByBank", myreq.BrokerIDByBank); + getChar(req, "SecuPwdFlag", &myreq.SecuPwdFlag); + getStr(req, "Digest", myreq.Digest); + int i = this->api->ReqQueryBankAccountMoneyByFuture(&myreq, nRequestID); + return i; +}; + + +///------------------------------------------------------------------------------------- +///Boost.Pythonװ +///------------------------------------------------------------------------------------- + +struct TdApiWrap : TdApi, wrapper < TdApi > +{ + virtual void onFrontConnected() + { + //pythonеûصǰҪȻȡȫGILֹ + PyLock lock; + + //µtry...catch...ʵֲ׽pythonдĹܣֹC++ֱӳԭδ֪ı + try + { + this->get_override("onFrontConnected")(); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onFrontDisconnected(int i) + { + PyLock lock; + + try + { + this->get_override("onFrontDisconnected")(i); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onHeartBeatWarning(int i) + { + PyLock lock; + + try + { + this->get_override("onHeartBeatWarning")(i); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspAuthenticate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspAuthenticate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUserLogin(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUserLogin")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUserLogout(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUserLogout")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspUserPasswordUpdate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspUserPasswordUpdate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspTradingAccountPasswordUpdate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspTradingAccountPasswordUpdate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspOrderInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspOrderInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspParkedOrderInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspParkedOrderInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspParkedOrderAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspParkedOrderAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspOrderAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspOrderAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQueryMaxOrderVolume(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQueryMaxOrderVolume")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspSettlementInfoConfirm(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspSettlementInfoConfirm")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspRemoveParkedOrder(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspRemoveParkedOrder")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspRemoveParkedOrderAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspRemoveParkedOrderAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspExecOrderInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspExecOrderInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspExecOrderAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspExecOrderAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspForQuoteInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspForQuoteInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQuoteInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQuoteInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQuoteAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQuoteAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspLockInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspLockInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspCombActionInsert(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspCombActionInsert")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryOrder(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryOrder")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryTrade(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryTrade")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInvestorPosition(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInvestorPosition")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryTradingAccount(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryTradingAccount")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInvestor(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInvestor")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryTradingCode(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryTradingCode")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInstrumentMarginRate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInstrumentMarginRate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInstrumentCommissionRate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInstrumentCommissionRate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryExchange(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryExchange")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryProduct(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryProduct")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInstrument(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInstrument")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryDepthMarketData(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryDepthMarketData")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQrySettlementInfo(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQrySettlementInfo")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryTransferBank(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryTransferBank")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInvestorPositionDetail(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInvestorPositionDetail")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryNotice(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryNotice")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQrySettlementInfoConfirm(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQrySettlementInfoConfirm")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInvestorPositionCombineDetail(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInvestorPositionCombineDetail")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryCFMMCTradingAccountKey(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryCFMMCTradingAccountKey")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryEWarrantOffset(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryEWarrantOffset")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInvestorProductGroupMargin(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInvestorProductGroupMargin")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryExchangeMarginRate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryExchangeMarginRate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryExchangeMarginRateAdjust(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryExchangeMarginRateAdjust")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryExchangeRate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryExchangeRate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQrySecAgentACIDMap(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQrySecAgentACIDMap")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryProductExchRate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryProductExchRate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryProductGroup(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryProductGroup")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryOptionInstrTradeCost(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryOptionInstrTradeCost")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryOptionInstrCommRate(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryOptionInstrCommRate")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryExecOrder(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryExecOrder")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryForQuote(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryForQuote")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryQuote(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryQuote")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryLock(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryLock")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryLockPosition(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryLockPosition")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryInvestorLevel(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryInvestorLevel")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryExecFreeze(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryExecFreeze")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryCombInstrumentGuard(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryCombInstrumentGuard")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryCombAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryCombAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryTransferSerial(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryTransferSerial")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryAccountregister(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryAccountregister")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspError(dict error, int id, bool last) + { + try + { + this->get_override("onRspError")(error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnOrder(dict data) + { + try + { + this->get_override("onRtnOrder")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnTrade(dict data) + { + try + { + this->get_override("onRtnTrade")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnOrderInsert(dict data, dict error) + { + try + { + this->get_override("onErrRtnOrderInsert")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnOrderAction(dict data, dict error) + { + try + { + this->get_override("onErrRtnOrderAction")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnInstrumentStatus(dict data) + { + try + { + this->get_override("onRtnInstrumentStatus")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnTradingNotice(dict data) + { + try + { + this->get_override("onRtnTradingNotice")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnErrorConditionalOrder(dict data) + { + try + { + this->get_override("onRtnErrorConditionalOrder")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnExecOrder(dict data) + { + try + { + this->get_override("onRtnExecOrder")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnExecOrderInsert(dict data, dict error) + { + try + { + this->get_override("onErrRtnExecOrderInsert")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnExecOrderAction(dict data, dict error) + { + try + { + this->get_override("onErrRtnExecOrderAction")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnForQuoteInsert(dict data, dict error) + { + try + { + this->get_override("onErrRtnForQuoteInsert")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnQuote(dict data) + { + try + { + this->get_override("onRtnQuote")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnQuoteInsert(dict data, dict error) + { + try + { + this->get_override("onErrRtnQuoteInsert")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnQuoteAction(dict data, dict error) + { + try + { + this->get_override("onErrRtnQuoteAction")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnForQuoteRsp(dict data) + { + try + { + this->get_override("onRtnForQuoteRsp")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnCFMMCTradingAccountToken(dict data) + { + try + { + this->get_override("onRtnCFMMCTradingAccountToken")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnLock(dict data) + { + try + { + this->get_override("onRtnLock")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnLockInsert(dict data, dict error) + { + try + { + this->get_override("onErrRtnLockInsert")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnCombAction(dict data) + { + try + { + this->get_override("onRtnCombAction")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnCombActionInsert(dict data, dict error) + { + try + { + this->get_override("onErrRtnCombActionInsert")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryContractBank(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryContractBank")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryParkedOrder(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryParkedOrder")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryParkedOrderAction(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryParkedOrderAction")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryTradingNotice(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryTradingNotice")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryBrokerTradingParams(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryBrokerTradingParams")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQryBrokerTradingAlgos(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQryBrokerTradingAlgos")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQueryCFMMCTradingAccountToken(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQueryCFMMCTradingAccountToken")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnFromBankToFutureByBank(dict data) + { + try + { + this->get_override("onRtnFromBankToFutureByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnFromFutureToBankByBank(dict data) + { + try + { + this->get_override("onRtnFromFutureToBankByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnRepealFromBankToFutureByBank(dict data) + { + try + { + this->get_override("onRtnRepealFromBankToFutureByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnRepealFromFutureToBankByBank(dict data) + { + try + { + this->get_override("onRtnRepealFromFutureToBankByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnFromBankToFutureByFuture(dict data) + { + try + { + this->get_override("onRtnFromBankToFutureByFuture")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnFromFutureToBankByFuture(dict data) + { + try + { + this->get_override("onRtnFromFutureToBankByFuture")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnRepealFromBankToFutureByFutureManual(dict data) + { + try + { + this->get_override("onRtnRepealFromBankToFutureByFutureManual")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnRepealFromFutureToBankByFutureManual(dict data) + { + try + { + this->get_override("onRtnRepealFromFutureToBankByFutureManual")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnQueryBankBalanceByFuture(dict data) + { + try + { + this->get_override("onRtnQueryBankBalanceByFuture")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnBankToFutureByFuture(dict data, dict error) + { + try + { + this->get_override("onErrRtnBankToFutureByFuture")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnFutureToBankByFuture(dict data, dict error) + { + try + { + this->get_override("onErrRtnFutureToBankByFuture")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnRepealBankToFutureByFutureManual(dict data, dict error) + { + try + { + this->get_override("onErrRtnRepealBankToFutureByFutureManual")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnRepealFutureToBankByFutureManual(dict data, dict error) + { + try + { + this->get_override("onErrRtnRepealFutureToBankByFutureManual")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onErrRtnQueryBankBalanceByFuture(dict data, dict error) + { + try + { + this->get_override("onErrRtnQueryBankBalanceByFuture")(data, error); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnRepealFromBankToFutureByFuture(dict data) + { + try + { + this->get_override("onRtnRepealFromBankToFutureByFuture")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnRepealFromFutureToBankByFuture(dict data) + { + try + { + this->get_override("onRtnRepealFromFutureToBankByFuture")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspFromBankToFutureByFuture(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspFromBankToFutureByFuture")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspFromFutureToBankByFuture(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspFromFutureToBankByFuture")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRspQueryBankAccountMoneyByFuture(dict data, dict error, int id, bool last) + { + try + { + this->get_override("onRspQueryBankAccountMoneyByFuture")(data, error, id, last); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnOpenAccountByBank(dict data) + { + try + { + this->get_override("onRtnOpenAccountByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnCancelAccountByBank(dict data) + { + try + { + this->get_override("onRtnCancelAccountByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + + virtual void onRtnChangeAccountByBank(dict data) + { + try + { + this->get_override("onRtnChangeAccountByBank")(data); + } + catch (error_already_set const &) + { + PyErr_Print(); + } + }; + +}; + +BOOST_PYTHON_MODULE(vnctptd) +{ + PyEval_InitThreads(); //ʱУ֤ȴGIL + + class_("TdApi") + .def("createFtdcTraderApi", &TdApiWrap::createFtdcTraderApi) + .def("release", &TdApiWrap::release) + .def("init", &TdApiWrap::init) + .def("join", &TdApiWrap::join) + .def("exit", &TdApiWrap::exit) + .def("getTradingDay", &TdApiWrap::getTradingDay) + .def("registerFront", &TdApiWrap::registerFront) + .def("subscribePrivateTopic", &TdApiWrap::subscribePrivateTopic) + .def("subscribePublicTopic", &TdApiWrap::subscribePublicTopic) + .def("reqAuthenticate", &TdApiWrap::reqAuthenticate) + .def("reqUserLogin", &TdApiWrap::reqUserLogin) + .def("reqUserLogout", &TdApiWrap::reqUserLogout) + .def("reqUserPasswordUpdate", &TdApiWrap::reqUserPasswordUpdate) + .def("reqTradingAccountPasswordUpdate", &TdApiWrap::reqTradingAccountPasswordUpdate) + .def("reqOrderInsert", &TdApiWrap::reqOrderInsert) + .def("reqParkedOrderInsert", &TdApiWrap::reqParkedOrderInsert) + .def("reqParkedOrderAction", &TdApiWrap::reqParkedOrderAction) + .def("reqOrderAction", &TdApiWrap::reqOrderAction) + .def("reqQueryMaxOrderVolume", &TdApiWrap::reqQueryMaxOrderVolume) + .def("reqSettlementInfoConfirm", &TdApiWrap::reqSettlementInfoConfirm) + .def("reqRemoveParkedOrder", &TdApiWrap::reqRemoveParkedOrder) + .def("reqRemoveParkedOrderAction", &TdApiWrap::reqRemoveParkedOrderAction) + .def("reqExecOrderInsert", &TdApiWrap::reqExecOrderInsert) + .def("reqExecOrderAction", &TdApiWrap::reqExecOrderAction) + .def("reqForQuoteInsert", &TdApiWrap::reqForQuoteInsert) + .def("reqQuoteInsert", &TdApiWrap::reqQuoteInsert) + .def("reqQuoteAction", &TdApiWrap::reqQuoteAction) + .def("reqLockInsert", &TdApiWrap::reqLockInsert) + .def("reqCombActionInsert", &TdApiWrap::reqCombActionInsert) + .def("reqQryOrder", &TdApiWrap::reqQryOrder) + .def("reqQryTrade", &TdApiWrap::reqQryTrade) + .def("reqQryInvestorPosition", &TdApiWrap::reqQryInvestorPosition) + .def("reqQryTradingAccount", &TdApiWrap::reqQryTradingAccount) + .def("reqQryInvestor", &TdApiWrap::reqQryInvestor) + .def("reqQryTradingCode", &TdApiWrap::reqQryTradingCode) + .def("reqQryInstrumentMarginRate", &TdApiWrap::reqQryInstrumentMarginRate) + .def("reqQryInstrumentCommissionRate", &TdApiWrap::reqQryInstrumentCommissionRate) + .def("reqQryExchange", &TdApiWrap::reqQryExchange) + .def("reqQryProduct", &TdApiWrap::reqQryProduct) + .def("reqQryInstrument", &TdApiWrap::reqQryInstrument) + .def("reqQryDepthMarketData", &TdApiWrap::reqQryDepthMarketData) + .def("reqQrySettlementInfo", &TdApiWrap::reqQrySettlementInfo) + .def("reqQryTransferBank", &TdApiWrap::reqQryTransferBank) + .def("reqQryInvestorPositionDetail", &TdApiWrap::reqQryInvestorPositionDetail) + .def("reqQryNotice", &TdApiWrap::reqQryNotice) + .def("reqQrySettlementInfoConfirm", &TdApiWrap::reqQrySettlementInfoConfirm) + .def("reqQryInvestorPositionCombineDetail", &TdApiWrap::reqQryInvestorPositionCombineDetail) + .def("reqQryCFMMCTradingAccountKey", &TdApiWrap::reqQryCFMMCTradingAccountKey) + .def("reqQryEWarrantOffset", &TdApiWrap::reqQryEWarrantOffset) + .def("reqQryInvestorProductGroupMargin", &TdApiWrap::reqQryInvestorProductGroupMargin) + .def("reqQryExchangeMarginRate", &TdApiWrap::reqQryExchangeMarginRate) + .def("reqQryExchangeMarginRateAdjust", &TdApiWrap::reqQryExchangeMarginRateAdjust) + .def("reqQryExchangeRate", &TdApiWrap::reqQryExchangeRate) + .def("reqQrySecAgentACIDMap", &TdApiWrap::reqQrySecAgentACIDMap) + .def("reqQryProductExchRate", &TdApiWrap::reqQryProductExchRate) + .def("reqQryProductGroup", &TdApiWrap::reqQryProductGroup) + .def("reqQryOptionInstrTradeCost", &TdApiWrap::reqQryOptionInstrTradeCost) + .def("reqQryOptionInstrCommRate", &TdApiWrap::reqQryOptionInstrCommRate) + .def("reqQryExecOrder", &TdApiWrap::reqQryExecOrder) + .def("reqQryForQuote", &TdApiWrap::reqQryForQuote) + .def("reqQryQuote", &TdApiWrap::reqQryQuote) + .def("reqQryLock", &TdApiWrap::reqQryLock) + .def("reqQryLockPosition", &TdApiWrap::reqQryLockPosition) + .def("reqQryInvestorLevel", &TdApiWrap::reqQryInvestorLevel) + .def("reqQryExecFreeze", &TdApiWrap::reqQryExecFreeze) + .def("reqQryCombInstrumentGuard", &TdApiWrap::reqQryCombInstrumentGuard) + .def("reqQryCombAction", &TdApiWrap::reqQryCombAction) + .def("reqQryTransferSerial", &TdApiWrap::reqQryTransferSerial) + .def("reqQryAccountregister", &TdApiWrap::reqQryAccountregister) + .def("reqQryContractBank", &TdApiWrap::reqQryContractBank) + .def("reqQryParkedOrder", &TdApiWrap::reqQryParkedOrder) + .def("reqQryParkedOrderAction", &TdApiWrap::reqQryParkedOrderAction) + .def("reqQryTradingNotice", &TdApiWrap::reqQryTradingNotice) + .def("reqQryBrokerTradingParams", &TdApiWrap::reqQryBrokerTradingParams) + .def("reqQryBrokerTradingAlgos", &TdApiWrap::reqQryBrokerTradingAlgos) + .def("reqQueryCFMMCTradingAccountToken", &TdApiWrap::reqQueryCFMMCTradingAccountToken) + .def("reqFromBankToFutureByFuture", &TdApiWrap::reqFromBankToFutureByFuture) + .def("reqFromFutureToBankByFuture", &TdApiWrap::reqFromFutureToBankByFuture) + .def("reqQueryBankAccountMoneyByFuture", &TdApiWrap::reqQueryBankAccountMoneyByFuture) + + .def("onFrontConnected", pure_virtual(&TdApiWrap::onFrontConnected)) + .def("onFrontDisconnected", pure_virtual(&TdApiWrap::onFrontDisconnected)) + .def("onHeartBeatWarning", pure_virtual(&TdApiWrap::onHeartBeatWarning)) + .def("onRspAuthenticate", pure_virtual(&TdApiWrap::onRspAuthenticate)) + .def("onRspUserLogin", pure_virtual(&TdApiWrap::onRspUserLogin)) + .def("onRspUserLogout", pure_virtual(&TdApiWrap::onRspUserLogout)) + .def("onRspUserPasswordUpdate", pure_virtual(&TdApiWrap::onRspUserPasswordUpdate)) + .def("onRspTradingAccountPasswordUpdate", pure_virtual(&TdApiWrap::onRspTradingAccountPasswordUpdate)) + .def("onRspOrderInsert", pure_virtual(&TdApiWrap::onRspOrderInsert)) + .def("onRspParkedOrderInsert", pure_virtual(&TdApiWrap::onRspParkedOrderInsert)) + .def("onRspParkedOrderAction", pure_virtual(&TdApiWrap::onRspParkedOrderAction)) + .def("onRspOrderAction", pure_virtual(&TdApiWrap::onRspOrderAction)) + .def("onRspQueryMaxOrderVolume", pure_virtual(&TdApiWrap::onRspQueryMaxOrderVolume)) + .def("onRspSettlementInfoConfirm", pure_virtual(&TdApiWrap::onRspSettlementInfoConfirm)) + .def("onRspRemoveParkedOrder", pure_virtual(&TdApiWrap::onRspRemoveParkedOrder)) + .def("onRspRemoveParkedOrderAction", pure_virtual(&TdApiWrap::onRspRemoveParkedOrderAction)) + .def("onRspExecOrderInsert", pure_virtual(&TdApiWrap::onRspExecOrderInsert)) + .def("onRspExecOrderAction", pure_virtual(&TdApiWrap::onRspExecOrderAction)) + .def("onRspForQuoteInsert", pure_virtual(&TdApiWrap::onRspForQuoteInsert)) + .def("onRspQuoteInsert", pure_virtual(&TdApiWrap::onRspQuoteInsert)) + .def("onRspQuoteAction", pure_virtual(&TdApiWrap::onRspQuoteAction)) + .def("onRspLockInsert", pure_virtual(&TdApiWrap::onRspLockInsert)) + .def("onRspCombActionInsert", pure_virtual(&TdApiWrap::onRspCombActionInsert)) + .def("onRspQryOrder", pure_virtual(&TdApiWrap::onRspQryOrder)) + .def("onRspQryTrade", pure_virtual(&TdApiWrap::onRspQryTrade)) + .def("onRspQryInvestorPosition", pure_virtual(&TdApiWrap::onRspQryInvestorPosition)) + .def("onRspQryTradingAccount", pure_virtual(&TdApiWrap::onRspQryTradingAccount)) + .def("onRspQryInvestor", pure_virtual(&TdApiWrap::onRspQryInvestor)) + .def("onRspQryTradingCode", pure_virtual(&TdApiWrap::onRspQryTradingCode)) + .def("onRspQryInstrumentMarginRate", pure_virtual(&TdApiWrap::onRspQryInstrumentMarginRate)) + .def("onRspQryInstrumentCommissionRate", pure_virtual(&TdApiWrap::onRspQryInstrumentCommissionRate)) + .def("onRspQryExchange", pure_virtual(&TdApiWrap::onRspQryExchange)) + .def("onRspQryProduct", pure_virtual(&TdApiWrap::onRspQryProduct)) + .def("onRspQryInstrument", pure_virtual(&TdApiWrap::onRspQryInstrument)) + .def("onRspQryDepthMarketData", pure_virtual(&TdApiWrap::onRspQryDepthMarketData)) + .def("onRspQrySettlementInfo", pure_virtual(&TdApiWrap::onRspQrySettlementInfo)) + .def("onRspQryTransferBank", pure_virtual(&TdApiWrap::onRspQryTransferBank)) + .def("onRspQryInvestorPositionDetail", pure_virtual(&TdApiWrap::onRspQryInvestorPositionDetail)) + .def("onRspQryNotice", pure_virtual(&TdApiWrap::onRspQryNotice)) + .def("onRspQrySettlementInfoConfirm", pure_virtual(&TdApiWrap::onRspQrySettlementInfoConfirm)) + .def("onRspQryInvestorPositionCombineDetail", pure_virtual(&TdApiWrap::onRspQryInvestorPositionCombineDetail)) + .def("onRspQryCFMMCTradingAccountKey", pure_virtual(&TdApiWrap::onRspQryCFMMCTradingAccountKey)) + .def("onRspQryEWarrantOffset", pure_virtual(&TdApiWrap::onRspQryEWarrantOffset)) + .def("onRspQryInvestorProductGroupMargin", pure_virtual(&TdApiWrap::onRspQryInvestorProductGroupMargin)) + .def("onRspQryExchangeMarginRate", pure_virtual(&TdApiWrap::onRspQryExchangeMarginRate)) + .def("onRspQryExchangeMarginRateAdjust", pure_virtual(&TdApiWrap::onRspQryExchangeMarginRateAdjust)) + .def("onRspQryExchangeRate", pure_virtual(&TdApiWrap::onRspQryExchangeRate)) + .def("onRspQrySecAgentACIDMap", pure_virtual(&TdApiWrap::onRspQrySecAgentACIDMap)) + .def("onRspQryProductExchRate", pure_virtual(&TdApiWrap::onRspQryProductExchRate)) + .def("onRspQryProductGroup", pure_virtual(&TdApiWrap::onRspQryProductGroup)) + .def("onRspQryOptionInstrTradeCost", pure_virtual(&TdApiWrap::onRspQryOptionInstrTradeCost)) + .def("onRspQryOptionInstrCommRate", pure_virtual(&TdApiWrap::onRspQryOptionInstrCommRate)) + .def("onRspQryExecOrder", pure_virtual(&TdApiWrap::onRspQryExecOrder)) + .def("onRspQryForQuote", pure_virtual(&TdApiWrap::onRspQryForQuote)) + .def("onRspQryQuote", pure_virtual(&TdApiWrap::onRspQryQuote)) + .def("onRspQryLock", pure_virtual(&TdApiWrap::onRspQryLock)) + .def("onRspQryLockPosition", pure_virtual(&TdApiWrap::onRspQryLockPosition)) + .def("onRspQryInvestorLevel", pure_virtual(&TdApiWrap::onRspQryInvestorLevel)) + .def("onRspQryExecFreeze", pure_virtual(&TdApiWrap::onRspQryExecFreeze)) + .def("onRspQryCombInstrumentGuard", pure_virtual(&TdApiWrap::onRspQryCombInstrumentGuard)) + .def("onRspQryCombAction", pure_virtual(&TdApiWrap::onRspQryCombAction)) + .def("onRspQryTransferSerial", pure_virtual(&TdApiWrap::onRspQryTransferSerial)) + .def("onRspQryAccountregister", pure_virtual(&TdApiWrap::onRspQryAccountregister)) + .def("onRspError", pure_virtual(&TdApiWrap::onRspError)) + .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("onRtnInstrumentStatus", pure_virtual(&TdApiWrap::onRtnInstrumentStatus)) + .def("onRtnTradingNotice", pure_virtual(&TdApiWrap::onRtnTradingNotice)) + .def("onRtnErrorConditionalOrder", pure_virtual(&TdApiWrap::onRtnErrorConditionalOrder)) + .def("onRtnExecOrder", pure_virtual(&TdApiWrap::onRtnExecOrder)) + .def("onErrRtnExecOrderInsert", pure_virtual(&TdApiWrap::onErrRtnExecOrderInsert)) + .def("onErrRtnExecOrderAction", pure_virtual(&TdApiWrap::onErrRtnExecOrderAction)) + .def("onErrRtnForQuoteInsert", pure_virtual(&TdApiWrap::onErrRtnForQuoteInsert)) + .def("onRtnQuote", pure_virtual(&TdApiWrap::onRtnQuote)) + .def("onErrRtnQuoteInsert", pure_virtual(&TdApiWrap::onErrRtnQuoteInsert)) + .def("onErrRtnQuoteAction", pure_virtual(&TdApiWrap::onErrRtnQuoteAction)) + .def("onRtnForQuoteRsp", pure_virtual(&TdApiWrap::onRtnForQuoteRsp)) + .def("onRtnCFMMCTradingAccountToken", pure_virtual(&TdApiWrap::onRtnCFMMCTradingAccountToken)) + .def("onRtnLock", pure_virtual(&TdApiWrap::onRtnLock)) + .def("onErrRtnLockInsert", pure_virtual(&TdApiWrap::onErrRtnLockInsert)) + .def("onRtnCombAction", pure_virtual(&TdApiWrap::onRtnCombAction)) + .def("onErrRtnCombActionInsert", pure_virtual(&TdApiWrap::onErrRtnCombActionInsert)) + .def("onRspQryContractBank", pure_virtual(&TdApiWrap::onRspQryContractBank)) + .def("onRspQryParkedOrder", pure_virtual(&TdApiWrap::onRspQryParkedOrder)) + .def("onRspQryParkedOrderAction", pure_virtual(&TdApiWrap::onRspQryParkedOrderAction)) + .def("onRspQryTradingNotice", pure_virtual(&TdApiWrap::onRspQryTradingNotice)) + .def("onRspQryBrokerTradingParams", pure_virtual(&TdApiWrap::onRspQryBrokerTradingParams)) + .def("onRspQryBrokerTradingAlgos", pure_virtual(&TdApiWrap::onRspQryBrokerTradingAlgos)) + .def("onRspQueryCFMMCTradingAccountToken", pure_virtual(&TdApiWrap::onRspQueryCFMMCTradingAccountToken)) + .def("onRtnFromBankToFutureByBank", pure_virtual(&TdApiWrap::onRtnFromBankToFutureByBank)) + .def("onRtnFromFutureToBankByBank", pure_virtual(&TdApiWrap::onRtnFromFutureToBankByBank)) + .def("onRtnRepealFromBankToFutureByBank", pure_virtual(&TdApiWrap::onRtnRepealFromBankToFutureByBank)) + .def("onRtnRepealFromFutureToBankByBank", pure_virtual(&TdApiWrap::onRtnRepealFromFutureToBankByBank)) + .def("onRtnFromBankToFutureByFuture", pure_virtual(&TdApiWrap::onRtnFromBankToFutureByFuture)) + .def("onRtnFromFutureToBankByFuture", pure_virtual(&TdApiWrap::onRtnFromFutureToBankByFuture)) + .def("onRtnRepealFromBankToFutureByFutureManual", pure_virtual(&TdApiWrap::onRtnRepealFromBankToFutureByFutureManual)) + .def("onRtnRepealFromFutureToBankByFutureManual", pure_virtual(&TdApiWrap::onRtnRepealFromFutureToBankByFutureManual)) + .def("onRtnQueryBankBalanceByFuture", pure_virtual(&TdApiWrap::onRtnQueryBankBalanceByFuture)) + .def("onErrRtnBankToFutureByFuture", pure_virtual(&TdApiWrap::onErrRtnBankToFutureByFuture)) + .def("onErrRtnFutureToBankByFuture", pure_virtual(&TdApiWrap::onErrRtnFutureToBankByFuture)) + .def("onErrRtnRepealBankToFutureByFutureManual", pure_virtual(&TdApiWrap::onErrRtnRepealBankToFutureByFutureManual)) + .def("onErrRtnRepealFutureToBankByFutureManual", pure_virtual(&TdApiWrap::onErrRtnRepealFutureToBankByFutureManual)) + .def("onErrRtnQueryBankBalanceByFuture", pure_virtual(&TdApiWrap::onErrRtnQueryBankBalanceByFuture)) + .def("onRtnRepealFromBankToFutureByFuture", pure_virtual(&TdApiWrap::onRtnRepealFromBankToFutureByFuture)) + .def("onRtnRepealFromFutureToBankByFuture", pure_virtual(&TdApiWrap::onRtnRepealFromFutureToBankByFuture)) + .def("onRspFromBankToFutureByFuture", pure_virtual(&TdApiWrap::onRspFromBankToFutureByFuture)) + .def("onRspFromFutureToBankByFuture", pure_virtual(&TdApiWrap::onRspFromFutureToBankByFuture)) + .def("onRspQueryBankAccountMoneyByFuture", pure_virtual(&TdApiWrap::onRspQueryBankAccountMoneyByFuture)) + .def("onRtnOpenAccountByBank", pure_virtual(&TdApiWrap::onRtnOpenAccountByBank)) + .def("onRtnCancelAccountByBank", pure_virtual(&TdApiWrap::onRtnCancelAccountByBank)) + .def("onRtnChangeAccountByBank", pure_virtual(&TdApiWrap::onRtnChangeAccountByBank)) + ; +} diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.h b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.h new file mode 100644 index 0000000000..612a061747 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.h @@ -0,0 +1,1258 @@ +//˵ +/* +CTP APIкʽתصĺ̫࣬ +ͬʱҲѾдĿͻ֧Щܣ +Pythonװʱѡֻֽ֧׹ +*/ + + +//ϵͳ +#ifdef WIN32 +#include "stdafx.h" +#endif +#include +#include + +//Boost +#define BOOST_PYTHON_STATIC_LIB +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //pythonװ +#include //е̹߳ +#include //е̹߳ +#include //еʵ + +//API +#include "ThostFtdcTraderApi.h" + +//ռ +using namespace std; +using namespace boost::python; +using namespace boost; + +//ʱ +#include "windows.h" + +// +#define ONFRONTCONNECTED 1 +#define ONFRONTDISCONNECTED 2 +#define ONHEARTBEATWARNING 3 +#define ONRSPAUTHENTICATE 4 +#define ONRSPUSERLOGIN 5 +#define ONRSPUSERLOGOUT 6 +#define ONRSPUSERPASSWORDUPDATE 7 +#define ONRSPTRADINGACCOUNTPASSWORDUPDATE 8 +#define ONRSPORDERINSERT 9 +#define ONRSPPARKEDORDERINSERT 10 +#define ONRSPPARKEDORDERACTION 11 +#define ONRSPORDERACTION 12 +#define ONRSPQUERYMAXORDERVOLUME 13 +#define ONRSPSETTLEMENTINFOCONFIRM 14 +#define ONRSPREMOVEPARKEDORDER 15 +#define ONRSPREMOVEPARKEDORDERACTION 16 +#define ONRSPEXECORDERINSERT 17 +#define ONRSPEXECORDERACTION 18 +#define ONRSPFORQUOTEINSERT 19 +#define ONRSPQUOTEINSERT 20 +#define ONRSPQUOTEACTION 21 +#define ONRSPLOCKINSERT 22 +#define ONRSPCOMBACTIONINSERT 23 +#define ONRSPQRYORDER 24 +#define ONRSPQRYTRADE 25 +#define ONRSPQRYINVESTORPOSITION 26 +#define ONRSPQRYTRADINGACCOUNT 27 +#define ONRSPQRYINVESTOR 28 +#define ONRSPQRYTRADINGCODE 29 +#define ONRSPQRYINSTRUMENTMARGINRATE 30 +#define ONRSPQRYINSTRUMENTCOMMISSIONRATE 31 +#define ONRSPQRYEXCHANGE 32 +#define ONRSPQRYPRODUCT 33 +#define ONRSPQRYINSTRUMENT 34 +#define ONRSPQRYDEPTHMARKETDATA 35 +#define ONRSPQRYSETTLEMENTINFO 36 +#define ONRSPQRYTRANSFERBANK 37 +#define ONRSPQRYINVESTORPOSITIONDETAIL 38 +#define ONRSPQRYNOTICE 39 +#define ONRSPQRYSETTLEMENTINFOCONFIRM 40 +#define ONRSPQRYINVESTORPOSITIONCOMBINEDETAIL 41 +#define ONRSPQRYCFMMCTRADINGACCOUNTKEY 42 +#define ONRSPQRYEWARRANTOFFSET 43 +#define ONRSPQRYINVESTORPRODUCTGROUPMARGIN 44 +#define ONRSPQRYEXCHANGEMARGINRATE 45 +#define ONRSPQRYEXCHANGEMARGINRATEADJUST 46 +#define ONRSPQRYEXCHANGERATE 47 +#define ONRSPQRYSECAGENTACIDMAP 48 +#define ONRSPQRYPRODUCTEXCHRATE 49 +#define ONRSPQRYPRODUCTGROUP 50 +#define ONRSPQRYOPTIONINSTRTRADECOST 51 +#define ONRSPQRYOPTIONINSTRCOMMRATE 52 +#define ONRSPQRYEXECORDER 53 +#define ONRSPQRYFORQUOTE 54 +#define ONRSPQRYQUOTE 55 +#define ONRSPQRYLOCK 56 +#define ONRSPQRYLOCKPOSITION 57 +#define ONRSPQRYINVESTORLEVEL 58 +#define ONRSPQRYEXECFREEZE 59 +#define ONRSPQRYCOMBINSTRUMENTGUARD 60 +#define ONRSPQRYCOMBACTION 61 +#define ONRSPQRYTRANSFERSERIAL 62 +#define ONRSPQRYACCOUNTREGISTER 63 +#define ONRSPERROR 64 +#define ONRTNORDER 65 +#define ONRTNTRADE 66 +#define ONERRRTNORDERINSERT 67 +#define ONERRRTNORDERACTION 68 +#define ONRTNINSTRUMENTSTATUS 69 +#define ONRTNTRADINGNOTICE 70 +#define ONRTNERRORCONDITIONALORDER 71 +#define ONRTNEXECORDER 72 +#define ONERRRTNEXECORDERINSERT 73 +#define ONERRRTNEXECORDERACTION 74 +#define ONERRRTNFORQUOTEINSERT 75 +#define ONRTNQUOTE 76 +#define ONERRRTNQUOTEINSERT 77 +#define ONERRRTNQUOTEACTION 78 +#define ONRTNFORQUOTERSP 79 +#define ONRTNCFMMCTRADINGACCOUNTTOKEN 80 +#define ONRTNLOCK 81 +#define ONERRRTNLOCKINSERT 82 +#define ONRTNCOMBACTION 83 +#define ONERRRTNCOMBACTIONINSERT 84 +#define ONRSPQRYCONTRACTBANK 85 +#define ONRSPQRYPARKEDORDER 86 +#define ONRSPQRYPARKEDORDERACTION 87 +#define ONRSPQRYTRADINGNOTICE 88 +#define ONRSPQRYBROKERTRADINGPARAMS 89 +#define ONRSPQRYBROKERTRADINGALGOS 90 +#define ONRSPQUERYCFMMCTRADINGACCOUNTTOKEN 91 +#define ONRTNFROMBANKTOFUTUREBYBANK 92 +#define ONRTNFROMFUTURETOBANKBYBANK 93 +#define ONRTNREPEALFROMBANKTOFUTUREBYBANK 94 +#define ONRTNREPEALFROMFUTURETOBANKBYBANK 95 +#define ONRTNFROMBANKTOFUTUREBYFUTURE 96 +#define ONRTNFROMFUTURETOBANKBYFUTURE 97 +#define ONRTNREPEALFROMBANKTOFUTUREBYFUTUREMANUAL 98 +#define ONRTNREPEALFROMFUTURETOBANKBYFUTUREMANUAL 99 +#define ONRTNQUERYBANKBALANCEBYFUTURE 100 +#define ONERRRTNBANKTOFUTUREBYFUTURE 101 +#define ONERRRTNFUTURETOBANKBYFUTURE 102 +#define ONERRRTNREPEALBANKTOFUTUREBYFUTUREMANUAL 103 +#define ONERRRTNREPEALFUTURETOBANKBYFUTUREMANUAL 104 +#define ONERRRTNQUERYBANKBALANCEBYFUTURE 105 +#define ONRTNREPEALFROMBANKTOFUTUREBYFUTURE 106 +#define ONRTNREPEALFROMFUTURETOBANKBYFUTURE 107 +#define ONRSPFROMBANKTOFUTUREBYFUTURE 108 +#define ONRSPFROMFUTURETOBANKBYFUTURE 109 +#define ONRSPQUERYBANKACCOUNTMONEYBYFUTURE 110 +#define ONRTNOPENACCOUNTBYBANK 111 +#define ONRTNCANCELACCOUNTBYBANK 112 +#define ONRTNCHANGEACCOUNTBYBANK 113 + + + +///------------------------------------------------------------------------------------- +///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); + + +//ֵлȡijֵӦֵַṹֵ +void getStr(dict d, string key, char* value); + + +///------------------------------------------------------------------------------------- +///C++ SPIĻصʵ +///------------------------------------------------------------------------------------- + +//APIļ̳ʵ +class TdApi : public CThostFtdcTraderSpi +{ +private: + CThostFtdcTraderApi* 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 OnRspAuthenticate(CThostFtdcRspAuthenticateField *pRspAuthenticateField, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + + ///¼Ӧ + virtual void OnRspUserLogin(CThostFtdcRspUserLoginField *pRspUserLogin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///dzӦ + virtual void OnRspUserLogout(CThostFtdcUserLogoutField *pUserLogout, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ûӦ + virtual void OnRspUserPasswordUpdate(CThostFtdcUserPasswordUpdateField *pUserPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ʽ˻Ӧ + virtual void OnRspTradingAccountPasswordUpdate(CThostFtdcTradingAccountPasswordUpdateField *pTradingAccountPasswordUpdate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///¼Ӧ + virtual void OnRspOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///Ԥ¼Ӧ + virtual void OnRspParkedOrderInsert(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///Ԥ񳷵¼Ӧ + virtual void OnRspParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///Ӧ + virtual void OnRspOrderAction(CThostFtdcInputOrderActionField *pInputOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ󱨵Ӧ + virtual void OnRspQueryMaxOrderVolume(CThostFtdcQueryMaxOrderVolumeField *pQueryMaxOrderVolume, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///Ͷ߽ȷӦ + virtual void OnRspSettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ɾԤӦ + virtual void OnRspRemoveParkedOrder(CThostFtdcRemoveParkedOrderField *pRemoveParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ɾԤ񳷵Ӧ + virtual void OnRspRemoveParkedOrderAction(CThostFtdcRemoveParkedOrderActionField *pRemoveParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ִ¼Ӧ + virtual void OnRspExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ִӦ + virtual void OnRspExecOrderAction(CThostFtdcInputExecOrderActionField *pInputExecOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ¼Ӧ + virtual void OnRspForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///¼Ӧ + virtual void OnRspQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///۲Ӧ + virtual void OnRspQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///Ӧ + virtual void OnRspLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///¼Ӧ + virtual void OnRspCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryOrder(CThostFtdcOrderField *pOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯɽӦ + virtual void OnRspQryTrade(CThostFtdcTradeField *pTrade, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶֲ߳Ӧ + virtual void OnRspQryInvestorPosition(CThostFtdcInvestorPositionField *pInvestorPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯʽ˻Ӧ + virtual void OnRspQryTradingAccount(CThostFtdcTradingAccountField *pTradingAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶӦ + virtual void OnRspQryInvestor(CThostFtdcInvestorField *pInvestor, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯױӦ + virtual void OnRspQryTradingCode(CThostFtdcTradingCodeField *pTradingCode, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯԼ֤Ӧ + virtual void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField *pInstrumentMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯԼӦ + virtual void OnRspQryInstrumentCommissionRate(CThostFtdcInstrumentCommissionRateField *pInstrumentCommissionRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryExchange(CThostFtdcExchangeField *pExchange, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯƷӦ + virtual void OnRspQryProduct(CThostFtdcProductField *pProduct, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯԼӦ + virtual void OnRspQryInstrument(CThostFtdcInstrumentField *pInstrument, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryDepthMarketData(CThostFtdcDepthMarketDataField *pDepthMarketData, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶ߽Ӧ + virtual void OnRspQrySettlementInfo(CThostFtdcSettlementInfoField *pSettlementInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯתӦ + virtual void OnRspQryTransferBank(CThostFtdcTransferBankField *pTransferBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionDetail(CThostFtdcInvestorPositionDetailField *pInvestorPositionDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͻ֪ͨӦ + virtual void OnRspQryNotice(CThostFtdcNoticeField *pNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯϢȷӦ + virtual void OnRspQrySettlementInfoConfirm(CThostFtdcSettlementInfoConfirmField *pSettlementInfoConfirm, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶֲ߳ϸӦ + virtual void OnRspQryInvestorPositionCombineDetail(CThostFtdcInvestorPositionCombineDetailField *pInvestorPositionCombineDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ֤ϵͳ͹˾ʽ˻ԿӦ + virtual void OnRspQryCFMMCTradingAccountKey(CThostFtdcCFMMCTradingAccountKeyField *pCFMMCTradingAccountKey, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯֵ۵ϢӦ + virtual void OnRspQryEWarrantOffset(CThostFtdcEWarrantOffsetField *pEWarrantOffset, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶƷ/Ʒֱ֤Ӧ + virtual void OnRspQryInvestorProductGroupMargin(CThostFtdcInvestorProductGroupMarginField *pInvestorProductGroupMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRate(CThostFtdcExchangeMarginRateField *pExchangeMarginRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ֤Ӧ + virtual void OnRspQryExchangeMarginRateAdjust(CThostFtdcExchangeMarginRateAdjustField *pExchangeMarginRateAdjust, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryExchangeRate(CThostFtdcExchangeRateField *pExchangeRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯԱȨӦ + virtual void OnRspQrySecAgentACIDMap(CThostFtdcSecAgentACIDMapField *pSecAgentACIDMap, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯƷۻ + virtual void OnRspQryProductExchRate(CThostFtdcProductExchRateField *pProductExchRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯƷ + virtual void OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯȨ׳ɱӦ + virtual void OnRspQryOptionInstrTradeCost(CThostFtdcOptionInstrTradeCostField *pOptionInstrTradeCost, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯȨԼӦ + virtual void OnRspQryOptionInstrCommRate(CThostFtdcOptionInstrCommRateField *pOptionInstrCommRate, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯִӦ + virtual void OnRspQryExecOrder(CThostFtdcExecOrderField *pExecOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯѯӦ + virtual void OnRspQryForQuote(CThostFtdcForQuoteField *pForQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryQuote(CThostFtdcQuoteField *pQuote, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryLock(CThostFtdcLockField *pLock, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ֤ȯλӦ + virtual void OnRspQryLockPosition(CThostFtdcLockPositionField *pLockPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯͶ߷ּ + virtual void OnRspQryInvestorLevel(CThostFtdcInvestorLevelField *pInvestorLevel, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯE+1ȨӦ + virtual void OnRspQryExecFreeze(CThostFtdcExecFreezeField *pExecFreeze, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯϺԼȫϵӦ + virtual void OnRspQryCombInstrumentGuard(CThostFtdcCombInstrumentGuardField *pCombInstrumentGuard, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯӦ + virtual void OnRspQryCombAction(CThostFtdcCombActionField *pCombAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯתˮӦ + virtual void OnRspQryTransferSerial(CThostFtdcTransferSerialField *pTransferSerial, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯǩԼϵӦ + virtual void OnRspQryAccountregister(CThostFtdcAccountregisterField *pAccountregister, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///Ӧ + virtual void OnRspError(CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///֪ͨ + virtual void OnRtnOrder(CThostFtdcOrderField *pOrder) ; + + ///ɽ֪ͨ + virtual void OnRtnTrade(CThostFtdcTradeField *pTrade) ; + + ///¼ر + virtual void OnErrRtnOrderInsert(CThostFtdcInputOrderField *pInputOrder, CThostFtdcRspInfoField *pRspInfo) ; + + ///ر + virtual void OnErrRtnOrderAction(CThostFtdcOrderActionField *pOrderAction, CThostFtdcRspInfoField *pRspInfo) ; + + ///Լ״̬֪ͨ + virtual void OnRtnInstrumentStatus(CThostFtdcInstrumentStatusField *pInstrumentStatus) ; + + ///֪ͨ + virtual void OnRtnTradingNotice(CThostFtdcTradingNoticeInfoField *pTradingNoticeInfo) ; + + ///ʾУ + virtual void OnRtnErrorConditionalOrder(CThostFtdcErrorConditionalOrderField *pErrorConditionalOrder) ; + + ///ִ֪ͨ + virtual void OnRtnExecOrder(CThostFtdcExecOrderField *pExecOrder) ; + + ///ִ¼ر + virtual void OnErrRtnExecOrderInsert(CThostFtdcInputExecOrderField *pInputExecOrder, CThostFtdcRspInfoField *pRspInfo) ; + + ///ִر + virtual void OnErrRtnExecOrderAction(CThostFtdcExecOrderActionField *pExecOrderAction, CThostFtdcRspInfoField *pRspInfo) ; + + ///ѯ¼ر + virtual void OnErrRtnForQuoteInsert(CThostFtdcInputForQuoteField *pInputForQuote, CThostFtdcRspInfoField *pRspInfo) ; + + ///֪ͨ + virtual void OnRtnQuote(CThostFtdcQuoteField *pQuote) ; + + ///¼ر + virtual void OnErrRtnQuoteInsert(CThostFtdcInputQuoteField *pInputQuote, CThostFtdcRspInfoField *pRspInfo) ; + + ///۲ر + virtual void OnErrRtnQuoteAction(CThostFtdcQuoteActionField *pQuoteAction, CThostFtdcRspInfoField *pRspInfo) ; + + ///ѯ֪ͨ + virtual void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField *pForQuoteRsp) ; + + ///֤û + virtual void OnRtnCFMMCTradingAccountToken(CThostFtdcCFMMCTradingAccountTokenField *pCFMMCTradingAccountToken) ; + + ///֪ͨ + virtual void OnRtnLock(CThostFtdcLockField *pLock) ; + + ///֪ͨ + virtual void OnErrRtnLockInsert(CThostFtdcInputLockField *pInputLock, CThostFtdcRspInfoField *pRspInfo) ; + + ///֪ͨ + virtual void OnRtnCombAction(CThostFtdcCombActionField *pCombAction) ; + + ///¼ر + virtual void OnErrRtnCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, CThostFtdcRspInfoField *pRspInfo) ; + + ///ѯǩԼӦ + virtual void OnRspQryContractBank(CThostFtdcContractBankField *pContractBank, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯԤӦ + virtual void OnRspQryParkedOrder(CThostFtdcParkedOrderField *pParkedOrder, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯԤ񳷵Ӧ + virtual void OnRspQryParkedOrderAction(CThostFtdcParkedOrderActionField *pParkedOrderAction, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ֪ͨӦ + virtual void OnRspQryTradingNotice(CThostFtdcTradingNoticeField *pTradingNotice, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ͹˾ײӦ + virtual void OnRspQryBrokerTradingParams(CThostFtdcBrokerTradingParamsField *pBrokerTradingParams, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯ͹˾㷨Ӧ + virtual void OnRspQryBrokerTradingAlgos(CThostFtdcBrokerTradingAlgosField *pBrokerTradingAlgos, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ѯû + virtual void OnRspQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///зʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByBank(CThostFtdcRspTransferField *pRspTransfer) ; + + ///зڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByBank(CThostFtdcRspTransferField *pRspTransfer) ; + + ///зתڻ֪ͨ + virtual void OnRtnRepealFromBankToFutureByBank(CThostFtdcRspRepealField *pRspRepeal) ; + + ///зڻת֪ͨ + virtual void OnRtnRepealFromFutureToBankByBank(CThostFtdcRspRepealField *pRspRepeal) ; + + ///ڻʽתڻ֪ͨ + virtual void OnRtnFromBankToFutureByFuture(CThostFtdcRspTransferField *pRspTransfer) ; + + ///ڻڻʽת֪ͨ + virtual void OnRtnFromFutureToBankByFuture(CThostFtdcRspTransferField *pRspTransfer) ; + + ///ϵͳʱڻֹתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFutureManual(CThostFtdcRspRepealField *pRspRepeal) ; + + ///ϵͳʱڻֹڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFutureManual(CThostFtdcRspRepealField *pRspRepeal) ; + + ///ڻѯ֪ͨ + virtual void OnRtnQueryBankBalanceByFuture(CThostFtdcNotifyQueryAccountField *pNotifyQueryAccount) ; + + ///ڻʽתڻر + virtual void OnErrRtnBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) ; + + ///ڻڻʽתдر + virtual void OnErrRtnFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo) ; + + ///ϵͳʱڻֹתڻر + virtual void OnErrRtnRepealBankToFutureByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) ; + + ///ϵͳʱڻֹڻתдر + virtual void OnErrRtnRepealFutureToBankByFutureManual(CThostFtdcReqRepealField *pReqRepeal, CThostFtdcRspInfoField *pRspInfo) ; + + ///ڻѯر + virtual void OnErrRtnQueryBankBalanceByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo) ; + + ///ڻתڻдϺ̷ص֪ͨ + virtual void OnRtnRepealFromBankToFutureByFuture(CThostFtdcRspRepealField *pRspRepeal) ; + + ///ڻڻתдϺ̷ص֪ͨ + virtual void OnRtnRepealFromFutureToBankByFuture(CThostFtdcRspRepealField *pRspRepeal) ; + + ///ڻʽתڻӦ + virtual void OnRspFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ڻڻʽתӦ + virtual void OnRspFromFutureToBankByFuture(CThostFtdcReqTransferField *pReqTransfer, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///ڻѯӦ + virtual void OnRspQueryBankAccountMoneyByFuture(CThostFtdcReqQueryAccountField *pReqQueryAccount, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) ; + + ///зڿ֪ͨ + virtual void OnRtnOpenAccountByBank(CThostFtdcOpenAccountField *pOpenAccount) ; + + ///з֪ͨ + virtual void OnRtnCancelAccountByBank(CThostFtdcCancelAccountField *pCancelAccount) ; + + ///з˺֪ͨ + virtual void OnRtnChangeAccountByBank(CThostFtdcChangeAccountField *pChangeAccount) ; + + //------------------------------------------------------------------------------------- + //task + //------------------------------------------------------------------------------------- + + void processTask(); + + void processFrontConnected(Task task); + + void processFrontDisconnected(Task task); + + void processHeartBeatWarning(Task task); + + void processRspAuthenticate(Task task); + + void processRspUserLogin(Task task); + + void processRspUserLogout(Task task); + + void processRspUserPasswordUpdate(Task task); + + void processRspTradingAccountPasswordUpdate(Task task); + + void processRspOrderInsert(Task task); + + void processRspParkedOrderInsert(Task task); + + void processRspParkedOrderAction(Task task); + + void processRspOrderAction(Task task); + + void processRspQueryMaxOrderVolume(Task task); + + void processRspSettlementInfoConfirm(Task task); + + void processRspRemoveParkedOrder(Task task); + + void processRspRemoveParkedOrderAction(Task task); + + void processRspExecOrderInsert(Task task); + + void processRspExecOrderAction(Task task); + + void processRspForQuoteInsert(Task task); + + void processRspQuoteInsert(Task task); + + void processRspQuoteAction(Task task); + + void processRspLockInsert(Task task); + + void processRspCombActionInsert(Task task); + + void processRspQryOrder(Task task); + + void processRspQryTrade(Task task); + + void processRspQryInvestorPosition(Task task); + + void processRspQryTradingAccount(Task task); + + void processRspQryInvestor(Task task); + + void processRspQryTradingCode(Task task); + + void processRspQryInstrumentMarginRate(Task task); + + void processRspQryInstrumentCommissionRate(Task task); + + void processRspQryExchange(Task task); + + void processRspQryProduct(Task task); + + void processRspQryInstrument(Task task); + + void processRspQryDepthMarketData(Task task); + + void processRspQrySettlementInfo(Task task); + + void processRspQryTransferBank(Task task); + + void processRspQryInvestorPositionDetail(Task task); + + void processRspQryNotice(Task task); + + void processRspQrySettlementInfoConfirm(Task task); + + void processRspQryInvestorPositionCombineDetail(Task task); + + void processRspQryCFMMCTradingAccountKey(Task task); + + void processRspQryEWarrantOffset(Task task); + + void processRspQryInvestorProductGroupMargin(Task task); + + void processRspQryExchangeMarginRate(Task task); + + void processRspQryExchangeMarginRateAdjust(Task task); + + void processRspQryExchangeRate(Task task); + + void processRspQrySecAgentACIDMap(Task task); + + void processRspQryProductExchRate(Task task); + + void processRspQryProductGroup(Task task); + + void processRspQryOptionInstrTradeCost(Task task); + + void processRspQryOptionInstrCommRate(Task task); + + void processRspQryExecOrder(Task task); + + void processRspQryForQuote(Task task); + + void processRspQryQuote(Task task); + + void processRspQryLock(Task task); + + void processRspQryLockPosition(Task task); + + void processRspQryInvestorLevel(Task task); + + void processRspQryExecFreeze(Task task); + + void processRspQryCombInstrumentGuard(Task task); + + void processRspQryCombAction(Task task); + + void processRspQryTransferSerial(Task task); + + void processRspQryAccountregister(Task task); + + void processRspError(Task task); + + void processRtnOrder(Task task); + + void processRtnTrade(Task task); + + void processErrRtnOrderInsert(Task task); + + void processErrRtnOrderAction(Task task); + + void processRtnInstrumentStatus(Task task); + + void processRtnTradingNotice(Task task); + + void processRtnErrorConditionalOrder(Task task); + + void processRtnExecOrder(Task task); + + void processErrRtnExecOrderInsert(Task task); + + void processErrRtnExecOrderAction(Task task); + + void processErrRtnForQuoteInsert(Task task); + + void processRtnQuote(Task task); + + void processErrRtnQuoteInsert(Task task); + + void processErrRtnQuoteAction(Task task); + + void processRtnForQuoteRsp(Task task); + + void processRtnCFMMCTradingAccountToken(Task task); + + void processRtnLock(Task task); + + void processErrRtnLockInsert(Task task); + + void processRtnCombAction(Task task); + + void processErrRtnCombActionInsert(Task task); + + void processRspQryContractBank(Task task); + + void processRspQryParkedOrder(Task task); + + void processRspQryParkedOrderAction(Task task); + + void processRspQryTradingNotice(Task task); + + void processRspQryBrokerTradingParams(Task task); + + void processRspQryBrokerTradingAlgos(Task task); + + void processRspQueryCFMMCTradingAccountToken(Task task); + + void processRtnFromBankToFutureByBank(Task task); + + void processRtnFromFutureToBankByBank(Task task); + + void processRtnRepealFromBankToFutureByBank(Task task); + + void processRtnRepealFromFutureToBankByBank(Task task); + + void processRtnFromBankToFutureByFuture(Task task); + + void processRtnFromFutureToBankByFuture(Task task); + + void processRtnRepealFromBankToFutureByFutureManual(Task task); + + void processRtnRepealFromFutureToBankByFutureManual(Task task); + + void processRtnQueryBankBalanceByFuture(Task task); + + void processErrRtnBankToFutureByFuture(Task task); + + void processErrRtnFutureToBankByFuture(Task task); + + void processErrRtnRepealBankToFutureByFutureManual(Task task); + + void processErrRtnRepealFutureToBankByFutureManual(Task task); + + void processErrRtnQueryBankBalanceByFuture(Task task); + + void processRtnRepealFromBankToFutureByFuture(Task task); + + void processRtnRepealFromFutureToBankByFuture(Task task); + + void processRspFromBankToFutureByFuture(Task task); + + void processRspFromFutureToBankByFuture(Task task); + + void processRspQueryBankAccountMoneyByFuture(Task task); + + void processRtnOpenAccountByBank(Task task); + + void processRtnCancelAccountByBank(Task task); + + void processRtnChangeAccountByBank(Task task); + + //------------------------------------------------------------------------------------- + //dataصֵ + //errorصĴֵ + //idid + //lastǷΪ󷵻 + //i + //------------------------------------------------------------------------------------- + + virtual void onFrontConnected(){}; + + virtual void onFrontDisconnected(int i){}; + + virtual void onHeartBeatWarning(int i){}; + + virtual void onRspAuthenticate(dict data, 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 onRspUserPasswordUpdate(dict data, dict error, int id, bool last) {}; + + virtual void onRspTradingAccountPasswordUpdate(dict data, dict error, int id, bool last) {}; + + virtual void onRspOrderInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspParkedOrderInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspParkedOrderAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspOrderAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspQueryMaxOrderVolume(dict data, dict error, int id, bool last) {}; + + virtual void onRspSettlementInfoConfirm(dict data, dict error, int id, bool last) {}; + + virtual void onRspRemoveParkedOrder(dict data, dict error, int id, bool last) {}; + + virtual void onRspRemoveParkedOrderAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspExecOrderInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspExecOrderAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspForQuoteInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspQuoteInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspQuoteAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspLockInsert(dict data, dict error, int id, bool last) {}; + + virtual void onRspCombActionInsert(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 onRspQryTradingAccount(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 onRspQryInstrumentMarginRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInstrumentCommissionRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExchange(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryProduct(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInstrument(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryDepthMarketData(dict data, dict error, int id, bool last) {}; + + virtual void onRspQrySettlementInfo(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryTransferBank(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInvestorPositionDetail(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryNotice(dict data, dict error, int id, bool last) {}; + + virtual void onRspQrySettlementInfoConfirm(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInvestorPositionCombineDetail(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryCFMMCTradingAccountKey(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryEWarrantOffset(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInvestorProductGroupMargin(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExchangeMarginRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExchangeMarginRateAdjust(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExchangeRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQrySecAgentACIDMap(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryProductExchRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryProductGroup(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryOptionInstrTradeCost(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryOptionInstrCommRate(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExecOrder(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryForQuote(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryQuote(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryLock(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryLockPosition(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryInvestorLevel(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryExecFreeze(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryCombInstrumentGuard(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryCombAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryTransferSerial(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryAccountregister(dict data, dict error, int id, bool last) {}; + + virtual void onRspError(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 onRtnInstrumentStatus(dict data) {}; + + virtual void onRtnTradingNotice(dict data) {}; + + virtual void onRtnErrorConditionalOrder(dict data) {}; + + virtual void onRtnExecOrder(dict data) {}; + + virtual void onErrRtnExecOrderInsert(dict data, dict error) {}; + + virtual void onErrRtnExecOrderAction(dict data, dict error) {}; + + virtual void onErrRtnForQuoteInsert(dict data, dict error) {}; + + virtual void onRtnQuote(dict data) {}; + + virtual void onErrRtnQuoteInsert(dict data, dict error) {}; + + virtual void onErrRtnQuoteAction(dict data, dict error) {}; + + virtual void onRtnForQuoteRsp(dict data) {}; + + virtual void onRtnCFMMCTradingAccountToken(dict data) {}; + + virtual void onRtnLock(dict data) {}; + + virtual void onErrRtnLockInsert(dict data, dict error) {}; + + virtual void onRtnCombAction(dict data) {}; + + virtual void onErrRtnCombActionInsert(dict data, dict error) {}; + + virtual void onRspQryContractBank(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryParkedOrder(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryParkedOrderAction(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryTradingNotice(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryBrokerTradingParams(dict data, dict error, int id, bool last) {}; + + virtual void onRspQryBrokerTradingAlgos(dict data, dict error, int id, bool last) {}; + + virtual void onRspQueryCFMMCTradingAccountToken(dict data, dict error, int id, bool last) {}; + + virtual void onRtnFromBankToFutureByBank(dict data) {}; + + virtual void onRtnFromFutureToBankByBank(dict data) {}; + + virtual void onRtnRepealFromBankToFutureByBank(dict data) {}; + + virtual void onRtnRepealFromFutureToBankByBank(dict data) {}; + + virtual void onRtnFromBankToFutureByFuture(dict data) {}; + + virtual void onRtnFromFutureToBankByFuture(dict data) {}; + + virtual void onRtnRepealFromBankToFutureByFutureManual(dict data) {}; + + virtual void onRtnRepealFromFutureToBankByFutureManual(dict data) {}; + + virtual void onRtnQueryBankBalanceByFuture(dict data) {}; + + virtual void onErrRtnBankToFutureByFuture(dict data, dict error) {}; + + virtual void onErrRtnFutureToBankByFuture(dict data, dict error) {}; + + virtual void onErrRtnRepealBankToFutureByFutureManual(dict data, dict error) {}; + + virtual void onErrRtnRepealFutureToBankByFutureManual(dict data, dict error) {}; + + virtual void onErrRtnQueryBankBalanceByFuture(dict data, dict error) {}; + + virtual void onRtnRepealFromBankToFutureByFuture(dict data) {}; + + virtual void onRtnRepealFromFutureToBankByFuture(dict data) {}; + + virtual void onRspFromBankToFutureByFuture(dict data, dict error, int id, bool last) {}; + + virtual void onRspFromFutureToBankByFuture(dict data, dict error, int id, bool last) {}; + + virtual void onRspQueryBankAccountMoneyByFuture(dict data, dict error, int id, bool last) {}; + + virtual void onRtnOpenAccountByBank(dict data) {}; + + virtual void onRtnCancelAccountByBank(dict data) {}; + + virtual void onRtnChangeAccountByBank(dict data) {}; + + + //------------------------------------------------------------------------------------- + //req:ֵ + //------------------------------------------------------------------------------------- + + void createFtdcTraderApi(string pszFlowPath = ""); + + void release(); + + void init(); + + int join(); + + int exit(); + + string getTradingDay(); + + void registerFront(string pszFrontAddress); + + void subscribePrivateTopic(int nType); + + void subscribePublicTopic(int nType); + + int reqAuthenticate(dict req, int nRequestID); + + int reqUserLogin(dict req, int nRequestID); + + int reqUserLogout(dict req, int nRequestID); + + int reqUserPasswordUpdate(dict req, int nRequestID); + + int reqTradingAccountPasswordUpdate(dict req, int nRequestID); + + LONGLONG reqOrderInsert(dict req, int nRequestID); + + int reqParkedOrderInsert(dict req, int nRequestID); + + int reqParkedOrderAction(dict req, int nRequestID); + + int reqOrderAction(dict req, int nRequestID); + + int reqQueryMaxOrderVolume(dict req, int nRequestID); + + int reqSettlementInfoConfirm(dict req, int nRequestID); + + int reqRemoveParkedOrder(dict req, int nRequestID); + + int reqRemoveParkedOrderAction(dict req, int nRequestID); + + int reqExecOrderInsert(dict req, int nRequestID); + + int reqExecOrderAction(dict req, int nRequestID); + + int reqForQuoteInsert(dict req, int nRequestID); + + int reqQuoteInsert(dict req, int nRequestID); + + int reqQuoteAction(dict req, int nRequestID); + + int reqLockInsert(dict req, int nRequestID); + + int reqCombActionInsert(dict req, int nRequestID); + + int reqQryOrder(dict req, int nRequestID); + + int reqQryTrade(dict req, int nRequestID); + + int reqQryInvestorPosition(dict req, int nRequestID); + + int reqQryTradingAccount(dict req, int nRequestID); + + int reqQryInvestor(dict req, int nRequestID); + + int reqQryTradingCode(dict req, int nRequestID); + + int reqQryInstrumentMarginRate(dict req, int nRequestID); + + int reqQryInstrumentCommissionRate(dict req, int nRequestID); + + int reqQryExchange(dict req, int nRequestID); + + int reqQryProduct(dict req, int nRequestID); + + int reqQryInstrument(dict req, int nRequestID); + + int reqQryDepthMarketData(dict req, int nRequestID); + + int reqQrySettlementInfo(dict req, int nRequestID); + + int reqQryTransferBank(dict req, int nRequestID); + + int reqQryInvestorPositionDetail(dict req, int nRequestID); + + int reqQryNotice(dict req, int nRequestID); + + int reqQrySettlementInfoConfirm(dict req, int nRequestID); + + int reqQryInvestorPositionCombineDetail(dict req, int nRequestID); + + int reqQryCFMMCTradingAccountKey(dict req, int nRequestID); + + int reqQryEWarrantOffset(dict req, int nRequestID); + + int reqQryInvestorProductGroupMargin(dict req, int nRequestID); + + int reqQryExchangeMarginRate(dict req, int nRequestID); + + int reqQryExchangeMarginRateAdjust(dict req, int nRequestID); + + int reqQryExchangeRate(dict req, int nRequestID); + + int reqQrySecAgentACIDMap(dict req, int nRequestID); + + int reqQryProductExchRate(dict req, int nRequestID); + + int reqQryProductGroup(dict req, int nRequestID); + + int reqQryOptionInstrTradeCost(dict req, int nRequestID); + + int reqQryOptionInstrCommRate(dict req, int nRequestID); + + int reqQryExecOrder(dict req, int nRequestID); + + int reqQryForQuote(dict req, int nRequestID); + + int reqQryQuote(dict req, int nRequestID); + + int reqQryLock(dict req, int nRequestID); + + int reqQryLockPosition(dict req, int nRequestID); + + int reqQryInvestorLevel(dict req, int nRequestID); + + int reqQryExecFreeze(dict req, int nRequestID); + + int reqQryCombInstrumentGuard(dict req, int nRequestID); + + int reqQryCombAction(dict req, int nRequestID); + + int reqQryTransferSerial(dict req, int nRequestID); + + int reqQryAccountregister(dict req, int nRequestID); + + int reqQryContractBank(dict req, int nRequestID); + + int reqQryParkedOrder(dict req, int nRequestID); + + int reqQryParkedOrderAction(dict req, int nRequestID); + + int reqQryTradingNotice(dict req, int nRequestID); + + int reqQryBrokerTradingParams(dict req, int nRequestID); + + int reqQryBrokerTradingAlgos(dict req, int nRequestID); + + int reqQueryCFMMCTradingAccountToken(dict req, int nRequestID); + + int reqFromBankToFutureByFuture(dict req, int nRequestID); + + int reqFromFutureToBankByFuture(dict req, int nRequestID); + + int reqQueryBankAccountMoneyByFuture(dict req, int nRequestID); +}; + diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.vcxproj b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.vcxproj new file mode 100644 index 0000000000..7c6971e689 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.vcxproj @@ -0,0 +1,120 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {9C81A42B-56A6-4E46-9F2E-8243061AAD25} + Win32Proj + vnctptd + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + D:\boost_1_57_0;D:\Anaconda2\include;X:\GithubProject\vnpy\vn.ctp\ctpapi;$(IncludePath) + D:\Anaconda2\libs;D:\boost_1_57_0\libs;X:\GithubProject\vnpy\vn.ctp\ctpapi;$(ReferencePath) + .pyd + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;VNCTPTD_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;VNCTPTD_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + D:\boost_1_57_0\stage\lib;D:\Anaconda2\libs;X:\GithubProject\vnpy\vn.ctp\ctpapi;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + + + + false + + + false + + + + + Create + Create + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.vcxproj.filters b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.vcxproj.filters new file mode 100644 index 0000000000..4c9f94cdd6 --- /dev/null +++ b/vn.how/tick2trade/vn.ctp_t2t/vnctptd/vnctptd/vnctptd.vcxproj.filters @@ -0,0 +1,62 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + + + + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/VT_setting.json b/vn.how/tick2trade/vn.trader_t2t/VT_setting.json new file mode 100644 index 0000000000..a6e5a1c771 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/VT_setting.json @@ -0,0 +1,9 @@ +{ + "fontFamily": "微软雅黑", + "fontSize": 12, + + "mongoHost": "localhost", + "mongoPort": 27017, + + "darkStyle": true +} \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/CTA_setting.json b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/CTA_setting.json new file mode 100644 index 0000000000..a792abfa64 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/CTA_setting.json @@ -0,0 +1,7 @@ +[ + { + "name": "double ema", + "className": "DoubleEmaDemo", + "vtSymbol": "IF1602" + } +] \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/__init__.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaBacktesting.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaBacktesting.py new file mode 100644 index 0000000000..95e042d6e6 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaBacktesting.py @@ -0,0 +1,933 @@ +# encoding: UTF-8 + +''' +本文件中包含的是CTA模块的回测引擎,回测引擎的API和CTA引擎一致, +可以使用和实盘相同的代码进行回测。 +''' +from __future__ import division + +from datetime import datetime, timedelta +from collections import OrderedDict +from itertools import product +import multiprocessing +import pymongo + +from ctaBase import * +from ctaSetting import * + +from vtConstant import * +from vtGateway import VtOrderData, VtTradeData +from vtFunction import loadMongoSetting + + +######################################################################## +class BacktestingEngine(object): + """ + CTA回测引擎 + 函数接口和策略引擎保持一样, + 从而实现同一套代码从回测到实盘。 + """ + + TICK_MODE = 'tick' + BAR_MODE = 'bar' + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + # 本地停止单编号计数 + self.stopOrderCount = 0 + # stopOrderID = STOPORDERPREFIX + str(stopOrderCount) + + # 本地停止单字典 + # key为stopOrderID,value为stopOrder对象 + self.stopOrderDict = {} # 停止单撤销后不会从本字典中删除 + self.workingStopOrderDict = {} # 停止单撤销后会从本字典中删除 + + # 引擎类型为回测 + self.engineType = ENGINETYPE_BACKTESTING + + # 回测相关 + self.strategy = None # 回测策略 + self.mode = self.BAR_MODE # 回测模式,默认为K线 + + self.startDate = '' + self.initDays = 0 + self.endDate = '' + + self.slippage = 0 # 回测时假设的滑点 + self.rate = 0 # 回测时假设的佣金比例(适用于百分比佣金) + self.size = 1 # 合约大小,默认为1 + + self.dbClient = None # 数据库客户端 + self.dbCursor = None # 数据库指针 + + #self.historyData = [] # 历史数据的列表,回测用 + self.initData = [] # 初始化用的数据 + #self.backtestingData = [] # 回测用的数据 + + self.dbName = '' # 回测数据库名 + self.symbol = '' # 回测集合名 + + self.dataStartDate = None # 回测数据开始日期,datetime对象 + self.dataEndDate = None # 回测数据结束日期,datetime对象 + self.strategyStartDate = None # 策略启动日期(即前面的数据用于初始化),datetime对象 + + self.limitOrderDict = OrderedDict() # 限价单字典 + self.workingLimitOrderDict = OrderedDict() # 活动限价单字典,用于进行撮合用 + self.limitOrderCount = 0 # 限价单编号 + + self.tradeCount = 0 # 成交编号 + self.tradeDict = OrderedDict() # 成交字典 + + self.logList = [] # 日志记录 + + # 当前最新数据,用于模拟成交用 + self.tick = None + self.bar = None + self.dt = None # 最新的时间 + + #---------------------------------------------------------------------- + def setStartDate(self, startDate='20100416', initDays=10): + """设置回测的启动日期""" + self.startDate = startDate + self.initDays = initDays + + self.dataStartDate = datetime.strptime(startDate, '%Y%m%d') + + initTimeDelta = timedelta(initDays) + self.strategyStartDate = self.dataStartDate + initTimeDelta + + #---------------------------------------------------------------------- + def setEndDate(self, endDate=''): + """设置回测的结束日期""" + self.endDate = endDate + if endDate: + self.dataEndDate= datetime.strptime(endDate, '%Y%m%d') + # 若不修改时间则会导致不包含dataEndDate当天数据 + self.dataEndDate.replace(hour=23, minute=59) + + #---------------------------------------------------------------------- + def setBacktestingMode(self, mode): + """设置回测模式""" + self.mode = mode + + #---------------------------------------------------------------------- + def setDatabase(self, dbName, symbol): + """设置历史数据所用的数据库""" + self.dbName = dbName + self.symbol = symbol + + #---------------------------------------------------------------------- + def loadHistoryData(self): + """载入历史数据""" + host, port = loadMongoSetting() + + self.dbClient = pymongo.MongoClient(host, port) + collection = self.dbClient[self.dbName][self.symbol] + + self.output(u'开始载入数据') + + # 首先根据回测模式,确认要使用的数据类 + if self.mode == self.BAR_MODE: + dataClass = CtaBarData + func = self.newBar + else: + dataClass = CtaTickData + func = self.newTick + + # 载入初始化需要用的数据 + flt = {'datetime':{'$gte':self.dataStartDate, + '$lt':self.strategyStartDate}} + initCursor = collection.find(flt) + + # 将数据从查询指针中读取出,并生成列表 + self.initData = [] # 清空initData列表 + for d in initCursor: + data = dataClass() + data.__dict__ = d + self.initData.append(data) + + # 载入回测数据 + if not self.dataEndDate: + flt = {'datetime':{'$gte':self.strategyStartDate}} # 数据过滤条件 + else: + flt = {'datetime':{'$gte':self.strategyStartDate, + '$lte':self.dataEndDate}} + self.dbCursor = collection.find(flt) + + self.output(u'载入完成,数据量:%s' %(initCursor.count() + self.dbCursor.count())) + + #---------------------------------------------------------------------- + def runBacktesting(self): + """运行回测""" + # 载入历史数据 + self.loadHistoryData() + + # 首先根据回测模式,确认要使用的数据类 + if self.mode == self.BAR_MODE: + dataClass = CtaBarData + func = self.newBar + else: + dataClass = CtaTickData + func = self.newTick + + self.output(u'开始回测') + + self.strategy.inited = True + self.strategy.onInit() + self.output(u'策略初始化完成') + + self.strategy.trading = True + self.strategy.onStart() + self.output(u'策略启动完成') + + self.output(u'开始回放数据') + + for d in self.dbCursor: + data = dataClass() + data.__dict__ = d + func(data) + + self.output(u'数据回放结束') + + #---------------------------------------------------------------------- + def newBar(self, bar): + """新的K线""" + self.bar = bar + self.dt = bar.datetime + self.crossLimitOrder() # 先撮合限价单 + self.crossStopOrder() # 再撮合停止单 + self.strategy.onBar(bar) # 推送K线到策略中 + + #---------------------------------------------------------------------- + def newTick(self, tick): + """新的Tick""" + self.tick = tick + self.dt = tick.datetime + self.crossLimitOrder() + self.crossStopOrder() + self.strategy.onTick(tick) + + #---------------------------------------------------------------------- + def initStrategy(self, strategyClass, setting=None): + """ + 初始化策略 + setting是策略的参数设置,如果使用类中写好的默认设置则可以不传该参数 + """ + self.strategy = strategyClass(self, setting) + self.strategy.name = self.strategy.className + + #---------------------------------------------------------------------- + def sendOrder(self, vtSymbol, orderType, price, volume, strategy): + """发单""" + self.limitOrderCount += 1 + orderID = str(self.limitOrderCount) + + order = VtOrderData() + order.vtSymbol = vtSymbol + order.price = price + order.totalVolume = volume + order.status = STATUS_NOTTRADED # 刚提交尚未成交 + order.orderID = orderID + order.vtOrderID = orderID + order.orderTime = str(self.dt) + + # CTA委托类型映射 + if orderType == CTAORDER_BUY: + order.direction = DIRECTION_LONG + order.offset = OFFSET_OPEN + elif orderType == CTAORDER_SELL: + order.direction = DIRECTION_SHORT + order.offset = OFFSET_CLOSE + elif orderType == CTAORDER_SHORT: + order.direction = DIRECTION_SHORT + order.offset = OFFSET_OPEN + elif orderType == CTAORDER_COVER: + order.direction = DIRECTION_LONG + order.offset = OFFSET_CLOSE + + # 保存到限价单字典中 + self.workingLimitOrderDict[orderID] = order + self.limitOrderDict[orderID] = order + + return orderID + + #---------------------------------------------------------------------- + def cancelOrder(self, vtOrderID): + """撤单""" + if vtOrderID in self.workingLimitOrderDict: + order = self.workingLimitOrderDict[vtOrderID] + order.status = STATUS_CANCELLED + order.cancelTime = str(self.dt) + del self.workingLimitOrderDict[vtOrderID] + + #---------------------------------------------------------------------- + def sendStopOrder(self, vtSymbol, orderType, price, volume, strategy): + """发停止单(本地实现)""" + self.stopOrderCount += 1 + stopOrderID = STOPORDERPREFIX + str(self.stopOrderCount) + + so = StopOrder() + so.vtSymbol = vtSymbol + so.price = price + so.volume = volume + so.strategy = strategy + so.stopOrderID = stopOrderID + so.status = STOPORDER_WAITING + + if orderType == CTAORDER_BUY: + so.direction = DIRECTION_LONG + so.offset = OFFSET_OPEN + elif orderType == CTAORDER_SELL: + so.direction = DIRECTION_SHORT + so.offset = OFFSET_CLOSE + elif orderType == CTAORDER_SHORT: + so.direction = DIRECTION_SHORT + so.offset = OFFSET_OPEN + elif orderType == CTAORDER_COVER: + so.direction = DIRECTION_LONG + so.offset = OFFSET_CLOSE + + # 保存stopOrder对象到字典中 + self.stopOrderDict[stopOrderID] = so + self.workingStopOrderDict[stopOrderID] = so + + return stopOrderID + + #---------------------------------------------------------------------- + def cancelStopOrder(self, stopOrderID): + """撤销停止单""" + # 检查停止单是否存在 + if stopOrderID in self.workingStopOrderDict: + so = self.workingStopOrderDict[stopOrderID] + so.status = STOPORDER_CANCELLED + del self.workingStopOrderDict[stopOrderID] + + #---------------------------------------------------------------------- + def crossLimitOrder(self): + """基于最新数据撮合限价单""" + # 先确定会撮合成交的价格 + if self.mode == self.BAR_MODE: + buyCrossPrice = self.bar.low # 若买入方向限价单价格高于该价格,则会成交 + sellCrossPrice = self.bar.high # 若卖出方向限价单价格低于该价格,则会成交 + buyBestCrossPrice = self.bar.open # 在当前时间点前发出的买入委托可能的最优成交价 + sellBestCrossPrice = self.bar.open # 在当前时间点前发出的卖出委托可能的最优成交价 + else: + buyCrossPrice = self.tick.askPrice1 + sellCrossPrice = self.tick.bidPrice1 + buyBestCrossPrice = self.tick.askPrice1 + sellBestCrossPrice = self.tick.bidPrice1 + + # 遍历限价单字典中的所有限价单 + for orderID, order in self.workingLimitOrderDict.items(): + # 判断是否会成交 + buyCross = order.direction==DIRECTION_LONG and order.price>=buyCrossPrice + sellCross = order.direction==DIRECTION_SHORT and order.price<=sellCrossPrice + + # 如果发生了成交 + if buyCross or sellCross: + # 推送成交数据 + self.tradeCount += 1 # 成交编号自增1 + tradeID = str(self.tradeCount) + trade = VtTradeData() + trade.vtSymbol = order.vtSymbol + trade.tradeID = tradeID + trade.vtTradeID = tradeID + trade.orderID = order.orderID + trade.vtOrderID = order.orderID + trade.direction = order.direction + trade.offset = order.offset + + # 以买入为例: + # 1. 假设当根K线的OHLC分别为:100, 125, 90, 110 + # 2. 假设在上一根K线结束(也是当前K线开始)的时刻,策略发出的委托为限价105 + # 3. 则在实际中的成交价会是100而不是105,因为委托发出时市场的最优价格是100 + if buyCross: + trade.price = min(order.price, buyBestCrossPrice) + self.strategy.pos += order.totalVolume + else: + trade.price = max(order.price, sellBestCrossPrice) + self.strategy.pos -= order.totalVolume + + trade.volume = order.totalVolume + trade.tradeTime = str(self.dt) + trade.dt = self.dt + self.strategy.onTrade(trade) + + self.tradeDict[tradeID] = trade + + # 推送委托数据 + order.tradedVolume = order.totalVolume + order.status = STATUS_ALLTRADED + self.strategy.onOrder(order) + + # 从字典中删除该限价单 + del self.workingLimitOrderDict[orderID] + + #---------------------------------------------------------------------- + def crossStopOrder(self): + """基于最新数据撮合停止单""" + # 先确定会撮合成交的价格,这里和限价单规则相反 + if self.mode == self.BAR_MODE: + buyCrossPrice = self.bar.high # 若买入方向停止单价格低于该价格,则会成交 + sellCrossPrice = self.bar.low # 若卖出方向限价单价格高于该价格,则会成交 + bestCrossPrice = self.bar.open # 最优成交价,买入停止单不能低于,卖出停止单不能高于 + else: + buyCrossPrice = self.tick.lastPrice + sellCrossPrice = self.tick.lastPrice + bestCrossPrice = self.tick.lastPrice + + # 遍历停止单字典中的所有停止单 + for stopOrderID, so in self.workingStopOrderDict.items(): + # 判断是否会成交 + buyCross = so.direction==DIRECTION_LONG and so.price<=buyCrossPrice + sellCross = so.direction==DIRECTION_SHORT and so.price>=sellCrossPrice + + # 如果发生了成交 + if buyCross or sellCross: + # 推送成交数据 + self.tradeCount += 1 # 成交编号自增1 + tradeID = str(self.tradeCount) + trade = VtTradeData() + trade.vtSymbol = so.vtSymbol + trade.tradeID = tradeID + trade.vtTradeID = tradeID + + if buyCross: + self.strategy.pos += so.volume + trade.price = max(bestCrossPrice, so.price) + else: + self.strategy.pos -= so.volume + trade.price = min(bestCrossPrice, so.price) + + self.limitOrderCount += 1 + orderID = str(self.limitOrderCount) + trade.orderID = orderID + trade.vtOrderID = orderID + + trade.direction = so.direction + trade.offset = so.offset + trade.volume = so.volume + trade.tradeTime = str(self.dt) + trade.dt = self.dt + self.strategy.onTrade(trade) + + self.tradeDict[tradeID] = trade + + # 推送委托数据 + so.status = STOPORDER_TRIGGERED + + order = VtOrderData() + order.vtSymbol = so.vtSymbol + order.symbol = so.vtSymbol + order.orderID = orderID + order.vtOrderID = orderID + order.direction = so.direction + order.offset = so.offset + order.price = so.price + order.totalVolume = so.volume + order.tradedVolume = so.volume + order.status = STATUS_ALLTRADED + order.orderTime = trade.tradeTime + self.strategy.onOrder(order) + + self.limitOrderDict[orderID] = order + + # 从字典中删除该限价单 + del self.workingStopOrderDict[stopOrderID] + + #---------------------------------------------------------------------- + def insertData(self, dbName, collectionName, data): + """考虑到回测中不允许向数据库插入数据,防止实盘交易中的一些代码出错""" + pass + + #---------------------------------------------------------------------- + def loadBar(self, dbName, collectionName, startDate): + """直接返回初始化数据列表中的Bar""" + return self.initData + + #---------------------------------------------------------------------- + def loadTick(self, dbName, collectionName, startDate): + """直接返回初始化数据列表中的Tick""" + return self.initData + + #---------------------------------------------------------------------- + def writeCtaLog(self, content): + """记录日志""" + log = str(self.dt) + ' ' + content + self.logList.append(log) + + #---------------------------------------------------------------------- + def output(self, content): + """输出内容""" + print str(datetime.now()) + "\t" + content + + #---------------------------------------------------------------------- + def calculateBacktestingResult(self): + """ + 计算回测结果 + """ + self.output(u'计算回测结果') + + # 首先基于回测后的成交记录,计算每笔交易的盈亏 + resultList = [] # 交易结果列表 + + longTrade = [] # 未平仓的多头交易 + shortTrade = [] # 未平仓的空头交易 + + for trade in self.tradeDict.values(): + # 多头交易 + if trade.direction == DIRECTION_LONG: + # 如果尚无空头交易 + if not shortTrade: + longTrade.append(trade) + # 当前多头交易为平空 + else: + while True: + entryTrade = shortTrade[0] + exitTrade = trade + + # 清算开平仓交易 + closedVolume = min(exitTrade.volume, entryTrade.volume) + result = TradingResult(entryTrade.price, entryTrade.dt, + exitTrade.price, exitTrade.dt, + -closedVolume, self.rate, self.slippage, self.size) + resultList.append(result) + + # 计算未清算部分 + entryTrade.volume -= closedVolume + exitTrade.volume -= closedVolume + + # 如果开仓交易已经全部清算,则从列表中移除 + if not entryTrade.volume: + shortTrade.pop(0) + + # 如果平仓交易已经全部清算,则退出循环 + if not exitTrade.volume: + break + + # 如果平仓交易未全部清算, + if exitTrade.volume: + # 且开仓交易已经全部清算完,则平仓交易剩余的部分 + # 等于新的反向开仓交易,添加到队列中 + if not shortTrade: + longTrade.append(exitTrade) + break + # 如果开仓交易还有剩余,则进入下一轮循环 + else: + pass + + # 空头交易 + else: + # 如果尚无多头交易 + if not longTrade: + shortTrade.append(trade) + # 当前空头交易为平多 + else: + while True: + entryTrade = longTrade[0] + exitTrade = trade + + # 清算开平仓交易 + closedVolume = min(exitTrade.volume, entryTrade.volume) + result = TradingResult(entryTrade.price, entryTrade.dt, + exitTrade.price, exitTrade.dt, + closedVolume, self.rate, self.slippage, self.size) + resultList.append(result) + + # 计算未清算部分 + entryTrade.volume -= closedVolume + exitTrade.volume -= closedVolume + + # 如果开仓交易已经全部清算,则从列表中移除 + if not entryTrade.volume: + longTrade.pop(0) + + # 如果平仓交易已经全部清算,则退出循环 + if not exitTrade.volume: + break + + # 如果平仓交易未全部清算, + if exitTrade.volume: + # 且开仓交易已经全部清算完,则平仓交易剩余的部分 + # 等于新的反向开仓交易,添加到队列中 + if not longTrade: + shortTrade.append(exitTrade) + break + # 如果开仓交易还有剩余,则进入下一轮循环 + else: + pass + + # 检查是否有交易 + if not resultList: + self.output(u'无交易结果') + return {} + + # 然后基于每笔交易的结果,我们可以计算具体的盈亏曲线和最大回撤等 + capital = 0 # 资金 + maxCapital = 0 # 资金最高净值 + drawdown = 0 # 回撤 + + totalResult = 0 # 总成交数量 + totalTurnover = 0 # 总成交金额(合约面值) + totalCommission = 0 # 总手续费 + totalSlippage = 0 # 总滑点 + + timeList = [] # 时间序列 + pnlList = [] # 每笔盈亏序列 + capitalList = [] # 盈亏汇总的时间序列 + drawdownList = [] # 回撤的时间序列 + + winningResult = 0 # 盈利次数 + losingResult = 0 # 亏损次数 + totalWinning = 0 # 总盈利金额 + totalLosing = 0 # 总亏损金额 + + for result in resultList: + capital += result.pnl + maxCapital = max(capital, maxCapital) + drawdown = capital - maxCapital + + pnlList.append(result.pnl) + timeList.append(result.exitDt) # 交易的时间戳使用平仓时间 + capitalList.append(capital) + drawdownList.append(drawdown) + + totalResult += 1 + totalTurnover += result.turnover + totalCommission += result.commission + totalSlippage += result.slippage + + if result.pnl >= 0: + winningResult += 1 + totalWinning += result.pnl + else: + losingResult += 1 + totalLosing += result.pnl + + # 计算盈亏相关数据 + winningRate = winningResult/totalResult*100 # 胜率 + + averageWinning = 0 # 这里把数据都初始化为0 + averageLosing = 0 + profitLossRatio = 0 + + if winningResult: + averageWinning = totalWinning/winningResult # 平均每笔盈利 + if losingResult: + averageLosing = totalLosing/losingResult # 平均每笔亏损 + if averageLosing: + profitLossRatio = -averageWinning/averageLosing # 盈亏比 + + # 返回回测结果 + d = {} + d['capital'] = capital + d['maxCapital'] = maxCapital + d['drawdown'] = drawdown + d['totalResult'] = totalResult + d['totalTurnover'] = totalTurnover + d['totalCommission'] = totalCommission + d['totalSlippage'] = totalSlippage + d['timeList'] = timeList + d['pnlList'] = pnlList + d['capitalList'] = capitalList + d['drawdownList'] = drawdownList + d['winningRate'] = winningRate + d['averageWinning'] = averageWinning + d['averageLosing'] = averageLosing + d['profitLossRatio'] = profitLossRatio + + return d + + #---------------------------------------------------------------------- + def showBacktestingResult(self): + """显示回测结果""" + d = self.calculateBacktestingResult() + + # 输出 + self.output('-' * 30) + self.output(u'第一笔交易:\t%s' % d['timeList'][0]) + self.output(u'最后一笔交易:\t%s' % d['timeList'][-1]) + + self.output(u'总交易次数:\t%s' % formatNumber(d['totalResult'])) + self.output(u'总盈亏:\t%s' % formatNumber(d['capital'])) + self.output(u'最大回撤: \t%s' % formatNumber(min(d['drawdownList']))) + + self.output(u'平均每笔盈利:\t%s' %formatNumber(d['capital']/d['totalResult'])) + self.output(u'平均每笔滑点:\t%s' %formatNumber(d['totalSlippage']/d['totalResult'])) + self.output(u'平均每笔佣金:\t%s' %formatNumber(d['totalCommission']/d['totalResult'])) + + self.output(u'胜率\t\t%s%%' %formatNumber(d['winningRate'])) + self.output(u'平均每笔盈利\t%s' %formatNumber(d['averageWinning'])) + self.output(u'平均每笔亏损\t%s' %formatNumber(d['averageLosing'])) + self.output(u'盈亏比:\t%s' %formatNumber(d['profitLossRatio'])) + + # 绘图 + import matplotlib.pyplot as plt + + pCapital = plt.subplot(3, 1, 1) + pCapital.set_ylabel("capital") + pCapital.plot(d['capitalList']) + + pDD = plt.subplot(3, 1, 2) + pDD.set_ylabel("DD") + pDD.bar(range(len(d['drawdownList'])), d['drawdownList']) + + pPnl = plt.subplot(3, 1, 3) + pPnl.set_ylabel("pnl") + pPnl.hist(d['pnlList'], bins=50) + + plt.show() + + #---------------------------------------------------------------------- + def putStrategyEvent(self, name): + """发送策略更新事件,回测中忽略""" + pass + + #---------------------------------------------------------------------- + def setSlippage(self, slippage): + """设置滑点点数""" + self.slippage = slippage + + #---------------------------------------------------------------------- + def setSize(self, size): + """设置合约大小""" + self.size = size + + #---------------------------------------------------------------------- + def setRate(self, rate): + """设置佣金比例""" + self.rate = rate + + #---------------------------------------------------------------------- + def runOptimization(self, strategyClass, optimizationSetting): + """优化参数""" + # 获取优化设置 + settingList = optimizationSetting.generateSetting() + targetName = optimizationSetting.optimizeTarget + + # 检查参数设置问题 + if not settingList or not targetName: + self.output(u'优化设置有问题,请检查') + + # 遍历优化 + resultList = [] + for setting in settingList: + self.clearBacktestingResult() + self.output('-' * 30) + self.output('setting: %s' %str(setting)) + self.initStrategy(strategyClass, setting) + self.runBacktesting() + d = self.calculateBacktestingResult() + try: + targetValue = d[targetName] + except KeyError: + targetValue = 0 + resultList.append(([str(setting)], targetValue)) + + # 显示结果 + resultList.sort(reverse=True, key=lambda result:result[1]) + self.output('-' * 30) + self.output(u'优化结果:') + for result in resultList: + self.output(u'%s: %s' %(result[0], result[1])) + return result + + #---------------------------------------------------------------------- + def clearBacktestingResult(self): + """清空之前回测的结果""" + # 清空限价单相关 + self.limitOrderCount = 0 + self.limitOrderDict.clear() + self.workingLimitOrderDict.clear() + + # 清空停止单相关 + self.stopOrderCount = 0 + self.stopOrderDict.clear() + self.workingStopOrderDict.clear() + + # 清空成交相关 + self.tradeCount = 0 + self.tradeDict.clear() + + #---------------------------------------------------------------------- + def runParallelOptimization(self, strategyClass, optimizationSetting): + """并行优化参数""" + # 获取优化设置 + settingList = optimizationSetting.generateSetting() + targetName = optimizationSetting.optimizeTarget + + # 检查参数设置问题 + if not settingList or not targetName: + self.output(u'优化设置有问题,请检查') + + # 多进程优化,启动一个对应CPU核心数量的进程池 + pool = multiprocessing.Pool(multiprocessing.cpu_count()) + l = [] + + for setting in settingList: + l.append(pool.apply_async(optimize, (strategyClass, setting, + targetName, self.mode, + self.startDate, self.initDays, self.endDate, + self.slippage, self.rate, self.size, + self.dbName, self.symbol))) + pool.close() + pool.join() + + # 显示结果 + resultList = [res.get() for res in l] + resultList.sort(reverse=True, key=lambda result:result[1]) + self.output('-' * 30) + self.output(u'优化结果:') + for result in resultList: + self.output(u'%s: %s' %(result[0], result[1])) + + +######################################################################## +class TradingResult(object): + """每笔交易的结果""" + + #---------------------------------------------------------------------- + def __init__(self, entryPrice, entryDt, exitPrice, + exitDt, volume, rate, slippage, size): + """Constructor""" + self.entryPrice = entryPrice # 开仓价格 + self.exitPrice = exitPrice # 平仓价格 + + self.entryDt = entryDt # 开仓时间datetime + self.exitDt = exitDt # 平仓时间 + + self.volume = volume # 交易数量(+/-代表方向) + + self.turnover = (self.entryPrice+self.exitPrice)*size*abs(volume) # 成交金额 + self.commission = self.turnover*rate # 手续费成本 + self.slippage = slippage*2*size*abs(volume) # 滑点成本 + self.pnl = ((self.exitPrice - self.entryPrice) * volume * size + - self.commission - self.slippage) # 净盈亏 + + +######################################################################## +class OptimizationSetting(object): + """优化设置""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.paramDict = OrderedDict() + + self.optimizeTarget = '' # 优化目标字段 + + #---------------------------------------------------------------------- + def addParameter(self, name, start, end=None, step=None): + """增加优化参数""" + if end is None and step is None: + self.paramDict[name] = [start] + return + + if end < start: + print u'参数起始点必须不大于终止点' + return + + if step <= 0: + print u'参数布进必须大于0' + return + + l = [] + param = start + + while param <= end: + l.append(param) + param += step + + self.paramDict[name] = l + + #---------------------------------------------------------------------- + def generateSetting(self): + """生成优化参数组合""" + # 参数名的列表 + nameList = self.paramDict.keys() + paramList = self.paramDict.values() + + # 使用迭代工具生产参数对组合 + productList = list(product(*paramList)) + + # 把参数对组合打包到一个个字典组成的列表中 + settingList = [] + for p in productList: + d = dict(zip(nameList, p)) + settingList.append(d) + + return settingList + + #---------------------------------------------------------------------- + def setOptimizeTarget(self, target): + """设置优化目标字段""" + self.optimizeTarget = target + + +#---------------------------------------------------------------------- +def formatNumber(n): + """格式化数字到字符串""" + rn = round(n, 2) # 保留两位小数 + return format(rn, ',') # 加上千分符 + + +#---------------------------------------------------------------------- +def optimize(strategyClass, setting, targetName, + mode, startDate, initDays, endDate, + slippage, rate, size, + dbName, symbol): + """多进程优化时跑在每个进程中运行的函数""" + engine = BacktestingEngine() + engine.setBacktestingMode(mode) + engine.setStartDate(startDate, initDays) + engine.setSlippage(slippage) + engine.setRate(rate) + engine.setSize(size) + engine.setDatabase(dbName, symbol) + + engine.initStrategy(strategyClass, setting) + engine.runBacktesting() + d = engine.calculateBacktestingResult() + try: + targetValue = d[targetName] + except KeyError: + targetValue = 0 + return (str(setting), targetValue) + + +if __name__ == '__main__': + # 以下内容是一段回测脚本的演示,用户可以根据自己的需求修改 + # 建议使用ipython notebook或者spyder来做回测 + # 同样可以在命令模式下进行回测(一行一行输入运行) + from ctaDemo import * + + # 创建回测引擎 + engine = BacktestingEngine() + + # 设置引擎的回测模式为K线 + engine.setBacktestingMode(engine.BAR_MODE) + + # 设置回测用的数据起始日期 + engine.setStartDate('20110101') + + # 载入历史数据到引擎中 + engine.setDatabase(MINUTE_DB_NAME, 'IF0000') + + # 设置产品相关参数 + engine.setSlippage(0.2) # 股指1跳 + engine.setRate(0.3/10000) # 万0.3 + engine.setSize(300) # 股指合约大小 + + # 在引擎中创建策略对象 + engine.initStrategy(DoubleEmaDemo, {}) + + # 开始跑回测 + engine.runBacktesting() + + # 显示回测结果 + # spyder或者ipython notebook中运行时,会弹出盈亏曲线图 + # 直接在cmd中回测则只会打印一些回测数值 + engine.showBacktestingResult() + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaBase.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaBase.py new file mode 100644 index 0000000000..6b16a85e0f --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaBase.py @@ -0,0 +1,136 @@ +# encoding: UTF-8 + +''' +本文件中包含了CTA模块中用到的一些基础设置、类和常量等。 +''' + +from __future__ import division + + +# 把vn.trader根目录添加到python环境变量中 +import sys +sys.path.append('..') + + +# 常量定义 +# CTA引擎中涉及到的交易方向类型 +CTAORDER_BUY = u'买开' +CTAORDER_SELL = u'卖平' +CTAORDER_SHORT = u'卖开' +CTAORDER_COVER = u'买平' + +# 本地停止单状态 +STOPORDER_WAITING = u'等待中' +STOPORDER_CANCELLED = u'已撤销' +STOPORDER_TRIGGERED = u'已触发' + +# 本地停止单前缀 +STOPORDERPREFIX = 'CtaStopOrder.' + +# 数据库名称 +SETTING_DB_NAME = 'VnTrader_Setting_Db' +POSITION_DB_NAME = 'VnTrader_Position_Db' + +TICK_DB_NAME = 'VnTrader_Tick_Db' +DAILY_DB_NAME = 'VnTrader_Daily_Db' +MINUTE_DB_NAME = 'VnTrader_1Min_Db' + +# 引擎类型,用于区分当前策略的运行环境 +ENGINETYPE_BACKTESTING = 'backtesting' # 回测 +ENGINETYPE_TRADING = 'trading' # 实盘 + +# CTA引擎中涉及的数据类定义 +from vtConstant import EMPTY_UNICODE, EMPTY_STRING, EMPTY_FLOAT, EMPTY_INT + + +######################################################################## +class StopOrder(object): + """本地停止单""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.vtSymbol = EMPTY_STRING + self.orderType = EMPTY_UNICODE + self.direction = EMPTY_UNICODE + self.offset = EMPTY_UNICODE + self.price = EMPTY_FLOAT + self.volume = EMPTY_INT + + self.strategy = None # 下停止单的策略对象 + self.stopOrderID = EMPTY_STRING # 停止单的本地编号 + self.status = EMPTY_STRING # 停止单状态 + + +######################################################################## +class CtaBarData(object): + """K线数据""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.vtSymbol = EMPTY_STRING # vt系统代码 + self.symbol = EMPTY_STRING # 代码 + self.exchange = EMPTY_STRING # 交易所 + + self.open = EMPTY_FLOAT # OHLC + self.high = EMPTY_FLOAT + self.low = EMPTY_FLOAT + self.close = EMPTY_FLOAT + + self.date = EMPTY_STRING # bar开始的时间,日期 + self.time = EMPTY_STRING # 时间 + self.datetime = None # python的datetime时间对象 + + self.volume = EMPTY_INT # 成交量 + self.openInterest = EMPTY_INT # 持仓量 + + +######################################################################## +class CtaTickData(object): + """Tick数据""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.vtSymbol = EMPTY_STRING # vt系统代码 + self.symbol = EMPTY_STRING # 合约代码 + self.exchange = EMPTY_STRING # 交易所代码 + + # 成交数据 + self.lastPrice = EMPTY_FLOAT # 最新成交价 + self.volume = EMPTY_INT # 最新成交量 + self.openInterest = EMPTY_INT # 持仓量 + + self.upperLimit = EMPTY_FLOAT # 涨停价 + self.lowerLimit = EMPTY_FLOAT # 跌停价 + + # tick的时间 + self.date = EMPTY_STRING # 日期 + self.time = EMPTY_STRING # 时间 + self.datetime = None # python的datetime时间对象 + + # 五档行情 + self.bidPrice1 = EMPTY_FLOAT + self.bidPrice2 = EMPTY_FLOAT + self.bidPrice3 = EMPTY_FLOAT + self.bidPrice4 = EMPTY_FLOAT + self.bidPrice5 = EMPTY_FLOAT + + self.askPrice1 = EMPTY_FLOAT + self.askPrice2 = EMPTY_FLOAT + self.askPrice3 = EMPTY_FLOAT + self.askPrice4 = EMPTY_FLOAT + self.askPrice5 = EMPTY_FLOAT + + self.bidVolume1 = EMPTY_INT + self.bidVolume2 = EMPTY_INT + self.bidVolume3 = EMPTY_INT + self.bidVolume4 = EMPTY_INT + self.bidVolume5 = EMPTY_INT + + self.askVolume1 = EMPTY_INT + self.askVolume2 = EMPTY_INT + self.askVolume3 = EMPTY_INT + self.askVolume4 = EMPTY_INT + self.askVolume5 = EMPTY_INT \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaDemo.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaDemo.py new file mode 100644 index 0000000000..747be12ae1 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaDemo.py @@ -0,0 +1,294 @@ +# encoding: UTF-8 + +""" +这里的Demo是一个最简单的策略实现,并未考虑太多实盘中的交易细节,如: +1. 委托价格超出涨跌停价导致的委托失败 +2. 委托未成交,需要撤单后重新委托 +3. 断网后恢复交易状态 +4. 等等 +这些点是作者选择特意忽略不去实现,因此想实盘的朋友请自己多多研究CTA交易的一些细节, +做到了然于胸后再去交易,对自己的money和时间负责。 +也希望社区能做出一个解决了以上潜在风险的Demo出来。 +""" + + +from ctaBase import * +from ctaTemplate import CtaTemplate + + +######################################################################## +class DoubleEmaDemo(CtaTemplate): + """双指数均线策略Demo""" + className = 'DoubleEmaDemo' + author = u'用Python的交易员' + + # 策略参数 + fastK = 0.9 # 快速EMA参数 + slowK = 0.1 # 慢速EMA参数 + initDays = 10 # 初始化数据所用的天数 + + # 策略变量 + bar = None + barMinute = EMPTY_STRING + + fastMa = [] # 快速EMA均线数组 + fastMa0 = EMPTY_FLOAT # 当前最新的快速EMA + fastMa1 = EMPTY_FLOAT # 上一根的快速EMA + + slowMa = [] # 与上面相同 + slowMa0 = EMPTY_FLOAT + slowMa1 = EMPTY_FLOAT + + # 参数列表,保存了参数的名称 + paramList = ['name', + 'className', + 'author', + 'vtSymbol', + 'fastK', + 'slowK'] + + # 变量列表,保存了变量的名称 + varList = ['inited', + 'trading', + 'pos', + 'fastMa0', + 'fastMa1', + 'slowMa0', + 'slowMa1'] + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, setting): + """Constructor""" + super(DoubleEmaDemo, self).__init__(ctaEngine, setting) + + # 注意策略类中的可变对象属性(通常是list和dict等),在策略初始化时需要重新创建, + # 否则会出现多个策略实例之间数据共享的情况,有可能导致潜在的策略逻辑错误风险, + # 策略类中的这些可变对象属性可以选择不写,全都放在__init__下面,写主要是为了阅读 + # 策略时方便(更多是个编程习惯的选择) + self.fastMa = [] + self.slowMa = [] + + #---------------------------------------------------------------------- + def onInit(self): + """初始化策略(必须由用户继承实现)""" + self.writeCtaLog(u'双EMA演示策略初始化') + + initData = self.loadBar(self.initDays) + for bar in initData: + self.onBar(bar) + + self.putEvent() + + #---------------------------------------------------------------------- + def onStart(self): + """启动策略(必须由用户继承实现)""" + self.writeCtaLog(u'双EMA演示策略启动') + self.putEvent() + + #---------------------------------------------------------------------- + def onStop(self): + """停止策略(必须由用户继承实现)""" + self.writeCtaLog(u'双EMA演示策略停止') + self.putEvent() + + #---------------------------------------------------------------------- + def onTick(self, tick): + """收到行情TICK推送(必须由用户继承实现)""" + # 计算K线 + tickMinute = tick.datetime.minute + + if tickMinute != self.barMinute: + if self.bar: + self.onBar(self.bar) + + bar = CtaBarData() + bar.vtSymbol = tick.vtSymbol + bar.symbol = tick.symbol + bar.exchange = tick.exchange + + bar.open = tick.lastPrice + bar.high = tick.lastPrice + bar.low = tick.lastPrice + bar.close = tick.lastPrice + + bar.date = tick.date + bar.time = tick.time + bar.datetime = tick.datetime # K线的时间设为第一个Tick的时间 + + # 实盘中用不到的数据可以选择不算,从而加快速度 + #bar.volume = tick.volume + #bar.openInterest = tick.openInterest + + self.bar = bar # 这种写法为了减少一层访问,加快速度 + self.barMinute = tickMinute # 更新当前的分钟 + + else: # 否则继续累加新的K线 + bar = self.bar # 写法同样为了加快速度 + + bar.high = max(bar.high, tick.lastPrice) + bar.low = min(bar.low, tick.lastPrice) + bar.close = tick.lastPrice + + #---------------------------------------------------------------------- + def onBar(self, bar): + """收到Bar推送(必须由用户继承实现)""" + # 计算快慢均线 + if not self.fastMa0: + self.fastMa0 = bar.close + self.fastMa.append(self.fastMa0) + else: + self.fastMa1 = self.fastMa0 + self.fastMa0 = bar.close * self.fastK + self.fastMa0 * (1 - self.fastK) + self.fastMa.append(self.fastMa0) + + if not self.slowMa0: + self.slowMa0 = bar.close + self.slowMa.append(self.slowMa0) + else: + self.slowMa1 = self.slowMa0 + self.slowMa0 = bar.close * self.slowK + self.slowMa0 * (1 - self.slowK) + self.slowMa.append(self.slowMa0) + + # 判断买卖 + crossOver = self.fastMa0>self.slowMa0 and self.fastMa1self.slowMa1 # 死叉下穿 + + # 金叉和死叉的条件是互斥 + # 所有的委托均以K线收盘价委托(这里有一个实盘中无法成交的风险,考虑添加对模拟市价单类型的支持) + if crossOver: + # 如果金叉时手头没有持仓,则直接做多 + if self.pos == 0: + self.buy(bar.close, 1) + # 如果有空头持仓,则先平空,再做多 + elif self.pos < 0: + self.cover(bar.close, 1) + self.buy(bar.close, 1) + # 死叉和金叉相反 + elif crossBelow: + if self.pos == 0: + self.short(bar.close, 1) + elif self.pos > 0: + self.sell(bar.close, 1) + self.short(bar.close, 1) + + # 发出状态更新事件 + self.putEvent() + + #---------------------------------------------------------------------- + def onOrder(self, order): + """收到委托变化推送(必须由用户继承实现)""" + # 对于无需做细粒度委托控制的策略,可以忽略onOrder + pass + + #---------------------------------------------------------------------- + def onTrade(self, trade): + """收到成交推送(必须由用户继承实现)""" + # 对于无需做细粒度委托控制的策略,可以忽略onOrder + pass + + +######################################################################################## +class OrderManagementDemo(CtaTemplate): + """基于tick级别细粒度撤单追单测试demo""" + + className = 'OrderManagementDemo' + author = u'用Python的交易员' + + # 策略参数 + initDays = 10 # 初始化数据所用的天数 + + # 策略变量 + bar = None + barMinute = EMPTY_STRING + + + # 参数列表,保存了参数的名称 + paramList = ['name', + 'className', + 'author', + 'vtSymbol'] + + # 变量列表,保存了变量的名称 + varList = ['inited', + 'trading', + 'pos'] + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, setting): + """Constructor""" + super(OrderManagementDemo, self).__init__(ctaEngine, setting) + + self.lastOrder = None + self.orderType = '' + + #---------------------------------------------------------------------- + def onInit(self): + """初始化策略(必须由用户继承实现)""" + self.writeCtaLog(u'双EMA演示策略初始化') + + initData = self.loadBar(self.initDays) + for bar in initData: + self.onBar(bar) + + self.putEvent() + + #---------------------------------------------------------------------- + def onStart(self): + """启动策略(必须由用户继承实现)""" + self.writeCtaLog(u'双EMA演示策略启动') + self.putEvent() + + #---------------------------------------------------------------------- + def onStop(self): + """停止策略(必须由用户继承实现)""" + self.writeCtaLog(u'双EMA演示策略停止') + self.putEvent() + + #---------------------------------------------------------------------- + def onTick(self, tick): + """收到行情TICK推送(必须由用户继承实现)""" + + # 建立不成交买单测试单 + if self.lastOrder == None: + self.buy(tick.lastprice - 10.0, 1) + + # CTA委托类型映射 + if self.lastOrder != None and self.lastOrder.direction == u'多' and self.lastOrder.offset == u'开仓': + self.orderType = u'买开' + + elif self.lastOrder != None and self.lastOrder.direction == u'多' and self.lastOrder.offset == u'平仓': + self.orderType = u'买平' + + elif self.lastOrder != None and self.lastOrder.direction == u'空' and self.lastOrder.offset == u'开仓': + self.orderType = u'卖开' + + elif self.lastOrder != None and self.lastOrder.direction == u'空' and self.lastOrder.offset == u'平仓': + self.orderType = u'卖平' + + # 不成交,即撤单,并追单 + if self.lastOrder != None and self.lastOrder.status == u'未成交': + + self.cancelOrder(self.lastOrder.vtOrderID) + self.lastOrder = None + elif self.lastOrder != None and self.lastOrder.status == u'已撤销': + # 追单并设置为不能成交 + + self.sendOrder(self.orderType, self.tick.lastprice - 10, 1) + self.lastOrder = None + + #---------------------------------------------------------------------- + def onBar(self, bar): + """收到Bar推送(必须由用户继承实现)""" + pass + + #---------------------------------------------------------------------- + def onOrder(self, order): + """收到委托变化推送(必须由用户继承实现)""" + # 对于无需做细粒度委托控制的策略,可以忽略onOrder + self.lastOrder = order + + #---------------------------------------------------------------------- + def onTrade(self, trade): + """收到成交推送(必须由用户继承实现)""" + # 对于无需做细粒度委托控制的策略,可以忽略onOrder + pass diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaEngine.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaEngine.py new file mode 100644 index 0000000000..27ff0bbd2a --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaEngine.py @@ -0,0 +1,634 @@ +# encoding: UTF-8 + +''' +本文件中实现了CTA策略引擎,针对CTA类型的策略,抽象简化了部分底层接口的功能。 + +关于平今和平昨规则: +1. 普通的平仓OFFSET_CLOSET等于平昨OFFSET_CLOSEYESTERDAY +2. 只有上期所的品种需要考虑平今和平昨的区别 +3. 当上期所的期货有今仓时,调用Sell和Cover会使用OFFSET_CLOSETODAY,否则 + 会使用OFFSET_CLOSE +4. 以上设计意味着如果Sell和Cover的数量超过今日持仓量时,会导致出错(即用户 + 希望通过一个指令同时平今和平昨) +5. 采用以上设计的原因是考虑到vn.trader的用户主要是对TB、MC和金字塔类的平台 + 感到功能不足的用户(即希望更高频的交易),交易策略不应该出现4中所述的情况 +6. 对于想要实现4中所述情况的用户,需要实现一个策略信号引擎和交易委托引擎分开 + 的定制化统结构(没错,得自己写) +''' + +import json +import os +import traceback +from collections import OrderedDict +from datetime import datetime, timedelta + +from ctaBase import * +from ctaSetting import STRATEGY_CLASS +from eventEngine import * +from vtConstant import * +from vtGateway import VtSubscribeReq, VtOrderReq, VtCancelOrderReq, VtLogData +from vtFunction import todayDate + + +######################################################################## +class CtaEngine(object): + """CTA策略引擎""" + settingFileName = 'CTA_setting.json' + path = os.path.abspath(os.path.dirname(__file__)) + settingFileName = os.path.join(path, settingFileName) + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine): + """Constructor""" + self.mainEngine = mainEngine + self.eventEngine = eventEngine + + # 当前日期 + self.today = todayDate() + + # 保存策略实例的字典 + # key为策略名称,value为策略实例,注意策略名称不允许重复 + self.strategyDict = {} + + # 保存vtSymbol和策略实例映射的字典(用于推送tick数据) + # 由于可能多个strategy交易同一个vtSymbol,因此key为vtSymbol + # value为包含所有相关strategy对象的list + self.tickStrategyDict = {} + + # 保存vtOrderID和strategy对象映射的字典(用于推送order和trade数据) + # key为vtOrderID,value为strategy对象 + self.orderStrategyDict = {} + + # 本地停止单编号计数 + self.stopOrderCount = 0 + # stopOrderID = STOPORDERPREFIX + str(stopOrderCount) + + # 本地停止单字典 + # key为stopOrderID,value为stopOrder对象 + self.stopOrderDict = {} # 停止单撤销后不会从本字典中删除 + self.workingStopOrderDict = {} # 停止单撤销后会从本字典中删除 + + # 持仓缓存字典 + # key为vtSymbol,value为PositionBuffer对象 + self.posBufferDict = {} + + # 引擎类型为实盘 + self.engineType = ENGINETYPE_TRADING + + # 注册事件监听 + self.registerEvent() + + #---------------------------------------------------------------------- + def sendOrder(self, vtSymbol, orderType, price, volume, strategy): + """发单""" + contract = self.mainEngine.getContract(vtSymbol) + + req = VtOrderReq() + req.symbol = contract.symbol + req.exchange = contract.exchange + req.price = price + req.volume = volume + + req.productClass = strategy.productClass + req.currency = strategy.currency + + # 设计为CTA引擎发出的委托只允许使用限价单 + req.priceType = PRICETYPE_LIMITPRICE + + # CTA委托类型映射 + if orderType == CTAORDER_BUY: + req.direction = DIRECTION_LONG + req.offset = OFFSET_OPEN + + elif orderType == CTAORDER_SELL: + req.direction = DIRECTION_SHORT + + # 只有上期所才要考虑平今平昨 + if contract.exchange != EXCHANGE_SHFE: + req.offset = OFFSET_CLOSE + else: + # 获取持仓缓存数据 + posBuffer = self.posBufferDict.get(vtSymbol, None) + # 如果获取持仓缓存失败,则默认平昨 + if not posBuffer: + req.offset = OFFSET_CLOSE + # 否则如果有多头今仓,则使用平今 + elif posBuffer.longToday: + req.offset= OFFSET_CLOSETODAY + # 其他情况使用平昨 + else: + req.offset = OFFSET_CLOSE + + elif orderType == CTAORDER_SHORT: + req.direction = DIRECTION_SHORT + req.offset = OFFSET_OPEN + + elif orderType == CTAORDER_COVER: + req.direction = DIRECTION_LONG + + # 只有上期所才要考虑平今平昨 + if contract.exchange != EXCHANGE_SHFE: + req.offset = OFFSET_CLOSE + else: + # 获取持仓缓存数据 + posBuffer = self.posBufferDict.get(vtSymbol, None) + # 如果获取持仓缓存失败,则默认平昨 + if not posBuffer: + req.offset = OFFSET_CLOSE + # 否则如果有空头今仓,则使用平今 + elif posBuffer.shortToday: + req.offset= OFFSET_CLOSETODAY + # 其他情况使用平昨 + else: + req.offset = OFFSET_CLOSE + + vtOrderID = self.mainEngine.sendOrder(req, contract.gatewayName) # 发单 + self.orderStrategyDict[vtOrderID] = strategy # 保存vtOrderID和策略的映射关系 + + self.writeCtaLog(u'策略%s发送委托,%s,%s,%s@%s' + %(strategy.name, vtSymbol, req.direction, volume, price)) + + return vtOrderID + + #---------------------------------------------------------------------- + def cancelOrder(self, vtOrderID): + """撤单""" + # 查询报单对象 + order = self.mainEngine.getOrder(vtOrderID) + + # 如果查询成功 + if order: + # 检查是否报单还有效,只有有效时才发出撤单指令 + orderFinished = (order.status==STATUS_ALLTRADED or order.status==STATUS_CANCELLED) + if not orderFinished: + req = VtCancelOrderReq() + req.symbol = order.symbol + req.exchange = order.exchange + req.frontID = order.frontID + req.sessionID = order.sessionID + req.orderID = order.orderID + self.mainEngine.cancelOrder(req, order.gatewayName) + + #---------------------------------------------------------------------- + def sendStopOrder(self, vtSymbol, orderType, price, volume, strategy): + """发停止单(本地实现)""" + self.stopOrderCount += 1 + stopOrderID = STOPORDERPREFIX + str(self.stopOrderCount) + + so = StopOrder() + so.vtSymbol = vtSymbol + so.orderType = orderType + so.price = price + so.volume = volume + so.strategy = strategy + so.stopOrderID = stopOrderID + so.status = STOPORDER_WAITING + + if orderType == CTAORDER_BUY: + so.direction = DIRECTION_LONG + so.offset = OFFSET_OPEN + elif orderType == CTAORDER_SELL: + so.direction = DIRECTION_SHORT + so.offset = OFFSET_CLOSE + elif orderType == CTAORDER_SHORT: + so.direction = DIRECTION_SHORT + so.offset = OFFSET_OPEN + elif orderType == CTAORDER_COVER: + so.direction = DIRECTION_LONG + so.offset = OFFSET_CLOSE + + # 保存stopOrder对象到字典中 + self.stopOrderDict[stopOrderID] = so + self.workingStopOrderDict[stopOrderID] = so + + return stopOrderID + + #---------------------------------------------------------------------- + def cancelStopOrder(self, stopOrderID): + """撤销停止单""" + # 检查停止单是否存在 + if stopOrderID in self.workingStopOrderDict: + so = self.workingStopOrderDict[stopOrderID] + so.status = STOPORDER_CANCELLED + del self.workingStopOrderDict[stopOrderID] + + #---------------------------------------------------------------------- + def processStopOrder(self, tick): + """收到行情后处理本地停止单(检查是否要立即发出)""" + vtSymbol = tick.vtSymbol + + # 首先检查是否有策略交易该合约 + if vtSymbol in self.tickStrategyDict: + # 遍历等待中的停止单,检查是否会被触发 + for so in self.workingStopOrderDict.values(): + if so.vtSymbol == vtSymbol: + longTriggered = so.direction==DIRECTION_LONG and tick.lastPrice>=so.price # 多头停止单被触发 + shortTriggered = so.direction==DIRECTION_SHORT and tick.lastPrice<=so.price # 空头停止单被触发 + + if longTriggered or shortTriggered: + # 买入和卖出分别以涨停跌停价发单(模拟市价单) + if so.direction==DIRECTION_LONG: + price = tick.upperLimit + else: + price = tick.lowerLimit + + so.status = STOPORDER_TRIGGERED + self.sendOrder(so.vtSymbol, so.orderType, price, so.volume, so.strategy) + del self.workingStopOrderDict[so.stopOrderID] + + #---------------------------------------------------------------------- + def processTickEvent(self, event): + """处理行情推送""" + tick = event.dict_['data'] + # 收到tick行情后,先处理本地停止单(检查是否要立即发出) + self.processStopOrder(tick) + + # 推送tick到对应的策略实例进行处理 + if tick.vtSymbol in self.tickStrategyDict: + # 将vtTickData数据转化为ctaTickData + ctaTick = CtaTickData() + d = ctaTick.__dict__ + for key in d.keys(): + if key != 'datetime': + d[key] = tick.__getattribute__(key) + # 添加datetime字段 + ctaTick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S.%f') + + # 逐个推送到策略实例中 + l = self.tickStrategyDict[tick.vtSymbol] + for strategy in l: + self.callStrategyFunc(strategy, strategy.onTick, ctaTick) + + #---------------------------------------------------------------------- + def processOrderEvent(self, event): + """处理委托推送""" + order = event.dict_['data'] + + if order.vtOrderID in self.orderStrategyDict: + strategy = self.orderStrategyDict[order.vtOrderID] + self.callStrategyFunc(strategy, strategy.onOrder, order) + + #---------------------------------------------------------------------- + def processTradeEvent(self, event): + """处理成交推送""" + trade = event.dict_['data'] + + if trade.vtOrderID in self.orderStrategyDict: + strategy = self.orderStrategyDict[trade.vtOrderID] + + # 计算策略持仓 + if trade.direction == DIRECTION_LONG: + strategy.pos += trade.volume + else: + strategy.pos -= trade.volume + + self.callStrategyFunc(strategy, strategy.onTrade, trade) + + # 更新持仓缓存数据 + if trade.vtSymbol in self.tickStrategyDict: + posBuffer = self.posBufferDict.get(trade.vtSymbol, None) + if not posBuffer: + posBuffer = PositionBuffer() + posBuffer.vtSymbol = trade.vtSymbol + self.posBufferDict[trade.vtSymbol] = posBuffer + posBuffer.updateTradeData(trade) + + #---------------------------------------------------------------------- + def processPositionEvent(self, event): + """处理持仓推送""" + pos = event.dict_['data'] + + # 更新持仓缓存数据 + if pos.vtSymbol in self.tickStrategyDict: + posBuffer = self.posBufferDict.get(pos.vtSymbol, None) + if not posBuffer: + posBuffer = PositionBuffer() + posBuffer.vtSymbol = pos.vtSymbol + self.posBufferDict[pos.vtSymbol] = posBuffer + posBuffer.updatePositionData(pos) + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.eventEngine.register(EVENT_TICK, self.processTickEvent) + self.eventEngine.register(EVENT_ORDER, self.processOrderEvent) + self.eventEngine.register(EVENT_TRADE, self.processTradeEvent) + self.eventEngine.register(EVENT_POSITION, self.processPositionEvent) + + #---------------------------------------------------------------------- + def insertData(self, dbName, collectionName, data): + """插入数据到数据库(这里的data可以是CtaTickData或者CtaBarData)""" + self.mainEngine.dbInsert(dbName, collectionName, data.__dict__) + + #---------------------------------------------------------------------- + def loadBar(self, dbName, collectionName, days): + """从数据库中读取Bar数据,startDate是datetime对象""" + startDate = self.today - timedelta(days) + + d = {'datetime':{'$gte':startDate}} + cursor = self.mainEngine.dbQuery(dbName, collectionName, d) + + l = [] + if cursor: + for d in cursor: + bar = CtaBarData() + bar.__dict__ = d + l.append(bar) + + return l + + #---------------------------------------------------------------------- + def loadTick(self, dbName, collectionName, days): + """从数据库中读取Tick数据,startDate是datetime对象""" + startDate = self.today - timedelta(days) + + d = {'datetime':{'$gte':startDate}} + cursor = self.mainEngine.dbQuery(dbName, collectionName, d) + + l = [] + if cursor: + for d in cursor: + tick = CtaTickData() + tick.__dict__ = d + l.append(tick) + + return l + + #---------------------------------------------------------------------- + def writeCtaLog(self, content): + """快速发出CTA模块日志事件""" + log = VtLogData() + log.logContent = content + event = Event(type_=EVENT_CTA_LOG) + event.dict_['data'] = log + self.eventEngine.put(event) + + #---------------------------------------------------------------------- + def loadStrategy(self, setting): + """载入策略""" + try: + name = setting['name'] + className = setting['className'] + except Exception, e: + self.writeCtaLog(u'载入策略出错:%s' %e) + return + + # 获取策略类 + strategyClass = STRATEGY_CLASS.get(className, None) + if not strategyClass: + self.writeCtaLog(u'找不到策略类:%s' %className) + return + + # 防止策略重名 + if name in self.strategyDict: + self.writeCtaLog(u'策略实例重名:%s' %name) + else: + # 创建策略实例 + strategy = strategyClass(self, setting) + self.strategyDict[name] = strategy + + # 保存Tick映射关系 + if strategy.vtSymbol in self.tickStrategyDict: + l = self.tickStrategyDict[strategy.vtSymbol] + else: + l = [] + self.tickStrategyDict[strategy.vtSymbol] = l + l.append(strategy) + + # 订阅合约 + contract = self.mainEngine.getContract(strategy.vtSymbol) + if contract: + req = VtSubscribeReq() + req.symbol = contract.symbol + req.exchange = contract.exchange + + # 对于IB接口订阅行情时所需的货币和产品类型,从策略属性中获取 + req.currency = strategy.currency + req.productClass = strategy.productClass + + self.mainEngine.subscribe(req, contract.gatewayName) + else: + self.writeCtaLog(u'%s的交易合约%s无法找到' %(name, strategy.vtSymbol)) + + #---------------------------------------------------------------------- + def initStrategy(self, name): + """初始化策略""" + if name in self.strategyDict: + strategy = self.strategyDict[name] + + if not strategy.inited: + strategy.inited = True + self.callStrategyFunc(strategy, strategy.onInit) + else: + self.writeCtaLog(u'请勿重复初始化策略实例:%s' %name) + else: + self.writeCtaLog(u'策略实例不存在:%s' %name) + + #--------------------------------------------------------------------- + def startStrategy(self, name): + """启动策略""" + if name in self.strategyDict: + strategy = self.strategyDict[name] + + if strategy.inited and not strategy.trading: + strategy.trading = True + self.callStrategyFunc(strategy, strategy.onStart) + else: + self.writeCtaLog(u'策略实例不存在:%s' %name) + + #---------------------------------------------------------------------- + def stopStrategy(self, name): + """停止策略""" + if name in self.strategyDict: + strategy = self.strategyDict[name] + + if strategy.trading: + strategy.trading = False + self.callStrategyFunc(strategy, strategy.onStop) + + # 对该策略发出的所有限价单进行撤单 + for vtOrderID, s in self.orderStrategyDict.items(): + if s is strategy: + self.cancelOrder(vtOrderID) + + # 对该策略发出的所有本地停止单撤单 + for stopOrderID, so in self.workingStopOrderDict.items(): + if so.strategy is strategy: + self.cancelStopOrder(stopOrderID) + else: + self.writeCtaLog(u'策略实例不存在:%s' %name) + + #---------------------------------------------------------------------- + def saveSetting(self): + """保存策略配置""" + with open(self.settingFileName, 'w') as f: + l = [] + + for strategy in self.strategyDict.values(): + setting = {} + for param in strategy.paramList: + setting[param] = strategy.__getattribute__(param) + l.append(setting) + + jsonL = json.dumps(l, indent=4) + f.write(jsonL) + + #---------------------------------------------------------------------- + def loadSetting(self): + """读取策略配置""" + with open(self.settingFileName) as f: + l = json.load(f) + + for setting in l: + self.loadStrategy(setting) + + self.loadPosition() + + #---------------------------------------------------------------------- + def getStrategyVar(self, name): + """获取策略当前的变量字典""" + if name in self.strategyDict: + strategy = self.strategyDict[name] + varDict = OrderedDict() + + for key in strategy.varList: + varDict[key] = strategy.__getattribute__(key) + + return varDict + else: + self.writeCtaLog(u'策略实例不存在:' + name) + return None + + #---------------------------------------------------------------------- + def getStrategyParam(self, name): + """获取策略的参数字典""" + if name in self.strategyDict: + strategy = self.strategyDict[name] + paramDict = OrderedDict() + + for key in strategy.paramList: + paramDict[key] = strategy.__getattribute__(key) + + return paramDict + else: + self.writeCtaLog(u'策略实例不存在:' + name) + return None + + #---------------------------------------------------------------------- + def putStrategyEvent(self, name): + """触发策略状态变化事件(通常用于通知GUI更新)""" + event = Event(EVENT_CTA_STRATEGY+name) + self.eventEngine.put(event) + + #---------------------------------------------------------------------- + def callStrategyFunc(self, strategy, func, params=None): + """调用策略的函数,若触发异常则捕捉""" + try: + if params: + func(params) + else: + func() + except Exception: + # 停止策略,修改状态为未初始化 + strategy.trading = False + strategy.inited = False + + # 发出日志 + content = '\n'.join([u'策略%s触发异常已停止' %strategy.name, + traceback.format_exc()]) + self.writeCtaLog(content) + + #---------------------------------------------------------------------- + def savePosition(self): + """保存所有策略的持仓情况到数据库""" + for strategy in self.strategyDict.values(): + flt = {'name': strategy.name, + 'vtSymbol': strategy.vtSymbol} + + d = {'name': strategy.name, + 'vtSymbol': strategy.vtSymbol, + 'pos': strategy.pos} + + self.mainEngine.dbUpdate(POSITION_DB_NAME, strategy.className, + d, flt, True) + + content = '策略%s持仓保存成功' %strategy.name + self.writeCtaLog(content) + + #---------------------------------------------------------------------- + def loadPosition(self): + """从数据库载入策略的持仓情况""" + for strategy in self.strategyDict.values(): + flt = {'name': strategy.name, + 'vtSymbol': strategy.vtSymbol} + + cx = self.mainEngine.dbQuery(POSITION_DB_NAME, strategy.className, flt) + if cx: + for d in cx: + strategy.pos = d['pos'] + + +######################################################################## +class PositionBuffer(object): + """持仓缓存信息(本地维护的持仓数据)""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.vtSymbol = EMPTY_STRING + + # 多头 + self.longPosition = EMPTY_INT + self.longToday = EMPTY_INT + self.longYd = EMPTY_INT + + # 空头 + self.shortPosition = EMPTY_INT + self.shortToday = EMPTY_INT + self.shortYd = EMPTY_INT + + #---------------------------------------------------------------------- + def updatePositionData(self, pos): + """更新持仓数据""" + if pos.direction == DIRECTION_LONG: + self.longPosition = pos.position + self.longYd = pos.ydPosition + self.longToday = self.longPosition - self.longYd + else: + self.shortPosition = pos.position + self.shortYd = pos.ydPosition + self.shortToday = self.shortPosition - self.shortYd + + #---------------------------------------------------------------------- + def updateTradeData(self, trade): + """更新成交数据""" + if trade.direction == DIRECTION_LONG: + # 多方开仓,则对应多头的持仓和今仓增加 + if trade.offset == OFFSET_OPEN: + self.longPosition += trade.volume + self.longToday += trade.volume + # 多方平今,对应空头的持仓和今仓减少 + elif trade.offset == OFFSET_CLOSETODAY: + self.shortPosition -= trade.volume + self.shortToday -= trade.volume + # 多方平昨,对应空头的持仓和昨仓减少 + else: + self.shortPosition -= trade.volume + self.shortYd -= trade.volume + else: + # 空头和多头相同 + if trade.offset == OFFSET_OPEN: + self.shortPosition += trade.volume + self.shortToday += trade.volume + elif trade.offset == OFFSET_CLOSETODAY: + self.longPosition -= trade.volume + self.longToday -= trade.volume + else: + self.longPosition -= trade.volume + self.longYd -= trade.volume + + + + + + diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaHistoryData.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaHistoryData.py new file mode 100644 index 0000000000..5039adee08 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaHistoryData.py @@ -0,0 +1,361 @@ +# encoding: UTF-8 + +""" +本模块中主要包含: +1. 从通联数据下载历史行情的引擎 +2. 用来把MultiCharts导出的历史数据载入到MongoDB中用的函数 +""" + +from datetime import datetime, timedelta +import pymongo +from time import time +from multiprocessing.pool import ThreadPool + +from ctaBase import * +from vtConstant import * +from vtFunction import loadMongoSetting +from datayesClient import DatayesClient + + +# 以下为vn.trader和通联数据规定的交易所代码映射 +VT_TO_DATAYES_EXCHANGE = {} +VT_TO_DATAYES_EXCHANGE[EXCHANGE_CFFEX] = 'CCFX' # 中金所 +VT_TO_DATAYES_EXCHANGE[EXCHANGE_SHFE] = 'XSGE' # 上期所 +VT_TO_DATAYES_EXCHANGE[EXCHANGE_CZCE] = 'XZCE' # 郑商所 +VT_TO_DATAYES_EXCHANGE[EXCHANGE_DCE] = 'XDCE' # 大商所 +DATAYES_TO_VT_EXCHANGE = {v:k for k,v in VT_TO_DATAYES_EXCHANGE.items()} + + +######################################################################## +class HistoryDataEngine(object): + """CTA模块用的历史数据引擎""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + host, port = loadMongoSetting() + + self.dbClient = pymongo.MongoClient(host, port) + self.datayesClient = DatayesClient() + + #---------------------------------------------------------------------- + def lastTradeDate(self): + """获取最近交易日(只考虑工作日,无法检查国内假期)""" + today = datetime.now() + oneday = timedelta(1) + + if today.weekday() == 5: + today = today - oneday + elif today.weekday() == 6: + today = today - oneday*2 + + return today.strftime('%Y%m%d') + + #---------------------------------------------------------------------- + def readFuturesProductSymbol(self): + """查询所有期货产品代码""" + cx = self.dbClient[SETTING_DB_NAME]['FuturesSymbol'].find() + return set([d['productSymbol'] for d in cx]) # 这里返回的是集合(因为会重复) + + #---------------------------------------------------------------------- + def readFuturesSymbol(self): + """查询所有期货合约代码""" + cx = self.dbClient[SETTING_DB_NAME]['FuturesSymbol'].find() + return [d['symbol'] for d in cx] # 这里返回的是列表 + + #---------------------------------------------------------------------- + def downloadFuturesSymbol(self, tradeDate=''): + """下载所有期货的代码""" + if not tradeDate: + tradeDate = self.lastTradeDate() + + self.dbClient[SETTING_DB_NAME]['FuturesSymbol'].ensure_index([('symbol', pymongo.ASCENDING)], + unique=True) + + + path = 'api/market/getMktMFutd.json' + + params = {} + params['tradeDate'] = tradeDate + + data = self.datayesClient.downloadData(path, params) + + if data: + for d in data: + symbolDict = {} + symbolDict['symbol'] = d['ticker'] + symbolDict['productSymbol'] = d['contractObject'] + flt = {'symbol': d['ticker']} + + self.dbClient[SETTING_DB_NAME]['FuturesSymbol'].update_one(flt, {'$set':symbolDict}, + upsert=True) + print u'期货合约代码下载完成' + else: + print u'期货合约代码下载失败' + + #---------------------------------------------------------------------- + def downloadFuturesDailyBar(self, symbol): + """ + 下载期货合约的日行情,symbol是合约代码, + 若最后四位为0000(如IF0000),代表下载连续合约。 + """ + print u'开始下载%s日行情' %symbol + + # 查询数据库中已有数据的最后日期 + cl = self.dbClient[DAILY_DB_NAME][symbol] + cx = cl.find(sort=[('datetime', pymongo.DESCENDING)]) + if cx.count(): + last = cx[0] + else: + last = '' + + # 主力合约 + if '0000' in symbol: + path = 'api/market/getMktMFutd.json' + + params = {} + params['contractObject'] = symbol.replace('0000', '') + params['mainCon'] = 1 + if last: + params['startDate'] = last['date'] + # 交易合约 + else: + path = 'api/market/getMktFutd.json' + + params = {} + params['ticker'] = symbol + if last: + params['startDate'] = last['date'] + + # 开始下载数据 + data = self.datayesClient.downloadData(path, params) + + if data: + # 创建datetime索引 + self.dbClient[DAILY_DB_NAME][symbol].ensure_index([('datetime', pymongo.ASCENDING)], + unique=True) + + for d in data: + bar = CtaBarData() + bar.vtSymbol = symbol + bar.symbol = symbol + try: + bar.exchange = DATAYES_TO_VT_EXCHANGE.get(d.get('exchangeCD', ''), '') + bar.open = d.get('openPrice', 0) + bar.high = d.get('highestPrice', 0) + bar.low = d.get('lowestPrice', 0) + bar.close = d.get('closePrice', 0) + bar.date = d.get('tradeDate', '').replace('-', '') + bar.time = '' + bar.datetime = datetime.strptime(bar.date, '%Y%m%d') + bar.volume = d.get('turnoverVol', 0) + bar.openInterest = d.get('openInt', 0) + except KeyError: + print d + + flt = {'datetime': bar.datetime} + self.dbClient[DAILY_DB_NAME][symbol].update_one(flt, {'$set':bar.__dict__}, upsert=True) + + print u'%s下载完成' %symbol + else: + print u'找不到合约%s' %symbol + + #---------------------------------------------------------------------- + def downloadAllFuturesDailyBar(self): + """下载所有期货的主力合约日行情""" + start = time() + print u'开始下载所有期货的主力合约日行情' + + productSymbolSet = self.readFuturesProductSymbol() + + print u'代码列表读取成功,产品代码:%s' %productSymbolSet + + # 这里也测试了线程池,但可能由于下载函数中涉及较多的数据格 + # 式转换,CPU开销较大,多线程效率并无显著改变。 + #p = ThreadPool(10) + #p.map(self.downloadFuturesDailyBar, productSymbolSet) + #p.close() + #p.join() + + for productSymbol in productSymbolSet: + self.downloadFuturesDailyBar(productSymbol+'0000') + + print u'所有期货的主力合约日行情已经全部下载完成, 耗时%s秒' %(time()-start) + + #---------------------------------------------------------------------- + def downloadFuturesIntradayBar(self, symbol): + """下载期货的日内分钟行情""" + print u'开始下载%s日内分钟行情' %symbol + + # 日内分钟行情只有具体合约 + path = 'api/market/getFutureBarRTIntraDay.json' + + params = {} + params['instrumentID'] = symbol + params['unit'] = 1 + + data = self.datayesClient.downloadData(path, params) + + if data: + today = datetime.now().strftime('%Y%m%d') + + # 创建datetime索引 + self.dbClient[MINUTE_DB_NAME][symbol].ensure_index([('datetime', pymongo.ASCENDING)], + unique=True) + + for d in data: + bar = CtaBarData() + bar.vtSymbol = symbol + bar.symbol = symbol + try: + bar.exchange = DATAYES_TO_VT_EXCHANGE.get(d.get('exchangeCD', ''), '') + bar.open = d.get('openPrice', 0) + bar.high = d.get('highestPrice', 0) + bar.low = d.get('lowestPrice', 0) + bar.close = d.get('closePrice', 0) + bar.date = today + bar.time = d.get('barTime', '') + bar.datetime = datetime.strptime(bar.date + ' ' + bar.time, '%Y%m%d %H:%M') + bar.volume = d.get('totalVolume', 0) + bar.openInterest = 0 + except KeyError: + print d + + flt = {'datetime': bar.datetime} + self.dbClient[MINUTE_DB_NAME][symbol].update_one(flt, {'$set':bar.__dict__}, upsert=True) + + print u'%s下载完成' %symbol + else: + print u'找不到合约%s' %symbol + + #---------------------------------------------------------------------- + def downloadEquitySymbol(self, tradeDate=''): + """下载所有股票的代码""" + if not tradeDate: + tradeDate = self.lastTradeDate() + + self.dbClient[SETTING_DB_NAME]['EquitySymbol'].ensure_index([('symbol', pymongo.ASCENDING)], + unique=True) + + + path = 'api/market/getMktEqud.json' + + params = {} + params['tradeDate'] = tradeDate + + data = self.datayesClient.downloadData(path, params) + + if data: + for d in data: + symbolDict = {} + symbolDict['symbol'] = d['ticker'] + flt = {'symbol': d['ticker']} + + self.dbClient[SETTING_DB_NAME]['EquitySymbol'].update_one(flt, {'$set':symbolDict}, + upsert=True) + print u'股票代码下载完成' + else: + print u'股票代码下载失败' + + #---------------------------------------------------------------------- + def downloadEquityDailyBar(self, symbol): + """ + 下载股票的日行情,symbol是股票代码 + """ + print u'开始下载%s日行情' %symbol + + # 查询数据库中已有数据的最后日期 + cl = self.dbClient[DAILY_DB_NAME][symbol] + cx = cl.find(sort=[('datetime', pymongo.DESCENDING)]) + if cx.count(): + last = cx[0] + else: + last = '' + + # 开始下载数据 + path = 'api/market/getMktEqud.json' + + params = {} + params['ticker'] = symbol + if last: + params['beginDate'] = last['date'] + + data = self.datayesClient.downloadData(path, params) + + if data: + # 创建datetime索引 + self.dbClient[DAILY_DB_NAME][symbol].ensure_index([('datetime', pymongo.ASCENDING)], + unique=True) + + for d in data: + bar = CtaBarData() + bar.vtSymbol = symbol + bar.symbol = symbol + try: + bar.exchange = DATAYES_TO_VT_EXCHANGE.get(d.get('exchangeCD', ''), '') + bar.open = d.get('openPrice', 0) + bar.high = d.get('highestPrice', 0) + bar.low = d.get('lowestPrice', 0) + bar.close = d.get('closePrice', 0) + bar.date = d.get('tradeDate', '').replace('-', '') + bar.time = '' + bar.datetime = datetime.strptime(bar.date, '%Y%m%d') + bar.volume = d.get('turnoverVol', 0) + except KeyError: + print d + + flt = {'datetime': bar.datetime} + self.dbClient[DAILY_DB_NAME][symbol].update_one(flt, {'$set':bar.__dict__}, upsert=True) + + print u'%s下载完成' %symbol + else: + print u'找不到合约%s' %symbol + + + +#---------------------------------------------------------------------- +def loadMcCsv(fileName, dbName, symbol): + """将Multicharts导出的csv格式的历史数据插入到Mongo数据库中""" + import csv + + start = time() + print u'开始读取CSV文件%s中的数据插入到%s的%s中' %(fileName, dbName, symbol) + + # 锁定集合,并创建索引 + host, port = loadMongoSetting() + + client = pymongo.MongoClient(host, port) + collection = client[dbName][symbol] + collection.ensure_index([('datetime', pymongo.ASCENDING)], unique=True) + + # 读取数据和插入到数据库 + reader = csv.DictReader(file(fileName, 'r')) + for d in reader: + bar = CtaBarData() + bar.vtSymbol = symbol + bar.symbol = symbol + bar.open = float(d['Open']) + bar.high = float(d['High']) + bar.low = float(d['Low']) + bar.close = float(d['Close']) + bar.date = datetime.strptime(d['Date'], '%Y/%m/%d').strftime('%Y%m%d') + bar.time = d['Time'] + bar.datetime = datetime.strptime(bar.date + ' ' + bar.time, '%Y%m%d %H:%M:%S') + bar.volume = d['TotalVolume'] + + flt = {'datetime': bar.datetime} + collection.update_one(flt, {'$set':bar.__dict__}, upsert=True) + print bar.date, bar.time + + print u'插入完毕,耗时:%s' % (time()-start) + + +if __name__ == '__main__': + ## 简单的测试脚本可以写在这里 + #from time import sleep + #e = HistoryDataEngine() + #sleep(1) + #e.downloadEquityDailyBar('000001') + + # 这里将项目中包含的股指日内分钟线csv导入MongoDB,作者电脑耗时大约3分钟 + loadMcCsv('IF0000_1min.csv', MINUTE_DB_NAME, 'IF0000') diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaSetting.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaSetting.py new file mode 100644 index 0000000000..9115e9d201 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaSetting.py @@ -0,0 +1,14 @@ +# encoding: UTF-8 + +''' +在本文件中引入所有希望在系统中使用的策略类 + +这个字典中保存了需要运行的策略的名称和策略类的映射关系, +用户的策略类写好后,先在该文件中引入,并设置好名称,然后 +在CTA_setting.json中写入具体每个策略对象的类和合约设置。 +''' + +from ctaDemo import DoubleEmaDemo + +STRATEGY_CLASS = {} +STRATEGY_CLASS['DoubleEmaDemo'] = DoubleEmaDemo \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaTemplate.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaTemplate.py new file mode 100644 index 0000000000..2e4f57d496 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/ctaTemplate.py @@ -0,0 +1,173 @@ +# encoding: UTF-8 + +''' +本文件包含了CTA引擎中的策略开发用模板,开发策略时需要继承CtaTemplate类。 +''' + +from ctaBase import * +from vtConstant import * + + +######################################################################## +class CtaTemplate(object): + """CTA策略模板""" + + # 策略类的名称和作者 + className = 'CtaTemplate' + author = EMPTY_UNICODE + + # MongoDB数据库的名称,K线数据库默认为1分钟 + tickDbName = TICK_DB_NAME + barDbName = MINUTE_DB_NAME + + # 策略的基本参数 + name = EMPTY_UNICODE # 策略实例名称 + vtSymbol = EMPTY_STRING # 交易的合约vt系统代码 + productClass = EMPTY_STRING # 产品类型(只有IB接口需要) + currency = EMPTY_STRING # 货币(只有IB接口需要) + + # 策略的基本变量,由引擎管理 + inited = False # 是否进行了初始化 + trading = False # 是否启动交易,由引擎管理 + pos = 0 # 持仓情况 + + # 参数列表,保存了参数的名称 + paramList = ['name', + 'className', + 'author', + 'vtSymbol'] + + # 变量列表,保存了变量的名称 + varList = ['inited', + 'trading', + 'pos'] + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, setting): + """Constructor""" + self.ctaEngine = ctaEngine + + # 设置策略的参数 + if setting: + d = self.__dict__ + for key in self.paramList: + if key in setting: + d[key] = setting[key] + + #---------------------------------------------------------------------- + def onInit(self): + """初始化策略(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def onStart(self): + """启动策略(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def onStop(self): + """停止策略(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def onTick(self, tick): + """收到行情TICK推送(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def onOrder(self, order): + """收到委托变化推送(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def onTrade(self, trade): + """收到成交推送(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def onBar(self, bar): + """收到Bar推送(必须由用户继承实现)""" + raise NotImplementedError + + #---------------------------------------------------------------------- + def buy(self, price, volume, stop=False): + """买开""" + return self.sendOrder(CTAORDER_BUY, price, volume, stop) + + #---------------------------------------------------------------------- + def sell(self, price, volume, stop=False): + """卖平""" + return self.sendOrder(CTAORDER_SELL, price, volume, stop) + + #---------------------------------------------------------------------- + def short(self, price, volume, stop=False): + """卖开""" + return self.sendOrder(CTAORDER_SHORT, price, volume, stop) + + #---------------------------------------------------------------------- + def cover(self, price, volume, stop=False): + """买平""" + return self.sendOrder(CTAORDER_COVER, price, volume, stop) + + #---------------------------------------------------------------------- + def sendOrder(self, orderType, price, volume, stop=False): + """发送委托""" + if self.trading: + # 如果stop为True,则意味着发本地停止单 + if stop: + vtOrderID = self.ctaEngine.sendStopOrder(self.vtSymbol, orderType, price, volume, self) + else: + vtOrderID = self.ctaEngine.sendOrder(self.vtSymbol, orderType, price, volume, self) + return vtOrderID + else: + # 交易停止时发单返回空字符串 + return '' + + #---------------------------------------------------------------------- + def cancelOrder(self, vtOrderID): + """撤单""" + # 如果发单号为空字符串,则不进行后续操作 + if not vtOrderID: + return + + if STOPORDERPREFIX in vtOrderID: + self.ctaEngine.cancelStopOrder(vtOrderID) + else: + self.ctaEngine.cancelOrder(vtOrderID) + + #---------------------------------------------------------------------- + def insertTick(self, tick): + """向数据库中插入tick数据""" + self.ctaEngine.insertData(self.tickDbName, self.vtSymbol, tick) + + #---------------------------------------------------------------------- + def insertBar(self, bar): + """向数据库中插入bar数据""" + self.ctaEngine.insertData(self.barDbName, self.vtSymbol, bar) + + #---------------------------------------------------------------------- + def loadTick(self, days): + """读取tick数据""" + return self.ctaEngine.loadTick(self.tickDbName, self.vtSymbol, days) + + #---------------------------------------------------------------------- + def loadBar(self, days): + """读取bar数据""" + return self.ctaEngine.loadBar(self.barDbName, self.vtSymbol, days) + + #---------------------------------------------------------------------- + def writeCtaLog(self, content): + """记录CTA日志""" + content = self.name + ':' + content + self.ctaEngine.writeCtaLog(content) + + #---------------------------------------------------------------------- + def putEvent(self): + """发出策略状态变化事件""" + self.ctaEngine.putStrategyEvent(self.name) + + #---------------------------------------------------------------------- + def getEngineType(self): + """查询当前运行的环境""" + return self.ctaEngine.engineType + diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/datayes.json b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/datayes.json new file mode 100644 index 0000000000..e2d30eedda --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/datayes.json @@ -0,0 +1,5 @@ +{ + "domain": "http://api.wmcloud.com/data", + "version": "v1", + "token": "575593eb7696aec7339224c0fac2313780d8645f68b77369dcb35f8bcb419a0b" +} \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/datayesClient.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/datayesClient.py new file mode 100644 index 0000000000..4f0ceba78f --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/datayesClient.py @@ -0,0 +1,83 @@ +# encoding: UTF-8 + +'''一个简单的通联数据客户端,主要使用requests开发,比通联官网的python例子更为简洁。''' + + +import requests +import json + +FILENAME = 'datayes.json' +HTTP_OK = 200 + + +######################################################################## +class DatayesClient(object): + """通联数据客户端""" + + name = u'通联数据客户端' + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.domain = '' # 主域名 + self.version = '' # API版本 + self.token = '' # 授权码 + self.header = {} # http请求头部 + self.settingLoaded = False # 配置是否已经读取 + + self.loadSetting() + + #---------------------------------------------------------------------- + def loadSetting(self): + """载入配置""" + try: + path = os.path.abspath(os.path.dirname(__file__)) + FILENAME = os.path.join(path, FILENAME) + f = file(FILENAME) + except IOError: + print u'%s无法打开配置文件' % self.name + return + + setting = json.load(f) + try: + self.domain = str(setting['domain']) + self.version = str(setting['version']) + self.token = str(setting['token']) + except KeyError: + print u'%s配置文件字段缺失' % self.name + return + + self.header['Connection'] = 'keep_alive' + self.header['Authorization'] = 'Bearer ' + self.token + self.settingLoaded = True + + print u'%s配置载入完成' % self.name + + + #---------------------------------------------------------------------- + def downloadData(self, path, params): + """下载数据""" + if not self.settingLoaded: + print u'%s配置未载入' % self.name + return None + else: + url = '/'.join([self.domain, self.version, path]) + r = requests.get(url=url, headers=self.header, params=params) + + if r.status_code != HTTP_OK: + print u'%shttp请求失败,状态代码%s' %(self.name, r.status_code) + return None + else: + result = r.json() + if 'retMsg' in result and result['retMsg'] == 'Success': + return result['data'] + else: + if 'retMsg' in result: + print u'%s查询失败,返回信息%s' %(self.name, result['retMsg']) + elif 'message' in result: + print u'%s查询失败,返回信息%s' %(self.name, result['message']) + return None + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/strategyAtrRsi.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/strategyAtrRsi.py new file mode 100644 index 0000000000..bc37d35c83 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/strategyAtrRsi.py @@ -0,0 +1,290 @@ +# encoding: UTF-8 + +""" +一个ATR-RSI指标结合的交易策略,适合用在股指的1分钟和5分钟线上。 + +注意事项: +1. 作者不对交易盈利做任何保证,策略代码仅供参考 +2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装 +3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略 + +""" + + +from ctaBase import * +from ctaTemplate import CtaTemplate + +import talib +import numpy as np + + +######################################################################## +class AtrRsiStrategy(CtaTemplate): + """结合ATR和RSI指标的一个分钟线交易策略""" + className = 'AtrRsiStrategy' + author = u'用Python的交易员' + + # 策略参数 + atrLength = 22 # 计算ATR指标的窗口数 + atrMaLength = 10 # 计算ATR均线的窗口数 + rsiLength = 5 # 计算RSI的窗口数 + rsiEntry = 16 # RSI的开仓信号 + trailingPercent = 0.8 # 百分比移动止损 + initDays = 10 # 初始化数据所用的天数 + + # 策略变量 + bar = None # K线对象 + barMinute = EMPTY_STRING # K线当前的分钟 + + bufferSize = 100 # 需要缓存的数据的大小 + bufferCount = 0 # 目前已经缓存了的数据的计数 + highArray = np.zeros(bufferSize) # K线最高价的数组 + lowArray = np.zeros(bufferSize) # K线最低价的数组 + closeArray = np.zeros(bufferSize) # K线收盘价的数组 + + atrCount = 0 # 目前已经缓存了的ATR的计数 + atrArray = np.zeros(bufferSize) # ATR指标的数组 + atrValue = 0 # 最新的ATR指标数值 + atrMa = 0 # ATR移动平均的数值 + + rsiValue = 0 # RSI指标的数值 + rsiBuy = 0 # RSI买开阈值 + rsiSell = 0 # RSI卖开阈值 + intraTradeHigh = 0 # 移动止损用的持仓期内最高价 + intraTradeLow = 0 # 移动止损用的持仓期内最低价 + + orderList = [] # 保存委托代码的列表 + + # 参数列表,保存了参数的名称 + paramList = ['name', + 'className', + 'author', + 'vtSymbol', + 'atrLength', + 'atrMaLength', + 'rsiLength', + 'rsiEntry', + 'trailingPercent'] + + # 变量列表,保存了变量的名称 + varList = ['inited', + 'trading', + 'pos', + 'atrValue', + 'atrMa', + 'rsiValue', + 'rsiBuy', + 'rsiSell'] + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, setting): + """Constructor""" + super(AtrRsiStrategy, self).__init__(ctaEngine, setting) + + # 注意策略类中的可变对象属性(通常是list和dict等),在策略初始化时需要重新创建, + # 否则会出现多个策略实例之间数据共享的情况,有可能导致潜在的策略逻辑错误风险, + # 策略类中的这些可变对象属性可以选择不写,全都放在__init__下面,写主要是为了阅读 + # 策略时方便(更多是个编程习惯的选择) + + #---------------------------------------------------------------------- + def onInit(self): + """初始化策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略初始化' %self.name) + + # 初始化RSI入场阈值 + self.rsiBuy = 50 + self.rsiEntry + self.rsiSell = 50 - self.rsiEntry + + # 载入历史数据,并采用回放计算的方式初始化策略数值 + initData = self.loadBar(self.initDays) + for bar in initData: + self.onBar(bar) + + self.putEvent() + + #---------------------------------------------------------------------- + def onStart(self): + """启动策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略启动' %self.name) + self.putEvent() + + #---------------------------------------------------------------------- + def onStop(self): + """停止策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略停止' %self.name) + self.putEvent() + + #---------------------------------------------------------------------- + def onTick(self, tick): + """收到行情TICK推送(必须由用户继承实现)""" + # 计算K线 + tickMinute = tick.datetime.minute + + if tickMinute != self.barMinute: + if self.bar: + self.onBar(self.bar) + + bar = CtaBarData() + bar.vtSymbol = tick.vtSymbol + bar.symbol = tick.symbol + bar.exchange = tick.exchange + + bar.open = tick.lastPrice + bar.high = tick.lastPrice + bar.low = tick.lastPrice + bar.close = tick.lastPrice + + bar.date = tick.date + bar.time = tick.time + bar.datetime = tick.datetime # K线的时间设为第一个Tick的时间 + + self.bar = bar # 这种写法为了减少一层访问,加快速度 + self.barMinute = tickMinute # 更新当前的分钟 + else: # 否则继续累加新的K线 + bar = self.bar # 写法同样为了加快速度 + + bar.high = max(bar.high, tick.lastPrice) + bar.low = min(bar.low, tick.lastPrice) + bar.close = tick.lastPrice + + #---------------------------------------------------------------------- + def onBar(self, bar): + """收到Bar推送(必须由用户继承实现)""" + # 撤销之前发出的尚未成交的委托(包括限价单和停止单) + for orderID in self.orderList: + self.cancelOrder(orderID) + self.orderList = [] + + # 保存K线数据 + self.closeArray[0:self.bufferSize-1] = self.closeArray[1:self.bufferSize] + self.highArray[0:self.bufferSize-1] = self.highArray[1:self.bufferSize] + self.lowArray[0:self.bufferSize-1] = self.lowArray[1:self.bufferSize] + + self.closeArray[-1] = bar.close + self.highArray[-1] = bar.high + self.lowArray[-1] = bar.low + + self.bufferCount += 1 + if self.bufferCount < self.bufferSize: + return + + # 计算指标数值 + self.atrValue = talib.ATR(self.highArray, + self.lowArray, + self.closeArray, + self.atrLength)[-1] + self.atrArray[0:self.bufferSize-1] = self.atrArray[1:self.bufferSize] + self.atrArray[-1] = self.atrValue + + self.atrCount += 1 + if self.atrCount < self.bufferSize: + return + + self.atrMa = talib.MA(self.atrArray, + self.atrMaLength)[-1] + self.rsiValue = talib.RSI(self.closeArray, + self.rsiLength)[-1] + + # 判断是否要进行交易 + + # 当前无仓位 + if self.pos == 0: + self.intraTradeHigh = bar.high + self.intraTradeLow = bar.low + + # ATR数值上穿其移动平均线,说明行情短期内波动加大 + # 即处于趋势的概率较大,适合CTA开仓 + if self.atrValue > self.atrMa: + # 使用RSI指标的趋势行情时,会在超买超卖区钝化特征,作为开仓信号 + if self.rsiValue > self.rsiBuy: + # 这里为了保证成交,选择超价5个整指数点下单 + self.buy(bar.close+5, 1) + + elif self.rsiValue < self.rsiSell: + self.short(bar.close-5, 1) + + # 持有多头仓位 + elif self.pos > 0: + # 计算多头持有期内的最高价,以及重置最低价 + self.intraTradeHigh = max(self.intraTradeHigh, bar.high) + self.intraTradeLow = bar.low + # 计算多头移动止损 + longStop = self.intraTradeHigh * (1-self.trailingPercent/100) + # 发出本地止损委托,并且把委托号记录下来,用于后续撤单 + orderID = self.sell(longStop, 1, stop=True) + self.orderList.append(orderID) + + # 持有空头仓位 + elif self.pos < 0: + self.intraTradeLow = min(self.intraTradeLow, bar.low) + self.intraTradeHigh = bar.high + + shortStop = self.intraTradeLow * (1+self.trailingPercent/100) + orderID = self.cover(shortStop, 1, stop=True) + self.orderList.append(orderID) + + # 发出状态更新事件 + self.putEvent() + + #---------------------------------------------------------------------- + def onOrder(self, order): + """收到委托变化推送(必须由用户继承实现)""" + pass + + #---------------------------------------------------------------------- + def onTrade(self, trade): + pass + + +if __name__ == '__main__': + # 提供直接双击回测的功能 + # 导入PyQt4的包是为了保证matplotlib使用PyQt4而不是PySide,防止初始化出错 + from ctaBacktesting import * + from PyQt4 import QtCore, QtGui + + # 创建回测引擎 + engine = BacktestingEngine() + + # 设置引擎的回测模式为K线 + engine.setBacktestingMode(engine.BAR_MODE) + + # 设置回测用的数据起始日期 + engine.setStartDate('20120101') + + # 设置产品相关参数 + engine.setSlippage(0.2) # 股指1跳 + engine.setRate(0.3/10000) # 万0.3 + engine.setSize(300) # 股指合约大小 + + # 设置使用的历史数据库 + engine.setDatabase(MINUTE_DB_NAME, 'IF0000') + + ## 在引擎中创建策略对象 + #d = {'atrLength': 11} + #engine.initStrategy(AtrRsiStrategy, d) + + ## 开始跑回测 + ##engine.runBacktesting() + + ## 显示回测结果 + ##engine.showBacktestingResult() + + # 跑优化 + setting = OptimizationSetting() # 新建一个优化任务设置对象 + setting.setOptimizeTarget('capital') # 设置优化排序的目标是策略净盈利 + setting.addParameter('atrLength', 12, 20, 2) # 增加第一个优化参数atrLength,起始11,结束12,步进1 + setting.addParameter('atrMa', 20, 30, 5) # 增加第二个优化参数atrMa,起始20,结束30,步进1 + setting.addParameter('rsiLength', 5) # 增加一个固定数值的参数 + + # 性能测试环境:I7-3770,主频3.4G, 8核心,内存16G,Windows 7 专业版 + # 测试时还跑着一堆其他的程序,性能仅供参考 + import time + start = time.time() + + # 运行单进程优化函数,自动输出结果,耗时:359秒 + engine.runOptimization(AtrRsiStrategy, setting) + + # 多进程优化,耗时:89秒 + #engine.runParallelOptimization(AtrRsiStrategy, setting) + + print u'耗时:%s' %(time.time()-start) \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/README.md b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/README.md new file mode 100644 index 0000000000..67c59f1599 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/README.md @@ -0,0 +1,10 @@ +# CTA策略开发相关的工具代码 + +### ctaLineBar.py +* 简介:CTA策略开发中常用的K线类,可以基于tick自动生成K线,并提供EMA、DMI、ATR、RSI等常用技术指标的计算 +* 贡献者:李来佳 +* WeChat/QQ: 28888502 + +### multiTimeFrame +* 简介:基于CTA模块扩展了回测和交易功能,允许策略中引用辅助品种信息(其他时间框架、其他合约),同时提供了一个突破策略的例子 +* 贡献者:周正舟 diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/ctaLineBar.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/ctaLineBar.py new file mode 100644 index 0000000000..dfae9217af --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/ctaLineBar.py @@ -0,0 +1,842 @@ +# encoding: UTF-8 + +# AUTHOR:李来佳 +# WeChat/QQ: 28888502 + +from vtConstant import * +from ctaBase import * + +from datetime import datetime + +import talib as ta +import numpy +import copy,csv + + +DEBUGCTALOG = True + +class CtaLineBar(object): + """CTA K线""" + """ 使用方法: + 1、在策略构造函数__init()中初始化 + self.lineM = None # 1分钟K线 + lineMSetting = {} + lineMSetting['name'] = u'M1' + lineMSetting['barTimeInterval'] = 60 # 1分钟对应60秒 + lineMSetting['inputEma1Len'] = 7 # EMA线1的周期 + lineMSetting['inputEma2Len'] = 21 # EMA线2的周期 + lineMSetting['inputBollLen'] = 20 # 布林特线周期 + lineMSetting['inputBollStdRate'] = 2 # 布林特线标准差 + lineMSetting['minDiff'] = self.minDiff # 最小条 + lineMSetting['shortSymbol'] = self.shortSymbol #商品短号 + self.lineM = CtaLineBar(self, self.onBar, lineMSetting) + 2、在onTick()中,需要导入tick数据 + self.lineM.onTick(tick) + self.lineM5.onTick(tick) # 如果你使用2个周期 + 3、在onBar事件中,按照k线结束使用;其他任何情况下bar内使用,通过对象使用即可,self.lineM.lineBar[-1].close + """ + + # 参数列表,保存了参数的名称 + paramList = ['vtSymbol'] + + def __init__(self, strategy, onBarFunc, setting=None,): + + # OnBar事件回调函数 + self.onBarFunc = onBarFunc + + # 参数列表 + self.paramList.append('barTimeInterval') + self.paramList.append('inputPreLen') + self.paramList.append('inputEma1Len') + self.paramList.append('inputEma2Len') + self.paramList.append('inputDmiLen') + self.paramList.append('inputDmiMax') + self.paramList.append('inputAtr1Len') + self.paramList.append('inputAtr2Len') + self.paramList.append('inputAtr3Len') + self.paramList.append('inputVolLen') + self.paramList.append('inputRsiLen') + self.paramList.append('inputCmiLen') + self.paramList.append('inputBollLen') + self.paramList.append('inputBollStdRate') + + + self.paramList.append('minDiff') + self.paramList.append('shortSymbol') + self.paramList.append('activeDayJump') + self.paramList.append('name') + + + # 输入参数 + self.name = u'LineBar' + self.barTimeInterval = 300 + + self.inputPreLen = EMPTY_INT #1 + + self.inputEma1Len = EMPTY_INT # 13 + self.inputEma2Len = EMPTY_INT # 21 + + self.inputDmiLen = EMPTY_INT # 14 # DMI的计算周期 + self.inputDmiMax = EMPTY_FLOAT # 30 # Dpi和Mdi的突破阈值 + + self.inputAtr1Len = EMPTY_INT # 10 # ATR波动率的计算周期(近端) + self.inputAtr2Len = EMPTY_INT # 26 # ATR波动率的计算周期(常用) + self.inputAtr3Len = EMPTY_INT # 50 # ATR波动率的计算周期(远端) + + self.inputVolLen = EMPTY_INT # 14 # 平均交易量的计算周期 + + self.inputRsiLen = EMPTY_INT # 7 # RSI 相对强弱指数 + + self.shortSymbol = EMPTY_STRING # 商品的短代码 + self.minDiff = 1 # 商品的最小价格单位 + + self.activeDayJump = False # 隔夜跳空 + + # 当前的Tick + self.curTick = None + + # K 线服务的策略 + self.strategy = strategy + + # K线保存数据 + self.bar = None # K线数据对象 + self.lineBar = [] # K线缓存数据队列 + self.barFirstTick =False # K线的第一条Tick数据 + + # K 线的相关计算结果数据 + + self.preHigh = [] # K线的前inputPreLen的的最高 + self.preLow = [] # K线的前inputPreLen的的最低 + + self.lineEma1 = [] # K线的EMA1均线,周期是InputEmaLen1,包含当前bar + self.lineEma1MtmRate = [] # K线的EMA1均线 的momentum(3) 动能 + + self.lineEma2 = [] # K线的EMA2均线,周期是InputEmaLen2,包含当前bar + self.lineEma2MtmRate = [] # K线的EMA2均线 的momentum(3) 动能 + + # K线的DMI( Pdi,Mdi,ADX,Adxr) 计算数据 + self.barPdi = EMPTY_FLOAT # bar内的升动向指标,即做多的比率 + self.barMdi = EMPTY_FLOAT # bar内的下降动向指标,即做空的比率 + + self.linePdi = [] # 升动向指标,即做多的比率 + self.lineMdi = [] # 下降动向指标,即做空的比率 + + self.lineDx = [] # 趋向指标列表,最大长度为inputM*2 + self.barAdx = EMPTY_FLOAT # Bar内计算的平均趋向指标 + self.lineAdx = [] # 平均趋向指标 + self.barAdxr = EMPTY_FLOAT # 趋向平均值,为当日ADX值与M日前的ADX值的均值 + self.lineAdxr = [] # 平均趋向变化指标 + + # K线的基于DMI、ADX计算的结果 + self.barAdxTrend = EMPTY_FLOAT # ADX值持续高于前一周期时,市场行情将维持原趋势 + self.barAdxrTrend = EMPTY_FLOAT # ADXR值持续高于前一周期时,波动率比上一周期高 + + self.buyFilterCond = False # 多过滤器条件,做多趋势的判断,ADX高于前一天,上升动向> inputMM + self.sellFilterCond = False # 空过滤器条件,做空趋势的判断,ADXR高于前一天,下降动向> inputMM + + # K线的ATR技术数据 + self.lineAtr1 = [] # K线的ATR1,周期为inputAtr1Len + self.lineAtr2 = [] # K线的ATR2,周期为inputAtr2Len + self.lineAtr3 = [] # K线的ATR3,周期为inputAtr3Len + + self.barAtr1 = EMPTY_FLOAT + self.barAtr2 = EMPTY_FLOAT + self.barAtr3 = EMPTY_FLOAT + + # K线的交易量平均 + self.lineAvgVol = [] # K 线的交易量平均 + + # K线的RSI计算数据 + self.lineRsi = [] # 记录K线对应的RSI数值,只保留inputRsiLen*8 + + self.lowRsi = 30 # RSI的最低线 + self.highRsi = 70 # RSI的最高线 + + self.lineRsiTop = [] # 记录RSI的最高峰,只保留 inputRsiLen个 + self.lineRsiButtom = [] # 记录RSI的最低谷,只保留 inputRsiLen个 + self.lastRsiTopButtom = None # 最近的一个波峰/波谷 + + # K线的CMI计算数据 + self.inputCmiLen = EMPTY_INT + self.lineCmi = [] # 记录K线对应的Cmi数值,只保留inputCmiLen*8 + + # K线的布林特计算数据 + self.inputBollLen = EMPTY_INT # K线周期 + self.inputBollStdRate = 1.5 # 两倍标准差 + + self.lineUpperBand = [] # 上轨 + self.lineMiddleBand = [] # 中线 + self.lineLowerBand = [] # 下轨 + + if setting: + self.setParam(setting) + + def setParam(self, setting): + """设置参数""" + d = self.__dict__ + for key in self.paramList: + if key in setting: + + d[key] = setting[key] + + def onTick(self, tick): + """行情更新 + :type tick: object + """ + # Tick 有效性检查 + #if (tick.datetime- datetime.now()).seconds > 10: + # self.writeCtaLog(u'无效的tick时间:{0}'.format(tick.datetime)) + # return + + if tick.datetime.hour == 8 or tick.datetime.hour == 20: + self.writeCtaLog(u'竞价排名tick时间:{0}'.format(tick.datetime)) + return + + self.curTick = tick + + # 3.生成x K线,若形成新Bar,则触发OnBar事件 + self.__drawLineBar(tick) + + def addBar(self,bar): + """予以外部初始化程序增加bar""" + l1 = len(self.lineBar) + + if l1 == 0: + self.lineBar.append(bar) + self.onBar(bar) + return + + # 与最后一个BAR的时间比对,判断是否超过K线的周期 + lastBar = self.lineBar[-1] + + if (bar.datetime - lastBar.datetime).seconds >= self.barTimeInterval: + self.lineBar.append(bar) + self.onBar(bar) + return + + # 更新最后一个bar + lastBar.close = bar.close + lastBar.high = max(lastBar.high, bar.high) + lastBar.low = min(lastBar.low, bar.low) + lastBar.volume = lastBar.volume + bar.volume + + + def onBar(self, bar): + """OnBar事件""" + # 计算相关数据 + self.__recountPreHighLow() + self.__recountEma() + self.__recountDmi() + self.__recountAtr() + self.__recoundAvgVol() + self.__recountRsi() + self.__recountCmi() + self.__recountBoll() + + + # 回调上层调用者 + self.onBarFunc(bar) + + + def __firstTick(self,tick): + """ K线的第一个Tick数据""" + self.bar = CtaBarData() # 创建新的K线 + + self.bar.vtSymbol = tick.vtSymbol + self.bar.symbol = tick.symbol + self.bar.exchange = tick.exchange + + self.bar.open = tick.lastPrice # O L H C + self.bar.high = tick.lastPrice + self.bar.low = tick.lastPrice + self.bar.close = tick.lastPrice + + # K线的日期时间 + self.bar.date = tick.date # K线的日期时间(去除秒)设为第一个Tick的时间 + self.bar.time = tick.time # K线的日期时间(去除秒)设为第一个Tick的时间 + self.bar.datetime = tick.datetime + + self.bar.volume = tick.volume + self.bar.openInterest = tick.openInterest + + self.barFirstTick = True # 标识该Tick属于该Bar的第一个tick数据 + + self.lineBar.append(self.bar) # 推入到lineBar队列 + + # ---------------------------------------------------------------------- + def __drawLineBar(self, tick): + """生成 line Bar """ + + l1 = len(self.lineBar) + + # 保存第一个K线数据 + if l1 == 0: + self.__firstTick(tick) + self.onBar(self.bar) + return + + # 清除8交易小时前的数据, + if l1 > 60 * 8: + del self.lineBar[0] + + # 与最后一个BAR的时间比对,判断是否超过5分钟 + lastBar = self.lineBar[-1] + + # 专门处理隔夜跳空。隔夜跳空会造成开盘后EMA和ADX的计算错误。 + if len(self.lineAtr2) < 1: + priceInBar = 5 * self.minDiff + else: + priceInBar = self.lineAtr2[-1] + + jumpBars = int(abs(tick.lastPrice - lastBar.close)/priceInBar) + + # 开盘时间 + if (tick.datetime.hour == 9 or tick.datetime.hour == 21) \ + and tick.datetime.minute == 0 and tick.datetime.second == 0 \ + and lastBar.datetime.hour != tick.datetime.hour \ + and jumpBars > 0 and self.activeDayJump: + + priceInYesterday = lastBar.close + + self.writeCtaLog(u'line Bar jumpbars:{0}'.format(jumpBars)) + + if tick.lastPrice > priceInYesterday: # 价格往上跳 + + # 生成砖块递增K线,减小ATR变动 + for i in range(0, jumpBars, 1): + upbar = copy.deepcopy(lastBar) + upbar.open = priceInYesterday + float(i * priceInBar) + upbar.low = upbar.open + upbar.close = priceInYesterday + float((i+1) * priceInBar) + upbar.high = upbar.close + upbar.volume = 0 + + self.lineBar.append(upbar) + self.onBar(upbar) + + else: # 价格往下跳 + # 生成递减K线,减小ATR变动 + for i in range(0, jumpBars, 1): + + downbar = copy.deepcopy(lastBar) + downbar.open = priceInYesterday - float(i * priceInBar) + downbar.high = downbar.open + downbar.close = priceInYesterday - float((i+1) * priceInBar) + downbar.low = downbar.close + downbar.volume = 0 + + self.lineBar.append(downbar) + self.onBar(downbar) + + # 生成平移K线,减小Pdi,Mdi、ADX变动 + for i in range(0, jumpBars*2, 1): + equalbar=copy.deepcopy(self.lineBar[-1]) + equalbar.volume = 0 + self.lineBar.append(equalbar) + self.onBar(equalbar) + + # 重新指定为最后一个Bar + lastBar = self.lineBar[-1] + + # 处理日内的间隔时段最后一个tick,如10:15分,11:30分,15:00 和 2:30分 + endtick = False + if (tick.datetime.hour == 10 and tick.datetime.minute == 15 ) \ + or (tick.datetime.hour == 11 and tick.datetime.minute == 30 ) \ + or (tick.datetime.hour == 15 and tick.datetime.minute == 00 ) \ + or (tick.datetime.hour == 2 and tick.datetime.minute == 30 ): + endtick = True + + if self.shortSymbol in NIGHT_MARKET_SQ2 and tick.datetime.hour == 1 and tick.datetime.minute == 00: + endtick = True + + if self.shortSymbol in NIGHT_MARKET_SQ3 and tick.datetime.hour == 23 and tick.datetime.minute == 00: + endtick = True + + if self.shortSymbol in NIGHT_MARKET_ZZ or self.shortSymbol in NIGHT_MARKET_DL: + if tick.datetime.hour == 23 and tick.datetime.minute == 30: + endtick = True + + # 满足时间要求 + if (tick.datetime-lastBar.datetime).seconds >= self.barTimeInterval and not endtick: + + # 创建并推入新的Bar + self.__firstTick(tick) + # 触发OnBar事件 + self.onBar(lastBar) + + else: + # 更新当前最后一个bar + self.barFirstTick = False + + # 更新最高价、最低价、收盘价、成交量 + lastBar.high = max(lastBar.high, tick.lastPrice) + lastBar.low = min(lastBar.low, tick.lastPrice) + lastBar.close = tick.lastPrice + lastBar.volume = lastBar.volume + tick.volume + + # 更新Bar的颜色 + if lastBar.close > lastBar.open: + lastBar.color = COLOR_RED + elif lastBar.close < lastBar.open: + lastBar.color = COLOR_BLUE + else: + lastBar.color = COLOR_EQUAL + + # ---------------------------------------------------------------------- + def __recountPreHighLow(self): + """计算 K线的前周期最高和最低""" + + if self.inputPreLen <= 0: # 不计算 + return + + # 1、lineBar满足长度才执行计算 + if len(self.lineBar) < self.inputPreLen: + self.writeCtaLog(u'数据未充分,当前Bar数据数量:{0},计算High、Low需要:{1}'. + format(len(self.lineBar), self.inputPreLen)) + return + + # 2.计算前inputPreLen周期内(不包含当前周期)的Bar高点和低点 + preHigh = EMPTY_FLOAT + preLow = EMPTY_FLOAT + + for i in range(len(self.lineBar)-2, len(self.lineBar)-2-self.inputPreLen, -1): + + if self.lineBar[i].high > preHigh or preHigh == EMPTY_FLOAT: + preHigh = self.lineBar[i].high # 前InputPreLen周期高点 + + if self.lineBar[i].low < preLow or preLow == EMPTY_FLOAT: + preLow = self.lineBar[i].low # 前InputPreLen周期低点 + + # 保存 + if len(self.preHigh) > self.inputPreLen * 8: + del self.preHigh[0] + self.preHigh.append(preHigh) + + # 保存 + if len(self.preLow)> self.inputPreLen * 8: + del self.preLow[0] + self.preLow.append(preLow) + + #---------------------------------------------------------------------- + + + def __recountEma(self): + """计算K线的EMA1 和EMA2""" + l = len(self.lineBar) + + # 1、lineBar满足长度才执行计算 + if len(self.lineBar) < max(7, self.inputEma1Len, self.inputEma2Len)+2: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算EMA需要:{1}'. + format(len(self.lineBar), max(7, self.inputEma1Len, self.inputEma2Len)+2)) + return + + # 计算第一条EMA均线 + if self.inputEma1Len > 0: + + if self.inputEma1Len > l: + ema1Len = l + else: + ema1Len = self.inputEma1Len + + # 3、获取前InputN周期(不包含当前周期)的自适应均线 + listClose=[x.close for x in self.lineBar[-ema1Len - 1:-1]] + + barEma1 = ta.EMA(numpy.array(listClose, dtype=float), ema1Len)[-1] + + barEma1 = round(float(barEma1), 3) + + if len(self.lineEma1) > self.inputEma1Len*8: + del self.lineEma1[0] + self.lineEma1.append(barEma1) + + # 计算第二条EMA均线 + if self.inputEma2Len > 0: + + if self.inputEma2Len > l: + ema2Len = l + else: + ema2Len = self.inputEma2Len + + # 3、获取前InputN周期(不包含当前周期)的自适应均线 + listClose=[x.close for x in self.lineBar[-ema2Len - 1:-1]] + barEma2 = ta.EMA(numpy.array(listClose, dtype=float), ema2Len)[-1] + + barEma2 = round(float(barEma2), 3) + + if len(self.lineEma2) > self.inputEma1Len*8: + del self.lineEma2[0] + self.lineEma2.append(barEma2) + + + def __recountDmi(self): + """计算K线的DMI数据和条件""" + + if self.inputDmiLen <= 0: # 不计算 + return + + # 1、lineMx满足长度才执行计算 + if len(self.lineBar) < self.inputDmiLen+1: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算DMI需要:{1}'.format(len(self.lineBar), self.inputDmiLen+1)) + return + + + # 2、根据当前High,Low,(不包含当前周期)重新计算TR1,PDM,MDM和ATR + barTr1 = EMPTY_FLOAT # 获取InputP周期内的价差最大值之和 + barPdm = EMPTY_FLOAT # InputP周期内的做多价差之和 + barMdm = EMPTY_FLOAT # InputP周期内的做空价差之和 + + for i in range(len(self.lineBar)-2, len(self.lineBar)-2-self.inputDmiLen, -1): # 周期 inputDmiLen + # 3.1、计算TR1 + + # 当前周期最高与最低的价差 + high_low_spread = self.lineBar[i].high - self.lineBar[i].low + # 当前周期最高与昨收价的价差 + high_preclose_spread = abs(self.lineBar[i].high - self.lineBar[i - 1].close) + # 当前周期最低与昨收价的价差 + low_preclose_spread = abs(self.lineBar[i].low - self.lineBar[i - 1].close) + + # 最大价差 + max_spread = max(high_low_spread, high_preclose_spread, low_preclose_spread) + barTr1 = barTr1 + float(max_spread) + + # 今高与昨高的价差 + high_prehigh_spread = self.lineBar[i].high - self.lineBar[i - 1].high + # 昨低与今低的价差 + low_prelow_spread = self.lineBar[i - 1].low - self.lineBar[i].low + + # 3.2、计算周期内的做多价差之和 + if high_prehigh_spread > 0 and high_prehigh_spread > low_prelow_spread: + barPdm = barPdm + high_prehigh_spread + + # 3.3、计算周期内的做空价差之和 + if low_prelow_spread > 0 and low_prelow_spread > high_prehigh_spread: + barMdm = barMdm + low_prelow_spread + + # 6、计算上升动向指标,即做多的比率 + if barTr1 == 0: + self.barPdi = 0 + else: + self.barPdi = barPdm * 100 / barTr1 + + if len(self.linePdi) > self.inputDmiLen+1: + del self.linePdi[0] + + self.linePdi.append(self.barPdi) + + # 7、计算下降动向指标,即做空的比率 + if barTr1 == 0: + self.barMdi = 0 + else: + self.barMdi = barMdm * 100 / barTr1 + + # 8、计算平均趋向指标 Adx,Adxr + if self.barMdi + self.barPdi == 0: + dx = 0 + else: + dx = 100 * abs(self.barMdi - self.barPdi) / (self.barMdi + self.barPdi) + + if len(self.lineMdi) > self.inputDmiLen+1: + del self.lineMdi[0] + + self.lineMdi.append(self.barMdi) + + if len(self.lineDx) > self.inputDmiLen+1: + del self.lineDx[0] + + self.lineDx.append(dx) + + # 平均趋向指标,MA计算 + if len(self.lineDx) < self.inputDmiLen+1: + self.barAdx = dx + else: + self.barAdx = ta.EMA(numpy.array(self.lineDx, dtype=float), self.inputDmiLen)[-1] + + # 保存Adx值 + if len(self.lineAdx) > self.inputDmiLen+1: + del self.lineAdx[0] + + self.lineAdx.append(self.barAdx) + + # 趋向平均值,为当日ADX值与1周期前的ADX值的均值 + if len(self.lineAdx) == 1: + self.barAdxr = self.lineAdx[-1] + else: + self.barAdxr = (self.lineAdx[-1] + self.lineAdx[-2]) / 2 + + # 保存Adxr值 + if len(self.lineAdxr) > self.inputDmiLen+1: + del self.lineAdxr[0] + self.lineAdxr.append(self.barAdxr) + + # 7、计算A,ADX值持续高于前一周期时,市场行情将维持原趋势 + if len(self.lineAdx) < 2: + self.barAdxTrend = False + elif self.lineAdx[-1] > self.lineAdx[-2]: + self.barAdxTrend = True + else: + self.barAdxTrend = False + + # ADXR值持续高于前一周期时,波动率比上一周期高 + if len(self.lineAdxr) < 2: + self.barAdxrTrend = False + elif self.lineAdxr[-1] > self.lineAdxr[-2]: + self.barAdxrTrend = True + else: + self.barAdxrTrend = False + + # 多过滤器条件,做多趋势,ADX高于前一天,上升动向> inputDmiMax + if self.barPdi > self.barMdi and self.barAdxTrend and self.barAdxrTrend and self.barPdi >= self.inputDmiMax: + self.buyFilterCond = True + + self.writeCtaLog(u'{0}[DEBUG]Buy Signal On Bar,Pdi:{1}>Mdi:{2},adx[-1]:{3}>Adx[-2]:{4}' + .format(self.curTick.datetime, self.barPdi, self.barMdi, self.lineAdx[-1], self.lineAdx[-2])) + else: + self.buyFilterCond = False + + # 空过滤器条件 做空趋势,ADXR高于前一天,下降动向> inputMM + if self.barPdi < self.barMdi and self.barAdxTrend and self.barAdxrTrend and self.barMdi >= self.inputDmiMax: + self.sellFilterCond = True + + self.writeCtaLog(u'{0}[DEBUG]Short Signal On Bar,Pdi:{1}Adx[-2]:{4}' + .format(self.curTick.datetime, self.barPdi, self.barMdi, self.lineAdx[-1], self.lineAdx[-2])) + else: + self.sellFilterCond = False + + def __recountAtr(self): + """计算Mx K线的各类数据和条件""" + + # 1、lineMx满足长度才执行计算 + maxAtrLen = max(self.inputAtr1Len, self.inputAtr2Len, self.inputAtr3Len) + + if maxAtrLen <= 0: # 不计算 + return + + if len(self.lineBar) < maxAtrLen+1: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算ATR需要:{1}'. + format(len(self.lineBar), maxAtrLen+1)) + return + + # 首次计算 + if (self.inputAtr1Len > 0 and len(self.lineAtr1) < 1) \ + or (self.inputAtr2Len > 0 and len(self.lineAtr2) < 1) \ + or (self.inputAtr3Len > 0 and len(self.lineAtr3) < 1): + + # 根据当前High,Low,(不包含当前周期)重新计算TR1和ATR + barTr1 = EMPTY_FLOAT # 获取inputAtr1Len周期内的价差最大值之和 + barTr2 = EMPTY_FLOAT # 获取inputAtr2Len周期内的价差最大值之和 + barTr3 = EMPTY_FLOAT # 获取inputAtr3Len周期内的价差最大值之和 + + j = 0 + for i in range(len(self.lineBar)-2, len(self.lineBar)-2-maxAtrLen, -1): # 周期 inputP + # 3.1、计算TR + + # 当前周期最高与最低的价差 + high_low_spread = self.lineBar[i].high - self.lineBar[i].low + # 当前周期最高与昨收价的价差 + high_preclose_spread = abs(self.lineBar[i].high - self.lineBar[i - 1].close) + # 当前周期最低与昨收价的价差 + low_preclose_spread = abs(self.lineBar[i].low - self.lineBar[i - 1].close) + + # 最大价差 + max_spread = max(high_low_spread, high_preclose_spread, low_preclose_spread) + if j < self.inputAtr1Len: + barTr1 = barTr1 + float(max_spread) + if j < self.inputAtr2Len: + barTr2 = barTr2 + float(max_spread) + if j < self.inputAtr3Len: + barTr3 = barTr3 + float(max_spread) + + j = j + 1 + + else: # 只计算一个 + + # 当前周期最高与最低的价差 + high_low_spread = self.lineBar[-2].high - self.lineBar[-2].low + # 当前周期最高与昨收价的价差 + high_preclose_spread = abs(self.lineBar[-2].high - self.lineBar[-3].close) + # 当前周期最低与昨收价的价差 + low_preclose_spread = abs(self.lineBar[-2].low - self.lineBar[-3].close) + + # 最大价差 + barTr1 = max(high_low_spread, high_preclose_spread, low_preclose_spread) + barTr2 = barTr1 + barTr3 = barTr1 + + # 计算 ATR + if self.inputAtr1Len > 0: + if len(self.lineAtr1) < 1: + self.barAtr1 = round(barTr1 / self.inputAtr1Len, 3) + else: + self.barAtr1 = round((self.lineAtr1[-1]*(self.inputAtr1Len -1) + barTr1) / self.inputAtr1Len, 3) + + if len(self.lineAtr1) > self. inputAtr1Len+1 : + del self.lineAtr1[0] + self.lineAtr1.append(self.barAtr1) + + if self.inputAtr2Len > 0: + if len(self.lineAtr2) < 1: + self.barAtr2 = round(barTr2 / self.inputAtr2Len, 3) + else: + self.barAtr2 = round((self.lineAtr2[-1]*(self.inputAtr2Len -1) + barTr2) / self.inputAtr2Len, 3) + + if len(self.lineAtr2) > self. inputAtr2Len+1: + del self.lineAtr2[0] + self.lineAtr2.append(self.barAtr2) + + if self.inputAtr3Len > 0: + if len(self.lineAtr3) < 1: + self.barAtr3 = round(barTr3 / self.inputAtr3Len, 3) + else: + self.barAtr3 = round((self.lineAtr3[-1]*(self.inputAtr3Len -1) + barTr3) / self.inputAtr3Len, 3) + + if len(self.lineAtr3) > self. inputAtr3Len+1: + del self.lineAtr3[0] + + self.lineAtr3.append(self.barAtr3) + + #---------------------------------------------------------------------- + def __recoundAvgVol(self): + """计算平均成交量""" + + # 1、lineBar满足长度才执行计算 + if self.inputVolLen <= 0: # 不计算 + return + + if len(self.lineBar) < self.inputVolLen+1: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算Avg Vol需要:{1}'. + format(len(self.lineBar), self.inputVolLen+1)) + return + + listVol = [x.volume for x in self.lineBar[-self.inputVolLen-1: -1]] + + sumVol = ta.SUM(numpy.array(listVol, dtype=float), timeperiod=self.inputVolLen)[-1] + + avgVol = round(sumVol/self.inputVolLen, 0) + + self.lineAvgVol.append(avgVol) + + # ---------------------------------------------------------------------- + def __recountRsi(self): + """计算K线的RSI""" + + if self.inputRsiLen <= 0: return + + # 1、lineBar满足长度才执行计算 + if len(self.lineBar) < self.inputRsiLen+2: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算RSI需要:{1}'. + format(len(self.lineBar), self.inputRsiLen+2)) + return + + # 3、inputRsiLen(包含当前周期)的相对强弱 + listClose=[x.close for x in self.lineBar[-self.inputRsiLen - 2:]] + barRsi = ta.RSI(numpy.array(listClose, dtype=float), self.inputRsiLen)[-1] + barRsi = round(float(barRsi), 3) + + l = len(self.lineRsi) + if l > self.inputRsiLen*8: + del self.lineRsi[0] + + self.lineRsi.append(barRsi) + + if l > 3: + # 峰 + if self.lineRsi[-1] < self.lineRsi[-2] and self.lineRsi[-3] < self.lineRsi[-2]: + + t={} + t["Type"] = u'T' + t["RSI"] = self.lineRsi[-2] + t["Close"] = self.lineBar[-2].close + + + if len(self.lineRsiTop) > self.inputRsiLen: + del self.lineRsiTop[0] + + self.lineRsiTop.append( t ) + self.lastRsiTopButtom = self.lineRsiTop[-1] + + # 谷 + elif self.lineRsi[-1] > self.lineRsi[-2] and self.lineRsi[-3] > self.lineRsi[-2]: + + b={} + b["Type"] = u'B' + b["RSI"] = self.lineRsi[-2] + b["Close"] = self.lineBar[-2].close + + if len(self.lineRsiButtom) > self.inputRsiLen: + del self.lineRsiButtom[0] + self.lineRsiButtom.append(b) + self.lastRsiTopButtom = self.lineRsiButtom[-1] + + def __recountCmi(self): + """市场波动指数(Choppy Market Index,CMI)是一个用来判断市场走势类型的技术分析指标。 + 它通过计算当前收盘价与一定周期前的收盘价的差值与这段时间内价格波动的范围的比值,来判断目前的股价走势是趋势还是盘整。 + 市场波动指数CMI的计算公式: + CMI=(Abs(Close-ref(close,(n-1)))*100/(HHV(high,n)-LLV(low,n)) + 其中,Abs是绝对值。 + n是周期数,例如30。 + 市场波动指数CMI的使用方法: + 这个指标的重要用途是来区分目前的股价走势类型:盘整,趋势。当CMI指标小于20时,市场走势是盘整;当CMI指标大于20时,市场在趋势期。 + CMI指标还可以用于预测股价走势类型的转变。因为物极必反,当CMI长期处于0附近,此时,股价走势很可能从盘整转为趋势;当CMI长期处于100附近,此时,股价趋势很可能变弱,形成盘整。 + """ + + if self.inputCmiLen <= EMPTY_INT: return + + # 1、lineBar满足长度才执行计算 + if len(self.lineBar) < self.inputCmiLen: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算CMI需要:{1}'. + format(len(self.lineBar), self.inputCmiLen)) + return + + listClose =[x.close for x in self.lineBar[-self.inputCmiLen:]] + hhv = max(listClose) + llv = min(listClose) + + if hhv==llv: + cmi = 100 + else: + cmi = abs(self.lineBar[-1].close-self.lineBar[-2].close)*100/(hhv-llv) + + cmi = round(cmi, 2) + + if len(self.lineCmi) > self.inputCmiLen: + del self.lineCmi[0] + + self.lineCmi.append(cmi) + + def __recountBoll(self): + """布林特线""" + if self.inputBollLen < EMPTY_INT: return + + l = len(self.lineBar) + + if l < min(7, self.inputBollLen)+1: + self.debugCtaLog(u'数据未充分,当前Bar数据数量:{0},计算Boll需要:{1}'. + format(len(self.lineBar), min(7, self.inputBollLen)+1)) + return + + if l < self.inputBollLen+2: + bollLen = l-1 + else: + bollLen = self.inputBollLen + + # 不包含当前最新的Bar + listClose=[x.close for x in self.lineBar[-bollLen - 1:-1]] + # + upper, middle, lower = ta.BBANDS(numpy.array(listClose, dtype=float), + timeperiod=bollLen, nbdevup=self.inputBollStdRate, + nbdevdn=self.inputBollStdRate, matype=0) + + self.lineUpperBand.append(upper[-1]) + self.lineMiddleBand.append(middle[-1]) + self.lineLowerBand.append(lower[-1]) + + + # ---------------------------------------------------------------------- + def writeCtaLog(self, content): + """记录CTA日志""" + self.strategy.writeCtaLog(u'['+self.name+u']'+content) + + def debugCtaLog(self,content): + """记录CTA日志""" + if DEBUGCTALOG: + self.strategy.writeCtaLog(u'['+self.name+u'-DEBUG]'+content) \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/Screen Shot 2016-11-08 at 9.08.47 PM.png b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/Screen Shot 2016-11-08 at 9.08.47 PM.png new file mode 100644 index 0000000000..ca857f31d2 Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/Screen Shot 2016-11-08 at 9.08.47 PM.png differ diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/ctaBacktestMultiTF.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/ctaBacktestMultiTF.py new file mode 100644 index 0000000000..cc5c257917 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/ctaBacktestMultiTF.py @@ -0,0 +1,208 @@ +# encoding: UTF-8 + +''' +这个文件加入在CTA回测引擎的基础上加入了辅助品种信息, 保持接口的一致, 可以在原CTA引擎上执行的代码, +也可以在这个引擎上执行 +This file add multi Time Frame functionalities to CTA backtesting engine, the APIs are the +same as CTA engine. Real trading code can be directly used for backtesting. +''' + +from __future__ import division +from vtFunction import loadMongoSetting + +from ctaBacktesting import * + +class BacktestEngineMultiTF(BacktestingEngine): + + def __init__(self): + """Constructor""" + super(BacktestEngineMultiTF, self).__init__() + + self.info_symbols = [] # List, 输入辅助品种的2值tuple, 左边为数据库名, 右边为collection名 + self.InfoCursor = {} # Dict, 放置回测用辅助品种数据库 + self.initInfoCursor = {} # Dict, 放置初始化用辅助品种数据库 + self.infobar = {} # Dict, 放置辅助品种最新一个K线数据 + self.MultiOn = False # Boolean, 判断是否传入了辅助品种 + + # ---------------------------------------------------------------------- + def setDatabase(self, dbName, symbol, **kwargs): + """set database that provide historical data""" + + self.dbName = dbName + + # Set executed symbol and information symbols + self.symbol = symbol + if "info_symbol" in kwargs: + self.info_symbols = kwargs["info_symbol"] + + # Turn on MultiTF switch + if len(self.info_symbols) > 0: + self.MultiOn = True + + # ---------------------------------------------------------------------- + def loadInitData(self, collection, **kwargs): + """Load initializing data""" + # 载入初始化需要用的数据 + # Load initialised data + + # $gte means "greater and equal to" + # $lt means "less than" + flt = {'datetime': {'$gte': self.dataStartDate, + '$lt': self.strategyStartDate}} + self.initCursor = collection.find(flt) + + # 初始化辅助品种数据 + # Initializing information data + if "inf" in kwargs: + for name in kwargs["inf"]: + DB = kwargs["inf"][name] + self.initInfoCursor[name] = DB.find(flt) + + # 将数据从查询指针中读取出,并生成列表 + # Read data from cursor, generate a list + self.initData = [] + + for d in self.initCursor: + data = self.dataClass() + data.__dict__ = d + self.initData.append(data) + + # ---------------------------------------------------------------------- + def loadHistoryData(self): + """载入历史数据""" + """load historical data""" + + host, port = loadMongoSetting() + + self.dbClient = pymongo.MongoClient(host, port) + collection = self.dbClient[self.dbName][self.symbol] + + # Load historical data of information symbols, construct a dictionary of Database + # Values of dictionary are mongo.Client. + info_collection = {} + if self.MultiOn is True: + for DBname, symbol in self.info_symbols: + info_collection[DBname + " " + symbol] = self.dbClient[DBname][symbol] + + self.output("Start loading historical data") + + # 首先根据回测模式,确认要使用的数据类 + # Choose data type based on backtest mode + if self.mode == self.BAR_MODE: + self.dataClass = CtaBarData + self.func = self.newBar + else: + self.dataClass = CtaTickData + self.func = self.newTick + + # Load initializing data + self.loadInitData(collection, inf=info_collection) + + # 载入回测数据 + # Load backtest data (exclude initializing data) + if not self.dataEndDate: + # If "End Date" is not set, retreat data up to today + flt = {'datetime': {'$gte': self.strategyStartDate}} + else: + flt = {'datetime': {'$gte': self.strategyStartDate, + '$lte': self.dataEndDate}} + self.dbCursor = collection.find(flt) + + if self.MultiOn is True: + for db in info_collection: + self.InfoCursor[db] = info_collection[db].find(flt) + self.output( + "Data loading completed, data volumn: %s" % (self.initCursor.count() + self.dbCursor.count() + \ + sum([i.count() for i in self.InfoCursor.values()]))) + else: + self.output("Data loading completed, data volumn: %s" % (self.initCursor.count() + self.dbCursor.count())) + + # ---------------------------------------------------------------------- + def runBacktesting(self): + """运行回测""" + """Run backtesting""" + + # 载入历史数据 + # Load historical data + self.loadHistoryData() + + self.output("Start backtesing!") + + self.strategy.inited = True + self.strategy.onInit() + self.output("Strategy initialsing complete") + + self.strategy.trading = True + self.strategy.onStart() + self.output("Strategy started") + + self.output("Processing historical data...") + + dataClass = self.dataClass + func = self.func + for d in self.dbCursor: + data = dataClass() + data.__dict__ = d + func(data) + + self.output("No more historical data") + + # ---------------------------------------------------------------------- + def checkInformationData(self): + """Update information symbols' data""" + + # If infobar is empty, which means it is the first time calling this method + if self.infobar == {}: + for info_symbol in self.InfoCursor: + try: + self.infobar[info_symbol] = next(self.InfoCursor[info_symbol]) + except StopIteration: + print "Data of information symbols is empty! Input must be a list, not str." + raise + + temp = {} + for info_symbol in self.infobar: + + data = self.infobar[info_symbol] + + # Update data only when Time Stamp is matched + if (data is not None) and (data['datetime'] <= self.dt): + + try: + temp[info_symbol] = CtaBarData() + temp[info_symbol].__dict__ = data + self.infobar[info_symbol] = next(self.InfoCursor[info_symbol]) + except StopIteration: + self.infobar[info_symbol] = None + self.output("No more data in information database.") + else: + temp[info_symbol] = None + + return temp + + # ---------------------------------------------------------------------- + def newBar(self, bar): + """新的K线""" + """new ohlc Bar""" + self.bar = bar + self.dt = bar.datetime + self.updatePosition() # Update total position value based on new Bar + self.crossLimitOrder() # 先撮合限价单 + self.crossStopOrder() # 再撮合停止单 + if self.MultiOn is True: + self.strategy.onBar(bar, infobar=self.checkInformationData()) # 推送K线到策略中 + else: + self.strategy.onBar(bar) # 推送K线到策略中 + + # ---------------------------------------------------------------------- + def newTick(self, tick): + """新的Tick""" + """new Tick""" + self.tick = tick + self.dt = tick.datetime + self.crossLimitOrder() + self.crossStopOrder() + self.strategy.onTick(tick) + +######################################################################## + diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/ctaStrategyMultiTF.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/ctaStrategyMultiTF.py new file mode 100644 index 0000000000..21eb627e87 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/ctaStrategyMultiTF.py @@ -0,0 +1,410 @@ +# encoding: UTF-8 +""" +This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies. +""" + +from strategyAtrRsi import * +from ctaBase import * +from ctaTemplate import CtaTemplate + +######################################################################## +class TC11(CtaTemplate): + + # Strategy name and author + className = "TC11" + author = "Zenacon" + + # Set MongoDB DataBase + barDbName = "TestData" + + # Strategy parameters + pGeneric_prd = 21 + pGeneric_on = True + + pATRprd_F = 13 + pATRprd_M = 21 + pATRprd_S = 63 + + pBOSSplus_prd = 98 + pBOSSminus_prd = 22 + + if pGeneric_on == 0: + pRSIprd = 20 + pBBprd = 10 + pBB_ATRprd = 15 + pATRprd = 21 + pDMIprd = 21 + else: + pRSIprd = \ + pBBprd = \ + pBB_ATRprd = \ + pATRprd = \ + pDMIprd = pGeneric_prd + + pBOSS_Mult = 1.75 + + # Strategy variables + vOBO_initialpoint = EMPTY_FLOAT + vOBO_Stretch = EMPTY_FLOAT + vOBO_level_L = EMPTY_FLOAT + vOBO_level_S = EMPTY_FLOAT + + # parameters' list, record names of parameters + paramList = ['name', + 'className', + 'author', + 'vtSymbol'] + + # variables' list, record names of variables + varList = ['inited', + 'trading', + 'pos'] + + def __init__(self, ctaEngine, setting): + """Constructor""" + super(TC11, self).__init__(ctaEngine, setting) + + # ---------------------------------------------------------------------- + def onBar(self, bar, **kwargs): + """收到Bar推送(必须由用户继承实现)""" + # 撤销之前发出的尚未成交的委托(包括限价单和停止单) + for orderID in self.orderList: + self.cancelOrder(orderID) + self.orderList = [] + + # Record new information bar + if "infobar" in kwargs: + for i in kwargs["infobar"]: + if kwargs["infobar"][i] is None: + pass + else: + # print kwargs["infobar"][i]["close"] + self.closeArray[0:self.bufferSize - 1] = self.closeArray[1:self.bufferSize] + self.highArray[0:self.bufferSize - 1] = self.highArray[1:self.bufferSize] + self.lowArray[0:self.bufferSize - 1] = self.lowArray[1:self.bufferSize] + + self.closeArray[-1] = bar.close + self.highArray[-1] = bar.high + self.lowArray[-1] = bar.low + + """ + Record new bar + """ + self.closeArray[0:self.bufferSize - 1] = self.closeArray[1:self.bufferSize] + self.highArray[0:self.bufferSize - 1] = self.highArray[1:self.bufferSize] + self.lowArray[0:self.bufferSize - 1] = self.lowArray[1:self.bufferSize] + + self.closeArray[-1] = bar.close + self.highArray[-1] = bar.high + self.lowArray[-1] = bar.low + + self.bufferCount += 1 + if self.bufferCount < self.bufferSize: + return + + """ + Calculate Indicators + """ + + vOBO_initialpoint = self.dataHTF_filled['Open'] + vOBO_Stretch = self.vATR['htf'].m * self.pBOSS_Mult + + self.atrValue = talib.ATR(self.highArray, + self.lowArray, + self.closeArray, + self.atrLength)[-1] + self.atrArray[0:self.bufferSize - 1] = self.atrArray[1:self.bufferSize] + self.atrArray[-1] = self.atrValue + + self.atrCount += 1 + if self.atrCount < self.bufferSize: + return + + self.atrMa = talib.MA(self.atrArray, + self.atrMaLength)[-1] + self.rsiValue = talib.RSI(self.closeArray, + self.rsiLength)[-1] + + # 判断是否要进行交易 + + # 当前无仓位 + if self.pos == 0: + self.intraTradeHigh = bar.high + self.intraTradeLow = bar.low + + # ATR数值上穿其移动平均线,说明行情短期内波动加大 + # 即处于趋势的概率较大,适合CTA开仓 + if self.atrValue > self.atrMa: + # 使用RSI指标的趋势行情时,会在超买超卖区钝化特征,作为开仓信号 + if self.rsiValue > self.rsiBuy: + # 这里为了保证成交,选择超价5个整指数点下单 + self.buy(bar.close + 5, 1) + + elif self.rsiValue < self.rsiSell: + self.short(bar.close - 5, 1) + + # 持有多头仓位 + elif self.pos > 0: + # 计算多头持有期内的最高价,以及重置最低价 + self.intraTradeHigh = max(self.intraTradeHigh, bar.high) + self.intraTradeLow = bar.low + # 计算多头移动止损 + longStop = self.intraTradeHigh * (1 - self.trailingPercent / 100) + # 发出本地止损委托,并且把委托号记录下来,用于后续撤单 + orderID = self.sell(longStop, 1, stop=True) + self.orderList.append(orderID) + + # 持有空头仓位 + elif self.pos < 0: + self.intraTradeLow = min(self.intraTradeLow, bar.low) + self.intraTradeHigh = bar.high + + shortStop = self.intraTradeLow * (1 + self.trailingPercent / 100) + orderID = self.cover(shortStop, 1, stop=True) + self.orderList.append(orderID) + + # 发出状态更新事件 + self.putEvent() + +######################################################################## +class Prototype(AtrRsiStrategy): + + """ + "infoArray" 字典是用来储存辅助品种信息的, 可以是同品种的不同分钟k线, 也可以是不同品种的价格。 + + 调用的方法: + self.infoArray["数据库名 + 空格 + collection名"]["close"] + self.infoArray["数据库名 + 空格 + collection名"]["high"] + self.infoArray["数据库名 + 空格 + collection名"]["low"] + """ + infoArray = {} + initInfobar = {} + + def __int__(self): + super(Prototype, self).__int__() + + # ---------------------------------------------------------------------- + def onInit(self): + """初始化策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略初始化' % self.name) + + # 初始化RSI入场阈值 + self.rsiBuy = 50 + self.rsiEntry + self.rsiSell = 50 - self.rsiEntry + + # 载入历史数据,并采用回放计算的方式初始化策略数值 + initData = self.loadBar(self.initDays) + for bar in initData: + + # 推送新数据, 同时检查是否有information bar需要推送 + # Update new bar, check whether the Time Stamp matching any information bar + ibar = self.checkInfoBar(bar) + self.onBar(bar, infobar=ibar) + + self.putEvent() + + # ---------------------------------------------------------------------- + def checkInfoBar(self, bar): + """在初始化时, 检查辅助品种数据的推送(初始化结束后, 回测时不会调用)""" + + initInfoCursorDict = self.ctaEngine.initInfoCursor + + # 如果"initInfobar"字典为空, 初始化字典, 插入第一个数据 + # If dictionary "initInfobar" is empty, insert first data record + if self.initInfobar == {}: + for info_symbol in initInfoCursorDict: + try: + self.initInfobar[info_symbol] = next(initInfoCursorDict[info_symbol]) + except StopIteration: + print "Data of information symbols is empty! Input is a list, not str." + raise + + # 若有某一品种的 TimeStamp 和执行报价的 TimeStamp 匹配, 则将"initInfobar"中的数据推送, + # 然后更新该品种的数据 + # If any symbol's TimeStamp is matched with execution symbol's TimeStamp, return data + # in "initInfobar", and update new data. + temp = {} + for info_symbol in self.initInfobar: + + data = self.initInfobar[info_symbol] + + # Update data only when Time Stamp is matched + if data['datetime'] <= bar.datetime: + try: + temp[info_symbol] = CtaBarData() + temp[info_symbol].__dict__ = data + self.initInfobar[info_symbol] = next(initInfoCursorDict[info_symbol]) + except StopIteration: + self.ctaEngine.output("No more data for initializing %s." % (info_symbol,)) + else: + temp[info_symbol] = None + + return temp + + # ---------------------------------------------------------------------- + def updateInfoArray(self, infobar): + """收到Infomation Data, 更新辅助品种缓存字典""" + + for name in infobar: + + data = infobar[name] + + # Construct empty array + if len(self.infoArray) < len(infobar) : + self.infoArray[name] = { + "close": np.zeros(self.bufferSize), + "high": np.zeros(self.bufferSize), + "low": np.zeros(self.bufferSize) + } + + if data is None: + pass + + else: + self.infoArray[name]["close"][0:self.bufferSize - 1] = \ + self.infoArray[name]["close"][1:self.bufferSize] + self.infoArray[name]["high"][0:self.bufferSize - 1] = \ + self.infoArray[name]["high"][1:self.bufferSize] + self.infoArray[name]["low"][0:self.bufferSize - 1] = \ + self.infoArray[name]["low"][1:self.bufferSize] + + self.infoArray[name]["close"][-1] = data.close + self.infoArray[name]["high"][-1] = data.high + self.infoArray[name]["low"][-1] = data.low + + # ---------------------------------------------------------------------- + def onBar(self, bar, **kwargs): + """收到Bar推送(必须由用户继承实现)""" + # 撤销之前发出的尚未成交的委托(包括限价单和停止单) + for orderID in self.orderList: + self.cancelOrder(orderID) + self.orderList = [] + + # Update infomation data + # "infobar"是由不同时间或不同品种的品种数据组成的字典, 如果和执行品种的 TimeStamp 不匹配, + # 则传入的是"None", 当time stamp和执行品种匹配时, 传入的是"Bar" + self.updateInfoArray(kwargs["infobar"]) + + # 保存K线数据 + self.closeArray[0:self.bufferSize - 1] = self.closeArray[1:self.bufferSize] + self.highArray[0:self.bufferSize - 1] = self.highArray[1:self.bufferSize] + self.lowArray[0:self.bufferSize - 1] = self.lowArray[1:self.bufferSize] + + self.closeArray[-1] = bar.close + self.highArray[-1] = bar.high + self.lowArray[-1] = bar.low + + # 若读取的缓存数据不足, 不考虑交易 + self.bufferCount += 1 + if self.bufferCount < self.bufferSize: + return + + # 计算指标数值 + + # 计算不同时间下的ATR数值 + + # Only trading when information bar changes + # 只有在30min或者1d K线更新后才可以交易 + TradeOn = False + if any([i is not None for i in kwargs["infobar"].values()]): + + TradeOn = True + self.scaledAtrValue1M = talib.ATR(self.highArray, + self.lowArray, + self.closeArray, + self.atrLength)[-1] * (25) ** (0.5) + self.atrValue30M = talib.abstract.ATR(self.infoArray["TestData @GC_30M"])[-1] + self.rsiValue = talib.abstract.RSI(self.infoArray["TestData @GC_30M"], self.rsiLength)[-1] + + self.atrCount += 1 + if self.atrCount < self.bufferSize: + return + + # 判断是否要进行交易 + + # 当前无仓位 + if (self.pos == 0 and TradeOn == True): + self.intraTradeHigh = bar.high + self.intraTradeLow = bar.low + + # 1Min调整后ATR大于30MinATR + # 即处于趋势的概率较大,适合CTA开仓 + if self.atrValue30M < self.scaledAtrValue1M: + # 使用RSI指标的趋势行情时,会在超买超卖区钝化特征,作为开仓信号 + if self.rsiValue > self.rsiBuy: + # 这里为了保证成交,选择超价5个整指数点下单 + self.buy(bar.close+5, 1) + + elif self.rsiValue < self.rsiSell: + self.short(bar.close-5, 1) + + # 下单后, 在下一个30Min K线之前不交易 + TradeOn = False + + # 持有多头仓位 + elif self.pos > 0: + # 计算多头持有期内的最高价,以及重置最低价 + self.intraTradeHigh = max(self.intraTradeHigh, bar.high) + self.intraTradeLow = bar.low + # 计算多头移动止损 + longStop = self.intraTradeHigh * (1 - self.trailingPercent / 100) + # 发出本地止损委托,并且把委托号记录下来,用于后续撤单 + orderID = self.sell(longStop, 1, stop=True) + self.orderList.append(orderID) + + # 持有空头仓位 + elif self.pos < 0: + self.intraTradeLow = min(self.intraTradeLow, bar.low) + self.intraTradeHigh = bar.high + + shortStop = self.intraTradeLow * (1 + self.trailingPercent / 100) + orderID = self.cover(shortStop, 1, stop=True) + self.orderList.append(orderID) + + # 发出状态更新事件 + self.putEvent() + + +if __name__ == '__main__': + # 提供直接双击回测的功能 + # 导入PyQt4的包是为了保证matplotlib使用PyQt4而不是PySide,防止初始化出错 + from ctaBacktestMultiTF import * + from PyQt4 import QtCore, QtGui + import time + + ''' + 创建回测引擎 + 设置引擎的回测模式为K线 + 设置回测用的数据起始日期 + 载入历史数据到引擎中 + 在引擎中创建策略对象 + + Create backtesting engine + Set backtest mode as "Bar" + Set "Start Date" of data range + Load historical data to engine + Create strategy instance in engine + ''' + engine = BacktestEngineMultiTF() + engine.setBacktestingMode(engine.BAR_MODE) + engine.setStartDate('20100101') + engine.setDatabase("TestData", "@GC_1M", info_symbol=[("TestData","@GC_30M")]) + + # Set parameters for strategy + d = {'atrLength': 11} + engine.initStrategy(Prototype, d) + + # 设置产品相关参数 + engine.setSlippage(0.2) # 股指1跳 + engine.setCommission(0.3 / 10000) # 万0.3 + engine.setSize(300) # 股指合约大小 + + # 开始跑回测 + start = time.time() + + engine.runBacktesting() + + # 显示回测结果 + engine.showBacktestingResult() + + print 'Time consumed:%s' % (time.time() - start) \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/strategyBreakOut.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/strategyBreakOut.py new file mode 100644 index 0000000000..3236ec0bbb --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/strategyBreakOut.py @@ -0,0 +1,317 @@ +# encoding: UTF-8 +""" +This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies. +""" + +from ctaBase import * +from ctaTemplate import CtaTemplate +import numpy as np + +######################################################################## +class BreakOut(CtaTemplate): + + """ + "infoArray" 字典是用来储存辅助品种信息的, 可以是同品种的不同分钟k线, 也可以是不同品种的价格。 + + 调用的方法: + 价格序列: + self.infoArray["数据库名 + 空格 + collection名"]["close"] + self.infoArray["数据库名 + 空格 + collection名"]["high"] + self.infoArray["数据库名 + 空格 + collection名"]["low"] + + 单个价格: + self.infoBar["数据库名 + 空格 + collection名"] + 返回的值为一个ctaBarData 或 None + """ + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, setting): + """日内突破交易策略, 出场方式非常多, 本文件使用指标出场""" + + className = 'BreakOut' + author = 'Joe' + super(BreakOut, self).__init__(ctaEngine, setting) + + # 设置辅助品种数据字典 + self.infoArray = {} + self.initInfobar = {} + self.infoBar = {} + + # 缓存数据量 + self.bufferSize = 100 + self.bufferCount = 0 + self.initDays = 10 + + # 设置参数 + self.pOBO_Mult = 0.5 # 计算突破点位 + # self.pProtMult = 2 # 止损的ATR倍数 + # self.pProfitMult = 2 # 止盈相对于止损的倍数 + # self.SlTp_On = False # 止损止盈功能 + # self.EODTime = 15 # 设置日内平仓时间 + + self.vOBO_stretch = EMPTY_FLOAT + self.vOBO_initialpoint = EMPTY_FLOAT + self.vOBO_level_L = EMPTY_FLOAT + self.vOBO_level_S = EMPTY_FLOAT + + self.orderList = [] + + # 参数列表,保存了参数的名称 + paramList = ['name', + 'className', + 'author', + 'pOBO_Mult', + 'pProtMult', + 'pProfitMult', + 'SlTp_On', + 'EODTime'] + + # 变量列表,保存了变量的名称 + varList = ['vOBO_stretch', + 'vOBO_initialpoint', + 'vOBO_level_L', + 'vOBO_level_S'] + + # ---------------------------------------------------------------------- + def onInit(self): + """初始化策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略初始化' % self.name) + + # 载入历史数据,并采用回放计算的方式初始化策略数值 + initData = self.loadBar(self.initDays) + for bar in initData: + + # 推送新数据, 同时检查是否有information bar需要推送 + # Update new bar, check whether the Time Stamp matching any information bar + ibar = self.checkInfoBar(bar) + self.onBar(bar, infobar=ibar) + + self.putEvent() + + #---------------------------------------------------------------------- + def onStart(self): + """启动策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略启动' %self.name) + self.putEvent() + + #---------------------------------------------------------------------- + def onStop(self): + """停止策略(必须由用户继承实现)""" + self.writeCtaLog(u'%s策略停止' %self.name) + self.putEvent() + + # ---------------------------------------------------------------------- + def checkInfoBar(self, bar): + """在初始化时, 检查辅助品种数据的推送(初始化结束后, 回测时不会调用)""" + + initInfoCursorDict = self.ctaEngine.initInfoCursor + + # 如果"initInfobar"字典为空, 初始化字典, 插入第一个数据 + # If dictionary "initInfobar" is empty, insert first data record + if self.initInfobar == {}: + for info_symbol in initInfoCursorDict: + try: + self.initInfobar[info_symbol] = next(initInfoCursorDict[info_symbol]) + except StopIteration: + print "Data of information symbols is empty! Input is a list, not str." + raise + + # 若有某一品种的 TimeStamp 和执行报价的 TimeStamp 匹配, 则将"initInfobar"中的数据推送, + # 然后更新该品种的数据 + # If any symbol's TimeStamp is matched with execution symbol's TimeStamp, return data + # in "initInfobar", and update new data. + temp = {} + for info_symbol in self.initInfobar: + + data = self.initInfobar[info_symbol] + + # Update data only when Time Stamp is matched + + if (data is not None) and (data['datetime'] <= bar.datetime): + + try: + temp[info_symbol] = CtaBarData() + temp[info_symbol].__dict__ = data + self.initInfobar[info_symbol] = next(initInfoCursorDict[info_symbol]) + except StopIteration: + self.initInfobar[info_symbol] = None + self.ctaEngine.output("No more data for initializing %s." % (info_symbol,)) + else: + temp[info_symbol] = None + + return temp + + # ---------------------------------------------------------------------- + def updateInfoArray(self, infobar): + """收到Infomation Data, 更新辅助品种缓存字典""" + + for name in infobar: + + data = infobar[name] + + # Construct empty array + if len(self.infoArray) < len(infobar) : + self.infoArray[name] = { + "close": np.zeros(self.bufferSize), + "high": np.zeros(self.bufferSize), + "low": np.zeros(self.bufferSize), + "open": np.zeros(self.bufferSize) + } + + if data is None: + pass + + else: + self.infoArray[name]["close"][0:self.bufferSize - 1] = \ + self.infoArray[name]["close"][1:self.bufferSize] + self.infoArray[name]["high"][0:self.bufferSize - 1] = \ + self.infoArray[name]["high"][1:self.bufferSize] + self.infoArray[name]["low"][0:self.bufferSize - 1] = \ + self.infoArray[name]["low"][1:self.bufferSize] + self.infoArray[name]["open"][0:self.bufferSize - 1] = \ + self.infoArray[name]["open"][1:self.bufferSize] + + self.infoArray[name]["close"][-1] = data.close + self.infoArray[name]["high"][-1] = data.high + self.infoArray[name]["low"][-1] = data.low + self.infoArray[name]["open"][-1] = data.open + + # ---------------------------------------------------------------------- + def onBar(self, bar, **kwargs): + """收到Bar推送(必须由用户继承实现)""" + + # Update infomation data + # "infobar"是由不同时间或不同品种的品种数据组成的字典, 如果和执行品种的 TimeStamp 不匹配, + # 则传入的是"None", 当time stamp和执行品种匹配时, 传入的是"Bar" + if "infobar" in kwargs: + self.infoBar = kwargs["infobar"] + self.updateInfoArray(kwargs["infobar"]) + + # 若读取的缓存数据不足, 不考虑交易 + self.bufferCount += 1 + if self.bufferCount < self.bufferSize: + return + + # 计算指标数值 + a = np.sum(self.infoArray["TestData @GC_1D"]["close"]) + if a == 0.0: + return + + # Only updating indicators when information bar changes + # 只有在30min或者1d K线更新后才更新指标 + TradeOn = False + if any([i is not None for i in self.infoBar]): + TradeOn = True + self.vRange = self.infoArray["TestData @GC_1D"]["high"][-1] -\ + self.infoArray["TestData @GC_1D"]["low"][-1] + self.vOBO_stretch = self.vRange * self.pOBO_Mult + self.vOBO_initialpoint = self.infoArray["TestData @GC_1D"]["close"][-1] + self.vOBO_level_L = self.vOBO_initialpoint + self.vOBO_stretch + self.vOBO_level_S = self.vOBO_initialpoint - self.vOBO_stretch + + self.atrValue30M = talib.abstract.ATR(self.infoArray["TestData @GC_30M"])[-1] + + # 判断是否要进行交易 + + # 当前无仓位 + if (self.pos == 0 and TradeOn == True): + + # 撤销之前发出的尚未成交的委托(包括限价单和停止单) + for orderID in self.orderList: + self.cancelOrder(orderID) + self.orderList = [] + + # 若上一个30分钟K线的最高价大于OBO_level_L + # 且当前的价格大于OBO_level_L, 则买入 + if self.infoArray["TestData @GC_30M"]["high"][-1] > self.vOBO_level_L: + + if bar.close > self.vOBO_level_L: + + self.buy(bar.close + 0.5, 1) + + # 下单后, 在下一个30Min K线之前不交易 + TradeOn = False + + # 若上一个30分钟K线的最高价低于OBO_level_S + # 且当前的价格小于OBO_level_S, 则卖出 + elif self.infoArray["TestData @GC_30M"]["low"][-1] < self.vOBO_level_S: + + if bar.close < self.vOBO_level_S: + + self.short(bar.close - 0.5, 1) + + # 下单后, 在下一个30Min K线之前不交易 + TradeOn = False + + # 持有多头仓位 + elif self.pos > 0: + + # 当价格低于initialpoint水平, 出场 + if bar.close < self.vOBO_initialpoint: + self.sell(bar.close - 0.5 , 1) + + # 持有空头仓位 + elif self.pos < 0: + + # 当价格高于initialpoint水平, 出场 + if bar.close > self.vOBO_initialpoint: + self.cover(bar.close + 0.5, 1) + + + # 发出状态更新事件 + self.putEvent() + + # ---------------------------------------------------------------------- + def onOrder(self, order): + """收到委托变化推送(必须由用户继承实现)""" + pass + + # ---------------------------------------------------------------------- + def onTrade(self, trade): + pass + + +if __name__ == '__main__': + # 提供直接双击回测的功能 + # 导入PyQt4的包是为了保证matplotlib使用PyQt4而不是PySide,防止初始化出错 + from ctaBacktestMultiTF import * + from PyQt4 import QtCore, QtGui + import time + + ''' + 创建回测引擎 + 设置引擎的回测模式为K线 + 设置回测用的数据起始日期 + 载入历史数据到引擎中 + 在引擎中创建策略对象 + + Create backtesting engine + Set backtest mode as "Bar" + Set "Start Date" of data range + Load historical data to engine + Create strategy instance in engine + ''' + engine = BacktestEngineMultiTF() + engine.setBacktestingMode(engine.BAR_MODE) + engine.setStartDate('20120101') + engine.setEndDate('20150101') + engine.setDatabase("TestData", "@GC_1M", info_symbol=[("TestData","@GC_30M"), + ("TestData","@GC_1D")]) + + # Set parameters for strategy + engine.initStrategy(BreakOut, {}) + + # 设置产品相关参数 + engine.setSlippage(0.2) # 股指1跳 + engine.setCommission(0.3 / 10000) # 万0.3 + engine.setSize(1) # 股指合约大小 + + # 开始跑回测 + start = time.time() + + engine.runBacktesting() + + # 显示回测结果 + engine.showBacktestingResult() + + print 'Time consumed:%s' % (time.time() - start) \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/uiCtaWidget.py b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/uiCtaWidget.py new file mode 100644 index 0000000000..98d1292c9a --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctaAlgo/uiCtaWidget.py @@ -0,0 +1,273 @@ +# encoding: UTF-8 + +''' +CTA模块相关的GUI控制组件 +''' + + +from uiBasicWidget import QtGui, QtCore, BasicCell +from eventEngine import * + + +######################################################################## +class CtaValueMonitor(QtGui.QTableWidget): + """参数监控""" + + #---------------------------------------------------------------------- + def __init__(self, parent=None): + """Constructor""" + super(CtaValueMonitor, self).__init__(parent) + + self.keyCellDict = {} + self.data = None + self.inited = False + + self.initUi() + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setRowCount(1) + self.verticalHeader().setVisible(False) + self.setEditTriggers(self.NoEditTriggers) + + self.setMaximumHeight(self.sizeHint().height()) + + #---------------------------------------------------------------------- + def updateData(self, data): + """更新数据""" + if not self.inited: + self.setColumnCount(len(data)) + self.setHorizontalHeaderLabels(data.keys()) + + col = 0 + for k, v in data.items(): + cell = QtGui.QTableWidgetItem(unicode(v)) + self.keyCellDict[k] = cell + self.setItem(0, col, cell) + col += 1 + + self.inited = True + else: + for k, v in data.items(): + cell = self.keyCellDict[k] + cell.setText(unicode(v)) + + +######################################################################## +class CtaStrategyManager(QtGui.QGroupBox): + """策略管理组件""" + signal = QtCore.pyqtSignal(type(Event())) + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, eventEngine, name, parent=None): + """Constructor""" + super(CtaStrategyManager, self).__init__(parent) + + self.ctaEngine = ctaEngine + self.eventEngine = eventEngine + self.name = name + + self.initUi() + self.updateMonitor() + self.registerEvent() + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setTitle(self.name) + + self.paramMonitor = CtaValueMonitor(self) + self.varMonitor = CtaValueMonitor(self) + + height = 60 + self.paramMonitor.setFixedHeight(height) + self.varMonitor.setFixedHeight(height) + + buttonInit = QtGui.QPushButton(u'初始化') + buttonStart = QtGui.QPushButton(u'启动') + buttonStop = QtGui.QPushButton(u'停止') + buttonInit.clicked.connect(self.init) + buttonStart.clicked.connect(self.start) + buttonStop.clicked.connect(self.stop) + + hbox1 = QtGui.QHBoxLayout() + hbox1.addWidget(buttonInit) + hbox1.addWidget(buttonStart) + hbox1.addWidget(buttonStop) + hbox1.addStretch() + + hbox2 = QtGui.QHBoxLayout() + hbox2.addWidget(self.paramMonitor) + + hbox3 = QtGui.QHBoxLayout() + hbox3.addWidget(self.varMonitor) + + vbox = QtGui.QVBoxLayout() + vbox.addLayout(hbox1) + vbox.addLayout(hbox2) + vbox.addLayout(hbox3) + + self.setLayout(vbox) + + #---------------------------------------------------------------------- + def updateMonitor(self, event=None): + """显示策略最新状态""" + paramDict = self.ctaEngine.getStrategyParam(self.name) + if paramDict: + self.paramMonitor.updateData(paramDict) + + varDict = self.ctaEngine.getStrategyVar(self.name) + if varDict: + self.varMonitor.updateData(varDict) + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.signal.connect(self.updateMonitor) + self.eventEngine.register(EVENT_CTA_STRATEGY+self.name, self.signal.emit) + + #---------------------------------------------------------------------- + def init(self): + """初始化策略""" + self.ctaEngine.initStrategy(self.name) + + #---------------------------------------------------------------------- + def start(self): + """启动策略""" + self.ctaEngine.startStrategy(self.name) + + #---------------------------------------------------------------------- + def stop(self): + """停止策略""" + self.ctaEngine.stopStrategy(self.name) + + +######################################################################## +class CtaEngineManager(QtGui.QWidget): + """CTA引擎管理组件""" + signal = QtCore.pyqtSignal(type(Event())) + + #---------------------------------------------------------------------- + def __init__(self, ctaEngine, eventEngine, parent=None): + """Constructor""" + super(CtaEngineManager, self).__init__(parent) + + self.ctaEngine = ctaEngine + self.eventEngine = eventEngine + + self.strategyLoaded = False + + self.initUi() + self.registerEvent() + + # 记录日志 + self.ctaEngine.writeCtaLog(u'CTA引擎启动成功') + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setWindowTitle(u'CTA策略') + + # 按钮 + loadButton = QtGui.QPushButton(u'加载策略') + initAllButton = QtGui.QPushButton(u'全部初始化') + startAllButton = QtGui.QPushButton(u'全部启动') + stopAllButton = QtGui.QPushButton(u'全部停止') + savePositionButton = QtGui.QPushButton(u'保存持仓') + + loadButton.clicked.connect(self.load) + initAllButton.clicked.connect(self.initAll) + startAllButton.clicked.connect(self.startAll) + stopAllButton.clicked.connect(self.stopAll) + savePositionButton.clicked.connect(self.ctaEngine.savePosition) + + # 滚动区域,放置所有的CtaStrategyManager + self.scrollArea = QtGui.QScrollArea() + self.scrollArea.setWidgetResizable(True) + + # CTA组件的日志监控 + self.ctaLogMonitor = QtGui.QTextEdit() + self.ctaLogMonitor.setReadOnly(True) + self.ctaLogMonitor.setMaximumHeight(200) + + # 设置布局 + hbox2 = QtGui.QHBoxLayout() + hbox2.addWidget(loadButton) + hbox2.addWidget(initAllButton) + hbox2.addWidget(startAllButton) + hbox2.addWidget(stopAllButton) + hbox2.addWidget(savePositionButton) + hbox2.addStretch() + + vbox = QtGui.QVBoxLayout() + vbox.addLayout(hbox2) + vbox.addWidget(self.scrollArea) + vbox.addWidget(self.ctaLogMonitor) + self.setLayout(vbox) + + #---------------------------------------------------------------------- + def initStrategyManager(self): + """初始化策略管理组件界面""" + w = QtGui.QWidget() + vbox = QtGui.QVBoxLayout() + + for name in self.ctaEngine.strategyDict.keys(): + strategyManager = CtaStrategyManager(self.ctaEngine, self.eventEngine, name) + vbox.addWidget(strategyManager) + + vbox.addStretch() + + w.setLayout(vbox) + self.scrollArea.setWidget(w) + + #---------------------------------------------------------------------- + def initAll(self): + """全部初始化""" + for name in self.ctaEngine.strategyDict.keys(): + self.ctaEngine.initStrategy(name) + + #---------------------------------------------------------------------- + def startAll(self): + """全部启动""" + for name in self.ctaEngine.strategyDict.keys(): + self.ctaEngine.startStrategy(name) + + #---------------------------------------------------------------------- + def stopAll(self): + """全部停止""" + for name in self.ctaEngine.strategyDict.keys(): + self.ctaEngine.stopStrategy(name) + + #---------------------------------------------------------------------- + def load(self): + """加载策略""" + if not self.strategyLoaded: + self.ctaEngine.loadSetting() + self.initStrategyManager() + self.strategyLoaded = True + self.ctaEngine.writeCtaLog(u'策略加载成功') + + #---------------------------------------------------------------------- + def updateCtaLog(self, event): + """更新CTA相关日志""" + log = event.dict_['data'] + content = '\t'.join([log.logTime, log.logContent]) + self.ctaLogMonitor.append(content) + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.signal.connect(self.updateCtaLog) + self.eventEngine.register(EVENT_CTA_LOG, self.signal.emit) + + + + + + + + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/CTP_connect.json b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/CTP_connect.json new file mode 100644 index 0000000000..0f3215d37f --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/CTP_connect.json @@ -0,0 +1,7 @@ +{ + "brokerID": "9999", + "tdAddress": "tcp://180.168.146.187:10000", + "password": "19890624", + "mdAddress": "tcp://180.168.146.187:10010", + "userID": "000300" +} \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/__init__.py b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/ctpDataType.py b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/ctpDataType.py new file mode 100644 index 0000000000..13033f68fe --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/ctpDataType.py @@ -0,0 +1,6456 @@ +# encoding: UTF-8 + +defineDict = {} +typedefDict = {} + +#////////////////////////////////////////////////////////////////////// +#@system 新一代交易所系统 +#@company 上海期货信息技术有限公司 +#@file ThostFtdcUserApiDataType.h +#@brief 定义了客户端接口使用的业务数据类型 +#@history +#20060106 赵鸿昊 创建该文件 +#////////////////////////////////////////////////////////////////////// + + + +#////////////////////////////////////////////////////////////////////// +#TFtdcTraderIDType是一个交易所交易员代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTraderIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorIDType是一个投资者代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvestorIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerIDType是一个经纪公司代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBrokerIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerAbbrType是一个经纪公司简称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBrokerAbbrType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerNameType是一个经纪公司名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBrokerNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeInstIDType是一个合约在交易所的代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExchangeInstIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderRefType是一个报单引用类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrderRefType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParticipantIDType是一个会员代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcParticipantIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserIDType是一个用户代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUserIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPasswordType是一个密码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPasswordType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientIDType是一个交易编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClientIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentIDType是一个合约代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstrumentIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentCodeType是一个合约标识码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstrumentCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMarketIDType是一个市场代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMarketIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductNameType是一个产品名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProductNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeIDType是一个交易所代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExchangeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeNameType是一个交易所名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExchangeNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeAbbrType是一个交易所简称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExchangeAbbrType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeFlagType是一个交易所标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExchangeFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMacAddressType是一个Mac地址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMacAddressType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSystemIDType是一个系统编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSystemIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangePropertyType是一个交易所属性类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_EXP_Normal"] = '0' +#根据成交生成报单 +defineDict["THOST_FTDC_EXP_GenOrderByTrade"] = '1' + +typedefDict["TThostFtdcExchangePropertyType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDateType是一个日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTimeType是一个时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLongTimeType是一个长时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLongTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentNameType是一个合约名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstrumentNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementGroupIDType是一个结算组代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSettlementGroupIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderSysIDType是一个报单编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrderSysIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeIDType是一个成交编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommandTypeType是一个DB命令类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommandTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIPAddressType是一个IP地址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIPAddressType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIPPortType是一个IP端口类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIPPortType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductInfoType是一个产品信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProductInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProtocolInfoType是一个协议信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProtocolInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBusinessUnitType是一个业务单元类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBusinessUnitType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDepositSeqNoType是一个出入金流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDepositSeqNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIdentifiedCardNoType是一个证件号码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIdentifiedCardNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIdCardTypeType是一个证件类型类型 +#////////////////////////////////////////////////////////////////////// +#组织机构代码 +defineDict["THOST_FTDC_ICT_EID"] = '0' +#中国公民身份证 +defineDict["THOST_FTDC_ICT_IDCard"] = '1' +#军官证 +defineDict["THOST_FTDC_ICT_OfficerIDCard"] = '2' +#警官证 +defineDict["THOST_FTDC_ICT_PoliceIDCard"] = '3' +#士兵证 +defineDict["THOST_FTDC_ICT_SoldierIDCard"] = '4' +#户口簿 +defineDict["THOST_FTDC_ICT_HouseholdRegister"] = '5' +#护照 +defineDict["THOST_FTDC_ICT_Passport"] = '6' +#台胞证 +defineDict["THOST_FTDC_ICT_TaiwanCompatriotIDCard"] = '7' +#回乡证 +defineDict["THOST_FTDC_ICT_HomeComingCard"] = '8' +#营业执照号 +defineDict["THOST_FTDC_ICT_LicenseNo"] = '9' +#税务登记号/当地纳税ID +defineDict["THOST_FTDC_ICT_TaxNo"] = 'A' +#港澳居民来往内地通行证 +defineDict["THOST_FTDC_ICT_HMMainlandTravelPermit"] = 'B' +#台湾居民来往大陆通行证 +defineDict["THOST_FTDC_ICT_TwMainlandTravelPermit"] = 'C' +#驾照 +defineDict["THOST_FTDC_ICT_DrivingLicense"] = 'D' +#当地社保ID +defineDict["THOST_FTDC_ICT_SocialID"] = 'F' +#当地身份证 +defineDict["THOST_FTDC_ICT_LocalID"] = 'G' +#商业登记证 +defineDict["THOST_FTDC_ICT_BusinessRegistration"] = 'H' +#港澳永久性居民身份证 +defineDict["THOST_FTDC_ICT_HKMCIDCard"] = 'I' +#人行开户许可证 +defineDict["THOST_FTDC_ICT_AccountsPermits"] = 'J' +#其他证件 +defineDict["THOST_FTDC_ICT_OtherCard"] = 'x' + +typedefDict["TThostFtdcIdCardTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderLocalIDType是一个本地报单编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrderLocalIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserNameType是一个用户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUserNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPartyNameType是一个参与人名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPartyNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcErrorMsgType是一个错误信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcErrorMsgType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFieldNameType是一个字段名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFieldNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFieldContentType是一个字段内容类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFieldContentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSystemNameType是一个系统名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSystemNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcContentType是一个消息正文类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcContentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorRangeType是一个投资者范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["THOST_FTDC_IR_All"] = '1' +#投资者组 +defineDict["THOST_FTDC_IR_Group"] = '2' +#单一投资者 +defineDict["THOST_FTDC_IR_Single"] = '3' + +typedefDict["TThostFtdcInvestorRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDepartmentRangeType是一个投资者范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["THOST_FTDC_DR_All"] = '1' +#组织架构 +defineDict["THOST_FTDC_DR_Group"] = '2' +#单一投资者 +defineDict["THOST_FTDC_DR_Single"] = '3' + +typedefDict["TThostFtdcDepartmentRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDataSyncStatusType是一个数据同步状态类型 +#////////////////////////////////////////////////////////////////////// +#未同步 +defineDict["THOST_FTDC_DS_Asynchronous"] = '1' +#同步中 +defineDict["THOST_FTDC_DS_Synchronizing"] = '2' +#已同步 +defineDict["THOST_FTDC_DS_Synchronized"] = '3' + +typedefDict["TThostFtdcDataSyncStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerDataSyncStatusType是一个经纪公司数据同步状态类型 +#////////////////////////////////////////////////////////////////////// +#已同步 +defineDict["THOST_FTDC_BDS_Synchronized"] = '1' +#同步中 +defineDict["THOST_FTDC_BDS_Synchronizing"] = '2' + +typedefDict["TThostFtdcBrokerDataSyncStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeConnectStatusType是一个交易所连接状态类型 +#////////////////////////////////////////////////////////////////////// +#没有任何连接 +defineDict["THOST_FTDC_ECS_NoConnection"] = '1' +#已经发出合约查询请求 +defineDict["THOST_FTDC_ECS_QryInstrumentSent"] = '2' +#已经获取信息 +defineDict["THOST_FTDC_ECS_GotInformation"] = '9' + +typedefDict["TThostFtdcExchangeConnectStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTraderConnectStatusType是一个交易所交易员连接状态类型 +#////////////////////////////////////////////////////////////////////// +#没有任何连接 +defineDict["THOST_FTDC_TCS_NotConnected"] = '1' +#已经连接 +defineDict["THOST_FTDC_TCS_Connected"] = '2' +#已经发出合约查询请求 +defineDict["THOST_FTDC_TCS_QryInstrumentSent"] = '3' +#订阅私有流 +defineDict["THOST_FTDC_TCS_SubPrivateFlow"] = '4' + +typedefDict["TThostFtdcTraderConnectStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionCodeType是一个功能代码类型 +#////////////////////////////////////////////////////////////////////// +#数据异步化 +defineDict["THOST_FTDC_FC_DataAsync"] = '1' +#强制用户登出 +defineDict["THOST_FTDC_FC_ForceUserLogout"] = '2' +#变更管理用户口令 +defineDict["THOST_FTDC_FC_UserPasswordUpdate"] = '3' +#变更经纪公司口令 +defineDict["THOST_FTDC_FC_BrokerPasswordUpdate"] = '4' +#变更投资者口令 +defineDict["THOST_FTDC_FC_InvestorPasswordUpdate"] = '5' +#报单插入 +defineDict["THOST_FTDC_FC_OrderInsert"] = '6' +#报单操作 +defineDict["THOST_FTDC_FC_OrderAction"] = '7' +#同步系统数据 +defineDict["THOST_FTDC_FC_SyncSystemData"] = '8' +#同步经纪公司数据 +defineDict["THOST_FTDC_FC_SyncBrokerData"] = '9' +#批量同步经纪公司数据 +defineDict["THOST_FTDC_FC_BachSyncBrokerData"] = 'A' +#超级查询 +defineDict["THOST_FTDC_FC_SuperQuery"] = 'B' +#预埋报单插入 +defineDict["THOST_FTDC_FC_ParkedOrderInsert"] = 'C' +#预埋报单操作 +defineDict["THOST_FTDC_FC_ParkedOrderAction"] = 'D' +#同步动态令牌 +defineDict["THOST_FTDC_FC_SyncOTP"] = 'E' +#删除未知单 +defineDict["THOST_FTDC_FC_DeleteOrder"] = 'F' + +typedefDict["TThostFtdcFunctionCodeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerFunctionCodeType是一个经纪公司功能代码类型 +#////////////////////////////////////////////////////////////////////// +#强制用户登出 +defineDict["THOST_FTDC_BFC_ForceUserLogout"] = '1' +#变更用户口令 +defineDict["THOST_FTDC_BFC_UserPasswordUpdate"] = '2' +#同步经纪公司数据 +defineDict["THOST_FTDC_BFC_SyncBrokerData"] = '3' +#批量同步经纪公司数据 +defineDict["THOST_FTDC_BFC_BachSyncBrokerData"] = '4' +#报单插入 +defineDict["THOST_FTDC_BFC_OrderInsert"] = '5' +#报单操作 +defineDict["THOST_FTDC_BFC_OrderAction"] = '6' +#全部查询 +defineDict["THOST_FTDC_BFC_AllQuery"] = '7' +#系统功能:登入/登出/修改密码等 +defineDict["THOST_FTDC_BFC_log"] = 'a' +#基本查询:查询基础数据,如合约,交易所等常量 +defineDict["THOST_FTDC_BFC_BaseQry"] = 'b' +#交易查询:如查成交,委托 +defineDict["THOST_FTDC_BFC_TradeQry"] = 'c' +#交易功能:报单,撤单 +defineDict["THOST_FTDC_BFC_Trade"] = 'd' +#银期转账 +defineDict["THOST_FTDC_BFC_Virement"] = 'e' +#风险监控 +defineDict["THOST_FTDC_BFC_Risk"] = 'f' +#查询/管理:查询会话,踢人等 +defineDict["THOST_FTDC_BFC_Session"] = 'g' +#风控通知控制 +defineDict["THOST_FTDC_BFC_RiskNoticeCtl"] = 'h' +#风控通知发送 +defineDict["THOST_FTDC_BFC_RiskNotice"] = 'i' +#察看经纪公司资金权限 +defineDict["THOST_FTDC_BFC_BrokerDeposit"] = 'j' +#资金查询 +defineDict["THOST_FTDC_BFC_QueryFund"] = 'k' +#报单查询 +defineDict["THOST_FTDC_BFC_QueryOrder"] = 'l' +#成交查询 +defineDict["THOST_FTDC_BFC_QueryTrade"] = 'm' +#持仓查询 +defineDict["THOST_FTDC_BFC_QueryPosition"] = 'n' +#行情查询 +defineDict["THOST_FTDC_BFC_QueryMarketData"] = 'o' +#用户事件查询 +defineDict["THOST_FTDC_BFC_QueryUserEvent"] = 'p' +#风险通知查询 +defineDict["THOST_FTDC_BFC_QueryRiskNotify"] = 'q' +#出入金查询 +defineDict["THOST_FTDC_BFC_QueryFundChange"] = 'r' +#投资者信息查询 +defineDict["THOST_FTDC_BFC_QueryInvestor"] = 's' +#交易编码查询 +defineDict["THOST_FTDC_BFC_QueryTradingCode"] = 't' +#强平 +defineDict["THOST_FTDC_BFC_ForceClose"] = 'u' +#压力测试 +defineDict["THOST_FTDC_BFC_PressTest"] = 'v' +#权益反算 +defineDict["THOST_FTDC_BFC_RemainCalc"] = 'w' +#净持仓保证金指标 +defineDict["THOST_FTDC_BFC_NetPositionInd"] = 'x' +#风险预算 +defineDict["THOST_FTDC_BFC_RiskPredict"] = 'y' +#数据导出 +defineDict["THOST_FTDC_BFC_DataExport"] = 'z' +#风控指标设置 +defineDict["THOST_FTDC_BFC_RiskTargetSetup"] = 'A' +#行情预警 +defineDict["THOST_FTDC_BFC_MarketDataWarn"] = 'B' +#业务通知查询 +defineDict["THOST_FTDC_BFC_QryBizNotice"] = 'C' +#业务通知模板设置 +defineDict["THOST_FTDC_BFC_CfgBizNotice"] = 'D' +#同步动态令牌 +defineDict["THOST_FTDC_BFC_SyncOTP"] = 'E' +#发送业务通知 +defineDict["THOST_FTDC_BFC_SendBizNotice"] = 'F' +#风险级别标准设置 +defineDict["THOST_FTDC_BFC_CfgRiskLevelStd"] = 'G' +#交易终端应急功能 +defineDict["THOST_FTDC_BFC_TbCommand"] = 'H' +#删除未知单 +defineDict["THOST_FTDC_BFC_DeleteOrder"] = 'J' +#预埋报单插入 +defineDict["THOST_FTDC_BFC_ParkedOrderInsert"] = 'K' +#预埋报单操作 +defineDict["THOST_FTDC_BFC_ParkedOrderAction"] = 'L' + +typedefDict["TThostFtdcBrokerFunctionCodeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderActionStatusType是一个报单操作状态类型 +#////////////////////////////////////////////////////////////////////// +#已经提交 +defineDict["THOST_FTDC_OAS_Submitted"] = 'a' +#已经接受 +defineDict["THOST_FTDC_OAS_Accepted"] = 'b' +#已经被拒绝 +defineDict["THOST_FTDC_OAS_Rejected"] = 'c' + +typedefDict["TThostFtdcOrderActionStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderStatusType是一个报单状态类型 +#////////////////////////////////////////////////////////////////////// +#全部成交 +defineDict["THOST_FTDC_OST_AllTraded"] = '0' +#部分成交还在队列中 +defineDict["THOST_FTDC_OST_PartTradedQueueing"] = '1' +#部分成交不在队列中 +defineDict["THOST_FTDC_OST_PartTradedNotQueueing"] = '2' +#未成交还在队列中 +defineDict["THOST_FTDC_OST_NoTradeQueueing"] = '3' +#未成交不在队列中 +defineDict["THOST_FTDC_OST_NoTradeNotQueueing"] = '4' +#撤单 +defineDict["THOST_FTDC_OST_Canceled"] = '5' +#未知 +defineDict["THOST_FTDC_OST_Unknown"] = 'a' +#尚未触发 +defineDict["THOST_FTDC_OST_NotTouched"] = 'b' +#已触发 +defineDict["THOST_FTDC_OST_Touched"] = 'c' + +typedefDict["TThostFtdcOrderStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderSubmitStatusType是一个报单提交状态类型 +#////////////////////////////////////////////////////////////////////// +#已经提交 +defineDict["THOST_FTDC_OSS_InsertSubmitted"] = '0' +#撤单已经提交 +defineDict["THOST_FTDC_OSS_CancelSubmitted"] = '1' +#修改已经提交 +defineDict["THOST_FTDC_OSS_ModifySubmitted"] = '2' +#已经接受 +defineDict["THOST_FTDC_OSS_Accepted"] = '3' +#报单已经被拒绝 +defineDict["THOST_FTDC_OSS_InsertRejected"] = '4' +#撤单已经被拒绝 +defineDict["THOST_FTDC_OSS_CancelRejected"] = '5' +#改单已经被拒绝 +defineDict["THOST_FTDC_OSS_ModifyRejected"] = '6' + +typedefDict["TThostFtdcOrderSubmitStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionDateType是一个持仓日期类型 +#////////////////////////////////////////////////////////////////////// +#今日持仓 +defineDict["THOST_FTDC_PSD_Today"] = '1' +#历史持仓 +defineDict["THOST_FTDC_PSD_History"] = '2' + +typedefDict["TThostFtdcPositionDateType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionDateTypeType是一个持仓日期类型类型 +#////////////////////////////////////////////////////////////////////// +#使用历史持仓 +defineDict["THOST_FTDC_PDT_UseHistory"] = '1' +#不使用历史持仓 +defineDict["THOST_FTDC_PDT_NoUseHistory"] = '2' + +typedefDict["TThostFtdcPositionDateTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradingRoleType是一个交易角色类型 +#////////////////////////////////////////////////////////////////////// +#代理 +defineDict["THOST_FTDC_ER_Broker"] = '1' +#自营 +defineDict["THOST_FTDC_ER_Host"] = '2' +#做市商 +defineDict["THOST_FTDC_ER_Maker"] = '3' + +typedefDict["TThostFtdcTradingRoleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductClassType是一个产品类型类型 +#////////////////////////////////////////////////////////////////////// +#期货 +defineDict["THOST_FTDC_PC_Futures"] = '1' +#期货期权 +defineDict["THOST_FTDC_PC_Options"] = '2' +#组合 +defineDict["THOST_FTDC_PC_Combination"] = '3' +#即期 +defineDict["THOST_FTDC_PC_Spot"] = '4' +#期转现 +defineDict["THOST_FTDC_PC_EFP"] = '5' +#现货期权 +defineDict["THOST_FTDC_PC_SpotOption"] = '6' +#个股期权 +defineDict["THOST_FTDC_PC_ETFOption"] = '7' +#证券 +defineDict["THOST_FTDC_PC_Stock"] = '8' + +typedefDict["TThostFtdcProductClassType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstLifePhaseType是一个合约生命周期状态类型 +#////////////////////////////////////////////////////////////////////// +#未上市 +defineDict["THOST_FTDC_IP_NotStart"] = '0' +#上市 +defineDict["THOST_FTDC_IP_Started"] = '1' +#停牌 +defineDict["THOST_FTDC_IP_Pause"] = '2' +#到期 +defineDict["THOST_FTDC_IP_Expired"] = '3' + +typedefDict["TThostFtdcInstLifePhaseType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDirectionType是一个买卖方向类型 +#////////////////////////////////////////////////////////////////////// +#买 +defineDict["THOST_FTDC_D_Buy"] = '0' +#卖 +defineDict["THOST_FTDC_D_Sell"] = '1' + +typedefDict["TThostFtdcDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionTypeType是一个持仓类型类型 +#////////////////////////////////////////////////////////////////////// +#净持仓 +defineDict["THOST_FTDC_PT_Net"] = '1' +#综合持仓 +defineDict["THOST_FTDC_PT_Gross"] = '2' + +typedefDict["TThostFtdcPositionTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPosiDirectionType是一个持仓多空方向类型 +#////////////////////////////////////////////////////////////////////// +#净 +defineDict["THOST_FTDC_PD_Net"] = '1' +#多头 +defineDict["THOST_FTDC_PD_Long"] = '2' +#空头 +defineDict["THOST_FTDC_PD_Short"] = '3' + +typedefDict["TThostFtdcPosiDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSysSettlementStatusType是一个系统结算状态类型 +#////////////////////////////////////////////////////////////////////// +#不活跃 +defineDict["THOST_FTDC_SS_NonActive"] = '1' +#启动 +defineDict["THOST_FTDC_SS_Startup"] = '2' +#操作 +defineDict["THOST_FTDC_SS_Operating"] = '3' +#结算 +defineDict["THOST_FTDC_SS_Settlement"] = '4' +#结算完成 +defineDict["THOST_FTDC_SS_SettlementFinished"] = '5' + +typedefDict["TThostFtdcSysSettlementStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRatioAttrType是一个费率属性类型 +#////////////////////////////////////////////////////////////////////// +#交易费率 +defineDict["THOST_FTDC_RA_Trade"] = '0' +#结算费率 +defineDict["THOST_FTDC_RA_Settlement"] = '1' + +typedefDict["TThostFtdcRatioAttrType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHedgeFlagType是一个投机套保标志类型 +#////////////////////////////////////////////////////////////////////// +#投机 +defineDict["THOST_FTDC_HF_Speculation"] = '1' +#套利 +defineDict["THOST_FTDC_HF_Arbitrage"] = '2' +#套保 +defineDict["THOST_FTDC_HF_Hedge"] = '3' +#备兑 +defineDict["THOST_FTDC_HF_Covered"] = '4' + +typedefDict["TThostFtdcHedgeFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBillHedgeFlagType是一个投机套保标志类型 +#////////////////////////////////////////////////////////////////////// +#投机 +defineDict["THOST_FTDC_BHF_Speculation"] = '1' +#套利 +defineDict["THOST_FTDC_BHF_Arbitrage"] = '2' +#套保 +defineDict["THOST_FTDC_BHF_Hedge"] = '3' + +typedefDict["TThostFtdcBillHedgeFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientIDTypeType是一个交易编码类型类型 +#////////////////////////////////////////////////////////////////////// +#投机 +defineDict["THOST_FTDC_CIDT_Speculation"] = '1' +#套利 +defineDict["THOST_FTDC_CIDT_Arbitrage"] = '2' +#套保 +defineDict["THOST_FTDC_CIDT_Hedge"] = '3' + +typedefDict["TThostFtdcClientIDTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderPriceTypeType是一个报单价格条件类型 +#////////////////////////////////////////////////////////////////////// +#任意价 +defineDict["THOST_FTDC_OPT_AnyPrice"] = '1' +#限价 +defineDict["THOST_FTDC_OPT_LimitPrice"] = '2' +#最优价 +defineDict["THOST_FTDC_OPT_BestPrice"] = '3' +#最新价 +defineDict["THOST_FTDC_OPT_LastPrice"] = '4' +#最新价浮动上浮1个ticks +defineDict["THOST_FTDC_OPT_LastPricePlusOneTicks"] = '5' +#最新价浮动上浮2个ticks +defineDict["THOST_FTDC_OPT_LastPricePlusTwoTicks"] = '6' +#最新价浮动上浮3个ticks +defineDict["THOST_FTDC_OPT_LastPricePlusThreeTicks"] = '7' +#卖一价 +defineDict["THOST_FTDC_OPT_AskPrice1"] = '8' +#卖一价浮动上浮1个ticks +defineDict["THOST_FTDC_OPT_AskPrice1PlusOneTicks"] = '9' +#卖一价浮动上浮2个ticks +defineDict["THOST_FTDC_OPT_AskPrice1PlusTwoTicks"] = 'A' +#卖一价浮动上浮3个ticks +defineDict["THOST_FTDC_OPT_AskPrice1PlusThreeTicks"] = 'B' +#买一价 +defineDict["THOST_FTDC_OPT_BidPrice1"] = 'C' +#买一价浮动上浮1个ticks +defineDict["THOST_FTDC_OPT_BidPrice1PlusOneTicks"] = 'D' +#买一价浮动上浮2个ticks +defineDict["THOST_FTDC_OPT_BidPrice1PlusTwoTicks"] = 'E' +#买一价浮动上浮3个ticks +defineDict["THOST_FTDC_OPT_BidPrice1PlusThreeTicks"] = 'F' +#五档价 +defineDict["THOST_FTDC_OPT_FiveLevelPrice"] = 'G' +#本方最优价 +defineDict["THOST_FTDC_OPT_BestPriceThisSide"] = 'H' + +typedefDict["TThostFtdcOrderPriceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOffsetFlagType是一个开平标志类型 +#////////////////////////////////////////////////////////////////////// +#开仓 +defineDict["THOST_FTDC_OF_Open"] = '0' +#平仓 +defineDict["THOST_FTDC_OF_Close"] = '1' +#强平 +defineDict["THOST_FTDC_OF_ForceClose"] = '2' +#平今 +defineDict["THOST_FTDC_OF_CloseToday"] = '3' +#平昨 +defineDict["THOST_FTDC_OF_CloseYesterday"] = '4' +#强减 +defineDict["THOST_FTDC_OF_ForceOff"] = '5' +#本地强平 +defineDict["THOST_FTDC_OF_LocalForceClose"] = '6' + +typedefDict["TThostFtdcOffsetFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcForceCloseReasonType是一个强平原因类型 +#////////////////////////////////////////////////////////////////////// +#非强平 +defineDict["THOST_FTDC_FCC_NotForceClose"] = '0' +#资金不足 +defineDict["THOST_FTDC_FCC_LackDeposit"] = '1' +#客户超仓 +defineDict["THOST_FTDC_FCC_ClientOverPositionLimit"] = '2' +#会员超仓 +defineDict["THOST_FTDC_FCC_MemberOverPositionLimit"] = '3' +#持仓非整数倍 +defineDict["THOST_FTDC_FCC_NotMultiple"] = '4' +#违规 +defineDict["THOST_FTDC_FCC_Violation"] = '5' +#其它 +defineDict["THOST_FTDC_FCC_Other"] = '6' +#自然人临近交割 +defineDict["THOST_FTDC_FCC_PersonDeliv"] = '7' + +typedefDict["TThostFtdcForceCloseReasonType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderTypeType是一个报单类型类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_ORDT_Normal"] = '0' +#报价衍生 +defineDict["THOST_FTDC_ORDT_DeriveFromQuote"] = '1' +#组合衍生 +defineDict["THOST_FTDC_ORDT_DeriveFromCombination"] = '2' +#组合报单 +defineDict["THOST_FTDC_ORDT_Combination"] = '3' +#条件单 +defineDict["THOST_FTDC_ORDT_ConditionalOrder"] = '4' +#互换单 +defineDict["THOST_FTDC_ORDT_Swap"] = '5' + +typedefDict["TThostFtdcOrderTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTimeConditionType是一个有效期类型类型 +#////////////////////////////////////////////////////////////////////// +#立即完成,否则撤销 +defineDict["THOST_FTDC_TC_IOC"] = '1' +#本节有效 +defineDict["THOST_FTDC_TC_GFS"] = '2' +#当日有效 +defineDict["THOST_FTDC_TC_GFD"] = '3' +#指定日期前有效 +defineDict["THOST_FTDC_TC_GTD"] = '4' +#撤销前有效 +defineDict["THOST_FTDC_TC_GTC"] = '5' +#集合竞价有效 +defineDict["THOST_FTDC_TC_GFA"] = '6' + +typedefDict["TThostFtdcTimeConditionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVolumeConditionType是一个成交量类型类型 +#////////////////////////////////////////////////////////////////////// +#任何数量 +defineDict["THOST_FTDC_VC_AV"] = '1' +#最小数量 +defineDict["THOST_FTDC_VC_MV"] = '2' +#全部数量 +defineDict["THOST_FTDC_VC_CV"] = '3' + +typedefDict["TThostFtdcVolumeConditionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcContingentConditionType是一个触发条件类型 +#////////////////////////////////////////////////////////////////////// +#立即 +defineDict["THOST_FTDC_CC_Immediately"] = '1' +#止损 +defineDict["THOST_FTDC_CC_Touch"] = '2' +#止赢 +defineDict["THOST_FTDC_CC_TouchProfit"] = '3' +#预埋单 +defineDict["THOST_FTDC_CC_ParkedOrder"] = '4' +#最新价大于条件价 +defineDict["THOST_FTDC_CC_LastPriceGreaterThanStopPrice"] = '5' +#最新价大于等于条件价 +defineDict["THOST_FTDC_CC_LastPriceGreaterEqualStopPrice"] = '6' +#最新价小于条件价 +defineDict["THOST_FTDC_CC_LastPriceLesserThanStopPrice"] = '7' +#最新价小于等于条件价 +defineDict["THOST_FTDC_CC_LastPriceLesserEqualStopPrice"] = '8' +#卖一价大于条件价 +defineDict["THOST_FTDC_CC_AskPriceGreaterThanStopPrice"] = '9' +#卖一价大于等于条件价 +defineDict["THOST_FTDC_CC_AskPriceGreaterEqualStopPrice"] = 'A' +#卖一价小于条件价 +defineDict["THOST_FTDC_CC_AskPriceLesserThanStopPrice"] = 'B' +#卖一价小于等于条件价 +defineDict["THOST_FTDC_CC_AskPriceLesserEqualStopPrice"] = 'C' +#买一价大于条件价 +defineDict["THOST_FTDC_CC_BidPriceGreaterThanStopPrice"] = 'D' +#买一价大于等于条件价 +defineDict["THOST_FTDC_CC_BidPriceGreaterEqualStopPrice"] = 'E' +#买一价小于条件价 +defineDict["THOST_FTDC_CC_BidPriceLesserThanStopPrice"] = 'F' +#买一价小于等于条件价 +defineDict["THOST_FTDC_CC_BidPriceLesserEqualStopPrice"] = 'H' + +typedefDict["TThostFtdcContingentConditionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcActionFlagType是一个操作标志类型 +#////////////////////////////////////////////////////////////////////// +#删除 +defineDict["THOST_FTDC_AF_Delete"] = '0' +#修改 +defineDict["THOST_FTDC_AF_Modify"] = '3' + +typedefDict["TThostFtdcActionFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradingRightType是一个交易权限类型 +#////////////////////////////////////////////////////////////////////// +#可以交易 +defineDict["THOST_FTDC_TR_Allow"] = '0' +#只能平仓 +defineDict["THOST_FTDC_TR_CloseOnly"] = '1' +#不能交易 +defineDict["THOST_FTDC_TR_Forbidden"] = '2' + +typedefDict["TThostFtdcTradingRightType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderSourceType是一个报单来源类型 +#////////////////////////////////////////////////////////////////////// +#来自参与者 +defineDict["THOST_FTDC_OSRC_Participant"] = '0' +#来自管理员 +defineDict["THOST_FTDC_OSRC_Administrator"] = '1' + +typedefDict["TThostFtdcOrderSourceType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeTypeType是一个成交类型类型 +#////////////////////////////////////////////////////////////////////// +#组合持仓拆分为单一持仓,初始化不应包含该类型的持仓 +defineDict["THOST_FTDC_TRDT_SplitCombination"] = '#' +#普通成交 +defineDict["THOST_FTDC_TRDT_Common"] = '0' +#期权执行 +defineDict["THOST_FTDC_TRDT_OptionsExecution"] = '1' +#OTC成交 +defineDict["THOST_FTDC_TRDT_OTC"] = '2' +#期转现衍生成交 +defineDict["THOST_FTDC_TRDT_EFPDerived"] = '3' +#组合衍生成交 +defineDict["THOST_FTDC_TRDT_CombinationDerived"] = '4' + +typedefDict["TThostFtdcTradeTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriceSourceType是一个成交价来源类型 +#////////////////////////////////////////////////////////////////////// +#前成交价 +defineDict["THOST_FTDC_PSRC_LastPrice"] = '0' +#买委托价 +defineDict["THOST_FTDC_PSRC_Buy"] = '1' +#卖委托价 +defineDict["THOST_FTDC_PSRC_Sell"] = '2' + +typedefDict["TThostFtdcPriceSourceType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentStatusType是一个合约交易状态类型 +#////////////////////////////////////////////////////////////////////// +#开盘前 +defineDict["THOST_FTDC_IS_BeforeTrading"] = '0' +#非交易 +defineDict["THOST_FTDC_IS_NoTrading"] = '1' +#连续交易 +defineDict["THOST_FTDC_IS_Continous"] = '2' +#集合竞价报单 +defineDict["THOST_FTDC_IS_AuctionOrdering"] = '3' +#集合竞价价格平衡 +defineDict["THOST_FTDC_IS_AuctionBalance"] = '4' +#集合竞价撮合 +defineDict["THOST_FTDC_IS_AuctionMatch"] = '5' +#收盘 +defineDict["THOST_FTDC_IS_Closed"] = '6' + +typedefDict["TThostFtdcInstrumentStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstStatusEnterReasonType是一个品种进入交易状态原因类型 +#////////////////////////////////////////////////////////////////////// +#自动切换 +defineDict["THOST_FTDC_IER_Automatic"] = '1' +#手动切换 +defineDict["THOST_FTDC_IER_Manual"] = '2' +#熔断 +defineDict["THOST_FTDC_IER_Fuse"] = '3' + +typedefDict["TThostFtdcInstStatusEnterReasonType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrderActionRefType是一个报单操作引用类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrderActionRefType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstallCountType是一个安装数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstallCountType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstallIDType是一个安装编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstallIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcErrorIDType是一个错误代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcErrorIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementIDType是一个结算编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSettlementIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVolumeType是一个数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcVolumeType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFrontIDType是一个前置编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFrontIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSessionIDType是一个会话编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSessionIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSequenceNoType是一个序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSequenceNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommandNoType是一个DB命令序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommandNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMillisecType是一个时间(毫秒)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMillisecType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVolumeMultipleType是一个合约数量乘数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcVolumeMultipleType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradingSegmentSNType是一个交易阶段编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradingSegmentSNType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRequestIDType是一个请求编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRequestIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcYearType是一个年份类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcYearType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMonthType是一个月份类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMonthType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBoolType是一个布尔型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBoolType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriceType是一个价格类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPriceType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombOffsetFlagType是一个组合开平标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCombOffsetFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombHedgeFlagType是一个组合投机套保标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCombHedgeFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRatioType是一个比率类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRatioType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMoneyType是一个资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMoneyType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLargeVolumeType是一个大额数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLargeVolumeType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSequenceSeriesType是一个序列系列号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSequenceSeriesType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommPhaseNoType是一个通讯时段编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommPhaseNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSequenceLabelType是一个序列编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSequenceLabelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUnderlyingMultipleType是一个基础商品乘数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUnderlyingMultipleType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriorityType是一个优先级类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPriorityType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcContractCodeType是一个合同编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcContractCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCityType是一个市类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCityType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIsStockType是一个是否股民类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIsStockType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcChannelType是一个渠道类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcChannelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAddressType是一个通讯地址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAddressType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcZipCodeType是一个邮政编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcZipCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTelephoneType是一个联系电话类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTelephoneType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFaxType是一个传真类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFaxType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMobileType是一个手机类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMobileType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEMailType是一个电子邮件类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcEMailType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMemoType是一个备注类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCompanyCodeType是一个企业代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCompanyCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWebsiteType是一个网站地址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcWebsiteType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTaxNoType是一个税务登记号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTaxNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBatchStatusType是一个处理状态类型 +#////////////////////////////////////////////////////////////////////// +#未上传 +defineDict["THOST_FTDC_BS_NoUpload"] = '1' +#已上传 +defineDict["THOST_FTDC_BS_Uploaded"] = '2' +#审核失败 +defineDict["THOST_FTDC_BS_Failed"] = '3' + +typedefDict["TThostFtdcBatchStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPropertyIDType是一个属性代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPropertyIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPropertyNameType是一个属性名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPropertyNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLicenseNoType是一个营业执照号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLicenseNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAgentIDType是一个经纪人代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAgentIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAgentNameType是一个经纪人名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAgentNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAgentGroupIDType是一个经纪人组代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAgentGroupIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAgentGroupNameType是一个经纪人组名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAgentGroupNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReturnStyleType是一个按品种返还方式类型 +#////////////////////////////////////////////////////////////////////// +#按所有品种 +defineDict["THOST_FTDC_RS_All"] = '1' +#按品种 +defineDict["THOST_FTDC_RS_ByProduct"] = '2' + +typedefDict["TThostFtdcReturnStyleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReturnPatternType是一个返还模式类型 +#////////////////////////////////////////////////////////////////////// +#按成交手数 +defineDict["THOST_FTDC_RP_ByVolume"] = '1' +#按留存手续费 +defineDict["THOST_FTDC_RP_ByFeeOnHand"] = '2' + +typedefDict["TThostFtdcReturnPatternType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReturnLevelType是一个返还级别类型 +#////////////////////////////////////////////////////////////////////// +#级别1 +defineDict["THOST_FTDC_RL_Level1"] = '1' +#级别2 +defineDict["THOST_FTDC_RL_Level2"] = '2' +#级别3 +defineDict["THOST_FTDC_RL_Level3"] = '3' +#级别4 +defineDict["THOST_FTDC_RL_Level4"] = '4' +#级别5 +defineDict["THOST_FTDC_RL_Level5"] = '5' +#级别6 +defineDict["THOST_FTDC_RL_Level6"] = '6' +#级别7 +defineDict["THOST_FTDC_RL_Level7"] = '7' +#级别8 +defineDict["THOST_FTDC_RL_Level8"] = '8' +#级别9 +defineDict["THOST_FTDC_RL_Level9"] = '9' + +typedefDict["TThostFtdcReturnLevelType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReturnStandardType是一个返还标准类型 +#////////////////////////////////////////////////////////////////////// +#分阶段返还 +defineDict["THOST_FTDC_RSD_ByPeriod"] = '1' +#按某一标准 +defineDict["THOST_FTDC_RSD_ByStandard"] = '2' + +typedefDict["TThostFtdcReturnStandardType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMortgageTypeType是一个质押类型类型 +#////////////////////////////////////////////////////////////////////// +#质出 +defineDict["THOST_FTDC_MT_Out"] = '0' +#质入 +defineDict["THOST_FTDC_MT_In"] = '1' + +typedefDict["TThostFtdcMortgageTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorSettlementParamIDType是一个投资者结算参数代码类型 +#////////////////////////////////////////////////////////////////////// +#质押比例 +defineDict["THOST_FTDC_ISPI_MortgageRatio"] = '4' +#保证金算法 +defineDict["THOST_FTDC_ISPI_MarginWay"] = '5' +#结算单结存是否包含质押 +defineDict["THOST_FTDC_ISPI_BillDeposit"] = '9' + +typedefDict["TThostFtdcInvestorSettlementParamIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeSettlementParamIDType是一个交易所结算参数代码类型 +#////////////////////////////////////////////////////////////////////// +#质押比例 +defineDict["THOST_FTDC_ESPI_MortgageRatio"] = '1' +#分项资金导入项 +defineDict["THOST_FTDC_ESPI_OtherFundItem"] = '2' +#分项资金入交易所出入金 +defineDict["THOST_FTDC_ESPI_OtherFundImport"] = '3' +#中金所开户最低可用金额 +defineDict["THOST_FTDC_ESPI_CFFEXMinPrepa"] = '6' +#郑商所结算方式 +defineDict["THOST_FTDC_ESPI_CZCESettlementType"] = '7' +#交易所交割手续费收取方式 +defineDict["THOST_FTDC_ESPI_ExchDelivFeeMode"] = '9' +#投资者交割手续费收取方式 +defineDict["THOST_FTDC_ESPI_DelivFeeMode"] = '0' +#郑商所组合持仓保证金收取方式 +defineDict["THOST_FTDC_ESPI_CZCEComMarginType"] = 'A' +#大商所套利保证金是否优惠 +defineDict["THOST_FTDC_ESPI_DceComMarginType"] = 'B' +#虚值期权保证金优惠比率 +defineDict["THOST_FTDC_ESPI_OptOutDisCountRate"] = 'a' +#最低保障系数 +defineDict["THOST_FTDC_ESPI_OptMiniGuarantee"] = 'b' + +typedefDict["TThostFtdcExchangeSettlementParamIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSystemParamIDType是一个系统参数代码类型 +#////////////////////////////////////////////////////////////////////// +#投资者代码最小长度 +defineDict["THOST_FTDC_SPI_InvestorIDMinLength"] = '1' +#投资者帐号代码最小长度 +defineDict["THOST_FTDC_SPI_AccountIDMinLength"] = '2' +#投资者开户默认登录权限 +defineDict["THOST_FTDC_SPI_UserRightLogon"] = '3' +#投资者交易结算单成交汇总方式 +defineDict["THOST_FTDC_SPI_SettlementBillTrade"] = '4' +#统一开户更新交易编码方式 +defineDict["THOST_FTDC_SPI_TradingCode"] = '5' +#结算是否判断存在未复核的出入金和分项资金 +defineDict["THOST_FTDC_SPI_CheckFund"] = '6' +#是否启用手续费模板数据权限 +defineDict["THOST_FTDC_SPI_CommModelRight"] = '7' +#是否启用保证金率模板数据权限 +defineDict["THOST_FTDC_SPI_MarginModelRight"] = '9' +#是否规范用户才能激活 +defineDict["THOST_FTDC_SPI_IsStandardActive"] = '8' +#上传的交易所结算文件路径 +defineDict["THOST_FTDC_SPI_UploadSettlementFile"] = 'U' +#上报保证金监控中心文件路径 +defineDict["THOST_FTDC_SPI_DownloadCSRCFile"] = 'D' +#生成的结算单文件路径 +defineDict["THOST_FTDC_SPI_SettlementBillFile"] = 'S' +#证监会文件标识 +defineDict["THOST_FTDC_SPI_CSRCOthersFile"] = 'C' +#投资者照片路径 +defineDict["THOST_FTDC_SPI_InvestorPhoto"] = 'P' +#全结经纪公司上传文件路径 +defineDict["THOST_FTDC_SPI_CSRCData"] = 'R' +#开户密码录入方式 +defineDict["THOST_FTDC_SPI_InvestorPwdModel"] = 'I' +#投资者中金所结算文件下载路径 +defineDict["THOST_FTDC_SPI_CFFEXInvestorSettleFile"] = 'F' +#投资者代码编码方式 +defineDict["THOST_FTDC_SPI_InvestorIDType"] = 'a' +#休眠户最高权益 +defineDict["THOST_FTDC_SPI_FreezeMaxReMain"] = 'r' +#手续费相关操作实时上场开关 +defineDict["THOST_FTDC_SPI_IsSync"] = 'A' +#解除开仓权限限制 +defineDict["THOST_FTDC_SPI_RelieveOpenLimit"] = 'O' +#是否规范用户才能休眠 +defineDict["THOST_FTDC_SPI_IsStandardFreeze"] = 'X' +#郑商所是否开放所有品种套保交易 +defineDict["THOST_FTDC_SPI_CZCENormalProductHedge"] = 'B' + +typedefDict["TThostFtdcSystemParamIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeParamIDType是一个交易系统参数代码类型 +#////////////////////////////////////////////////////////////////////// +#系统加密算法 +defineDict["THOST_FTDC_TPID_EncryptionStandard"] = 'E' +#系统风险算法 +defineDict["THOST_FTDC_TPID_RiskMode"] = 'R' +#系统风险算法是否全局 0-否 1-是 +defineDict["THOST_FTDC_TPID_RiskModeGlobal"] = 'G' +#密码加密算法 +defineDict["THOST_FTDC_TPID_modeEncode"] = 'P' +#价格小数位数参数 +defineDict["THOST_FTDC_TPID_tickMode"] = 'T' +#用户最大会话数 +defineDict["THOST_FTDC_TPID_SingleUserSessionMaxNum"] = 'S' +#最大连续登录失败数 +defineDict["THOST_FTDC_TPID_LoginFailMaxNum"] = 'L' +#是否强制认证 +defineDict["THOST_FTDC_TPID_IsAuthForce"] = 'A' +#是否冻结证券持仓 +defineDict["THOST_FTDC_TPID_IsPosiFreeze"] = 'F' +#是否限仓 +defineDict["THOST_FTDC_TPID_IsPosiLimit"] = 'M' +#郑商所询价时间间隔 +defineDict["THOST_FTDC_TPID_ForQuoteTimeInterval"] = 'Q' + +typedefDict["TThostFtdcTradeParamIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementParamValueType是一个参数代码值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSettlementParamValueType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCounterIDType是一个计数器代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCounterIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorGroupNameType是一个投资者分组名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvestorGroupNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrandCodeType是一个牌号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBrandCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWarehouseType是一个仓库类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcWarehouseType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductDateType是一个产期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProductDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcGradeType是一个等级类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcGradeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClassifyType是一个类别类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClassifyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPositionType是一个货位类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPositionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcYieldlyType是一个产地类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcYieldlyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWeightType是一个公定重量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcWeightType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSubEntryFundNoType是一个分项资金流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSubEntryFundNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileIDType是一个文件标识类型 +#////////////////////////////////////////////////////////////////////// +#资金数据 +defineDict["THOST_FTDC_FI_SettlementFund"] = 'F' +#成交数据 +defineDict["THOST_FTDC_FI_Trade"] = 'T' +#投资者持仓数据 +defineDict["THOST_FTDC_FI_InvestorPosition"] = 'P' +#投资者分项资金数据 +defineDict["THOST_FTDC_FI_SubEntryFund"] = 'O' +#组合持仓数据 +defineDict["THOST_FTDC_FI_CZCECombinationPos"] = 'C' +#上报保证金监控中心数据 +defineDict["THOST_FTDC_FI_CSRCData"] = 'R' +#郑商所平仓了结数据 +defineDict["THOST_FTDC_FI_CZCEClose"] = 'L' +#郑商所非平仓了结数据 +defineDict["THOST_FTDC_FI_CZCENoClose"] = 'N' +#持仓明细数据 +defineDict["THOST_FTDC_FI_PositionDtl"] = 'D' +#期权执行文件 +defineDict["THOST_FTDC_FI_OptionStrike"] = 'S' +#结算价比对文件 +defineDict["THOST_FTDC_FI_SettlementPriceComparison"] = 'M' +#上期所非持仓变动明细 +defineDict["THOST_FTDC_FI_NonTradePosChange"] = 'B' + +typedefDict["TThostFtdcFileIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileNameType是一个文件名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFileNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileTypeType是一个文件上传类型类型 +#////////////////////////////////////////////////////////////////////// +#结算 +defineDict["THOST_FTDC_FUT_Settlement"] = '0' +#核对 +defineDict["THOST_FTDC_FUT_Check"] = '1' + +typedefDict["TThostFtdcFileTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileFormatType是一个文件格式类型 +#////////////////////////////////////////////////////////////////////// +#文本文件(.txt) +defineDict["THOST_FTDC_FFT_Txt"] = '0' +#压缩文件(.zip) +defineDict["THOST_FTDC_FFT_Zip"] = '1' +#DBF文件(.dbf) +defineDict["THOST_FTDC_FFT_DBF"] = '2' + +typedefDict["TThostFtdcFileFormatType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileUploadStatusType是一个文件状态类型 +#////////////////////////////////////////////////////////////////////// +#上传成功 +defineDict["THOST_FTDC_FUS_SucceedUpload"] = '1' +#上传失败 +defineDict["THOST_FTDC_FUS_FailedUpload"] = '2' +#导入成功 +defineDict["THOST_FTDC_FUS_SucceedLoad"] = '3' +#导入部分成功 +defineDict["THOST_FTDC_FUS_PartSucceedLoad"] = '4' +#导入失败 +defineDict["THOST_FTDC_FUS_FailedLoad"] = '5' + +typedefDict["TThostFtdcFileUploadStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTransferDirectionType是一个移仓方向类型 +#////////////////////////////////////////////////////////////////////// +#移出 +defineDict["THOST_FTDC_TD_Out"] = '0' +#移入 +defineDict["THOST_FTDC_TD_In"] = '1' + +typedefDict["TThostFtdcTransferDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUploadModeType是一个上传文件类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUploadModeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAccountIDType是一个投资者帐号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAccountIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankFlagType是一个银行统一标识类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccountType是一个银行账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOpenNameType是一个银行账户的开户人名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOpenNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOpenBankType是一个银行账户的开户行类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOpenBankType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankNameType是一个银行名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPublishPathType是一个发布路径类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPublishPathType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperatorIDType是一个操作员代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOperatorIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMonthCountType是一个月份数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMonthCountType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAdvanceMonthArrayType是一个月份提前数组类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAdvanceMonthArrayType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDateExprType是一个日期表达式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDateExprType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentIDExprType是一个合约代码表达式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstrumentIDExprType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentNameExprType是一个合约名称表达式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstrumentNameExprType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSpecialCreateRuleType是一个特殊的创建规则类型 +#////////////////////////////////////////////////////////////////////// +#没有特殊创建规则 +defineDict["THOST_FTDC_SC_NoSpecialRule"] = '0' +#不包含春节 +defineDict["THOST_FTDC_SC_NoSpringFestival"] = '1' + +typedefDict["TThostFtdcSpecialCreateRuleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBasisPriceTypeType是一个挂牌基准价类型类型 +#////////////////////////////////////////////////////////////////////// +#上一合约结算价 +defineDict["THOST_FTDC_IPT_LastSettlement"] = '1' +#上一合约收盘价 +defineDict["THOST_FTDC_IPT_LaseClose"] = '2' + +typedefDict["TThostFtdcBasisPriceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductLifePhaseType是一个产品生命周期状态类型 +#////////////////////////////////////////////////////////////////////// +#活跃 +defineDict["THOST_FTDC_PLP_Active"] = '1' +#不活跃 +defineDict["THOST_FTDC_PLP_NonActive"] = '2' +#注销 +defineDict["THOST_FTDC_PLP_Canceled"] = '3' + +typedefDict["TThostFtdcProductLifePhaseType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDeliveryModeType是一个交割方式类型 +#////////////////////////////////////////////////////////////////////// +#现金交割 +defineDict["THOST_FTDC_DM_CashDeliv"] = '1' +#实物交割 +defineDict["THOST_FTDC_DM_CommodityDeliv"] = '2' + +typedefDict["TThostFtdcDeliveryModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLogLevelType是一个日志级别类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLogLevelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProcessNameType是一个存储过程名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProcessNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperationMemoType是一个操作摘要类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOperationMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundIOTypeType是一个出入金类型类型 +#////////////////////////////////////////////////////////////////////// +#出入金 +defineDict["THOST_FTDC_FIOT_FundIO"] = '1' +#银期转帐 +defineDict["THOST_FTDC_FIOT_Transfer"] = '2' +#银期换汇 +defineDict["THOST_FTDC_FIOT_SwapCurrency"] = '3' + +typedefDict["TThostFtdcFundIOTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundTypeType是一个资金类型类型 +#////////////////////////////////////////////////////////////////////// +#银行存款 +defineDict["THOST_FTDC_FT_Deposite"] = '1' +#分项资金 +defineDict["THOST_FTDC_FT_ItemFund"] = '2' +#公司调整 +defineDict["THOST_FTDC_FT_Company"] = '3' +#资金内转 +defineDict["THOST_FTDC_FT_InnerTransfer"] = '4' + +typedefDict["TThostFtdcFundTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundDirectionType是一个出入金方向类型 +#////////////////////////////////////////////////////////////////////// +#入金 +defineDict["THOST_FTDC_FD_In"] = '1' +#出金 +defineDict["THOST_FTDC_FD_Out"] = '2' + +typedefDict["TThostFtdcFundDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundStatusType是一个资金状态类型 +#////////////////////////////////////////////////////////////////////// +#已录入 +defineDict["THOST_FTDC_FS_Record"] = '1' +#已复核 +defineDict["THOST_FTDC_FS_Check"] = '2' +#已冲销 +defineDict["THOST_FTDC_FS_Charge"] = '3' + +typedefDict["TThostFtdcFundStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBillNoType是一个票据号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBillNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBillNameType是一个票据名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBillNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPublishStatusType是一个发布状态类型 +#////////////////////////////////////////////////////////////////////// +#未发布 +defineDict["THOST_FTDC_PS_None"] = '1' +#正在发布 +defineDict["THOST_FTDC_PS_Publishing"] = '2' +#已发布 +defineDict["THOST_FTDC_PS_Published"] = '3' + +typedefDict["TThostFtdcPublishStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEnumValueIDType是一个枚举值代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcEnumValueIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEnumValueTypeType是一个枚举值类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcEnumValueTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEnumValueLabelType是一个枚举值名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcEnumValueLabelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEnumValueResultType是一个枚举值结果类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcEnumValueResultType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSystemStatusType是一个系统状态类型 +#////////////////////////////////////////////////////////////////////// +#不活跃 +defineDict["THOST_FTDC_ES_NonActive"] = '1' +#启动 +defineDict["THOST_FTDC_ES_Startup"] = '2' +#交易开始初始化 +defineDict["THOST_FTDC_ES_Initialize"] = '3' +#交易完成初始化 +defineDict["THOST_FTDC_ES_Initialized"] = '4' +#收市开始 +defineDict["THOST_FTDC_ES_Close"] = '5' +#收市完成 +defineDict["THOST_FTDC_ES_Closed"] = '6' +#结算 +defineDict["THOST_FTDC_ES_Settlement"] = '7' + +typedefDict["TThostFtdcSystemStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementStatusType是一个结算状态类型 +#////////////////////////////////////////////////////////////////////// +#初始 +defineDict["THOST_FTDC_STS_Initialize"] = '0' +#结算中 +defineDict["THOST_FTDC_STS_Settlementing"] = '1' +#已结算 +defineDict["THOST_FTDC_STS_Settlemented"] = '2' +#结算完成 +defineDict["THOST_FTDC_STS_Finished"] = '3' + +typedefDict["TThostFtdcSettlementStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRangeIntTypeType是一个限定值类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRangeIntTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRangeIntFromType是一个限定值下限类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRangeIntFromType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRangeIntToType是一个限定值上限类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRangeIntToType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionIDType是一个功能代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFunctionIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionValueCodeType是一个功能编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFunctionValueCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionNameType是一个功能名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFunctionNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRoleIDType是一个角色编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRoleIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRoleNameType是一个角色名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRoleNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDescriptionType是一个描述类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDescriptionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombineIDType是一个组合编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCombineIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombineTypeType是一个组合类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCombineTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorTypeType是一个投资者类型类型 +#////////////////////////////////////////////////////////////////////// +#自然人 +defineDict["THOST_FTDC_CT_Person"] = '0' +#法人 +defineDict["THOST_FTDC_CT_Company"] = '1' +#投资基金 +defineDict["THOST_FTDC_CT_Fund"] = '2' +#特殊法人 +defineDict["THOST_FTDC_CT_SpecialOrgan"] = '3' +#资管户 +defineDict["THOST_FTDC_CT_Asset"] = '4' + +typedefDict["TThostFtdcInvestorTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerTypeType是一个经纪公司类型类型 +#////////////////////////////////////////////////////////////////////// +#交易会员 +defineDict["THOST_FTDC_BT_Trade"] = '0' +#交易结算会员 +defineDict["THOST_FTDC_BT_TradeSettle"] = '1' + +typedefDict["TThostFtdcBrokerTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRiskLevelType是一个风险等级类型 +#////////////////////////////////////////////////////////////////////// +#低风险客户 +defineDict["THOST_FTDC_FAS_Low"] = '1' +#普通客户 +defineDict["THOST_FTDC_FAS_Normal"] = '2' +#关注客户 +defineDict["THOST_FTDC_FAS_Focus"] = '3' +#风险客户 +defineDict["THOST_FTDC_FAS_Risk"] = '4' + +typedefDict["TThostFtdcRiskLevelType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFeeAcceptStyleType是一个手续费收取方式类型 +#////////////////////////////////////////////////////////////////////// +#按交易收取 +defineDict["THOST_FTDC_FAS_ByTrade"] = '1' +#按交割收取 +defineDict["THOST_FTDC_FAS_ByDeliv"] = '2' +#不收 +defineDict["THOST_FTDC_FAS_None"] = '3' +#按指定手续费收取 +defineDict["THOST_FTDC_FAS_FixFee"] = '4' + +typedefDict["TThostFtdcFeeAcceptStyleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPasswordTypeType是一个密码类型类型 +#////////////////////////////////////////////////////////////////////// +#交易密码 +defineDict["THOST_FTDC_PWDT_Trade"] = '1' +#资金密码 +defineDict["THOST_FTDC_PWDT_Account"] = '2' + +typedefDict["TThostFtdcPasswordTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAlgorithmType是一个盈亏算法类型 +#////////////////////////////////////////////////////////////////////// +#浮盈浮亏都计算 +defineDict["THOST_FTDC_AG_All"] = '1' +#浮盈不计,浮亏计 +defineDict["THOST_FTDC_AG_OnlyLost"] = '2' +#浮盈计,浮亏不计 +defineDict["THOST_FTDC_AG_OnlyGain"] = '3' +#浮盈浮亏都不计算 +defineDict["THOST_FTDC_AG_None"] = '4' + +typedefDict["TThostFtdcAlgorithmType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIncludeCloseProfitType是一个是否包含平仓盈利类型 +#////////////////////////////////////////////////////////////////////// +#包含平仓盈利 +defineDict["THOST_FTDC_ICP_Include"] = '0' +#不包含平仓盈利 +defineDict["THOST_FTDC_ICP_NotInclude"] = '2' + +typedefDict["TThostFtdcIncludeCloseProfitType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAllWithoutTradeType是一个是否受可提比例限制类型 +#////////////////////////////////////////////////////////////////////// +#无仓无成交不受可提比例限制 +defineDict["THOST_FTDC_AWT_Enable"] = '0' +#受可提比例限制 +defineDict["THOST_FTDC_AWT_Disable"] = '2' +#无仓不受可提比例限制 +defineDict["THOST_FTDC_AWT_NoHoldEnable"] = '3' + +typedefDict["TThostFtdcAllWithoutTradeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommentType是一个盈亏算法说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVersionType是一个版本号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcVersionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeCodeType是一个交易代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeDateType是一个交易日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeTimeType是一个交易时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSerialType是一个发起方流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeSerialType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSerialNoType是一个发起方流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeSerialNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureIDType是一个期货公司代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankIDType是一个银行代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankBrchIDType是一个银行分中心代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankBrchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankBranchIDType是一个分中心代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperNoType是一个交易柜员类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOperNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDeviceIDType是一个渠道标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDeviceIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRecordNumType是一个记录数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRecordNumType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureAccountType是一个期货资金账号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFuturePwdFlagType是一个资金密码核对标志类型 +#////////////////////////////////////////////////////////////////////// +#不核对 +defineDict["THOST_FTDC_FPWD_UnCheck"] = '0' +#核对 +defineDict["THOST_FTDC_FPWD_Check"] = '1' + +typedefDict["TThostFtdcFuturePwdFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTransferTypeType是一个银期转账类型类型 +#////////////////////////////////////////////////////////////////////// +#银行转期货 +defineDict["THOST_FTDC_TT_BankToFuture"] = '0' +#期货转银行 +defineDict["THOST_FTDC_TT_FutureToBank"] = '1' + +typedefDict["TThostFtdcTransferTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureAccPwdType是一个期货资金密码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureAccPwdType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencyCodeType是一个币种类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrencyCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRetCodeType是一个响应代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRetCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRetInfoType是一个响应信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRetInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeAmtType是一个银行总余额类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeAmtType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUseAmtType是一个银行可用余额类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUseAmtType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFetchAmtType是一个银行可取余额类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFetchAmtType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTransferValidFlagType是一个转账有效标志类型 +#////////////////////////////////////////////////////////////////////// +#无效或失败 +defineDict["THOST_FTDC_TVF_Invalid"] = '0' +#有效 +defineDict["THOST_FTDC_TVF_Valid"] = '1' +#冲正 +defineDict["THOST_FTDC_TVF_Reverse"] = '2' + +typedefDict["TThostFtdcTransferValidFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCertCodeType是一个证件号码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCertCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReasonType是一个事由类型 +#////////////////////////////////////////////////////////////////////// +#错单 +defineDict["THOST_FTDC_RN_CD"] = '0' +#资金在途 +defineDict["THOST_FTDC_RN_ZT"] = '1' +#其它 +defineDict["THOST_FTDC_RN_QT"] = '2' + +typedefDict["TThostFtdcReasonType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundProjectIDType是一个资金项目编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFundProjectIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSexType是一个性别类型 +#////////////////////////////////////////////////////////////////////// +#未知 +defineDict["THOST_FTDC_SEX_None"] = '0' +#男 +defineDict["THOST_FTDC_SEX_Man"] = '1' +#女 +defineDict["THOST_FTDC_SEX_Woman"] = '2' + +typedefDict["TThostFtdcSexType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProfessionType是一个职业类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProfessionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcNationalType是一个国籍类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcNationalType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProvinceType是一个省类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProvinceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRegionType是一个区类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRegionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCountryType是一个国家类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCountryType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLicenseNOType是一个营业执照类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLicenseNOType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCompanyTypeType是一个企业性质类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCompanyTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBusinessScopeType是一个经营范围类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBusinessScopeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCapitalCurrencyType是一个注册资本币种类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCapitalCurrencyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserTypeType是一个用户类型类型 +#////////////////////////////////////////////////////////////////////// +#投资者 +defineDict["THOST_FTDC_UT_Investor"] = '0' +#操作员 +defineDict["THOST_FTDC_UT_Operator"] = '1' +#管理员 +defineDict["THOST_FTDC_UT_SuperUser"] = '2' + +typedefDict["TThostFtdcUserTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBranchIDType是一个营业部编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRateTypeType是一个费率类型类型 +#////////////////////////////////////////////////////////////////////// +#保证金率 +defineDict["THOST_FTDC_RATETYPE_MarginRate"] = '2' + +typedefDict["TThostFtdcRateTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcNoteTypeType是一个通知类型类型 +#////////////////////////////////////////////////////////////////////// +#交易结算单 +defineDict["THOST_FTDC_NOTETYPE_TradeSettleBill"] = '1' +#交易结算月报 +defineDict["THOST_FTDC_NOTETYPE_TradeSettleMonth"] = '2' +#追加保证金通知书 +defineDict["THOST_FTDC_NOTETYPE_CallMarginNotes"] = '3' +#强行平仓通知书 +defineDict["THOST_FTDC_NOTETYPE_ForceCloseNotes"] = '4' +#成交通知书 +defineDict["THOST_FTDC_NOTETYPE_TradeNotes"] = '5' +#交割通知书 +defineDict["THOST_FTDC_NOTETYPE_DelivNotes"] = '6' + +typedefDict["TThostFtdcNoteTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementStyleType是一个结算单方式类型 +#////////////////////////////////////////////////////////////////////// +#逐日盯市 +defineDict["THOST_FTDC_SBS_Day"] = '1' +#逐笔对冲 +defineDict["THOST_FTDC_SBS_Volume"] = '2' + +typedefDict["TThostFtdcSettlementStyleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerDNSType是一个域名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBrokerDNSType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSentenceType是一个语句类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSentenceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettlementBillTypeType是一个结算单类型类型 +#////////////////////////////////////////////////////////////////////// +#日报 +defineDict["THOST_FTDC_ST_Day"] = '0' +#月报 +defineDict["THOST_FTDC_ST_Month"] = '1' + +typedefDict["TThostFtdcSettlementBillTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserRightTypeType是一个客户权限类型类型 +#////////////////////////////////////////////////////////////////////// +#登录 +defineDict["THOST_FTDC_URT_Logon"] = '1' +#银期转帐 +defineDict["THOST_FTDC_URT_Transfer"] = '2' +#邮寄结算单 +defineDict["THOST_FTDC_URT_EMail"] = '3' +#传真结算单 +defineDict["THOST_FTDC_URT_Fax"] = '4' +#条件单 +defineDict["THOST_FTDC_URT_ConditionOrder"] = '5' + +typedefDict["TThostFtdcUserRightTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMarginPriceTypeType是一个保证金价格类型类型 +#////////////////////////////////////////////////////////////////////// +#昨结算价 +defineDict["THOST_FTDC_MPT_PreSettlementPrice"] = '1' +#最新价 +defineDict["THOST_FTDC_MPT_SettlementPrice"] = '2' +#成交均价 +defineDict["THOST_FTDC_MPT_AveragePrice"] = '3' +#开仓价 +defineDict["THOST_FTDC_MPT_OpenPrice"] = '4' + +typedefDict["TThostFtdcMarginPriceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBillGenStatusType是一个结算单生成状态类型 +#////////////////////////////////////////////////////////////////////// +#未生成 +defineDict["THOST_FTDC_BGS_None"] = '0' +#生成中 +defineDict["THOST_FTDC_BGS_NoGenerated"] = '1' +#已生成 +defineDict["THOST_FTDC_BGS_Generated"] = '2' + +typedefDict["TThostFtdcBillGenStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAlgoTypeType是一个算法类型类型 +#////////////////////////////////////////////////////////////////////// +#持仓处理算法 +defineDict["THOST_FTDC_AT_HandlePositionAlgo"] = '1' +#寻找保证金率算法 +defineDict["THOST_FTDC_AT_FindMarginRateAlgo"] = '2' + +typedefDict["TThostFtdcAlgoTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHandlePositionAlgoIDType是一个持仓处理算法编号类型 +#////////////////////////////////////////////////////////////////////// +#基本 +defineDict["THOST_FTDC_HPA_Base"] = '1' +#大连商品交易所 +defineDict["THOST_FTDC_HPA_DCE"] = '2' +#郑州商品交易所 +defineDict["THOST_FTDC_HPA_CZCE"] = '3' + +typedefDict["TThostFtdcHandlePositionAlgoIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFindMarginRateAlgoIDType是一个寻找保证金率算法编号类型 +#////////////////////////////////////////////////////////////////////// +#基本 +defineDict["THOST_FTDC_FMRA_Base"] = '1' +#大连商品交易所 +defineDict["THOST_FTDC_FMRA_DCE"] = '2' +#郑州商品交易所 +defineDict["THOST_FTDC_FMRA_CZCE"] = '3' + +typedefDict["TThostFtdcFindMarginRateAlgoIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHandleTradingAccountAlgoIDType是一个资金处理算法编号类型 +#////////////////////////////////////////////////////////////////////// +#基本 +defineDict["THOST_FTDC_HTAA_Base"] = '1' +#大连商品交易所 +defineDict["THOST_FTDC_HTAA_DCE"] = '2' +#郑州商品交易所 +defineDict["THOST_FTDC_HTAA_CZCE"] = '3' + +typedefDict["TThostFtdcHandleTradingAccountAlgoIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPersonTypeType是一个联系人类型类型 +#////////////////////////////////////////////////////////////////////// +#指定下单人 +defineDict["THOST_FTDC_PST_Order"] = '1' +#开户授权人 +defineDict["THOST_FTDC_PST_Open"] = '2' +#资金调拨人 +defineDict["THOST_FTDC_PST_Fund"] = '3' +#结算单确认人 +defineDict["THOST_FTDC_PST_Settlement"] = '4' +#法人 +defineDict["THOST_FTDC_PST_Company"] = '5' +#法人代表 +defineDict["THOST_FTDC_PST_Corporation"] = '6' +#投资者联系人 +defineDict["THOST_FTDC_PST_LinkMan"] = '7' +#分户管理资产负责人 +defineDict["THOST_FTDC_PST_Ledger"] = '8' +#托(保)管人 +defineDict["THOST_FTDC_PST_Trustee"] = '9' +#托(保)管机构法人代表 +defineDict["THOST_FTDC_PST_TrusteeCorporation"] = 'A' +#托(保)管机构开户授权人 +defineDict["THOST_FTDC_PST_TrusteeOpen"] = 'B' +#托(保)管机构联系人 +defineDict["THOST_FTDC_PST_TrusteeContact"] = 'C' +#境外自然人参考证件 +defineDict["THOST_FTDC_PST_ForeignerRefer"] = 'D' +#法人代表参考证件 +defineDict["THOST_FTDC_PST_CorporationRefer"] = 'E' + +typedefDict["TThostFtdcPersonTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcQueryInvestorRangeType是一个查询范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["THOST_FTDC_QIR_All"] = '1' +#查询分类 +defineDict["THOST_FTDC_QIR_Group"] = '2' +#单一投资者 +defineDict["THOST_FTDC_QIR_Single"] = '3' + +typedefDict["TThostFtdcQueryInvestorRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorRiskStatusType是一个投资者风险状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_IRS_Normal"] = '1' +#警告 +defineDict["THOST_FTDC_IRS_Warn"] = '2' +#追保 +defineDict["THOST_FTDC_IRS_Call"] = '3' +#强平 +defineDict["THOST_FTDC_IRS_Force"] = '4' +#异常 +defineDict["THOST_FTDC_IRS_Exception"] = '5' + +typedefDict["TThostFtdcInvestorRiskStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLegIDType是一个单腿编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLegIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLegMultipleType是一个单腿乘数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLegMultipleType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcImplyLevelType是一个派生层数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcImplyLevelType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClearAccountType是一个结算账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClearAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganNOType是一个结算账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrganNOType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClearbarchIDType是一个结算账户联行号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClearbarchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserEventTypeType是一个用户事件类型类型 +#////////////////////////////////////////////////////////////////////// +#登录 +defineDict["THOST_FTDC_UET_Login"] = '1' +#登出 +defineDict["THOST_FTDC_UET_Logout"] = '2' +#交易成功 +defineDict["THOST_FTDC_UET_Trading"] = '3' +#交易失败 +defineDict["THOST_FTDC_UET_TradingError"] = '4' +#修改密码 +defineDict["THOST_FTDC_UET_UpdatePassword"] = '5' +#客户端认证 +defineDict["THOST_FTDC_UET_Authenticate"] = '6' +#其他 +defineDict["THOST_FTDC_UET_Other"] = '9' + +typedefDict["TThostFtdcUserEventTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserEventInfoType是一个用户事件信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUserEventInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCloseStyleType是一个平仓方式类型 +#////////////////////////////////////////////////////////////////////// +#先开先平 +defineDict["THOST_FTDC_ICS_Close"] = '0' +#先平今再平昨 +defineDict["THOST_FTDC_ICS_CloseToday"] = '1' + +typedefDict["TThostFtdcCloseStyleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStatModeType是一个统计方式类型 +#////////////////////////////////////////////////////////////////////// +#---- +defineDict["THOST_FTDC_SM_Non"] = '0' +#按合约统计 +defineDict["THOST_FTDC_SM_Instrument"] = '1' +#按产品统计 +defineDict["THOST_FTDC_SM_Product"] = '2' +#按投资者统计 +defineDict["THOST_FTDC_SM_Investor"] = '3' + +typedefDict["TThostFtdcStatModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParkedOrderStatusType是一个预埋单状态类型 +#////////////////////////////////////////////////////////////////////// +#未发送 +defineDict["THOST_FTDC_PAOS_NotSend"] = '1' +#已发送 +defineDict["THOST_FTDC_PAOS_Send"] = '2' +#已删除 +defineDict["THOST_FTDC_PAOS_Deleted"] = '3' + +typedefDict["TThostFtdcParkedOrderStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParkedOrderIDType是一个预埋报单编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcParkedOrderIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParkedOrderActionIDType是一个预埋撤单编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcParkedOrderActionIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVirDealStatusType是一个处理状态类型 +#////////////////////////////////////////////////////////////////////// +#正在处理 +defineDict["THOST_FTDC_VDS_Dealing"] = '1' +#处理成功 +defineDict["THOST_FTDC_VDS_DeaclSucceed"] = '2' + +typedefDict["TThostFtdcVirDealStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrgSystemIDType是一个原有系统代码类型 +#////////////////////////////////////////////////////////////////////// +#综合交易平台 +defineDict["THOST_FTDC_ORGS_Standard"] = '0' +#易盛系统 +defineDict["THOST_FTDC_ORGS_ESunny"] = '1' +#金仕达V6系统 +defineDict["THOST_FTDC_ORGS_KingStarV6"] = '2' + +typedefDict["TThostFtdcOrgSystemIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVirTradeStatusType是一个交易状态类型 +#////////////////////////////////////////////////////////////////////// +#正常处理中 +defineDict["THOST_FTDC_VTS_NaturalDeal"] = '0' +#成功结束 +defineDict["THOST_FTDC_VTS_SucceedEnd"] = '1' +#失败结束 +defineDict["THOST_FTDC_VTS_FailedEND"] = '2' +#异常中 +defineDict["THOST_FTDC_VTS_Exception"] = '3' +#已人工异常处理 +defineDict["THOST_FTDC_VTS_ManualDeal"] = '4' +#通讯异常 ,请人工处理 +defineDict["THOST_FTDC_VTS_MesException"] = '5' +#系统出错,请人工处理 +defineDict["THOST_FTDC_VTS_SysException"] = '6' + +typedefDict["TThostFtdcVirTradeStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVirBankAccTypeType是一个银行帐户类型类型 +#////////////////////////////////////////////////////////////////////// +#存折 +defineDict["THOST_FTDC_VBAT_BankBook"] = '1' +#储蓄卡 +defineDict["THOST_FTDC_VBAT_BankCard"] = '2' +#信用卡 +defineDict["THOST_FTDC_VBAT_CreditCard"] = '3' + +typedefDict["TThostFtdcVirBankAccTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVirementStatusType是一个银行帐户类型类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_VMS_Natural"] = '0' +#销户 +defineDict["THOST_FTDC_VMS_Canceled"] = '9' + +typedefDict["TThostFtdcVirementStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVirementAvailAbilityType是一个有效标志类型 +#////////////////////////////////////////////////////////////////////// +#未确认 +defineDict["THOST_FTDC_VAA_NoAvailAbility"] = '0' +#有效 +defineDict["THOST_FTDC_VAA_AvailAbility"] = '1' +#冲正 +defineDict["THOST_FTDC_VAA_Repeal"] = '2' + +typedefDict["TThostFtdcVirementAvailAbilityType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcVirementTradeCodeType是一个交易代码类型 +#////////////////////////////////////////////////////////////////////// +#银行发起银行资金转期货 +defineDict["THOST_FTDC_VTC_BankBankToFuture"] = '102001' +#银行发起期货资金转银行 +defineDict["THOST_FTDC_VTC_BankFutureToBank"] = '102002' +#期货发起银行资金转期货 +defineDict["THOST_FTDC_VTC_FutureBankToFuture"] = '202001' +#期货发起期货资金转银行 +defineDict["THOST_FTDC_VTC_FutureFutureToBank"] = '202002' + +typedefDict["TThostFtdcVirementTradeCodeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPhotoTypeNameType是一个影像类型名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPhotoTypeNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPhotoTypeIDType是一个影像类型代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPhotoTypeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPhotoNameType是一个影像名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPhotoNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTopicIDType是一个主题代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTopicIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReportTypeIDType是一个交易报告类型标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcReportTypeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCharacterIDType是一个交易特征代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCharacterIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLParamIDType是一个参数代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLParamIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLInvestorTypeType是一个投资者类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLInvestorTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLIdCardTypeType是一个证件类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLIdCardTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLTradeDirectType是一个资金进出方向类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLTradeDirectType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLTradeModelType是一个资金进出方式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLTradeModelType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLParamIDType是一个参数代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLParamIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLOpParamValueType是一个业务参数代码值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLOpParamValueType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLCustomerCardTypeType是一个客户身份证件/证明文件类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLCustomerCardTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLInstitutionNameType是一个金融机构网点名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLInstitutionNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLDistrictIDType是一个金融机构网点所在地区行政区划代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLDistrictIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLRelationShipType是一个金融机构网点与大额交易的关系类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLRelationShipType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLInstitutionTypeType是一个金融机构网点代码类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLInstitutionTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLInstitutionIDType是一个金融机构网点代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLInstitutionIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLAccountTypeType是一个账户类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLAccountTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLTradingTypeType是一个交易方式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLTradingTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLTransactClassType是一个涉外收支交易分类与代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLTransactClassType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLCapitalIOType是一个资金收付标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLCapitalIOType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLSiteType是一个交易地点类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLSiteType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLCapitalPurposeType是一个资金用途类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLCapitalPurposeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLReportTypeType是一个报文类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLReportTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLSerialNoType是一个编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLSerialNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLStatusType是一个状态类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLGenStatusType是一个Aml生成方式类型 +#////////////////////////////////////////////////////////////////////// +#程序生成 +defineDict["THOST_FTDC_GEN_Program"] = '0' +#人工生成 +defineDict["THOST_FTDC_GEN_HandWork"] = '1' + +typedefDict["TThostFtdcAMLGenStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLSeqCodeType是一个业务标识号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLSeqCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLFileNameType是一个AML文件名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLFileNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLMoneyType是一个反洗钱资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLMoneyType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLFileAmountType是一个反洗钱资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLFileAmountType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCFMMCKeyType是一个密钥类型(保证金监管)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCFMMCKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCFMMCTokenType是一个令牌类型(保证金监管)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCFMMCTokenType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCFMMCKeyKindType是一个动态密钥类别(保证金监管)类型 +#////////////////////////////////////////////////////////////////////// +#主动请求更新 +defineDict["THOST_FTDC_CFMMCKK_REQUEST"] = 'R' +#CFMMC自动更新 +defineDict["THOST_FTDC_CFMMCKK_AUTO"] = 'A' +#CFMMC手动更新 +defineDict["THOST_FTDC_CFMMCKK_MANUAL"] = 'M' + +typedefDict["TThostFtdcCFMMCKeyKindType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLReportNameType是一个报文名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAMLReportNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBFComdTypeType是一个DBF命令类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBFComdTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBFComTimeType是一个DBF时间类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBFComTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBFComNoType是一个DBF流水号类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBFComNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBFFdNameType是一个DBF字段类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBFFdNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBFFdContentType是一个DBF字段内容类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBFFdContentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIndividualNameType是一个个人姓名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIndividualNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencyIDType是一个币种代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrencyIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCustNumberType是一个客户编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCustNumberType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganCodeType是一个机构编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrganCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganNameType是一个机构名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrganNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSuperOrganCodeType是一个上级机构编码,即期货公司总部、银行总行类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSuperOrganCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSubBranchIDType是一个分支机构类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSubBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSubBranchNameType是一个分支机构名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSubBranchNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBranchNetCodeType是一个机构网点号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBranchNetCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBranchNetNameType是一个机构网点名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBranchNetNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganFlagType是一个机构标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOrganFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankCodingForFutureType是一个银行对期货公司的编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankCodingForFutureType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankReturnCodeType是一个银行对返回码的定义类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankReturnCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPlateReturnCodeType是一个银期转帐平台对返回码的定义类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPlateReturnCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankSubBranchIDType是一个银行分支机构编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankSubBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureBranchIDType是一个期货分支机构编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureBranchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReturnCodeType是一个返回代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcReturnCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOperatorCodeType是一个操作员类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOperatorCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClearDepIDType是一个机构结算帐户机构号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClearDepIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClearBrchIDType是一个机构结算帐户联行号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClearBrchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClearNameType是一个机构结算帐户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClearNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccountNameType是一个银行帐户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankAccountNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvDepIDType是一个机构投资人账号机构号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvDepIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvBrchIDType是一个机构投资人联行号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvBrchIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMessageFormatVersionType是一个信息格式版本类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMessageFormatVersionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDigestType是一个摘要类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDigestType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAuthenticDataType是一个认证数据类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAuthenticDataType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPasswordKeyType是一个密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPasswordKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureAccountNameType是一个期货帐户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureAccountNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMobilePhoneType是一个手机类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcMobilePhoneType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureMainKeyType是一个期货公司主密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureMainKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureWorkKeyType是一个期货公司工作密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureWorkKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureTransKeyType是一个期货公司传输密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureTransKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankMainKeyType是一个银行主密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankMainKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankWorkKeyType是一个银行工作密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankWorkKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankTransKeyType是一个银行传输密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankTransKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankServerDescriptionType是一个银行服务器描述信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankServerDescriptionType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAddInfoType是一个附加信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAddInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDescrInfoForReturnCodeType是一个返回码描述类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDescrInfoForReturnCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCountryCodeType是一个国家代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCountryCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSerialType是一个流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPlateSerialType是一个平台流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPlateSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankSerialType是一个银行流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankSerialType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCorrectSerialType是一个被冲正交易流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCorrectSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureSerialType是一个期货公司流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureSerialType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcApplicationIDType是一个应用标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcApplicationIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankProxyIDType是一个银行代理标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankProxyIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTCoreIDType是一个银期转帐核心系统标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBTCoreIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcServerPortType是一个服务端口号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcServerPortType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRepealedTimesType是一个已经冲正次数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRepealedTimesType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRepealTimeIntervalType是一个冲正时间间隔类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRepealTimeIntervalType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTotalTimesType是一个每日累计转帐次数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTotalTimesType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTRequestIDType是一个请求ID类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBTRequestIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTIDType是一个交易ID类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeAmountType是一个交易金额(元)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeAmountType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCustFeeType是一个应收客户费用(元)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCustFeeType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureFeeType是一个应收期货公司费用(元)类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFutureFeeType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSingleMaxAmtType是一个单笔最高限额类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSingleMaxAmtType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSingleMinAmtType是一个单笔最低限额类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSingleMinAmtType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTotalAmtType是一个每日累计转帐额度类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTotalAmtType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCertificationTypeType是一个证件类型类型 +#////////////////////////////////////////////////////////////////////// +#身份证 +defineDict["THOST_FTDC_CFT_IDCard"] = '0' +#护照 +defineDict["THOST_FTDC_CFT_Passport"] = '1' +#军官证 +defineDict["THOST_FTDC_CFT_OfficerIDCard"] = '2' +#士兵证 +defineDict["THOST_FTDC_CFT_SoldierIDCard"] = '3' +#回乡证 +defineDict["THOST_FTDC_CFT_HomeComingCard"] = '4' +#户口簿 +defineDict["THOST_FTDC_CFT_HouseholdRegister"] = '5' +#营业执照号 +defineDict["THOST_FTDC_CFT_LicenseNo"] = '6' +#组织机构代码证 +defineDict["THOST_FTDC_CFT_InstitutionCodeCard"] = '7' +#临时营业执照号 +defineDict["THOST_FTDC_CFT_TempLicenseNo"] = '8' +#民办非企业登记证书 +defineDict["THOST_FTDC_CFT_NoEnterpriseLicenseNo"] = '9' +#其他证件 +defineDict["THOST_FTDC_CFT_OtherCard"] = 'x' +#主管部门批文 +defineDict["THOST_FTDC_CFT_SuperDepAgree"] = 'a' + +typedefDict["TThostFtdcCertificationTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileBusinessCodeType是一个文件业务功能类型 +#////////////////////////////////////////////////////////////////////// +#其他 +defineDict["THOST_FTDC_FBC_Others"] = '0' +#转账交易明细对账 +defineDict["THOST_FTDC_FBC_TransferDetails"] = '1' +#客户账户状态对账 +defineDict["THOST_FTDC_FBC_CustAccStatus"] = '2' +#账户类交易明细对账 +defineDict["THOST_FTDC_FBC_AccountTradeDetails"] = '3' +#期货账户信息变更明细对账 +defineDict["THOST_FTDC_FBC_FutureAccountChangeInfoDetails"] = '4' +#客户资金台账余额明细对账 +defineDict["THOST_FTDC_FBC_CustMoneyDetail"] = '5' +#客户销户结息明细对账 +defineDict["THOST_FTDC_FBC_CustCancelAccountInfo"] = '6' +#客户资金余额对账结果 +defineDict["THOST_FTDC_FBC_CustMoneyResult"] = '7' +#其它对账异常结果文件 +defineDict["THOST_FTDC_FBC_OthersExceptionResult"] = '8' +#客户结息净额明细 +defineDict["THOST_FTDC_FBC_CustInterestNetMoneyDetails"] = '9' +#客户资金交收明细 +defineDict["THOST_FTDC_FBC_CustMoneySendAndReceiveDetails"] = 'a' +#法人存管银行资金交收汇总 +defineDict["THOST_FTDC_FBC_CorporationMoneyTotal"] = 'b' +#主体间资金交收汇总 +defineDict["THOST_FTDC_FBC_MainbodyMoneyTotal"] = 'c' +#总分平衡监管数据 +defineDict["THOST_FTDC_FBC_MainPartMonitorData"] = 'd' +#存管银行备付金余额 +defineDict["THOST_FTDC_FBC_PreparationMoney"] = 'e' +#协办存管银行资金监管数据 +defineDict["THOST_FTDC_FBC_BankMoneyMonitorData"] = 'f' + +typedefDict["TThostFtdcFileBusinessCodeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCashExchangeCodeType是一个汇钞标志类型 +#////////////////////////////////////////////////////////////////////// +#汇 +defineDict["THOST_FTDC_CEC_Exchange"] = '1' +#钞 +defineDict["THOST_FTDC_CEC_Cash"] = '2' + +typedefDict["TThostFtdcCashExchangeCodeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcYesNoIndicatorType是一个是或否标识类型 +#////////////////////////////////////////////////////////////////////// +#是 +defineDict["THOST_FTDC_YNI_Yes"] = '0' +#否 +defineDict["THOST_FTDC_YNI_No"] = '1' + +typedefDict["TThostFtdcYesNoIndicatorType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBanlanceTypeType是一个余额类型类型 +#////////////////////////////////////////////////////////////////////// +#当前余额 +defineDict["THOST_FTDC_BLT_CurrentMoney"] = '0' +#可用余额 +defineDict["THOST_FTDC_BLT_UsableMoney"] = '1' +#可取余额 +defineDict["THOST_FTDC_BLT_FetchableMoney"] = '2' +#冻结余额 +defineDict["THOST_FTDC_BLT_FreezeMoney"] = '3' + +typedefDict["TThostFtdcBanlanceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcGenderType是一个性别类型 +#////////////////////////////////////////////////////////////////////// +#未知状态 +defineDict["THOST_FTDC_GD_Unknown"] = '0' +#男 +defineDict["THOST_FTDC_GD_Male"] = '1' +#女 +defineDict["THOST_FTDC_GD_Female"] = '2' + +typedefDict["TThostFtdcGenderType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFeePayFlagType是一个费用支付标志类型 +#////////////////////////////////////////////////////////////////////// +#由受益方支付费用 +defineDict["THOST_FTDC_FPF_BEN"] = '0' +#由发送方支付费用 +defineDict["THOST_FTDC_FPF_OUR"] = '1' +#由发送方支付发起的费用,受益方支付接受的费用 +defineDict["THOST_FTDC_FPF_SHA"] = '2' + +typedefDict["TThostFtdcFeePayFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPassWordKeyTypeType是一个密钥类型类型 +#////////////////////////////////////////////////////////////////////// +#交换密钥 +defineDict["THOST_FTDC_PWKT_ExchangeKey"] = '0' +#密码密钥 +defineDict["THOST_FTDC_PWKT_PassWordKey"] = '1' +#MAC密钥 +defineDict["THOST_FTDC_PWKT_MACKey"] = '2' +#报文密钥 +defineDict["THOST_FTDC_PWKT_MessageKey"] = '3' + +typedefDict["TThostFtdcPassWordKeyTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTPassWordTypeType是一个密码类型类型 +#////////////////////////////////////////////////////////////////////// +#查询 +defineDict["THOST_FTDC_PWT_Query"] = '0' +#取款 +defineDict["THOST_FTDC_PWT_Fetch"] = '1' +#转帐 +defineDict["THOST_FTDC_PWT_Transfer"] = '2' +#交易 +defineDict["THOST_FTDC_PWT_Trade"] = '3' + +typedefDict["TThostFtdcFBTPassWordTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTEncryModeType是一个加密方式类型 +#////////////////////////////////////////////////////////////////////// +#不加密 +defineDict["THOST_FTDC_EM_NoEncry"] = '0' +#DES +defineDict["THOST_FTDC_EM_DES"] = '1' +#3DES +defineDict["THOST_FTDC_EM_3DES"] = '2' + +typedefDict["TThostFtdcFBTEncryModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankRepealFlagType是一个银行冲正标志类型 +#////////////////////////////////////////////////////////////////////// +#银行无需自动冲正 +defineDict["THOST_FTDC_BRF_BankNotNeedRepeal"] = '0' +#银行待自动冲正 +defineDict["THOST_FTDC_BRF_BankWaitingRepeal"] = '1' +#银行已自动冲正 +defineDict["THOST_FTDC_BRF_BankBeenRepealed"] = '2' + +typedefDict["TThostFtdcBankRepealFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerRepealFlagType是一个期商冲正标志类型 +#////////////////////////////////////////////////////////////////////// +#期商无需自动冲正 +defineDict["THOST_FTDC_BRORF_BrokerNotNeedRepeal"] = '0' +#期商待自动冲正 +defineDict["THOST_FTDC_BRORF_BrokerWaitingRepeal"] = '1' +#期商已自动冲正 +defineDict["THOST_FTDC_BRORF_BrokerBeenRepealed"] = '2' + +typedefDict["TThostFtdcBrokerRepealFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstitutionTypeType是一个机构类别类型 +#////////////////////////////////////////////////////////////////////// +#银行 +defineDict["THOST_FTDC_TS_Bank"] = '0' +#期商 +defineDict["THOST_FTDC_TS_Future"] = '1' +#券商 +defineDict["THOST_FTDC_TS_Store"] = '2' + +typedefDict["TThostFtdcInstitutionTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLastFragmentType是一个最后分片标志类型 +#////////////////////////////////////////////////////////////////////// +#是最后分片 +defineDict["THOST_FTDC_LF_Yes"] = '0' +#不是最后分片 +defineDict["THOST_FTDC_LF_No"] = '1' + +typedefDict["TThostFtdcLastFragmentType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccStatusType是一个银行账户状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_BAS_Normal"] = '0' +#冻结 +defineDict["THOST_FTDC_BAS_Freeze"] = '1' +#挂失 +defineDict["THOST_FTDC_BAS_ReportLoss"] = '2' + +typedefDict["TThostFtdcBankAccStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMoneyAccountStatusType是一个资金账户状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_MAS_Normal"] = '0' +#销户 +defineDict["THOST_FTDC_MAS_Cancel"] = '1' + +typedefDict["TThostFtdcMoneyAccountStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcManageStatusType是一个存管状态类型 +#////////////////////////////////////////////////////////////////////// +#指定存管 +defineDict["THOST_FTDC_MSS_Point"] = '0' +#预指定 +defineDict["THOST_FTDC_MSS_PrePoint"] = '1' +#撤销指定 +defineDict["THOST_FTDC_MSS_CancelPoint"] = '2' + +typedefDict["TThostFtdcManageStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSystemTypeType是一个应用系统类型类型 +#////////////////////////////////////////////////////////////////////// +#银期转帐 +defineDict["THOST_FTDC_SYT_FutureBankTransfer"] = '0' +#银证转帐 +defineDict["THOST_FTDC_SYT_StockBankTransfer"] = '1' +#第三方存管 +defineDict["THOST_FTDC_SYT_TheThirdPartStore"] = '2' + +typedefDict["TThostFtdcSystemTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTxnEndFlagType是一个银期转帐划转结果标志类型 +#////////////////////////////////////////////////////////////////////// +#正常处理中 +defineDict["THOST_FTDC_TEF_NormalProcessing"] = '0' +#成功结束 +defineDict["THOST_FTDC_TEF_Success"] = '1' +#失败结束 +defineDict["THOST_FTDC_TEF_Failed"] = '2' +#异常中 +defineDict["THOST_FTDC_TEF_Abnormal"] = '3' +#已人工异常处理 +defineDict["THOST_FTDC_TEF_ManualProcessedForException"] = '4' +#通讯异常 ,请人工处理 +defineDict["THOST_FTDC_TEF_CommuFailedNeedManualProcess"] = '5' +#系统出错,请人工处理 +defineDict["THOST_FTDC_TEF_SysErrorNeedManualProcess"] = '6' + +typedefDict["TThostFtdcTxnEndFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProcessStatusType是一个银期转帐服务处理状态类型 +#////////////////////////////////////////////////////////////////////// +#未处理 +defineDict["THOST_FTDC_PSS_NotProcess"] = '0' +#开始处理 +defineDict["THOST_FTDC_PSS_StartProcess"] = '1' +#处理完成 +defineDict["THOST_FTDC_PSS_Finished"] = '2' + +typedefDict["TThostFtdcProcessStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCustTypeType是一个客户类型类型 +#////////////////////////////////////////////////////////////////////// +#自然人 +defineDict["THOST_FTDC_CUSTT_Person"] = '0' +#机构户 +defineDict["THOST_FTDC_CUSTT_Institution"] = '1' + +typedefDict["TThostFtdcCustTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTTransferDirectionType是一个银期转帐方向类型 +#////////////////////////////////////////////////////////////////////// +#入金,银行转期货 +defineDict["THOST_FTDC_FBTTD_FromBankToFuture"] = '1' +#出金,期货转银行 +defineDict["THOST_FTDC_FBTTD_FromFutureToBank"] = '2' + +typedefDict["TThostFtdcFBTTransferDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOpenOrDestroyType是一个开销户类别类型 +#////////////////////////////////////////////////////////////////////// +#开户 +defineDict["THOST_FTDC_OOD_Open"] = '1' +#销户 +defineDict["THOST_FTDC_OOD_Destroy"] = '0' + +typedefDict["TThostFtdcOpenOrDestroyType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAvailabilityFlagType是一个有效标志类型 +#////////////////////////////////////////////////////////////////////// +#未确认 +defineDict["THOST_FTDC_AVAF_Invalid"] = '0' +#有效 +defineDict["THOST_FTDC_AVAF_Valid"] = '1' +#冲正 +defineDict["THOST_FTDC_AVAF_Repeal"] = '2' + +typedefDict["TThostFtdcAvailabilityFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganTypeType是一个机构类型类型 +#////////////////////////////////////////////////////////////////////// +#银行代理 +defineDict["THOST_FTDC_OT_Bank"] = '1' +#交易前置 +defineDict["THOST_FTDC_OT_Future"] = '2' +#银期转帐平台管理 +defineDict["THOST_FTDC_OT_PlateForm"] = '9' + +typedefDict["TThostFtdcOrganTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganLevelType是一个机构级别类型 +#////////////////////////////////////////////////////////////////////// +#银行总行或期商总部 +defineDict["THOST_FTDC_OL_HeadQuarters"] = '1' +#银行分中心或期货公司营业部 +defineDict["THOST_FTDC_OL_Branch"] = '2' + +typedefDict["TThostFtdcOrganLevelType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProtocalIDType是一个协议类型类型 +#////////////////////////////////////////////////////////////////////// +#期商协议 +defineDict["THOST_FTDC_PID_FutureProtocal"] = '0' +#工行协议 +defineDict["THOST_FTDC_PID_ICBCProtocal"] = '1' +#农行协议 +defineDict["THOST_FTDC_PID_ABCProtocal"] = '2' +#中国银行协议 +defineDict["THOST_FTDC_PID_CBCProtocal"] = '3' +#建行协议 +defineDict["THOST_FTDC_PID_CCBProtocal"] = '4' +#交行协议 +defineDict["THOST_FTDC_PID_BOCOMProtocal"] = '5' +#银期转帐平台协议 +defineDict["THOST_FTDC_PID_FBTPlateFormProtocal"] = 'X' + +typedefDict["TThostFtdcProtocalIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcConnectModeType是一个套接字连接方式类型 +#////////////////////////////////////////////////////////////////////// +#短连接 +defineDict["THOST_FTDC_CM_ShortConnect"] = '0' +#长连接 +defineDict["THOST_FTDC_CM_LongConnect"] = '1' + +typedefDict["TThostFtdcConnectModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSyncModeType是一个套接字通信方式类型 +#////////////////////////////////////////////////////////////////////// +#异步 +defineDict["THOST_FTDC_SRM_ASync"] = '0' +#同步 +defineDict["THOST_FTDC_SRM_Sync"] = '1' + +typedefDict["TThostFtdcSyncModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccTypeType是一个银行帐号类型类型 +#////////////////////////////////////////////////////////////////////// +#银行存折 +defineDict["THOST_FTDC_BAT_BankBook"] = '1' +#储蓄卡 +defineDict["THOST_FTDC_BAT_SavingCard"] = '2' +#信用卡 +defineDict["THOST_FTDC_BAT_CreditCard"] = '3' + +typedefDict["TThostFtdcBankAccTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureAccTypeType是一个期货公司帐号类型类型 +#////////////////////////////////////////////////////////////////////// +#银行存折 +defineDict["THOST_FTDC_FAT_BankBook"] = '1' +#储蓄卡 +defineDict["THOST_FTDC_FAT_SavingCard"] = '2' +#信用卡 +defineDict["THOST_FTDC_FAT_CreditCard"] = '3' + +typedefDict["TThostFtdcFutureAccTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOrganStatusType是一个接入机构状态类型 +#////////////////////////////////////////////////////////////////////// +#启用 +defineDict["THOST_FTDC_OS_Ready"] = '0' +#签到 +defineDict["THOST_FTDC_OS_CheckIn"] = '1' +#签退 +defineDict["THOST_FTDC_OS_CheckOut"] = '2' +#对帐文件到达 +defineDict["THOST_FTDC_OS_CheckFileArrived"] = '3' +#对帐 +defineDict["THOST_FTDC_OS_CheckDetail"] = '4' +#日终清理 +defineDict["THOST_FTDC_OS_DayEndClean"] = '5' +#注销 +defineDict["THOST_FTDC_OS_Invalid"] = '9' + +typedefDict["TThostFtdcOrganStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCCBFeeModeType是一个建行收费模式类型 +#////////////////////////////////////////////////////////////////////// +#按金额扣收 +defineDict["THOST_FTDC_CCBFM_ByAmount"] = '1' +#按月扣收 +defineDict["THOST_FTDC_CCBFM_ByMonth"] = '2' + +typedefDict["TThostFtdcCCBFeeModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommApiTypeType是一个通讯API类型类型 +#////////////////////////////////////////////////////////////////////// +#客户端 +defineDict["THOST_FTDC_CAPIT_Client"] = '1' +#服务端 +defineDict["THOST_FTDC_CAPIT_Server"] = '2' +#交易系统的UserApi +defineDict["THOST_FTDC_CAPIT_UserApi"] = '3' + +typedefDict["TThostFtdcCommApiTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcServiceIDType是一个服务编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcServiceIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcServiceLineNoType是一个服务线路编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcServiceLineNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcServiceNameType是一个服务名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcServiceNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLinkStatusType是一个连接状态类型 +#////////////////////////////////////////////////////////////////////// +#已经连接 +defineDict["THOST_FTDC_LS_Connected"] = '1' +#没有连接 +defineDict["THOST_FTDC_LS_Disconnected"] = '2' + +typedefDict["TThostFtdcLinkStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommApiPointerType是一个通讯API指针类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommApiPointerType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPwdFlagType是一个密码核对标志类型 +#////////////////////////////////////////////////////////////////////// +#不核对 +defineDict["THOST_FTDC_BPWDF_NoCheck"] = '0' +#明文核对 +defineDict["THOST_FTDC_BPWDF_BlankCheck"] = '1' +#密文核对 +defineDict["THOST_FTDC_BPWDF_EncryptCheck"] = '2' + +typedefDict["TThostFtdcPwdFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSecuAccTypeType是一个期货帐号类型类型 +#////////////////////////////////////////////////////////////////////// +#资金帐号 +defineDict["THOST_FTDC_SAT_AccountID"] = '1' +#资金卡号 +defineDict["THOST_FTDC_SAT_CardID"] = '2' +#上海股东帐号 +defineDict["THOST_FTDC_SAT_SHStockholderID"] = '3' +#深圳股东帐号 +defineDict["THOST_FTDC_SAT_SZStockholderID"] = '4' + +typedefDict["TThostFtdcSecuAccTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTransferStatusType是一个转账交易状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_TRFS_Normal"] = '0' +#被冲正 +defineDict["THOST_FTDC_TRFS_Repealed"] = '1' + +typedefDict["TThostFtdcTransferStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSponsorTypeType是一个发起方类型 +#////////////////////////////////////////////////////////////////////// +#期商 +defineDict["THOST_FTDC_SPTYPE_Broker"] = '0' +#银行 +defineDict["THOST_FTDC_SPTYPE_Bank"] = '1' + +typedefDict["TThostFtdcSponsorTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReqRspTypeType是一个请求响应类别类型 +#////////////////////////////////////////////////////////////////////// +#请求 +defineDict["THOST_FTDC_REQRSP_Request"] = '0' +#响应 +defineDict["THOST_FTDC_REQRSP_Response"] = '1' + +typedefDict["TThostFtdcReqRspTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTUserEventTypeType是一个银期转帐用户事件类型类型 +#////////////////////////////////////////////////////////////////////// +#签到 +defineDict["THOST_FTDC_FBTUET_SignIn"] = '0' +#银行转期货 +defineDict["THOST_FTDC_FBTUET_FromBankToFuture"] = '1' +#期货转银行 +defineDict["THOST_FTDC_FBTUET_FromFutureToBank"] = '2' +#开户 +defineDict["THOST_FTDC_FBTUET_OpenAccount"] = '3' +#销户 +defineDict["THOST_FTDC_FBTUET_CancelAccount"] = '4' +#变更银行账户 +defineDict["THOST_FTDC_FBTUET_ChangeAccount"] = '5' +#冲正银行转期货 +defineDict["THOST_FTDC_FBTUET_RepealFromBankToFuture"] = '6' +#冲正期货转银行 +defineDict["THOST_FTDC_FBTUET_RepealFromFutureToBank"] = '7' +#查询银行账户 +defineDict["THOST_FTDC_FBTUET_QueryBankAccount"] = '8' +#查询期货账户 +defineDict["THOST_FTDC_FBTUET_QueryFutureAccount"] = '9' +#签退 +defineDict["THOST_FTDC_FBTUET_SignOut"] = 'A' +#密钥同步 +defineDict["THOST_FTDC_FBTUET_SyncKey"] = 'B' +#其他 +defineDict["THOST_FTDC_FBTUET_Other"] = 'Z' + +typedefDict["TThostFtdcFBTUserEventTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankIDByBankType是一个银行自己的编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankIDByBankType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankOperNoType是一个银行操作员号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankOperNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankCustNoType是一个银行客户号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankCustNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBOPSeqNoType是一个递增的序列号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBOPSeqNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTableNameType是一个FBT表名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTableNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPKNameType是一个FBT表操作主键名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPKNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPKValueType是一个FBT表操作主键值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPKValueType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBOperationType是一个记录操作类型类型 +#////////////////////////////////////////////////////////////////////// +#插入 +defineDict["THOST_FTDC_DBOP_Insert"] = '0' +#更新 +defineDict["THOST_FTDC_DBOP_Update"] = '1' +#删除 +defineDict["THOST_FTDC_DBOP_Delete"] = '2' + +typedefDict["TThostFtdcDBOperationType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSyncFlagType是一个同步标记类型 +#////////////////////////////////////////////////////////////////////// +#已同步 +defineDict["THOST_FTDC_SYNF_Yes"] = '0' +#未同步 +defineDict["THOST_FTDC_SYNF_No"] = '1' + +typedefDict["TThostFtdcSyncFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTargetIDType是一个同步目标编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTargetIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSyncTypeType是一个同步类型类型 +#////////////////////////////////////////////////////////////////////// +#一次同步 +defineDict["THOST_FTDC_SYNT_OneOffSync"] = '0' +#定时同步 +defineDict["THOST_FTDC_SYNT_TimerSync"] = '1' +#定时完全同步 +defineDict["THOST_FTDC_SYNT_TimerFullSync"] = '2' + +typedefDict["TThostFtdcSyncTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBETimeType是一个各种换汇时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBETimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEBankNoType是一个换汇银行行号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEBankNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBECertNoType是一个换汇凭证号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBECertNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExDirectionType是一个换汇方向类型 +#////////////////////////////////////////////////////////////////////// +#结汇 +defineDict["THOST_FTDC_FBEDIR_Settlement"] = '0' +#售汇 +defineDict["THOST_FTDC_FBEDIR_Sale"] = '1' + +typedefDict["TThostFtdcExDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEBankAccountType是一个换汇银行账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEBankAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEBankAccountNameType是一个换汇银行账户名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEBankAccountNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEAmtType是一个各种换汇金额类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEAmtType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEBusinessTypeType是一个换汇业务类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEBusinessTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEPostScriptType是一个换汇附言类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEPostScriptType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBERemarkType是一个换汇备注类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBERemarkType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExRateType是一个换汇汇率类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExRateType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEResultFlagType是一个换汇成功标志类型 +#////////////////////////////////////////////////////////////////////// +#成功 +defineDict["THOST_FTDC_FBERES_Success"] = '0' +#账户余额不足 +defineDict["THOST_FTDC_FBERES_InsufficientBalance"] = '1' +#交易结果未知 +defineDict["THOST_FTDC_FBERES_UnknownTrading"] = '8' +#失败 +defineDict["THOST_FTDC_FBERES_Fail"] = 'x' + +typedefDict["TThostFtdcFBEResultFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBERtnMsgType是一个换汇返回信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBERtnMsgType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEExtendMsgType是一个换汇扩展信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEExtendMsgType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEBusinessSerialType是一个换汇记账流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEBusinessSerialType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBESystemSerialType是一个换汇流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBESystemSerialType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBETotalExCntType是一个换汇交易总笔数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBETotalExCntType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEExchStatusType是一个换汇交易状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_FBEES_Normal"] = '0' +#交易重发 +defineDict["THOST_FTDC_FBEES_ReExchange"] = '1' + +typedefDict["TThostFtdcFBEExchStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEFileFlagType是一个换汇文件标志类型 +#////////////////////////////////////////////////////////////////////// +#数据包 +defineDict["THOST_FTDC_FBEFG_DataPackage"] = '0' +#文件 +defineDict["THOST_FTDC_FBEFG_File"] = '1' + +typedefDict["TThostFtdcFBEFileFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEAlreadyTradeType是一个换汇已交易标志类型 +#////////////////////////////////////////////////////////////////////// +#未交易 +defineDict["THOST_FTDC_FBEAT_NotTrade"] = '0' +#已交易 +defineDict["THOST_FTDC_FBEAT_Trade"] = '1' + +typedefDict["TThostFtdcFBEAlreadyTradeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEOpenBankType是一个换汇账户开户行类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEOpenBankType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEUserEventTypeType是一个银期换汇用户事件类型类型 +#////////////////////////////////////////////////////////////////////// +#签到 +defineDict["THOST_FTDC_FBEUET_SignIn"] = '0' +#换汇 +defineDict["THOST_FTDC_FBEUET_Exchange"] = '1' +#换汇重发 +defineDict["THOST_FTDC_FBEUET_ReExchange"] = '2' +#银行账户查询 +defineDict["THOST_FTDC_FBEUET_QueryBankAccount"] = '3' +#换汇明细查询 +defineDict["THOST_FTDC_FBEUET_QueryExchDetial"] = '4' +#换汇汇总查询 +defineDict["THOST_FTDC_FBEUET_QueryExchSummary"] = '5' +#换汇汇率查询 +defineDict["THOST_FTDC_FBEUET_QueryExchRate"] = '6' +#对账文件通知 +defineDict["THOST_FTDC_FBEUET_CheckBankAccount"] = '7' +#签退 +defineDict["THOST_FTDC_FBEUET_SignOut"] = '8' +#其他 +defineDict["THOST_FTDC_FBEUET_Other"] = 'Z' + +typedefDict["TThostFtdcFBEUserEventTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEFileNameType是一个换汇相关文件名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEFileNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEBatchSerialType是一个换汇批次号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFBEBatchSerialType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBEReqFlagType是一个换汇发送标志类型 +#////////////////////////////////////////////////////////////////////// +#未处理 +defineDict["THOST_FTDC_FBERF_UnProcessed"] = '0' +#等待发送 +defineDict["THOST_FTDC_FBERF_WaitSend"] = '1' +#发送成功 +defineDict["THOST_FTDC_FBERF_SendSuccess"] = '2' +#发送失败 +defineDict["THOST_FTDC_FBERF_SendFailed"] = '3' +#等待重发 +defineDict["THOST_FTDC_FBERF_WaitReSend"] = '4' + +typedefDict["TThostFtdcFBEReqFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcNotifyClassType是一个风险通知类型类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_NC_NOERROR"] = '0' +#警示 +defineDict["THOST_FTDC_NC_Warn"] = '1' +#追保 +defineDict["THOST_FTDC_NC_Call"] = '2' +#强平 +defineDict["THOST_FTDC_NC_Force"] = '3' +#穿仓 +defineDict["THOST_FTDC_NC_CHUANCANG"] = '4' +#异常 +defineDict["THOST_FTDC_NC_Exception"] = '5' + +typedefDict["TThostFtdcNotifyClassType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRiskNofityInfoType是一个客户风险通知消息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRiskNofityInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcForceCloseSceneIdType是一个强平场景编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcForceCloseSceneIdType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcForceCloseTypeType是一个强平单类型类型 +#////////////////////////////////////////////////////////////////////// +#手工强平 +defineDict["THOST_FTDC_FCT_Manual"] = '0' +#单一投资者辅助强平 +defineDict["THOST_FTDC_FCT_Single"] = '1' +#批量投资者辅助强平 +defineDict["THOST_FTDC_FCT_Group"] = '2' + +typedefDict["TThostFtdcForceCloseTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstrumentIDsType是一个多个产品代码,用+分隔,如cu+zn类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInstrumentIDsType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRiskNotifyMethodType是一个风险通知途径类型 +#////////////////////////////////////////////////////////////////////// +#系统通知 +defineDict["THOST_FTDC_RNM_System"] = '0' +#短信通知 +defineDict["THOST_FTDC_RNM_SMS"] = '1' +#邮件通知 +defineDict["THOST_FTDC_RNM_EMail"] = '2' +#人工通知 +defineDict["THOST_FTDC_RNM_Manual"] = '3' + +typedefDict["TThostFtdcRiskNotifyMethodType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRiskNotifyStatusType是一个风险通知状态类型 +#////////////////////////////////////////////////////////////////////// +#未生成 +defineDict["THOST_FTDC_RNS_NotGen"] = '0' +#已生成未发送 +defineDict["THOST_FTDC_RNS_Generated"] = '1' +#发送失败 +defineDict["THOST_FTDC_RNS_SendError"] = '2' +#已发送未接收 +defineDict["THOST_FTDC_RNS_SendOk"] = '3' +#已接收未确认 +defineDict["THOST_FTDC_RNS_Received"] = '4' +#已确认 +defineDict["THOST_FTDC_RNS_Confirmed"] = '5' + +typedefDict["TThostFtdcRiskNotifyStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRiskUserEventType是一个风控用户操作事件类型 +#////////////////////////////////////////////////////////////////////// +#导出数据 +defineDict["THOST_FTDC_RUE_ExportData"] = '0' + +typedefDict["TThostFtdcRiskUserEventType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParamIDType是一个参数代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcParamIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParamNameType是一个参数名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcParamNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcParamValueType是一个参数值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcParamValueType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcConditionalOrderSortTypeType是一个条件单索引条件类型 +#////////////////////////////////////////////////////////////////////// +#使用最新价升序 +defineDict["THOST_FTDC_COST_LastPriceAsc"] = '0' +#使用最新价降序 +defineDict["THOST_FTDC_COST_LastPriceDesc"] = '1' +#使用卖价升序 +defineDict["THOST_FTDC_COST_AskPriceAsc"] = '2' +#使用卖价降序 +defineDict["THOST_FTDC_COST_AskPriceDesc"] = '3' +#使用买价升序 +defineDict["THOST_FTDC_COST_BidPriceAsc"] = '4' +#使用买价降序 +defineDict["THOST_FTDC_COST_BidPriceDesc"] = '5' + +typedefDict["TThostFtdcConditionalOrderSortTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSendTypeType是一个报送状态类型 +#////////////////////////////////////////////////////////////////////// +#未发送 +defineDict["THOST_FTDC_UOAST_NoSend"] = '0' +#已发送 +defineDict["THOST_FTDC_UOAST_Sended"] = '1' +#已生成 +defineDict["THOST_FTDC_UOAST_Generated"] = '2' +#报送失败 +defineDict["THOST_FTDC_UOAST_SendFail"] = '3' +#接收成功 +defineDict["THOST_FTDC_UOAST_Success"] = '4' +#接收失败 +defineDict["THOST_FTDC_UOAST_Fail"] = '5' +#取消报送 +defineDict["THOST_FTDC_UOAST_Cancel"] = '6' + +typedefDict["TThostFtdcSendTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientIDStatusType是一个交易编码状态类型 +#////////////////////////////////////////////////////////////////////// +#未申请 +defineDict["THOST_FTDC_UOACS_NoApply"] = '1' +#已提交申请 +defineDict["THOST_FTDC_UOACS_Submited"] = '2' +#已发送申请 +defineDict["THOST_FTDC_UOACS_Sended"] = '3' +#完成 +defineDict["THOST_FTDC_UOACS_Success"] = '4' +#拒绝 +defineDict["THOST_FTDC_UOACS_Refuse"] = '5' +#已撤销编码 +defineDict["THOST_FTDC_UOACS_Cancel"] = '6' + +typedefDict["TThostFtdcClientIDStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIndustryIDType是一个行业编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIndustryIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcQuestionIDType是一个特有信息编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcQuestionIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcQuestionContentType是一个特有信息说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcQuestionContentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOptionIDType是一个选项编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOptionIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOptionContentType是一个选项说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOptionContentType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcQuestionTypeType是一个特有信息类型类型 +#////////////////////////////////////////////////////////////////////// +#单选 +defineDict["THOST_FTDC_QT_Radio"] = '1' +#多选 +defineDict["THOST_FTDC_QT_Option"] = '2' +#填空 +defineDict["THOST_FTDC_QT_Blank"] = '3' + +typedefDict["TThostFtdcQuestionTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProcessIDType是一个业务流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProcessIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSeqNoType是一个流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSeqNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAProcessStatusType是一个流程状态类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOAProcessStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProcessTypeType是一个流程功能类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcProcessTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBusinessTypeType是一个业务类型类型 +#////////////////////////////////////////////////////////////////////// +#请求 +defineDict["THOST_FTDC_BT_Request"] = '1' +#应答 +defineDict["THOST_FTDC_BT_Response"] = '2' +#通知 +defineDict["THOST_FTDC_BT_Notice"] = '3' + +typedefDict["TThostFtdcBusinessTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCfmmcReturnCodeType是一个监控中心返回码类型 +#////////////////////////////////////////////////////////////////////// +#成功 +defineDict["THOST_FTDC_CRC_Success"] = '0' +#该客户已经有流程在处理中 +defineDict["THOST_FTDC_CRC_Working"] = '1' +#监控中客户资料检查失败 +defineDict["THOST_FTDC_CRC_InfoFail"] = '2' +#监控中实名制检查失败 +defineDict["THOST_FTDC_CRC_IDCardFail"] = '3' +#其他错误 +defineDict["THOST_FTDC_CRC_OtherFail"] = '4' + +typedefDict["TThostFtdcCfmmcReturnCodeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExReturnCodeType是一个交易所返回码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExReturnCodeType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientTypeType是一个客户类型类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["THOST_FTDC_CfMMCCT_All"] = '0' +#个人 +defineDict["THOST_FTDC_CfMMCCT_Person"] = '1' +#单位 +defineDict["THOST_FTDC_CfMMCCT_Company"] = '2' +#其他 +defineDict["THOST_FTDC_CfMMCCT_Other"] = '3' +#特殊法人 +defineDict["THOST_FTDC_CfMMCCT_SpecialOrgan"] = '4' +#资管户 +defineDict["THOST_FTDC_CfMMCCT_Asset"] = '5' + +typedefDict["TThostFtdcClientTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeIDTypeType是一个交易所编号类型 +#////////////////////////////////////////////////////////////////////// +#上海期货交易所 +defineDict["THOST_FTDC_EIDT_SHFE"] = 'S' +#郑州商品交易所 +defineDict["THOST_FTDC_EIDT_CZCE"] = 'Z' +#大连商品交易所 +defineDict["THOST_FTDC_EIDT_DCE"] = 'D' +#中国金融期货交易所 +defineDict["THOST_FTDC_EIDT_CFFEX"] = 'J' +#上海国际能源交易中心股份有限公司 +defineDict["THOST_FTDC_EIDT_INE"] = 'N' +#上海证券交易所 +defineDict["THOST_FTDC_EIDT_SSE"] = 'A' +#深圳证券交易所 +defineDict["THOST_FTDC_EIDT_SZSE"] = 'E' + +typedefDict["TThostFtdcExchangeIDTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExClientIDTypeType是一个交易编码类型类型 +#////////////////////////////////////////////////////////////////////// +#套保 +defineDict["THOST_FTDC_ECIDT_Hedge"] = '1' +#套利 +defineDict["THOST_FTDC_ECIDT_Arbitrage"] = '2' +#投机 +defineDict["THOST_FTDC_ECIDT_Speculation"] = '3' + +typedefDict["TThostFtdcExClientIDTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientClassifyType是一个客户分类码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClientClassifyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAOrganTypeType是一个单位性质类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOAOrganTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOACountryCodeType是一个国家代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOACountryCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAreaCodeType是一个区号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAreaCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFuturesIDType是一个监控中心为客户分配的代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFuturesIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCffmcDateType是一个日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCffmcDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCffmcTimeType是一个时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCffmcTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcNocIDType是一个组织机构代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcNocIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUpdateFlagType是一个更新状态类型 +#////////////////////////////////////////////////////////////////////// +#未更新 +defineDict["THOST_FTDC_UF_NoUpdate"] = '0' +#更新全部信息成功 +defineDict["THOST_FTDC_UF_Success"] = '1' +#更新全部信息失败 +defineDict["THOST_FTDC_UF_Fail"] = '2' +#更新交易编码成功 +defineDict["THOST_FTDC_UF_TCSuccess"] = '3' +#更新交易编码失败 +defineDict["THOST_FTDC_UF_TCFail"] = '4' +#已丢弃 +defineDict["THOST_FTDC_UF_Cancel"] = '5' + +typedefDict["TThostFtdcUpdateFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcApplyOperateIDType是一个申请动作类型 +#////////////////////////////////////////////////////////////////////// +#开户 +defineDict["THOST_FTDC_AOID_OpenInvestor"] = '1' +#修改身份信息 +defineDict["THOST_FTDC_AOID_ModifyIDCard"] = '2' +#修改一般信息 +defineDict["THOST_FTDC_AOID_ModifyNoIDCard"] = '3' +#申请交易编码 +defineDict["THOST_FTDC_AOID_ApplyTradingCode"] = '4' +#撤销交易编码 +defineDict["THOST_FTDC_AOID_CancelTradingCode"] = '5' +#销户 +defineDict["THOST_FTDC_AOID_CancelInvestor"] = '6' +#账户休眠 +defineDict["THOST_FTDC_AOID_FreezeAccount"] = '8' +#激活休眠账户 +defineDict["THOST_FTDC_AOID_ActiveFreezeAccount"] = '9' + +typedefDict["TThostFtdcApplyOperateIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcApplyStatusIDType是一个申请状态类型 +#////////////////////////////////////////////////////////////////////// +#未补全 +defineDict["THOST_FTDC_ASID_NoComplete"] = '1' +#已提交 +defineDict["THOST_FTDC_ASID_Submited"] = '2' +#已审核 +defineDict["THOST_FTDC_ASID_Checked"] = '3' +#已拒绝 +defineDict["THOST_FTDC_ASID_Refused"] = '4' +#已删除 +defineDict["THOST_FTDC_ASID_Deleted"] = '5' + +typedefDict["TThostFtdcApplyStatusIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSendMethodType是一个发送方式类型 +#////////////////////////////////////////////////////////////////////// +#文件发送 +defineDict["THOST_FTDC_UOASM_ByAPI"] = '1' +#电子发送 +defineDict["THOST_FTDC_UOASM_ByFile"] = '2' + +typedefDict["TThostFtdcSendMethodType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEventTypeType是一个业务操作类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcEventTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcEventModeType是一个操作方法类型 +#////////////////////////////////////////////////////////////////////// +#增加 +defineDict["THOST_FTDC_EvM_ADD"] = '1' +#修改 +defineDict["THOST_FTDC_EvM_UPDATE"] = '2' +#删除 +defineDict["THOST_FTDC_EvM_DELETE"] = '3' +#复核 +defineDict["THOST_FTDC_EvM_CHECK"] = '4' +#复制 +defineDict["THOST_FTDC_EvM_COPY"] = '5' +#注销 +defineDict["THOST_FTDC_EvM_CANCEL"] = '6' +#冲销 +defineDict["THOST_FTDC_EvM_Reverse"] = '7' + +typedefDict["TThostFtdcEventModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAAutoSendType是一个统一开户申请自动发送类型 +#////////////////////////////////////////////////////////////////////// +#自动发送并接收 +defineDict["THOST_FTDC_UOAA_ASR"] = '1' +#自动发送,不自动接收 +defineDict["THOST_FTDC_UOAA_ASNR"] = '2' +#不自动发送,自动接收 +defineDict["THOST_FTDC_UOAA_NSAR"] = '3' +#不自动发送,也不自动接收 +defineDict["THOST_FTDC_UOAA_NSR"] = '4' + +typedefDict["TThostFtdcUOAAutoSendType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcQueryDepthType是一个查询深度类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcQueryDepthType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDataCenterIDType是一个数据中心代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDataCenterIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFlowIDType是一个流程ID类型 +#////////////////////////////////////////////////////////////////////// +#投资者对应投资者组设置 +defineDict["THOST_FTDC_EvM_InvestorGroupFlow"] = '1' +#投资者手续费率设置 +defineDict["THOST_FTDC_EvM_InvestorRate"] = '2' +#投资者手续费率模板关系设置 +defineDict["THOST_FTDC_EvM_InvestorCommRateModel"] = '3' + +typedefDict["TThostFtdcFlowIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCheckLevelType是一个复核级别类型 +#////////////////////////////////////////////////////////////////////// +#零级复核 +defineDict["THOST_FTDC_CL_Zero"] = '0' +#一级复核 +defineDict["THOST_FTDC_CL_One"] = '1' +#二级复核 +defineDict["THOST_FTDC_CL_Two"] = '2' + +typedefDict["TThostFtdcCheckLevelType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCheckNoType是一个操作次数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCheckNoType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCheckStatusType是一个复核级别类型 +#////////////////////////////////////////////////////////////////////// +#未复核 +defineDict["THOST_FTDC_CHS_Init"] = '0' +#复核中 +defineDict["THOST_FTDC_CHS_Checking"] = '1' +#已复核 +defineDict["THOST_FTDC_CHS_Checked"] = '2' +#拒绝 +defineDict["THOST_FTDC_CHS_Refuse"] = '3' +#作废 +defineDict["THOST_FTDC_CHS_Cancel"] = '4' + +typedefDict["TThostFtdcCheckStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUsedStatusType是一个生效状态类型 +#////////////////////////////////////////////////////////////////////// +#未生效 +defineDict["THOST_FTDC_CHU_Unused"] = '0' +#已生效 +defineDict["THOST_FTDC_CHU_Used"] = '1' +#生效失败 +defineDict["THOST_FTDC_CHU_Fail"] = '2' + +typedefDict["TThostFtdcUsedStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRateTemplateNameType是一个模型名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRateTemplateNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPropertyStringType是一个用于查询的投资属性字段类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPropertyStringType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAcountOriginType是一个账户来源类型 +#////////////////////////////////////////////////////////////////////// +#手工录入 +defineDict["THOST_FTDC_BAO_ByAccProperty"] = '0' +#银期转账 +defineDict["THOST_FTDC_BAO_ByFBTransfer"] = '1' + +typedefDict["TThostFtdcBankAcountOriginType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMonthBillTradeSumType是一个结算单月报成交汇总方式类型 +#////////////////////////////////////////////////////////////////////// +#同日同合约 +defineDict["THOST_FTDC_MBTS_ByInstrument"] = '0' +#同日同合约同价格 +defineDict["THOST_FTDC_MBTS_ByDayInsPrc"] = '1' +#同合约 +defineDict["THOST_FTDC_MBTS_ByDayIns"] = '2' + +typedefDict["TThostFtdcMonthBillTradeSumType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFBTTradeCodeEnumType是一个银期交易代码枚举类型 +#////////////////////////////////////////////////////////////////////// +#银行发起银行转期货 +defineDict["THOST_FTDC_FTC_BankLaunchBankToBroker"] = '102001' +#期货发起银行转期货 +defineDict["THOST_FTDC_FTC_BrokerLaunchBankToBroker"] = '202001' +#银行发起期货转银行 +defineDict["THOST_FTDC_FTC_BankLaunchBrokerToBank"] = '102002' +#期货发起期货转银行 +defineDict["THOST_FTDC_FTC_BrokerLaunchBrokerToBank"] = '202002' + +typedefDict["TThostFtdcFBTTradeCodeEnumType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRateTemplateIDType是一个模型代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRateTemplateIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRiskRateType是一个风险度类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRiskRateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTimestampType是一个时间戳类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTimestampType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorIDRuleNameType是一个号段规则名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvestorIDRuleNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorIDRuleExprType是一个号段规则表达式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvestorIDRuleExprType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLastDriftType是一个上次OTP漂移值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLastDriftType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLastSuccessType是一个上次OTP成功值类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLastSuccessType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAuthKeyType是一个令牌密钥类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAuthKeyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSerialNumberType是一个序列号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSerialNumberType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOTPTypeType是一个动态令牌类型类型 +#////////////////////////////////////////////////////////////////////// +#无动态令牌 +defineDict["THOST_FTDC_OTP_NONE"] = '0' +#时间令牌 +defineDict["THOST_FTDC_OTP_TOTP"] = '1' + +typedefDict["TThostFtdcOTPTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOTPVendorsIDType是一个动态令牌提供商类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOTPVendorsIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOTPVendorsNameType是一个动态令牌提供商名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOTPVendorsNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOTPStatusType是一个动态令牌状态类型 +#////////////////////////////////////////////////////////////////////// +#未使用 +defineDict["THOST_FTDC_OTPS_Unused"] = '0' +#已使用 +defineDict["THOST_FTDC_OTPS_Used"] = '1' +#注销 +defineDict["THOST_FTDC_OTPS_Disuse"] = '2' + +typedefDict["TThostFtdcOTPStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBrokerUserTypeType是一个经济公司用户类型类型 +#////////////////////////////////////////////////////////////////////// +#投资者 +defineDict["THOST_FTDC_BUT_Investor"] = '1' +#操作员 +defineDict["THOST_FTDC_BUT_BrokerUser"] = '2' + +typedefDict["TThostFtdcBrokerUserTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFutureTypeType是一个期货类型类型 +#////////////////////////////////////////////////////////////////////// +#商品期货 +defineDict["THOST_FTDC_FUTT_Commodity"] = '1' +#金融期货 +defineDict["THOST_FTDC_FUTT_Financial"] = '2' + +typedefDict["TThostFtdcFutureTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundEventTypeType是一个资金管理操作类型类型 +#////////////////////////////////////////////////////////////////////// +#转账限额 +defineDict["THOST_FTDC_FET_Restriction"] = '0' +#当日转账限额 +defineDict["THOST_FTDC_FET_TodayRestriction"] = '1' +#期商流水 +defineDict["THOST_FTDC_FET_Transfer"] = '2' +#资金冻结 +defineDict["THOST_FTDC_FET_Credit"] = '3' +#投资者可提资金比例 +defineDict["THOST_FTDC_FET_InvestorWithdrawAlm"] = '4' +#单个银行帐户转账限额 +defineDict["THOST_FTDC_FET_BankRestriction"] = '5' +#银期签约账户 +defineDict["THOST_FTDC_FET_Accountregister"] = '6' +#交易所出入金 +defineDict["THOST_FTDC_FET_ExchangeFundIO"] = '7' +#投资者出入金 +defineDict["THOST_FTDC_FET_InvestorFundIO"] = '8' + +typedefDict["TThostFtdcFundEventTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAccountSourceTypeType是一个资金账户来源类型 +#////////////////////////////////////////////////////////////////////// +#银期同步 +defineDict["THOST_FTDC_AST_FBTransfer"] = '0' +#手工录入 +defineDict["THOST_FTDC_AST_ManualEntry"] = '1' + +typedefDict["TThostFtdcAccountSourceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCodeSourceTypeType是一个交易编码来源类型 +#////////////////////////////////////////////////////////////////////// +#统一开户(已规范) +defineDict["THOST_FTDC_CST_UnifyAccount"] = '0' +#手工录入(未规范) +defineDict["THOST_FTDC_CST_ManualEntry"] = '1' + +typedefDict["TThostFtdcCodeSourceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserRangeType是一个操作员范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["THOST_FTDC_UR_All"] = '0' +#单一操作员 +defineDict["THOST_FTDC_UR_Single"] = '1' + +typedefDict["TThostFtdcUserRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTimeSpanType是一个时间跨度类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTimeSpanType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcImportSequenceIDType是一个动态令牌导入批次编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcImportSequenceIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcByGroupType是一个交易统计表按客户统计方式类型 +#////////////////////////////////////////////////////////////////////// +#按投资者统计 +defineDict["THOST_FTDC_BG_Investor"] = '2' +#按类统计 +defineDict["THOST_FTDC_BG_Group"] = '1' + +typedefDict["TThostFtdcByGroupType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSumStatModeType是一个交易统计表按范围统计方式类型 +#////////////////////////////////////////////////////////////////////// +#按合约统计 +defineDict["THOST_FTDC_TSSM_Instrument"] = '1' +#按产品统计 +defineDict["THOST_FTDC_TSSM_Product"] = '2' +#按交易所统计 +defineDict["THOST_FTDC_TSSM_Exchange"] = '3' + +typedefDict["TThostFtdcTradeSumStatModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcComTypeType是一个组合成交类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcComTypeType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserProductIDType是一个产品标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUserProductIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserProductNameType是一个产品名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUserProductNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUserProductMemoType是一个产品说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUserProductMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCCancelFlagType是一个新增或变更标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCCancelFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCDateType是一个日期类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCDateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCInvestorNameType是一个客户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCInvestorNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCOpenInvestorNameType是一个客户名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCOpenInvestorNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCInvestorIDType是一个客户代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCInvestorIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCIdentifiedCardNoType是一个证件号码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCIdentifiedCardNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCClientIDType是一个交易编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCClientIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCBankFlagType是一个银行标识类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCBankFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCBankAccountType是一个银行账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCBankAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCOpenNameType是一个开户人类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCOpenNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCMemoType是一个说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCTimeType是一个时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCTradeIDType是一个成交流水号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCTradeIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCExchangeInstIDType是一个合约代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCExchangeInstIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCMortgageNameType是一个质押品名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCMortgageNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCReasonType是一个事由类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCReasonType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIsSettlementType是一个是否为非结算会员类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIsSettlementType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCMoneyType是一个资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCMoneyType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCPriceType是一个价格类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCPriceType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCOptionsTypeType是一个期权类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCOptionsTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCStrikePriceType是一个执行价类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCStrikePriceType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCTargetProductIDType是一个标的品种类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCTargetProductIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCTargetInstrIDType是一个标的合约类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCTargetInstrIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommModelNameType是一个手续费率模板名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommModelNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCommModelMemoType是一个手续费率模板备注类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCommModelMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExprSetModeType是一个日期表达式设置类型类型 +#////////////////////////////////////////////////////////////////////// +#相对已有规则设置 +defineDict["THOST_FTDC_ESM_Relative"] = '1' +#典型设置 +defineDict["THOST_FTDC_ESM_Typical"] = '2' + +typedefDict["TThostFtdcExprSetModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRateInvestorRangeType是一个投资者范围类型 +#////////////////////////////////////////////////////////////////////// +#公司标准 +defineDict["THOST_FTDC_RIR_All"] = '1' +#模板 +defineDict["THOST_FTDC_RIR_Model"] = '2' +#单一投资者 +defineDict["THOST_FTDC_RIR_Single"] = '3' + +typedefDict["TThostFtdcRateInvestorRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAgentBrokerIDType是一个代理经纪公司代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAgentBrokerIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDRIdentityIDType是一个交易中心代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDRIdentityIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDRIdentityNameType是一个交易中心名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDRIdentityNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDBLinkIDType是一个DBLink标识号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDBLinkIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSyncDataStatusType是一个主次用系统数据同步状态类型 +#////////////////////////////////////////////////////////////////////// +#未同步 +defineDict["THOST_FTDC_SDS_Initialize"] = '0' +#同步中 +defineDict["THOST_FTDC_SDS_Settlementing"] = '1' +#已同步 +defineDict["THOST_FTDC_SDS_Settlemented"] = '2' + +typedefDict["TThostFtdcSyncDataStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSourceType是一个成交来源类型 +#////////////////////////////////////////////////////////////////////// +#来自交易所普通回报 +defineDict["THOST_FTDC_TSRC_NORMAL"] = '0' +#来自查询 +defineDict["THOST_FTDC_TSRC_QUERY"] = '1' + +typedefDict["TThostFtdcTradeSourceType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFlexStatModeType是一个产品合约统计方式类型 +#////////////////////////////////////////////////////////////////////// +#产品统计 +defineDict["THOST_FTDC_FSM_Product"] = '1' +#交易所统计 +defineDict["THOST_FTDC_FSM_Exchange"] = '2' +#统计所有 +defineDict["THOST_FTDC_FSM_All"] = '3' + +typedefDict["TThostFtdcFlexStatModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcByInvestorRangeType是一个投资者范围统计方式类型 +#////////////////////////////////////////////////////////////////////// +#属性统计 +defineDict["THOST_FTDC_BIR_Property"] = '1' +#统计所有 +defineDict["THOST_FTDC_BIR_All"] = '2' + +typedefDict["TThostFtdcByInvestorRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSRiskRateType是一个风险度类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSRiskRateType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSequenceNo12Type是一个序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSequenceNo12Type"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPropertyInvestorRangeType是一个投资者范围类型 +#////////////////////////////////////////////////////////////////////// +#所有 +defineDict["THOST_FTDC_PIR_All"] = '1' +#投资者属性 +defineDict["THOST_FTDC_PIR_Property"] = '2' +#单一投资者 +defineDict["THOST_FTDC_PIR_Single"] = '3' + +typedefDict["TThostFtdcPropertyInvestorRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileStatusType是一个文件状态类型 +#////////////////////////////////////////////////////////////////////// +#未生成 +defineDict["THOST_FTDC_FIS_NoCreate"] = '0' +#已生成 +defineDict["THOST_FTDC_FIS_Created"] = '1' +#生成失败 +defineDict["THOST_FTDC_FIS_Failed"] = '2' + +typedefDict["TThostFtdcFileStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFileGenStyleType是一个文件生成方式类型 +#////////////////////////////////////////////////////////////////////// +#下发 +defineDict["THOST_FTDC_FGS_FileTransmit"] = '0' +#生成 +defineDict["THOST_FTDC_FGS_FileGen"] = '1' + +typedefDict["TThostFtdcFileGenStyleType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSysOperModeType是一个系统日志操作方法类型 +#////////////////////////////////////////////////////////////////////// +#增加 +defineDict["THOST_FTDC_SoM_Add"] = '1' +#修改 +defineDict["THOST_FTDC_SoM_Update"] = '2' +#删除 +defineDict["THOST_FTDC_SoM_Delete"] = '3' +#复制 +defineDict["THOST_FTDC_SoM_Copy"] = '4' +#激活 +defineDict["THOST_FTDC_SoM_AcTive"] = '5' +#注销 +defineDict["THOST_FTDC_SoM_CanCel"] = '6' +#重置 +defineDict["THOST_FTDC_SoM_ReSet"] = '7' + +typedefDict["TThostFtdcSysOperModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSysOperTypeType是一个系统日志操作类型类型 +#////////////////////////////////////////////////////////////////////// +#修改操作员密码 +defineDict["THOST_FTDC_SoT_UpdatePassword"] = '0' +#操作员组织架构关系 +defineDict["THOST_FTDC_SoT_UserDepartment"] = '1' +#角色管理 +defineDict["THOST_FTDC_SoT_RoleManager"] = '2' +#角色功能设置 +defineDict["THOST_FTDC_SoT_RoleFunction"] = '3' +#基础参数设置 +defineDict["THOST_FTDC_SoT_BaseParam"] = '4' +#设置操作员 +defineDict["THOST_FTDC_SoT_SetUserID"] = '5' +#用户角色设置 +defineDict["THOST_FTDC_SoT_SetUserRole"] = '6' +#用户IP限制 +defineDict["THOST_FTDC_SoT_UserIpRestriction"] = '7' +#组织架构管理 +defineDict["THOST_FTDC_SoT_DepartmentManager"] = '8' +#组织架构向查询分类复制 +defineDict["THOST_FTDC_SoT_DepartmentCopy"] = '9' +#交易编码管理 +defineDict["THOST_FTDC_SoT_Tradingcode"] = 'A' +#投资者状态维护 +defineDict["THOST_FTDC_SoT_InvestorStatus"] = 'B' +#投资者权限管理 +defineDict["THOST_FTDC_SoT_InvestorAuthority"] = 'C' +#属性设置 +defineDict["THOST_FTDC_SoT_PropertySet"] = 'D' +#重置投资者密码 +defineDict["THOST_FTDC_SoT_ReSetInvestorPasswd"] = 'E' +#投资者个性信息维护 +defineDict["THOST_FTDC_SoT_InvestorPersonalityInfo"] = 'F' + +typedefDict["TThostFtdcSysOperTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCDataQueyTypeType是一个上报数据查询类型类型 +#////////////////////////////////////////////////////////////////////// +#查询当前交易日报送的数据 +defineDict["THOST_FTDC_CSRCQ_Current"] = '0' +#查询历史报送的代理经纪公司的数据 +defineDict["THOST_FTDC_CSRCQ_History"] = '1' + +typedefDict["TThostFtdcCSRCDataQueyTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFreezeStatusType是一个休眠状态类型 +#////////////////////////////////////////////////////////////////////// +#活跃 +defineDict["THOST_FTDC_FRS_Normal"] = '1' +#休眠 +defineDict["THOST_FTDC_FRS_Freeze"] = '0' + +typedefDict["TThostFtdcFreezeStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStandardStatusType是一个规范状态类型 +#////////////////////////////////////////////////////////////////////// +#已规范 +defineDict["THOST_FTDC_STST_Standard"] = '0' +#未规范 +defineDict["THOST_FTDC_STST_NonStandard"] = '1' + +typedefDict["TThostFtdcStandardStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCFreezeStatusType是一个休眠状态类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCFreezeStatusType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRightParamTypeType是一个配置类型类型 +#////////////////////////////////////////////////////////////////////// +#休眠户 +defineDict["THOST_FTDC_RPT_Freeze"] = '1' +#激活休眠户 +defineDict["THOST_FTDC_RPT_FreezeActive"] = '2' +#开仓权限限制 +defineDict["THOST_FTDC_RPT_OpenLimit"] = '3' +#解除开仓权限限制 +defineDict["THOST_FTDC_RPT_RelieveOpenLimit"] = '4' + +typedefDict["TThostFtdcRightParamTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRightTemplateIDType是一个模板代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRightTemplateIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRightTemplateNameType是一个模板名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRightTemplateNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDataStatusType是一个反洗钱审核表数据状态类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_AMLDS_Normal"] = '0' +#已删除 +defineDict["THOST_FTDC_AMLDS_Deleted"] = '1' + +typedefDict["TThostFtdcDataStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAMLCheckStatusType是一个审核状态类型 +#////////////////////////////////////////////////////////////////////// +#未复核 +defineDict["THOST_FTDC_AMLCHS_Init"] = '0' +#复核中 +defineDict["THOST_FTDC_AMLCHS_Checking"] = '1' +#已复核 +defineDict["THOST_FTDC_AMLCHS_Checked"] = '2' +#拒绝上报 +defineDict["THOST_FTDC_AMLCHS_RefuseReport"] = '3' + +typedefDict["TThostFtdcAMLCheckStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAmlDateTypeType是一个日期类型类型 +#////////////////////////////////////////////////////////////////////// +#检查日期 +defineDict["THOST_FTDC_AMLDT_DrawDay"] = '0' +#发生日期 +defineDict["THOST_FTDC_AMLDT_TouchDay"] = '1' + +typedefDict["TThostFtdcAmlDateTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAmlCheckLevelType是一个审核级别类型 +#////////////////////////////////////////////////////////////////////// +#零级审核 +defineDict["THOST_FTDC_AMLCL_CheckLevel0"] = '0' +#一级审核 +defineDict["THOST_FTDC_AMLCL_CheckLevel1"] = '1' +#二级审核 +defineDict["THOST_FTDC_AMLCL_CheckLevel2"] = '2' +#三级审核 +defineDict["THOST_FTDC_AMLCL_CheckLevel3"] = '3' + +typedefDict["TThostFtdcAmlCheckLevelType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAmlCheckFlowType是一个反洗钱数据抽取审核流程类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAmlCheckFlowType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDataTypeType是一个数据类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDataTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExportFileTypeType是一个导出文件类型类型 +#////////////////////////////////////////////////////////////////////// +#CSV +defineDict["THOST_FTDC_EFT_CSV"] = '0' +#Excel +defineDict["THOST_FTDC_EFT_EXCEL"] = '1' +#DBF +defineDict["THOST_FTDC_EFT_DBF"] = '2' + +typedefDict["TThostFtdcExportFileTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettleManagerTypeType是一个结算配置类型类型 +#////////////////////////////////////////////////////////////////////// +#结算前准备 +defineDict["THOST_FTDC_SMT_Before"] = '1' +#结算 +defineDict["THOST_FTDC_SMT_Settlement"] = '2' +#结算后核对 +defineDict["THOST_FTDC_SMT_After"] = '3' +#结算后处理 +defineDict["THOST_FTDC_SMT_Settlemented"] = '4' + +typedefDict["TThostFtdcSettleManagerTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettleManagerIDType是一个结算配置代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSettleManagerIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettleManagerNameType是一个结算配置名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSettleManagerNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettleManagerLevelType是一个结算配置等级类型 +#////////////////////////////////////////////////////////////////////// +#必要 +defineDict["THOST_FTDC_SML_Must"] = '1' +#警告 +defineDict["THOST_FTDC_SML_Alarm"] = '2' +#提示 +defineDict["THOST_FTDC_SML_Prompt"] = '3' +#不检查 +defineDict["THOST_FTDC_SML_Ignore"] = '4' + +typedefDict["TThostFtdcSettleManagerLevelType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettleManagerGroupType是一个模块分组类型 +#////////////////////////////////////////////////////////////////////// +#交易所核对 +defineDict["THOST_FTDC_SMG_Exhcange"] = '1' +#内部核对 +defineDict["THOST_FTDC_SMG_ASP"] = '2' +#上报数据核对 +defineDict["THOST_FTDC_SMG_CSRC"] = '3' + +typedefDict["TThostFtdcSettleManagerGroupType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCheckResultMemoType是一个核对结果说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCheckResultMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFunctionUrlType是一个功能链接类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcFunctionUrlType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAuthInfoType是一个客户端认证信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAuthInfoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAuthCodeType是一个客户端认证码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAuthCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLimitUseTypeType是一个保值额度使用类型类型 +#////////////////////////////////////////////////////////////////////// +#可重复使用 +defineDict["THOST_FTDC_LUT_Repeatable"] = '1' +#不可重复使用 +defineDict["THOST_FTDC_LUT_Unrepeatable"] = '2' + +typedefDict["TThostFtdcLimitUseTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDataResourceType是一个数据来源类型 +#////////////////////////////////////////////////////////////////////// +#本系统 +defineDict["THOST_FTDC_DAR_Settle"] = '1' +#交易所 +defineDict["THOST_FTDC_DAR_Exchange"] = '2' +#报送数据 +defineDict["THOST_FTDC_DAR_CSRC"] = '3' + +typedefDict["TThostFtdcDataResourceType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMarginTypeType是一个保证金类型类型 +#////////////////////////////////////////////////////////////////////// +#交易所保证金率 +defineDict["THOST_FTDC_MGT_ExchMarginRate"] = '0' +#投资者保证金率 +defineDict["THOST_FTDC_MGT_InstrMarginRate"] = '1' +#投资者交易保证金率 +defineDict["THOST_FTDC_MGT_InstrMarginRateTrade"] = '2' + +typedefDict["TThostFtdcMarginTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcActiveTypeType是一个生效类型类型 +#////////////////////////////////////////////////////////////////////// +#仅当日生效 +defineDict["THOST_FTDC_ACT_Intraday"] = '1' +#长期生效 +defineDict["THOST_FTDC_ACT_Long"] = '2' + +typedefDict["TThostFtdcActiveTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMarginRateTypeType是一个冲突保证金率类型类型 +#////////////////////////////////////////////////////////////////////// +#交易所保证金率 +defineDict["THOST_FTDC_MRT_Exchange"] = '1' +#投资者保证金率 +defineDict["THOST_FTDC_MRT_Investor"] = '2' +#投资者交易保证金率 +defineDict["THOST_FTDC_MRT_InvestorTrade"] = '3' + +typedefDict["TThostFtdcMarginRateTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBackUpStatusType是一个备份数据状态类型 +#////////////////////////////////////////////////////////////////////// +#未生成备份数据 +defineDict["THOST_FTDC_BUS_UnBak"] = '0' +#备份数据生成中 +defineDict["THOST_FTDC_BUS_BakUp"] = '1' +#已生成备份数据 +defineDict["THOST_FTDC_BUS_BakUped"] = '2' +#备份数据失败 +defineDict["THOST_FTDC_BUS_BakFail"] = '3' + +typedefDict["TThostFtdcBackUpStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInitSettlementType是一个结算初始化状态类型 +#////////////////////////////////////////////////////////////////////// +#结算初始化未开始 +defineDict["THOST_FTDC_SIS_UnInitialize"] = '0' +#结算初始化中 +defineDict["THOST_FTDC_SIS_Initialize"] = '1' +#结算初始化完成 +defineDict["THOST_FTDC_SIS_Initialized"] = '2' + +typedefDict["TThostFtdcInitSettlementType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReportStatusType是一个报表数据生成状态类型 +#////////////////////////////////////////////////////////////////////// +#未生成报表数据 +defineDict["THOST_FTDC_SRS_NoCreate"] = '0' +#报表数据生成中 +defineDict["THOST_FTDC_SRS_Create"] = '1' +#已生成报表数据 +defineDict["THOST_FTDC_SRS_Created"] = '2' +#生成报表数据失败 +defineDict["THOST_FTDC_SRS_CreateFail"] = '3' + +typedefDict["TThostFtdcReportStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSaveStatusType是一个数据归档状态类型 +#////////////////////////////////////////////////////////////////////// +#归档未完成 +defineDict["THOST_FTDC_SSS_UnSaveData"] = '0' +#归档完成 +defineDict["THOST_FTDC_SSS_SaveDatad"] = '1' + +typedefDict["TThostFtdcSaveStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSettArchiveStatusType是一个结算确认数据归档状态类型 +#////////////////////////////////////////////////////////////////////// +#未归档数据 +defineDict["THOST_FTDC_SAS_UnArchived"] = '0' +#数据归档中 +defineDict["THOST_FTDC_SAS_Archiving"] = '1' +#已归档数据 +defineDict["THOST_FTDC_SAS_Archived"] = '2' +#归档数据失败 +defineDict["THOST_FTDC_SAS_ArchiveFail"] = '3' + +typedefDict["TThostFtdcSettArchiveStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCTPTypeType是一个CTP交易系统类型类型 +#////////////////////////////////////////////////////////////////////// +#未知类型 +defineDict["THOST_FTDC_CTPT_Unkown"] = '0' +#主中心 +defineDict["THOST_FTDC_CTPT_MainCenter"] = '1' +#备中心 +defineDict["THOST_FTDC_CTPT_BackUp"] = '2' + +typedefDict["TThostFtdcCTPTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcToolIDType是一个工具代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcToolIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcToolNameType是一个工具名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcToolNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCloseDealTypeType是一个平仓处理类型类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_CDT_Normal"] = '0' +#投机平仓优先 +defineDict["THOST_FTDC_CDT_SpecFirst"] = '1' + +typedefDict["TThostFtdcCloseDealTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMortgageFundUseRangeType是一个货币质押资金可用范围类型 +#////////////////////////////////////////////////////////////////////// +#不能使用 +defineDict["THOST_FTDC_MFUR_None"] = '0' +#用于保证金 +defineDict["THOST_FTDC_MFUR_Margin"] = '1' +#用于手续费、盈亏、保证金 +defineDict["THOST_FTDC_MFUR_All"] = '2' + +typedefDict["TThostFtdcMortgageFundUseRangeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencyUnitType是一个币种单位数量类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrencyUnitType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExchangeRateType是一个汇率类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExchangeRateType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSpecProductTypeType是一个特殊产品类型类型 +#////////////////////////////////////////////////////////////////////// +#郑商所套保产品 +defineDict["THOST_FTDC_SPT_CzceHedge"] = '1' +#货币质押产品 +defineDict["THOST_FTDC_SPT_IneForeignCurrency"] = '2' +#大连短线开平仓产品 +defineDict["THOST_FTDC_SPT_DceOpenClose"] = '3' + +typedefDict["TThostFtdcSpecProductTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundMortgageTypeType是一个货币质押类型类型 +#////////////////////////////////////////////////////////////////////// +#质押 +defineDict["THOST_FTDC_FMT_Mortgage"] = '1' +#解质 +defineDict["THOST_FTDC_FMT_Redemption"] = '2' + +typedefDict["TThostFtdcFundMortgageTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAccountSettlementParamIDType是一个投资者账户结算参数代码类型 +#////////////////////////////////////////////////////////////////////// +#基础保证金 +defineDict["THOST_FTDC_ASPI_BaseMargin"] = '1' +#最低权益标准 +defineDict["THOST_FTDC_ASPI_LowestInterest"] = '2' + +typedefDict["TThostFtdcAccountSettlementParamIDType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencyNameType是一个币种名称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrencyNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencySignType是一个币种符号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrencySignType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundMortDirectionType是一个货币质押方向类型 +#////////////////////////////////////////////////////////////////////// +#货币质入 +defineDict["THOST_FTDC_FMD_In"] = '1' +#货币质出 +defineDict["THOST_FTDC_FMD_Out"] = '2' + +typedefDict["TThostFtdcFundMortDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBusinessClassType是一个换汇类别类型 +#////////////////////////////////////////////////////////////////////// +#盈利 +defineDict["THOST_FTDC_BT_Profit"] = '0' +#亏损 +defineDict["THOST_FTDC_BT_Loss"] = '1' +#其他 +defineDict["THOST_FTDC_BT_Other"] = 'Z' + +typedefDict["TThostFtdcBusinessClassType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSwapSourceTypeType是一个换汇数据来源类型 +#////////////////////////////////////////////////////////////////////// +#手工 +defineDict["THOST_FTDC_SST_Manual"] = '0' +#自动生成 +defineDict["THOST_FTDC_SST_Automatic"] = '1' + +typedefDict["TThostFtdcSwapSourceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrExDirectionType是一个换汇类型类型 +#////////////////////////////////////////////////////////////////////// +#结汇 +defineDict["THOST_FTDC_CED_Settlement"] = '0' +#售汇 +defineDict["THOST_FTDC_CED_Sale"] = '1' + +typedefDict["TThostFtdcCurrExDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencySwapStatusType是一个申请状态类型 +#////////////////////////////////////////////////////////////////////// +#已录入 +defineDict["THOST_FTDC_CSS_Entry"] = '1' +#已审核 +defineDict["THOST_FTDC_CSS_Approve"] = '2' +#已拒绝 +defineDict["THOST_FTDC_CSS_Refuse"] = '3' +#已撤销 +defineDict["THOST_FTDC_CSS_Revoke"] = '4' +#已发送 +defineDict["THOST_FTDC_CSS_Send"] = '5' +#换汇成功 +defineDict["THOST_FTDC_CSS_Success"] = '6' +#换汇失败 +defineDict["THOST_FTDC_CSS_Failure"] = '7' + +typedefDict["TThostFtdcCurrencySwapStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrExchCertNoType是一个凭证号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrExchCertNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBatchSerialNoType是一个批次号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBatchSerialNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcReqFlagType是一个换汇发送标志类型 +#////////////////////////////////////////////////////////////////////// +#未发送 +defineDict["THOST_FTDC_REQF_NoSend"] = '0' +#发送成功 +defineDict["THOST_FTDC_REQF_SendSuccess"] = '1' +#发送失败 +defineDict["THOST_FTDC_REQF_SendFailed"] = '2' +#等待重发 +defineDict["THOST_FTDC_REQF_WaitReSend"] = '3' + +typedefDict["TThostFtdcReqFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcResFlagType是一个换汇返回成功标志类型 +#////////////////////////////////////////////////////////////////////// +#成功 +defineDict["THOST_FTDC_RESF_Success"] = '0' +#账户余额不足 +defineDict["THOST_FTDC_RESF_InsuffiCient"] = '1' +#交易结果未知 +defineDict["THOST_FTDC_RESF_UnKnown"] = '8' + +typedefDict["TThostFtdcResFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPageControlType是一个换汇页面控制类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPageControlType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcRecordCountType是一个记录数类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcRecordCountType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCurrencySwapMemoType是一个换汇需确认信息类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCurrencySwapMemoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExStatusType是一个修改状态类型 +#////////////////////////////////////////////////////////////////////// +#修改前 +defineDict["THOST_FTDC_EXS_Before"] = '0' +#修改后 +defineDict["THOST_FTDC_EXS_After"] = '1' + +typedefDict["TThostFtdcExStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientRegionType是一个开户客户地域类型 +#////////////////////////////////////////////////////////////////////// +#国内客户 +defineDict["THOST_FTDC_CR_Domestic"] = '1' +#港澳台客户 +defineDict["THOST_FTDC_CR_GMT"] = '2' +#国外客户 +defineDict["THOST_FTDC_CR_Foreign"] = '3' + +typedefDict["TThostFtdcClientRegionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWorkPlaceType是一个工作单位类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcWorkPlaceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBusinessPeriodType是一个经营期限类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBusinessPeriodType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcWebSiteType是一个网址类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcWebSiteType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAIdCardTypeType是一个统一开户证件类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOAIdCardTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcClientModeType是一个开户模式类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcClientModeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestorFullNameType是一个投资者全称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvestorFullNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOABrokerIDType是一个境外中介机构ID类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOABrokerIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAZipCodeType是一个邮政编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOAZipCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAEMailType是一个电子邮箱类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOAEMailType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOldCityType是一个城市类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcOldCityType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCorporateIdentifiedCardNoType是一个法人代表证件号码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCorporateIdentifiedCardNoType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHasBoardType是一个是否有董事会类型 +#////////////////////////////////////////////////////////////////////// +#没有 +defineDict["THOST_FTDC_HB_No"] = '0' +#有 +defineDict["THOST_FTDC_HB_Yes"] = '1' + +typedefDict["TThostFtdcHasBoardType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStartModeType是一个启动模式类型 +#////////////////////////////////////////////////////////////////////// +#正常 +defineDict["THOST_FTDC_SM_Normal"] = '1' +#应急 +defineDict["THOST_FTDC_SM_Emerge"] = '2' +#恢复 +defineDict["THOST_FTDC_SM_Restore"] = '3' + +typedefDict["TThostFtdcStartModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTemplateTypeType是一个模型类型类型 +#////////////////////////////////////////////////////////////////////// +#全量 +defineDict["THOST_FTDC_TPT_Full"] = '1' +#增量 +defineDict["THOST_FTDC_TPT_Increment"] = '2' +#备份 +defineDict["THOST_FTDC_TPT_BackUp"] = '3' + +typedefDict["TThostFtdcTemplateTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLoginModeType是一个登录模式类型 +#////////////////////////////////////////////////////////////////////// +#交易 +defineDict["THOST_FTDC_LM_Trade"] = '0' +#转账 +defineDict["THOST_FTDC_LM_Transfer"] = '1' + +typedefDict["TThostFtdcLoginModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPromptTypeType是一个日历提示类型类型 +#////////////////////////////////////////////////////////////////////// +#合约上下市 +defineDict["THOST_FTDC_CPT_Instrument"] = '1' +#保证金分段生效 +defineDict["THOST_FTDC_CPT_Margin"] = '2' + +typedefDict["TThostFtdcPromptTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLedgerManageIDType是一个分户管理资产编码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLedgerManageIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInvestVarietyType是一个投资品种类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInvestVarietyType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBankAccountTypeType是一个账户类别类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBankAccountTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLedgerManageBankType是一个开户银行类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcLedgerManageBankType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCffexDepartmentNameType是一个开户营业部类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCffexDepartmentNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCffexDepartmentCodeType是一个营业部代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCffexDepartmentCodeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHasTrusteeType是一个是否有托管人类型 +#////////////////////////////////////////////////////////////////////// +#有 +defineDict["THOST_FTDC_HT_Yes"] = '1' +#没有 +defineDict["THOST_FTDC_HT_No"] = '0' + +typedefDict["TThostFtdcHasTrusteeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCMemo1Type是一个说明类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCMemo1Type"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAssetmgrCFullNameType是一个代理资产管理业务的期货公司全称类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAssetmgrCFullNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAssetmgrApprovalNOType是一个资产管理业务批文号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAssetmgrApprovalNOType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAssetmgrMgrNameType是一个资产管理业务负责人姓名类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAssetmgrMgrNameType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAmTypeType是一个机构类型类型 +#////////////////////////////////////////////////////////////////////// +#银行 +defineDict["THOST_FTDC_AMT_Bank"] = '1' +#证券公司 +defineDict["THOST_FTDC_AMT_Securities"] = '2' +#基金公司 +defineDict["THOST_FTDC_AMT_Fund"] = '3' +#保险公司 +defineDict["THOST_FTDC_AMT_Insurance"] = '4' +#信托公司 +defineDict["THOST_FTDC_AMT_Trust"] = '5' +#其他 +defineDict["THOST_FTDC_AMT_Other"] = '9' + +typedefDict["TThostFtdcAmTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCAmTypeType是一个机构类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCAmTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCFundIOTypeType是一个出入金类型类型 +#////////////////////////////////////////////////////////////////////// +#出入金 +defineDict["THOST_FTDC_CFIOT_FundIO"] = '0' +#银期换汇 +defineDict["THOST_FTDC_CFIOT_SwapCurrency"] = '1' + +typedefDict["TThostFtdcCSRCFundIOTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCusAccountTypeType是一个结算账户类型类型 +#////////////////////////////////////////////////////////////////////// +#期货结算账户 +defineDict["THOST_FTDC_CAT_Futures"] = '1' +#纯期货资管业务下的资管结算账户 +defineDict["THOST_FTDC_CAT_AssetmgrFuture"] = '2' +#综合类资管业务下的期货资管托管账户 +defineDict["THOST_FTDC_CAT_AssetmgrTrustee"] = '3' +#综合类资管业务下的资金中转账户 +defineDict["THOST_FTDC_CAT_AssetmgrTransfer"] = '4' + +typedefDict["TThostFtdcCusAccountTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCNationalType是一个国籍类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCNationalType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCSRCSecAgentIDType是一个二级代理ID类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCSRCSecAgentIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLanguageTypeType是一个通知语言类型类型 +#////////////////////////////////////////////////////////////////////// +#中文 +defineDict["THOST_FTDC_LT_Chinese"] = '1' +#英文 +defineDict["THOST_FTDC_LT_English"] = '2' + +typedefDict["TThostFtdcLanguageTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAmAccountType是一个投资账户类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcAmAccountType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAssetmgrClientTypeType是一个资产管理客户类型类型 +#////////////////////////////////////////////////////////////////////// +#个人资管客户 +defineDict["THOST_FTDC_AMCT_Person"] = '1' +#单位资管客户 +defineDict["THOST_FTDC_AMCT_Organ"] = '2' +#特殊单位资管客户 +defineDict["THOST_FTDC_AMCT_SpecialOrgan"] = '4' + +typedefDict["TThostFtdcAssetmgrClientTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcAssetmgrTypeType是一个投资类型类型 +#////////////////////////////////////////////////////////////////////// +#期货类 +defineDict["THOST_FTDC_ASST_Futures"] = '3' +#综合类 +defineDict["THOST_FTDC_ASST_SpecialOrgan"] = '4' + +typedefDict["TThostFtdcAssetmgrTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOMType是一个计量单位类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcUOMType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSHFEInstLifePhaseType是一个上期所合约生命周期状态类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSHFEInstLifePhaseType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSHFEProductClassType是一个产品类型类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSHFEProductClassType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcPriceDecimalType是一个价格小数位类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcPriceDecimalType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInTheMoneyFlagType是一个平值期权标志类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcInTheMoneyFlagType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCheckInstrTypeType是一个合约比较类型类型 +#////////////////////////////////////////////////////////////////////// +#合约交易所不存在 +defineDict["THOST_FTDC_CIT_HasExch"] = '0' +#合约本系统不存在 +defineDict["THOST_FTDC_CIT_HasATP"] = '1' +#合约比较不一致 +defineDict["THOST_FTDC_CIT_HasDiff"] = '2' + +typedefDict["TThostFtdcCheckInstrTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDeliveryTypeType是一个交割类型类型 +#////////////////////////////////////////////////////////////////////// +#手工交割 +defineDict["THOST_FTDC_DT_HandDeliv"] = '1' +#到期交割 +defineDict["THOST_FTDC_DT_PersonDeliv"] = '2' + +typedefDict["TThostFtdcDeliveryTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBigMoneyType是一个资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcBigMoneyType"] = "float" + +#////////////////////////////////////////////////////////////////////// +#TFtdcMaxMarginSideAlgorithmType是一个大额单边保证金算法类型 +#////////////////////////////////////////////////////////////////////// +#不使用大额单边保证金算法 +defineDict["THOST_FTDC_MMSA_NO"] = '0' +#使用大额单边保证金算法 +defineDict["THOST_FTDC_MMSA_YES"] = '1' + +typedefDict["TThostFtdcMaxMarginSideAlgorithmType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDAClientTypeType是一个资产管理客户类型类型 +#////////////////////////////////////////////////////////////////////// +#自然人 +defineDict["THOST_FTDC_CACT_Person"] = '0' +#法人 +defineDict["THOST_FTDC_CACT_Company"] = '1' +#其他 +defineDict["THOST_FTDC_CACT_Other"] = '2' + +typedefDict["TThostFtdcDAClientTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombinInstrIDType是一个套利合约代码类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCombinInstrIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombinSettlePriceType是一个各腿结算价类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcCombinSettlePriceType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDCEPriorityType是一个优先级类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcDCEPriorityType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeGroupIDType是一个成交组号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcTradeGroupIDType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcIsCheckPrepaType是一个是否校验开户可用资金类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcIsCheckPrepaType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcUOAAssetmgrTypeType是一个投资类型类型 +#////////////////////////////////////////////////////////////////////// +#期货类 +defineDict["THOST_FTDC_UOAAT_Futures"] = '1' +#综合类 +defineDict["THOST_FTDC_UOAAT_SpecialOrgan"] = '2' + +typedefDict["TThostFtdcUOAAssetmgrTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDirectionEnType是一个买卖方向类型 +#////////////////////////////////////////////////////////////////////// +#Buy +defineDict["THOST_FTDC_DEN_Buy"] = '0' +#Sell +defineDict["THOST_FTDC_DEN_Sell"] = '1' + +typedefDict["TThostFtdcDirectionEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOffsetFlagEnType是一个开平标志类型 +#////////////////////////////////////////////////////////////////////// +#Position Opening +defineDict["THOST_FTDC_OFEN_Open"] = '0' +#Position Close +defineDict["THOST_FTDC_OFEN_Close"] = '1' +#Forced Liquidation +defineDict["THOST_FTDC_OFEN_ForceClose"] = '2' +#Close Today +defineDict["THOST_FTDC_OFEN_CloseToday"] = '3' +#Close Prev. +defineDict["THOST_FTDC_OFEN_CloseYesterday"] = '4' +#Forced Reduction +defineDict["THOST_FTDC_OFEN_ForceOff"] = '5' +#Local Forced Liquidation +defineDict["THOST_FTDC_OFEN_LocalForceClose"] = '6' + +typedefDict["TThostFtdcOffsetFlagEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcHedgeFlagEnType是一个投机套保标志类型 +#////////////////////////////////////////////////////////////////////// +#Speculation +defineDict["THOST_FTDC_HFEN_Speculation"] = '1' +#Arbitrage +defineDict["THOST_FTDC_HFEN_Arbitrage"] = '2' +#Hedge +defineDict["THOST_FTDC_HFEN_Hedge"] = '3' + +typedefDict["TThostFtdcHedgeFlagEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundIOTypeEnType是一个出入金类型类型 +#////////////////////////////////////////////////////////////////////// +#Deposit/Withdrawal +defineDict["THOST_FTDC_FIOTEN_FundIO"] = '1' +#Bank-Futures Transfer +defineDict["THOST_FTDC_FIOTEN_Transfer"] = '2' +#Bank-Futures FX Exchange +defineDict["THOST_FTDC_FIOTEN_SwapCurrency"] = '3' + +typedefDict["TThostFtdcFundIOTypeEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundTypeEnType是一个资金类型类型 +#////////////////////////////////////////////////////////////////////// +#Bank Deposit +defineDict["THOST_FTDC_FTEN_Deposite"] = '1' +#Payment/Fee +defineDict["THOST_FTDC_FTEN_ItemFund"] = '2' +#Brokerage Adj +defineDict["THOST_FTDC_FTEN_Company"] = '3' +#Internal Transfer +defineDict["THOST_FTDC_FTEN_InnerTransfer"] = '4' + +typedefDict["TThostFtdcFundTypeEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundDirectionEnType是一个出入金方向类型 +#////////////////////////////////////////////////////////////////////// +#Deposit +defineDict["THOST_FTDC_FDEN_In"] = '1' +#Withdrawal +defineDict["THOST_FTDC_FDEN_Out"] = '2' + +typedefDict["TThostFtdcFundDirectionEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFundMortDirectionEnType是一个货币质押方向类型 +#////////////////////////////////////////////////////////////////////// +#Pledge +defineDict["THOST_FTDC_FMDEN_In"] = '1' +#Redemption +defineDict["THOST_FTDC_FMDEN_Out"] = '2' + +typedefDict["TThostFtdcFundMortDirectionEnType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSwapBusinessTypeType是一个换汇业务种类类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcSwapBusinessTypeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOptionsTypeType是一个期权类型类型 +#////////////////////////////////////////////////////////////////////// +#看涨 +defineDict["THOST_FTDC_CP_CallOptions"] = '1' +#看跌 +defineDict["THOST_FTDC_CP_PutOptions"] = '2' + +typedefDict["TThostFtdcOptionsTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStrikeModeType是一个执行方式类型 +#////////////////////////////////////////////////////////////////////// +#欧式 +defineDict["THOST_FTDC_STM_Continental"] = '0' +#美式 +defineDict["THOST_FTDC_STM_American"] = '1' +#百慕大 +defineDict["THOST_FTDC_STM_Bermuda"] = '2' + +typedefDict["TThostFtdcStrikeModeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStrikeTypeType是一个执行类型类型 +#////////////////////////////////////////////////////////////////////// +#自身对冲 +defineDict["THOST_FTDC_STT_Hedge"] = '0' +#匹配执行 +defineDict["THOST_FTDC_STT_Match"] = '1' + +typedefDict["TThostFtdcStrikeTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcApplyTypeType是一个中金所期权放弃执行申请类型类型 +#////////////////////////////////////////////////////////////////////// +#不执行数量 +defineDict["THOST_FTDC_APPT_NotStrikeNum"] = '4' + +typedefDict["TThostFtdcApplyTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcGiveUpDataSourceType是一个放弃执行申请数据来源类型 +#////////////////////////////////////////////////////////////////////// +#系统生成 +defineDict["THOST_FTDC_GUDS_Gen"] = '0' +#手工添加 +defineDict["THOST_FTDC_GUDS_Hand"] = '1' + +typedefDict["TThostFtdcGiveUpDataSourceType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExecOrderSysIDType是一个执行宣告系统编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcExecOrderSysIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExecResultType是一个执行结果类型 +#////////////////////////////////////////////////////////////////////// +#没有执行 +defineDict["THOST_FTDC_OER_NoExec"] = 'n' +#已经取消 +defineDict["THOST_FTDC_OER_Canceled"] = 'c' +#执行成功 +defineDict["THOST_FTDC_OER_OK"] = '0' +#期权持仓不够 +defineDict["THOST_FTDC_OER_NoPosition"] = '1' +#资金不够 +defineDict["THOST_FTDC_OER_NoDeposit"] = '2' +#会员不存在 +defineDict["THOST_FTDC_OER_NoParticipant"] = '3' +#客户不存在 +defineDict["THOST_FTDC_OER_NoClient"] = '4' +#合约不存在 +defineDict["THOST_FTDC_OER_NoInstrument"] = '6' +#没有执行权限 +defineDict["THOST_FTDC_OER_NoRight"] = '7' +#不合理的数量 +defineDict["THOST_FTDC_OER_InvalidVolume"] = '8' +#没有足够的历史成交 +defineDict["THOST_FTDC_OER_NoEnoughHistoryTrade"] = '9' +#未知 +defineDict["THOST_FTDC_OER_Unknown"] = 'a' + +typedefDict["TThostFtdcExecResultType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStrikeSequenceType是一个执行序号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcStrikeSequenceType"] = "int" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStrikeTimeType是一个执行时间类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcStrikeTimeType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombinationTypeType是一个组合类型类型 +#////////////////////////////////////////////////////////////////////// +#期货组合 +defineDict["THOST_FTDC_COMBT_Future"] = '0' +#垂直价差BUL +defineDict["THOST_FTDC_COMBT_BUL"] = '1' +#垂直价差BER +defineDict["THOST_FTDC_COMBT_BER"] = '2' +#跨式组合 +defineDict["THOST_FTDC_COMBT_STD"] = '3' +#宽跨式组合 +defineDict["THOST_FTDC_COMBT_STG"] = '4' +#备兑组合 +defineDict["THOST_FTDC_COMBT_PRT"] = '5' +#时间价差组合 +defineDict["THOST_FTDC_COMBT_CLD"] = '6' + +typedefDict["TThostFtdcCombinationTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcOptionRoyaltyPriceTypeType是一个期权权利金价格类型类型 +#////////////////////////////////////////////////////////////////////// +#昨结算价 +defineDict["THOST_FTDC_ORPT_PreSettlementPrice"] = '1' +#开仓价 +defineDict["THOST_FTDC_ORPT_OpenPrice"] = '4' + +typedefDict["TThostFtdcOptionRoyaltyPriceTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBalanceAlgorithmType是一个权益算法类型 +#////////////////////////////////////////////////////////////////////// +#不计算期权市值盈亏 +defineDict["THOST_FTDC_BLAG_Default"] = '1' +#计算期权市值亏损 +defineDict["THOST_FTDC_BLAG_IncludeOptValLost"] = '2' + +typedefDict["TThostFtdcBalanceAlgorithmType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcActionTypeType是一个执行类型类型 +#////////////////////////////////////////////////////////////////////// +#执行 +defineDict["THOST_FTDC_ACTP_Exec"] = '1' +#放弃 +defineDict["THOST_FTDC_ACTP_Abandon"] = '2' + +typedefDict["TThostFtdcActionTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcForQuoteStatusType是一个询价状态类型 +#////////////////////////////////////////////////////////////////////// +#已经提交 +defineDict["THOST_FTDC_FQST_Submitted"] = 'a' +#已经接受 +defineDict["THOST_FTDC_FQST_Accepted"] = 'b' +#已经被拒绝 +defineDict["THOST_FTDC_FQST_Rejected"] = 'c' + +typedefDict["TThostFtdcForQuoteStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcValueMethodType是一个取值方式类型 +#////////////////////////////////////////////////////////////////////// +#按绝对值 +defineDict["THOST_FTDC_VM_Absolute"] = '0' +#按比率 +defineDict["THOST_FTDC_VM_Ratio"] = '1' + +typedefDict["TThostFtdcValueMethodType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExecOrderPositionFlagType是一个期权行权后是否保留期货头寸的标记类型 +#////////////////////////////////////////////////////////////////////// +#保留 +defineDict["THOST_FTDC_EOPF_Reserve"] = '0' +#不保留 +defineDict["THOST_FTDC_EOPF_UnReserve"] = '1' + +typedefDict["TThostFtdcExecOrderPositionFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcExecOrderCloseFlagType是一个期权行权后生成的头寸是否自动平仓类型 +#////////////////////////////////////////////////////////////////////// +#自动平仓 +defineDict["THOST_FTDC_EOCF_AutoClose"] = '0' +#免于自动平仓 +defineDict["THOST_FTDC_EOCF_NotToClose"] = '1' + +typedefDict["TThostFtdcExecOrderCloseFlagType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcProductTypeType是一个产品类型类型 +#////////////////////////////////////////////////////////////////////// +#期货 +defineDict["THOST_FTDC_PTE_Futures"] = '1' +#期权 +defineDict["THOST_FTDC_PTE_Options"] = '2' + +typedefDict["TThostFtdcProductTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCZCEUploadFileNameType是一个郑商所结算文件名类型 +#////////////////////////////////////////////////////////////////////// +#^\d{8}_zz_\d{4} +defineDict["THOST_FTDC_CUFN_CUFN_O"] = 'O' +#^\d{8}成交表 +defineDict["THOST_FTDC_CUFN_CUFN_T"] = 'T' +#^\d{8}单腿持仓表new +defineDict["THOST_FTDC_CUFN_CUFN_P"] = 'P' +#^\d{8}非平仓了结表 +defineDict["THOST_FTDC_CUFN_CUFN_N"] = 'N' +#^\d{8}平仓表 +defineDict["THOST_FTDC_CUFN_CUFN_L"] = 'L' +#^\d{8}资金表 +defineDict["THOST_FTDC_CUFN_CUFN_F"] = 'F' +#^\d{8}组合持仓表 +defineDict["THOST_FTDC_CUFN_CUFN_C"] = 'C' +#^\d{8}保证金参数表 +defineDict["THOST_FTDC_CUFN_CUFN_M"] = 'M' + +typedefDict["TThostFtdcCZCEUploadFileNameType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDCEUploadFileNameType是一个大商所结算文件名类型 +#////////////////////////////////////////////////////////////////////// +#^\d{8}_dl_\d{3} +defineDict["THOST_FTDC_DUFN_DUFN_O"] = 'O' +#^\d{8}_成交表 +defineDict["THOST_FTDC_DUFN_DUFN_T"] = 'T' +#^\d{8}_持仓表 +defineDict["THOST_FTDC_DUFN_DUFN_P"] = 'P' +#^\d{8}_资金结算表 +defineDict["THOST_FTDC_DUFN_DUFN_F"] = 'F' +#^\d{8}_优惠组合持仓明细表 +defineDict["THOST_FTDC_DUFN_DUFN_C"] = 'C' +#^\d{8}_持仓明细表 +defineDict["THOST_FTDC_DUFN_DUFN_D"] = 'D' +#^\d{8}_保证金参数表 +defineDict["THOST_FTDC_DUFN_DUFN_M"] = 'M' +#^\d{8}_期权执行表 +defineDict["THOST_FTDC_DUFN_DUFN_S"] = 'S' + +typedefDict["TThostFtdcDCEUploadFileNameType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcSHFEUploadFileNameType是一个上期所结算文件名类型 +#////////////////////////////////////////////////////////////////////// +#^\d{4}_\d{8}_\d{8}_DailyFundChg +defineDict["THOST_FTDC_SUFN_SUFN_O"] = 'O' +#^\d{4}_\d{8}_\d{8}_Trade +defineDict["THOST_FTDC_SUFN_SUFN_T"] = 'T' +#^\d{4}_\d{8}_\d{8}_SettlementDetail +defineDict["THOST_FTDC_SUFN_SUFN_P"] = 'P' +#^\d{4}_\d{8}_\d{8}_Capital +defineDict["THOST_FTDC_SUFN_SUFN_F"] = 'F' + +typedefDict["TThostFtdcSHFEUploadFileNameType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCFFEXUploadFileNameType是一个中金所结算文件名类型 +#////////////////////////////////////////////////////////////////////// +#^\d{4}_SG\d{1}_\d{8}_\d{1}_Trade +defineDict["THOST_FTDC_CFUFN_SUFN_T"] = 'T' +#^\d{4}_SG\d{1}_\d{8}_\d{1}_SettlementDetail +defineDict["THOST_FTDC_CFUFN_SUFN_P"] = 'P' +#^\d{4}_SG\d{1}_\d{8}_\d{1}_Capital +defineDict["THOST_FTDC_CFUFN_SUFN_F"] = 'F' +#^\d{4}_SG\d{1}_\d{8}_\d{1}_OptionExec +defineDict["THOST_FTDC_CFUFN_SUFN_S"] = 'S' + +typedefDict["TThostFtdcCFFEXUploadFileNameType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcCombDirectionType是一个组合指令方向类型 +#////////////////////////////////////////////////////////////////////// +#申请组合 +defineDict["THOST_FTDC_CMDR_Comb"] = '0' +#申请拆分 +defineDict["THOST_FTDC_CMDR_UnComb"] = '1' + +typedefDict["TThostFtdcCombDirectionType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLockTypeType是一个锁定方向类型 +#////////////////////////////////////////////////////////////////////// +#锁定 +defineDict["THOST_FTDC_LCKT_Lock"] = '1' +#解锁 +defineDict["THOST_FTDC_LCKT_Unlock"] = '2' + +typedefDict["TThostFtdcLockTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcBizTypeType是一个业务类型类型 +#////////////////////////////////////////////////////////////////////// +#期货 +defineDict["THOST_FTDC_BZTP_Future"] = '1' +#证券 +defineDict["THOST_FTDC_BZTP_Stock"] = '2' + +typedefDict["TThostFtdcBizTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcDesignateTypeType是一个指定类型类型 +#////////////////////////////////////////////////////////////////////// +#指定登记 +defineDict["THOST_FTDC_DSTP_Register"] = '1' +#指定撤销 +defineDict["THOST_FTDC_DSTP_Cancel"] = '2' + +typedefDict["TThostFtdcDesignateTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFreezeReasonTypeType是一个冻结原因类型 +#////////////////////////////////////////////////////////////////////// +#初始化 +defineDict["THOST_FTDC_FRTP_Init"] = '1' +#锁定 +defineDict["THOST_FTDC_FRTP_Lock"] = '2' +#执行 +defineDict["THOST_FTDC_FRTP_Exec"] = '3' +#仓位校验 +defineDict["THOST_FTDC_FRTP_Check"] = '4' +#E+1日执行冻结 +defineDict["THOST_FTDC_FRTP_ExecFreeze"] = '5' + +typedefDict["TThostFtdcFreezeReasonTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcFreezeTypeType是一个冻结类型类型 +#////////////////////////////////////////////////////////////////////// +#冻结 +defineDict["THOST_FTDC_FZTP_Freeze"] = '1' +#解冻 +defineDict["THOST_FTDC_FZTP_Unfreeze"] = '2' +#强制执行 +defineDict["THOST_FTDC_FZTP_Force"] = '3' + +typedefDict["TThostFtdcFreezeTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcTradeSystemTypeType是一个交易系统类型类型 +#////////////////////////////////////////////////////////////////////// +#未知系统 +defineDict["THOST_FTDC_TSTP_Unknow"] = '0' +#期货系统 +defineDict["THOST_FTDC_TSTP_Future"] = '1' +#个股系统 +defineDict["THOST_FTDC_TSTP_IShare"] = '2' + +typedefDict["TThostFtdcTradeSystemTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockDisposalTypeType是一个证券处置方向类型 +#////////////////////////////////////////////////////////////////////// +#划入经纪公司账户 +defineDict["THOST_FTDC_STPT_ToBroker"] = '1' +#划入投资者账户 +defineDict["THOST_FTDC_STPT_ToInvestor"] = '2' + +typedefDict["TThostFtdcStockDisposalTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockDisposalSysIDType是一个证券处置编号类型 +#////////////////////////////////////////////////////////////////////// +typedefDict["TThostFtdcStockDisposalSysIDType"] = "string" + +#////////////////////////////////////////////////////////////////////// +#TFtdcStockDisposalStatusType是一个证券处置状态类型 +#////////////////////////////////////////////////////////////////////// +#已经提交 +defineDict["THOST_FTDC_SDPS_Submitted"] = 'a' +#已经接受 +defineDict["THOST_FTDC_SDPS_Accepted"] = 'b' +#已经被拒绝 +defineDict["THOST_FTDC_SDPS_Rejected"] = 'c' +#已经被撤销 +defineDict["THOST_FTDC_SDPS_Cancelled"] = 'd' + +typedefDict["TThostFtdcStockDisposalStatusType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcInstructionRightTypeType是一个指令权限类型类型 +#////////////////////////////////////////////////////////////////////// +#限价单 +defineDict["THOST_FTDC_ISTR_Limit"] = '1' +#限价全额成交否则取消 +defineDict["THOST_FTDC_ISTR_Limit_FOK"] = '2' +#市价订单剩余转限价 +defineDict["THOST_FTDC_ISTR_Market_RemainLimit"] = '3' +#市价订单剩余撤销 +defineDict["THOST_FTDC_ISTR_Market_FAK"] = '4' +#市价全额成交否则取消 +defineDict["THOST_FTDC_ISTR_Market_FOK"] = '5' +#证券锁定 +defineDict["THOST_FTDC_ISTR_Lock"] = '6' +#证券解锁 +defineDict["THOST_FTDC_ISTR_Unlock"] = '7' + +typedefDict["TThostFtdcInstructionRightTypeType"] = "char" + +#////////////////////////////////////////////////////////////////////// +#TFtdcLevelTypeType是一个投资者分级类型类型 +#////////////////////////////////////////////////////////////////////// +#一级投资者 +defineDict["THOST_FTDC_IVLV_FirstLevel"] = '1' +#二级投资者 +defineDict["THOST_FTDC_IVLV_SecondLevel"] = '2' +#三级投资者 +defineDict["THOST_FTDC_IVLV_ThirdLevel"] = '3' + +typedefDict["TThostFtdcLevelTypeType"] = "char" + diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/ctpGateway.py b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/ctpGateway.py new file mode 100644 index 0000000000..f29f0827db --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/ctpGateway.py @@ -0,0 +1,1472 @@ +# encoding: UTF-8 + +''' +vn.ctp的gateway接入 + +考虑到现阶段大部分CTP中的ExchangeID字段返回的都是空值 +vtSymbol直接使用symbol +''' + + +import os +import json +from copy import copy +from datetime import datetime + +from vnctpmd import MdApi +from vnctptd import TdApi +from ctpDataType import * +from vtGateway import * + + +# 以下为一些VT类型和CTP类型的映射字典 +# 价格类型映射 +priceTypeMap = {} +priceTypeMap[PRICETYPE_LIMITPRICE] = defineDict["THOST_FTDC_OPT_LimitPrice"] +priceTypeMap[PRICETYPE_MARKETPRICE] = defineDict["THOST_FTDC_OPT_AnyPrice"] +priceTypeMapReverse = {v: k for k, v in priceTypeMap.items()} + +# 方向类型映射 +directionMap = {} +directionMap[DIRECTION_LONG] = defineDict['THOST_FTDC_D_Buy'] +directionMap[DIRECTION_SHORT] = defineDict['THOST_FTDC_D_Sell'] +directionMapReverse = {v: k for k, v in directionMap.items()} + +# 开平类型映射 +offsetMap = {} +offsetMap[OFFSET_OPEN] = defineDict['THOST_FTDC_OF_Open'] +offsetMap[OFFSET_CLOSE] = defineDict['THOST_FTDC_OF_Close'] +offsetMap[OFFSET_CLOSETODAY] = defineDict['THOST_FTDC_OF_CloseToday'] +offsetMap[OFFSET_CLOSEYESTERDAY] = defineDict['THOST_FTDC_OF_CloseYesterday'] +offsetMapReverse = {v:k for k,v in offsetMap.items()} + +# 交易所类型映射 +exchangeMap = {} +exchangeMap[EXCHANGE_CFFEX] = 'CFFEX' +exchangeMap[EXCHANGE_SHFE] = 'SHFE' +exchangeMap[EXCHANGE_CZCE] = 'CZCE' +exchangeMap[EXCHANGE_DCE] = 'DCE' +exchangeMap[EXCHANGE_SSE] = 'SSE' +exchangeMap[EXCHANGE_UNKNOWN] = '' +exchangeMapReverse = {v:k for k,v in exchangeMap.items()} + +# 持仓类型映射 +posiDirectionMap = {} +posiDirectionMap[DIRECTION_NET] = defineDict["THOST_FTDC_PD_Net"] +posiDirectionMap[DIRECTION_LONG] = defineDict["THOST_FTDC_PD_Long"] +posiDirectionMap[DIRECTION_SHORT] = defineDict["THOST_FTDC_PD_Short"] +posiDirectionMapReverse = {v:k for k,v in posiDirectionMap.items()} + +# 产品类型映射 +productClassMap = {} +productClassMap[PRODUCT_FUTURES] = defineDict["THOST_FTDC_PC_Futures"] +productClassMap[PRODUCT_OPTION] = defineDict["THOST_FTDC_PC_Options"] +productClassMap[PRODUCT_COMBINATION] = defineDict["THOST_FTDC_PC_Combination"] +productClassMapReverse = {v:k for k,v in productClassMap.items()} + +# 委托状态映射 +statusMap = {} +statusMap[STATUS_ALLTRADED] = defineDict["THOST_FTDC_OST_AllTraded"] +statusMap[STATUS_PARTTRADED] = defineDict["THOST_FTDC_OST_PartTradedQueueing"] +statusMap[STATUS_NOTTRADED] = defineDict["THOST_FTDC_OST_NoTradeQueueing"] +statusMap[STATUS_CANCELLED] = defineDict["THOST_FTDC_OST_Canceled"] +statusMapReverse = {v:k for k,v in statusMap.items()} + + +######################################################################## +class CtpGateway(VtGateway): + """CTP接口""" + + #---------------------------------------------------------------------- + def __init__(self, eventEngine, gatewayName='CTP'): + """Constructor""" + super(CtpGateway, self).__init__(eventEngine, gatewayName) + + self.mdApi = CtpMdApi(self) # 行情API + self.tdApi = CtpTdApi(self) # 交易API + + self.mdConnected = False # 行情API连接状态,登录完成后为True + self.tdConnected = False # 交易API连接状态 + + self.qryEnabled = False # 是否要启动循环查询 + + #---------------------------------------------------------------------- + def connect(self): + """连接""" + # 载入json文件 + fileName = self.gatewayName + '_connect.json' + path = os.path.abspath(os.path.dirname(__file__)) + fileName = os.path.join(path, fileName) + + try: + f = file(fileName) + except IOError: + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'读取连接配置出错,请检查' + self.onLog(log) + return + + # 解析json文件 + setting = json.load(f) + try: + userID = str(setting['userID']) + password = str(setting['password']) + brokerID = str(setting['brokerID']) + tdAddress = str(setting['tdAddress']) + mdAddress = str(setting['mdAddress']) + except KeyError: + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'连接配置缺少字段,请检查' + self.onLog(log) + return + + # 创建行情和交易接口对象 + self.mdApi.connect(userID, password, brokerID, mdAddress) + self.tdApi.connect(userID, password, brokerID, tdAddress) + + # 初始化并启动查询 + self.initQuery() + + #---------------------------------------------------------------------- + def subscribe(self, subscribeReq): + """订阅行情""" + self.mdApi.subscribe(subscribeReq) + + #---------------------------------------------------------------------- + def sendOrder(self, orderReq): + """发单""" + return self.tdApi.sendOrder(orderReq) + + #---------------------------------------------------------------------- + def cancelOrder(self, cancelOrderReq): + """撤单""" + self.tdApi.cancelOrder(cancelOrderReq) + + #---------------------------------------------------------------------- + def qryAccount(self): + """查询账户资金""" + self.tdApi.qryAccount() + + #---------------------------------------------------------------------- + def qryPosition(self): + """查询持仓""" + self.tdApi.qryPosition() + + #---------------------------------------------------------------------- + def close(self): + """关闭""" + if self.mdConnected: + self.mdApi.close() + if self.tdConnected: + self.tdApi.close() + + #---------------------------------------------------------------------- + def initQuery(self): + """初始化连续查询""" + if self.qryEnabled: + # 需要循环的查询函数列表 + self.qryFunctionList = [self.qryAccount, self.qryPosition] + + self.qryCount = 0 # 查询触发倒计时 + self.qryTrigger = 2 # 查询触发点 + self.qryNextFunction = 0 # 上次运行的查询函数索引 + + self.startQuery() + + #---------------------------------------------------------------------- + def query(self, event): + """注册到事件处理引擎上的查询函数""" + self.qryCount += 1 + + if self.qryCount > self.qryTrigger: + # 清空倒计时 + self.qryCount = 0 + + # 执行查询函数 + function = self.qryFunctionList[self.qryNextFunction] + function() + + # 计算下次查询函数的索引,如果超过了列表长度,则重新设为0 + self.qryNextFunction += 1 + if self.qryNextFunction == len(self.qryFunctionList): + self.qryNextFunction = 0 + + #---------------------------------------------------------------------- + def startQuery(self): + """启动连续查询""" + self.eventEngine.register(EVENT_TIMER, self.query) + + #---------------------------------------------------------------------- + def setQryEnabled(self, qryEnabled): + """设置是否要启动循环查询""" + self.qryEnabled = qryEnabled + + + +######################################################################## +class CtpMdApi(MdApi): + """CTP行情API实现""" + + #---------------------------------------------------------------------- + def __init__(self, gateway): + """Constructor""" + super(CtpMdApi, self).__init__() + + self.gateway = gateway # gateway对象 + self.gatewayName = gateway.gatewayName # gateway对象名称 + + self.reqID = EMPTY_INT # 操作请求编号 + + self.connectionStatus = False # 连接状态 + self.loginStatus = False # 登录状态 + + self.subscribedSymbols = set() # 已订阅合约代码 + + self.userID = EMPTY_STRING # 账号 + self.password = EMPTY_STRING # 密码 + self.brokerID = EMPTY_STRING # 经纪商代码 + self.address = EMPTY_STRING # 服务器地址 + + #---------------------------------------------------------------------- + def onFrontConnected(self): + """服务器连接""" + self.connectionStatus = True + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'行情服务器连接成功' + self.gateway.onLog(log) + self.login() + + #---------------------------------------------------------------------- + def onFrontDisconnected(self, n): + """服务器断开""" + self.connectionStatus = False + self.loginStatus = False + self.gateway.mdConnected = False + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'行情服务器连接断开' + self.gateway.onLog(log) + + #---------------------------------------------------------------------- + def onHeartBeatWarning(self, n): + """心跳报警""" + # 因为API的心跳报警比较常被触发,且与API工作关系不大,因此选择忽略 + pass + + #---------------------------------------------------------------------- + def onRspError(self, error, n, last): + """错误回报""" + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspUserLogin(self, data, error, n, last): + """登陆回报""" + # 如果登录成功,推送日志信息 + if error['ErrorID'] == 0: + self.loginStatus = True + self.gateway.mdConnected = True + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'行情服务器登录完成' + self.gateway.onLog(log) + + # 重新订阅之前订阅的合约 + for subscribeReq in self.subscribedSymbols: + self.subscribe(subscribeReq) + + # 否则,推送错误信息 + else: + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspUserLogout(self, data, error, n, last): + """登出回报""" + # 如果登出成功,推送日志信息 + if error['ErrorID'] == 0: + self.loginStatus = False + self.gateway.mdConnected = False + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'行情服务器登出完成' + self.gateway.onLog(log) + + # 否则,推送错误信息 + else: + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspSubMarketData(self, data, error, n, last): + """订阅合约回报""" + # 通常不在乎订阅错误,选择忽略 + pass + + #---------------------------------------------------------------------- + def onRspUnSubMarketData(self, data, error, n, last): + """退订合约回报""" + # 同上 + pass + + #---------------------------------------------------------------------- + def onRtnDepthMarketData(self, data): + """行情推送""" + tick = VtTickData() + tick.gatewayName = self.gatewayName + + tick.symbol = data['InstrumentID'] + tick.exchange = exchangeMapReverse.get(data['ExchangeID'], u'未知') + tick.vtSymbol = tick.symbol #'.'.join([tick.symbol, EXCHANGE_UNKNOWN]) + + tick.lastPrice = data['LastPrice'] + tick.volume = data['Volume'] + tick.openInterest = data['OpenInterest'] + tick.time = '.'.join([data['UpdateTime'], str(data['UpdateMillisec']/100)]) + + # 这里由于交易所夜盘时段的交易日数据有误,所以选择本地获取 + #tick.date = data['TradingDay'] + tick.date = datetime.now().strftime('%Y%m%d') + + tick.openPrice = data['OpenPrice'] + tick.highPrice = data['HighestPrice'] + tick.lowPrice = data['LowestPrice'] + tick.preClosePrice = data['PreClosePrice'] + + tick.upperLimit = data['UpperLimitPrice'] + tick.lowerLimit = data['LowerLimitPrice'] + + # CTP只有一档行情 + tick.bidPrice1 = data['BidPrice1'] + tick.bidVolume1 = data['BidVolume1'] + tick.askPrice1 = data['AskPrice1'] + tick.askVolume1 = data['AskVolume1'] + + # 测试延时 + tick.tick_time = data['tick_time'] + tick.frequency_time = data['frequency_time'] + + self.gateway.onTick(tick) + + #---------------------------------------------------------------------- + def onRspSubForQuoteRsp(self, data, error, n, last): + """订阅期权询价""" + pass + + #---------------------------------------------------------------------- + def onRspUnSubForQuoteRsp(self, data, error, n, last): + """退订期权询价""" + pass + + #---------------------------------------------------------------------- + def onRtnForQuoteRsp(self, data): + """期权询价推送""" + pass + + #---------------------------------------------------------------------- + def connect(self, userID, password, brokerID, address): + """初始化连接""" + self.userID = userID # 账号 + self.password = password # 密码 + self.brokerID = brokerID # 经纪商代码 + self.address = address # 服务器地址 + + # 如果尚未建立服务器连接,则进行连接 + if not self.connectionStatus: + # 创建C++环境中的API对象,这里传入的参数是需要用来保存.con文件的文件夹路径 + path = os.getcwd() + '/temp/' + self.gatewayName + '/' + if not os.path.exists(path): + os.makedirs(path) + self.createFtdcMdApi(path) + + # 注册服务器地址 + self.registerFront(self.address) + + # 初始化连接,成功会调用onFrontConnected + self.init() + + # 若已经连接但尚未登录,则进行登录 + else: + if not self.loginStatus: + self.login() + + #---------------------------------------------------------------------- + def subscribe(self, subscribeReq): + """订阅合约""" + # 这里的设计是,如果尚未登录就调用了订阅方法 + # 则先保存订阅请求,登录完成后会自动订阅 + if self.loginStatus: + self.subscribeMarketData(str(subscribeReq.symbol)) + self.subscribedSymbols.add(subscribeReq) + + #---------------------------------------------------------------------- + def login(self): + """登录""" + # 如果填入了用户名密码等,则登录 + if self.userID and self.password and self.brokerID: + req = {} + req['UserID'] = self.userID + req['Password'] = self.password + req['BrokerID'] = self.brokerID + self.reqID += 1 + self.reqUserLogin(req, self.reqID) + + #---------------------------------------------------------------------- + def close(self): + """关闭""" + self.exit() + + +######################################################################## +class CtpTdApi(TdApi): + """CTP交易API实现""" + + #---------------------------------------------------------------------- + def __init__(self, gateway): + """API对象的初始化函数""" + super(CtpTdApi, self).__init__() + + self.gateway = gateway # gateway对象 + self.gatewayName = gateway.gatewayName # gateway对象名称 + + self.reqID = EMPTY_INT # 操作请求编号 + self.orderRef = EMPTY_INT # 订单编号 + + self.connectionStatus = False # 连接状态 + self.loginStatus = False # 登录状态 + + self.userID = EMPTY_STRING # 账号 + self.password = EMPTY_STRING # 密码 + self.brokerID = EMPTY_STRING # 经纪商代码 + self.address = EMPTY_STRING # 服务器地址 + + self.frontID = EMPTY_INT # 前置机编号 + self.sessionID = EMPTY_INT # 会话编号 + + self.posBufferDict = {} # 缓存持仓数据的字典 + self.symbolExchangeDict = {} # 保存合约代码和交易所的印射关系 + self.symbolSizeDict = {} # 保存合约代码和合约大小的印射关系 + + #---------------------------------------------------------------------- + def onFrontConnected(self): + """服务器连接""" + self.connectionStatus = True + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'交易服务器连接成功' + self.gateway.onLog(log) + + self.login() + + #---------------------------------------------------------------------- + def onFrontDisconnected(self, n): + """服务器断开""" + self.connectionStatus = False + self.loginStatus = False + self.gateway.tdConnected = False + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'交易服务器连接断开' + self.gateway.onLog(log) + + #---------------------------------------------------------------------- + def onHeartBeatWarning(self, n): + """""" + pass + + #---------------------------------------------------------------------- + def onRspAuthenticate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspUserLogin(self, data, error, n, last): + """登陆回报""" + # 如果登录成功,推送日志信息 + if error['ErrorID'] == 0: + self.frontID = str(data['FrontID']) + self.sessionID = str(data['SessionID']) + self.loginStatus = True + self.gateway.tdConnected = True + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'交易服务器登录完成' + self.gateway.onLog(log) + + # 确认结算信息 + req = {} + req['BrokerID'] = self.brokerID + req['InvestorID'] = self.userID + self.reqID += 1 + self.reqSettlementInfoConfirm(req, self.reqID) + + # 否则,推送错误信息 + else: + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspUserLogout(self, data, error, n, last): + """登出回报""" + # 如果登出成功,推送日志信息 + if error['ErrorID'] == 0: + self.loginStatus = False + self.gateway.tdConnected = False + + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'交易服务器登出完成' + self.gateway.onLog(log) + + # 否则,推送错误信息 + else: + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspUserPasswordUpdate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspTradingAccountPasswordUpdate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspOrderInsert(self, data, error, n, last): + """发单错误(柜台)""" + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspParkedOrderInsert(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspParkedOrderAction(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspOrderAction(self, data, error, n, last): + """撤单错误(柜台)""" + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRspQueryMaxOrderVolume(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspSettlementInfoConfirm(self, data, error, n, last): + """确认结算信息回报""" + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'结算信息确认完成' + self.gateway.onLog(log) + + # 查询合约代码 + self.reqID += 1 + self.reqQryInstrument({}, self.reqID) + + #---------------------------------------------------------------------- + def onRspRemoveParkedOrder(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspRemoveParkedOrderAction(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspExecOrderInsert(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspExecOrderAction(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspForQuoteInsert(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQuoteInsert(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQuoteAction(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspLockInsert(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspCombActionInsert(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryOrder(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryTrade(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInvestorPosition(self, data, error, n, last): + """持仓查询回报""" + # 获取缓存字典中的持仓缓存,若无则创建并初始化 + positionName = '.'.join([data['InstrumentID'], data['PosiDirection']]) + + if positionName in self.posBufferDict: + posBuffer = self.posBufferDict[positionName] + else: + posBuffer = PositionBuffer(data, self.gatewayName) + self.posBufferDict[positionName] = posBuffer + + # 更新持仓缓存,并获取VT系统中持仓对象的返回值 + exchange = self.symbolExchangeDict.get(data['InstrumentID'], EXCHANGE_UNKNOWN) + size = self.symbolSizeDict.get(data['InstrumentID'], 1) + if exchange == EXCHANGE_SHFE: + posBuffer.updateShfeBuffer(data, size) + else: + posBuffer.updateBuffer(data, size) + + # 所有持仓数据都更新后,再将缓存中的持仓情况发送到事件引擎中 + if last: + for buf in self.posBufferDict.values(): + pos = buf.getPos() + self.gateway.onPosition(pos) + + #---------------------------------------------------------------------- + def onRspQryTradingAccount(self, data, error, n, last): + """资金账户查询回报""" + account = VtAccountData() + account.gatewayName = self.gatewayName + + # 账户代码 + account.accountID = data['AccountID'] + account.vtAccountID = '.'.join([self.gatewayName, account.accountID]) + + # 数值相关 + account.preBalance = data['PreBalance'] + account.available = data['Available'] + account.commission = data['Commission'] + account.margin = data['CurrMargin'] + account.closeProfit = data['CloseProfit'] + account.positionProfit = data['PositionProfit'] + + # 这里的balance和快期中的账户不确定是否一样,需要测试 + account.balance = (data['PreBalance'] - data['PreCredit'] - data['PreMortgage'] + + data['Mortgage'] - data['Withdraw'] + data['Deposit'] + + data['CloseProfit'] + data['PositionProfit'] + data['CashIn'] - + data['Commission']) + + # 推送 + self.gateway.onAccount(account) + + #---------------------------------------------------------------------- + def onRspQryInvestor(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryTradingCode(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInstrumentMarginRate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInstrumentCommissionRate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryExchange(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryProduct(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInstrument(self, data, error, n, last): + """合约查询回报""" + contract = VtContractData() + contract.gatewayName = self.gatewayName + + contract.symbol = data['InstrumentID'] + contract.exchange = exchangeMapReverse[data['ExchangeID']] + contract.vtSymbol = contract.symbol #'.'.join([contract.symbol, contract.exchange]) + contract.name = data['InstrumentName'].decode('GBK') + + # 合约数值 + contract.size = data['VolumeMultiple'] + contract.priceTick = data['PriceTick'] + contract.strikePrice = data['StrikePrice'] + contract.underlyingSymbol = data['UnderlyingInstrID'] + + contract.productClass = productClassMapReverse.get(data['ProductClass'], PRODUCT_UNKNOWN) + + # 期权类型 + if data['OptionsType'] == '1': + contract.optionType = OPTION_CALL + elif data['OptionsType'] == '2': + contract.optionType = OPTION_PUT + + # 缓存代码和交易所的印射关系 + self.symbolExchangeDict[contract.symbol] = contract.exchange + self.symbolSizeDict[contract.symbol] = contract.size + + # 推送 + self.gateway.onContract(contract) + + if last: + log = VtLogData() + log.gatewayName = self.gatewayName + log.logContent = u'交易合约信息获取完成' + self.gateway.onLog(log) + + #---------------------------------------------------------------------- + def onRspQryDepthMarketData(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQrySettlementInfo(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryTransferBank(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInvestorPositionDetail(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryNotice(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQrySettlementInfoConfirm(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInvestorPositionCombineDetail(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryCFMMCTradingAccountKey(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryEWarrantOffset(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInvestorProductGroupMargin(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryExchangeMarginRate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryExchangeMarginRateAdjust(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryExchangeRate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQrySecAgentACIDMap(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryProductExchRate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryProductGroup(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryOptionInstrTradeCost(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryOptionInstrCommRate(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryExecOrder(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryForQuote(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryQuote(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryLock(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryLockPosition(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryInvestorLevel(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryExecFreeze(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryCombInstrumentGuard(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryCombAction(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryTransferSerial(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryAccountregister(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspError(self, error, n, last): + """错误回报""" + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRtnOrder(self, data): + """报单回报""" + # 更新最大报单编号 + newref = data['OrderRef'] + self.orderRef = max(self.orderRef, int(newref)) + + # 创建报单数据对象 + order = VtOrderData() + order.gatewayName = self.gatewayName + + # 保存代码和报单号 + order.symbol = data['InstrumentID'] + order.exchange = exchangeMapReverse[data['ExchangeID']] + order.vtSymbol = order.symbol #'.'.join([order.symbol, order.exchange]) + + order.orderID = data['OrderRef'] + # CTP的报单号一致性维护需要基于frontID, sessionID, orderID三个字段 + # 但在本接口设计中,已经考虑了CTP的OrderRef的自增性,避免重复 + # 唯一可能出现OrderRef重复的情况是多处登录并在非常接近的时间内(几乎同时发单) + # 考虑到VtTrader的应用场景,认为以上情况不会构成问题 + order.vtOrderID = '.'.join([self.gatewayName, order.orderID]) + + order.direction = directionMapReverse.get(data['Direction'], DIRECTION_UNKNOWN) + order.offset = offsetMapReverse.get(data['CombOffsetFlag'], OFFSET_UNKNOWN) + order.status = statusMapReverse.get(data['OrderStatus'], STATUS_UNKNOWN) + + # 价格、报单量等数值 + order.price = data['LimitPrice'] + order.totalVolume = data['VolumeTotalOriginal'] + order.tradedVolume = data['VolumeTraded'] + order.orderTime = data['InsertTime'] + order.cancelTime = data['CancelTime'] + order.frontID = data['FrontID'] + order.sessionID = data['SessionID'] + + # 推送 + self.gateway.onOrder(order) + + #---------------------------------------------------------------------- + def onRtnTrade(self, data): + """成交回报""" + # 创建报单数据对象 + trade = VtTradeData() + trade.gatewayName = self.gatewayName + + # 保存代码和报单号 + trade.symbol = data['InstrumentID'] + trade.exchange = exchangeMapReverse[data['ExchangeID']] + trade.vtSymbol = trade.symbol #'.'.join([trade.symbol, trade.exchange]) + + trade.tradeID = data['TradeID'] + trade.vtTradeID = '.'.join([self.gatewayName, trade.tradeID]) + + trade.orderID = data['OrderRef'] + trade.vtOrderID = '.'.join([self.gatewayName, trade.orderID]) + + # 方向 + trade.direction = directionMapReverse.get(data['Direction'], '') + + # 开平 + trade.offset = offsetMapReverse.get(data['OffsetFlag'], '') + + # 价格、报单量等数值 + trade.price = data['Price'] + trade.volume = data['Volume'] + trade.tradeTime = data['TradeTime'] + + # 推送 + self.gateway.onTrade(trade) + + #---------------------------------------------------------------------- + def onErrRtnOrderInsert(self, data, error): + """发单错误回报(交易所)""" + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onErrRtnOrderAction(self, data, error): + """撤单错误回报(交易所)""" + err = VtErrorData() + err.gatewayName = self.gatewayName + err.errorID = error['ErrorID'] + err.errorMsg = error['ErrorMsg'].decode('gbk') + self.gateway.onError(err) + + #---------------------------------------------------------------------- + def onRtnInstrumentStatus(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnTradingNotice(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnErrorConditionalOrder(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnExecOrder(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnExecOrderInsert(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnExecOrderAction(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnForQuoteInsert(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnQuote(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnQuoteInsert(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnQuoteAction(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnForQuoteRsp(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnCFMMCTradingAccountToken(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnLock(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnLockInsert(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnCombAction(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnCombActionInsert(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryContractBank(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryParkedOrder(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryParkedOrderAction(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryTradingNotice(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryBrokerTradingParams(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQryBrokerTradingAlgos(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQueryCFMMCTradingAccountToken(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnFromBankToFutureByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnFromFutureToBankByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnRepealFromBankToFutureByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnRepealFromFutureToBankByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnFromBankToFutureByFuture(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnFromFutureToBankByFuture(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnRepealFromBankToFutureByFutureManual(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnRepealFromFutureToBankByFutureManual(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnQueryBankBalanceByFuture(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnBankToFutureByFuture(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnFutureToBankByFuture(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnRepealBankToFutureByFutureManual(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnRepealFutureToBankByFutureManual(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onErrRtnQueryBankBalanceByFuture(self, data, error): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnRepealFromBankToFutureByFuture(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnRepealFromFutureToBankByFuture(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRspFromBankToFutureByFuture(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspFromFutureToBankByFuture(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRspQueryBankAccountMoneyByFuture(self, data, error, n, last): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnOpenAccountByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnCancelAccountByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def onRtnChangeAccountByBank(self, data): + """""" + pass + + #---------------------------------------------------------------------- + def connect(self, userID, password, brokerID, address): + """初始化连接""" + self.userID = userID # 账号 + self.password = password # 密码 + self.brokerID = brokerID # 经纪商代码 + self.address = address # 服务器地址 + + # 如果尚未建立服务器连接,则进行连接 + if not self.connectionStatus: + # 创建C++环境中的API对象,这里传入的参数是需要用来保存.con文件的文件夹路径 + path = os.getcwd() + '/temp/' + self.gatewayName + '/' + if not os.path.exists(path): + os.makedirs(path) + self.createFtdcTraderApi(path) + + # 设置数据同步模式为推送从今日开始所有数据 + self.subscribePrivateTopic(0) + self.subscribePublicTopic(0) + + # 注册服务器地址 + self.registerFront(self.address) + + # 初始化连接,成功会调用onFrontConnected + self.init() + + # 若已经连接但尚未登录,则进行登录 + else: + if not self.loginStatus: + self.login() + + #---------------------------------------------------------------------- + def login(self): + """连接服务器""" + # 如果填入了用户名密码等,则登录 + if self.userID and self.password and self.brokerID: + req = {} + req['UserID'] = self.userID + req['Password'] = self.password + req['BrokerID'] = self.brokerID + self.reqID += 1 + self.reqUserLogin(req, self.reqID) + + #---------------------------------------------------------------------- + def qryAccount(self): + """查询账户""" + self.reqID += 1 + self.reqQryTradingAccount({}, self.reqID) + + #---------------------------------------------------------------------- + def qryPosition(self): + """查询持仓""" + self.reqID += 1 + req = {} + req['BrokerID'] = self.brokerID + req['InvestorID'] = self.userID + self.reqQryInvestorPosition(req, self.reqID) + + #---------------------------------------------------------------------- + def sendOrder(self, orderReq): + """发单""" + self.reqID += 1 + self.orderRef += 1 + + req = {} + + req['InstrumentID'] = orderReq.symbol + req['LimitPrice'] = orderReq.price + req['VolumeTotalOriginal'] = orderReq.volume + + # 下面如果由于传入的类型本接口不支持,则会返回空字符串 + req['OrderPriceType'] = priceTypeMap.get(orderReq.priceType, '') + req['Direction'] = directionMap.get(orderReq.direction, '') + req['CombOffsetFlag'] = offsetMap.get(orderReq.offset, '') + + req['OrderRef'] = str(self.orderRef) + req['InvestorID'] = self.userID + req['UserID'] = self.userID + req['BrokerID'] = self.brokerID + + req['CombHedgeFlag'] = defineDict['THOST_FTDC_HF_Speculation'] # 投机单 + req['ContingentCondition'] = defineDict['THOST_FTDC_CC_Immediately'] # 立即发单 + req['ForceCloseReason'] = defineDict['THOST_FTDC_FCC_NotForceClose'] # 非强平 + req['IsAutoSuspend'] = 0 # 非自动挂起 + req['TimeCondition'] = defineDict['THOST_FTDC_TC_GFD'] # 今日有效 + req['VolumeCondition'] = defineDict['THOST_FTDC_VC_AV'] # 任意成交量 + req['MinVolume'] = 1 # 最小成交量为1 + + # 判断FAK和FOK + if orderReq.priceType == PRICETYPE_FAK: + req['OrderPriceType'] = defineDict["THOST_FTDC_OPT_LimitPrice"] + req['TimeCondition'] = defineDict['THOST_FTDC_TC_IOC'] + req['VolumeCondition'] = defineDict['THOST_FTDC_VC_AV'] + if orderReq.priceType == PRICETYPE_FOK: + req['OrderPriceType'] = defineDict["THOST_FTDC_OPT_LimitPrice"] + req['TimeCondition'] = defineDict['THOST_FTDC_TC_IOC'] + req['VolumeCondition'] = defineDict['THOST_FTDC_VC_CV'] + + i = self.reqOrderInsert(req, self.reqID) + return i + ## 返回订单号(字符串),便于某些算法进行动态管理 + #vtOrderID = '.'.join([self.gatewayName, str(self.orderRef)]) + #return vtOrderID + + #---------------------------------------------------------------------- + def cancelOrder(self, cancelOrderReq): + """撤单""" + self.reqID += 1 + + req = {} + + req['InstrumentID'] = cancelOrderReq.symbol + req['ExchangeID'] = cancelOrderReq.exchange + req['OrderRef'] = cancelOrderReq.orderID + req['FrontID'] = cancelOrderReq.frontID + req['SessionID'] = cancelOrderReq.sessionID + + req['ActionFlag'] = defineDict['THOST_FTDC_AF_Delete'] + req['BrokerID'] = self.brokerID + req['InvestorID'] = self.userID + + self.reqOrderAction(req, self.reqID) + + #---------------------------------------------------------------------- + def close(self): + """关闭""" + self.exit() + + +######################################################################## +class PositionBuffer(object): + """用来缓存持仓的数据,处理上期所的数据返回分今昨的问题""" + + #---------------------------------------------------------------------- + def __init__(self, data, gatewayName): + """Constructor""" + self.symbol = data['InstrumentID'] + self.direction = posiDirectionMapReverse.get(data['PosiDirection'], '') + + self.todayPosition = EMPTY_INT + self.ydPosition = EMPTY_INT + self.todayPositionCost = EMPTY_FLOAT + self.ydPositionCost = EMPTY_FLOAT + + # 通过提前创建持仓数据对象并重复使用的方式来降低开销 + pos = VtPositionData() + pos.symbol = self.symbol + pos.vtSymbol = self.symbol + pos.gatewayName = gatewayName + pos.direction = self.direction + pos.vtPositionName = '.'.join([pos.vtSymbol, pos.direction]) + self.pos = pos + + #---------------------------------------------------------------------- + def updateShfeBuffer(self, data, size): + """更新上期所缓存,返回更新后的持仓数据""" + # 昨仓和今仓的数据更新是分在两条记录里的,因此需要判断检查该条记录对应仓位 + # 因为今仓字段TodayPosition可能变为0(被全部平仓),因此分辨今昨仓需要用YdPosition字段 + if data['YdPosition']: + self.ydPosition = data['Position'] + self.ydPositionCost = data['PositionCost'] + else: + self.todayPosition = data['Position'] + self.todayPositionCost = data['PositionCost'] + + # 持仓的昨仓和今仓相加后为总持仓 + self.pos.position = self.todayPosition + self.ydPosition + self.pos.ydPosition = self.ydPosition + + # 如果手头还有持仓,则通过加权平均方式计算持仓均价 + if self.todayPosition or self.ydPosition: + self.pos.price = ((self.todayPositionCost + self.ydPositionCost)/ + ((self.todayPosition + self.ydPosition) * size)) + # 否则价格为0 + else: + self.pos.price = 0 + + return copy(self.pos) + + #---------------------------------------------------------------------- + def updateBuffer(self, data, size): + """更新其他交易所的缓存,返回更新后的持仓数据""" + # 其他交易所并不区分今昨,因此只关心总仓位,昨仓设为0 + self.pos.position = data['Position'] + self.pos.ydPosition = 0 + + if data['Position']: + self.pos.price = data['PositionCost'] / (data['Position'] * size) + else: + self.pos.price = 0 + + return copy(self.pos) + + #---------------------------------------------------------------------- + def getPos(self): + """获取当前的持仓数据""" + return copy(self.pos) + + +#---------------------------------------------------------------------- +def test(): + """测试""" + from PyQt4 import QtCore + import sys + + def print_log(event): + log = event.dict_['data'] + print ':'.join([log.logTime, log.logContent]) + + app = QtCore.QCoreApplication(sys.argv) + + eventEngine = EventEngine() + eventEngine.register(EVENT_LOG, print_log) + eventEngine.start() + + gateway = CtpGateway(eventEngine) + gateway.connect() + + sys.exit(app.exec_()) + + +if __name__ == '__main__': + test() \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/thostmduserapi.dll b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/thostmduserapi.dll new file mode 100644 index 0000000000..b48e747ef3 Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/thostmduserapi.dll differ diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/thosttraderapi.dll b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/thosttraderapi.dll new file mode 100644 index 0000000000..162cc143ce Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/thosttraderapi.dll differ diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctpmd.pyd b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctpmd.pyd new file mode 100644 index 0000000000..019bd110c0 Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctpmd.pyd differ diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctpmd.so b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctpmd.so new file mode 100644 index 0000000000..c149f76399 Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctpmd.so differ diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctptd.pyd b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctptd.pyd new file mode 100644 index 0000000000..69fde13491 Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctptd.pyd differ diff --git a/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctptd.so b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctptd.so new file mode 100644 index 0000000000..28f972494c Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/ctpGateway/vnctptd.so differ diff --git a/vn.how/tick2trade/vn.trader_t2t/dataRecorder/DR_setting.json b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/DR_setting.json new file mode 100644 index 0000000000..f7c297c53a --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/DR_setting.json @@ -0,0 +1,32 @@ +{ + "working": false, + + "tick": + [ + ["m1609", "XSPEED"], + ["IF1606", "SGIT"], + ["IH1606", "SGIT"], + ["IH1606", "SGIT"], + ["IC1606", "SGIT"], + ["IC1606", "SGIT"], + ["600036", "LTS", "SZSE"], + ["EUR.USD", "IB", "IDEALPRO", "USD", "外汇"] + ], + + "bar": + [ + ["IF1605", "SGIT"], + ["IF1606", "SGIT"], + ["IH1606", "SGIT"], + ["IH1606", "SGIT"], + ["IC1606", "SGIT"], + ["IC1606", "SGIT"] + ], + + "active": + { + "IF0000": "IF1605", + "IH0000": "IH1605", + "IC0000": "IC1605" + } +} \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/dataRecorder/__init__.py b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vn.how/tick2trade/vn.trader_t2t/dataRecorder/drBase.py b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/drBase.py new file mode 100644 index 0000000000..85581d96ad --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/drBase.py @@ -0,0 +1,97 @@ +# encoding: UTF-8 + +''' +本文件中包含的数据格式和CTA模块通用,用户有必要可以自行添加格式。 +''' + +from __future__ import division + + +# 把vn.trader根目录添加到python环境变量中 +import sys +sys.path.append('..') + + +# 数据库名称 +SETTING_DB_NAME = 'VnTrader_Setting_Db' +TICK_DB_NAME = 'VnTrader_Tick_Db' +DAILY_DB_NAME = 'VnTrader_Daily_Db' +MINUTE_DB_NAME = 'VnTrader_1Min_Db' + + +# CTA引擎中涉及的数据类定义 +from vtConstant import EMPTY_UNICODE, EMPTY_STRING, EMPTY_FLOAT, EMPTY_INT + + +######################################################################## +class DrBarData(object): + """K线数据""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.vtSymbol = EMPTY_STRING # vt系统代码 + self.symbol = EMPTY_STRING # 代码 + self.exchange = EMPTY_STRING # 交易所 + + self.open = EMPTY_FLOAT # OHLC + self.high = EMPTY_FLOAT + self.low = EMPTY_FLOAT + self.close = EMPTY_FLOAT + + self.date = EMPTY_STRING # bar开始的时间,日期 + self.time = EMPTY_STRING # 时间 + self.datetime = None # python的datetime时间对象 + + self.volume = EMPTY_INT # 成交量 + self.openInterest = EMPTY_INT # 持仓量 + + +######################################################################## +class DrTickData(object): + """Tick数据""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.vtSymbol = EMPTY_STRING # vt系统代码 + self.symbol = EMPTY_STRING # 合约代码 + self.exchange = EMPTY_STRING # 交易所代码 + + # 成交数据 + self.lastPrice = EMPTY_FLOAT # 最新成交价 + self.volume = EMPTY_INT # 最新成交量 + self.openInterest = EMPTY_INT # 持仓量 + + self.upperLimit = EMPTY_FLOAT # 涨停价 + self.lowerLimit = EMPTY_FLOAT # 跌停价 + + # tick的时间 + self.date = EMPTY_STRING # 日期 + self.time = EMPTY_STRING # 时间 + self.datetime = None # python的datetime时间对象 + + # 五档行情 + self.bidPrice1 = EMPTY_FLOAT + self.bidPrice2 = EMPTY_FLOAT + self.bidPrice3 = EMPTY_FLOAT + self.bidPrice4 = EMPTY_FLOAT + self.bidPrice5 = EMPTY_FLOAT + + self.askPrice1 = EMPTY_FLOAT + self.askPrice2 = EMPTY_FLOAT + self.askPrice3 = EMPTY_FLOAT + self.askPrice4 = EMPTY_FLOAT + self.askPrice5 = EMPTY_FLOAT + + self.bidVolume1 = EMPTY_INT + self.bidVolume2 = EMPTY_INT + self.bidVolume3 = EMPTY_INT + self.bidVolume4 = EMPTY_INT + self.bidVolume5 = EMPTY_INT + + self.askVolume1 = EMPTY_INT + self.askVolume2 = EMPTY_INT + self.askVolume3 = EMPTY_INT + self.askVolume4 = EMPTY_INT + self.askVolume5 = EMPTY_INT \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/dataRecorder/drEngine.py b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/drEngine.py new file mode 100644 index 0000000000..c4565fc4a8 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/drEngine.py @@ -0,0 +1,233 @@ +# encoding: UTF-8 + +''' +本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。 + +使用DR_setting.json来配置需要收集的合约,以及主力合约代码。 +''' + +import json +import os +import copy +from collections import OrderedDict +from datetime import datetime, timedelta +from Queue import Queue +from threading import Thread + +from eventEngine import * +from vtGateway import VtSubscribeReq, VtLogData +from drBase import * +from vtFunction import todayDate + + +######################################################################## +class DrEngine(object): + """数据记录引擎""" + + settingFileName = 'DR_setting.json' + path = os.path.abspath(os.path.dirname(__file__)) + settingFileName = os.path.join(path, settingFileName) + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine): + """Constructor""" + self.mainEngine = mainEngine + self.eventEngine = eventEngine + + # 当前日期 + self.today = todayDate() + + # 主力合约代码映射字典,key为具体的合约代码(如IF1604),value为主力合约代码(如IF0000) + self.activeSymbolDict = {} + + # Tick对象字典 + self.tickDict = {} + + # K线对象字典 + self.barDict = {} + + # 负责执行数据库插入的单独线程相关 + self.active = False # 工作状态 + self.queue = Queue() # 队列 + self.thread = Thread(target=self.run) # 线程 + + # 载入设置,订阅行情 + self.loadSetting() + + #---------------------------------------------------------------------- + def loadSetting(self): + """载入设置""" + with open(self.settingFileName) as f: + drSetting = json.load(f) + + # 如果working设为False则不启动行情记录功能 + working = drSetting['working'] + if not working: + return + + if 'tick' in drSetting: + l = drSetting['tick'] + + for setting in l: + symbol = setting[0] + vtSymbol = symbol + + req = VtSubscribeReq() + req.symbol = setting[0] + + # 针对LTS和IB接口,订阅行情需要交易所代码 + if len(setting)>=3: + req.exchange = setting[2] + vtSymbol = '.'.join([symbol, req.exchange]) + + # 针对IB接口,订阅行情需要货币和产品类型 + if len(setting)>=5: + req.currency = setting[3] + req.productClass = setting[4] + + self.mainEngine.subscribe(req, setting[1]) + + drTick = DrTickData() # 该tick实例可以用于缓存部分数据(目前未使用) + self.tickDict[vtSymbol] = drTick + + if 'bar' in drSetting: + l = drSetting['bar'] + + for setting in l: + symbol = setting[0] + vtSymbol = symbol + + req = VtSubscribeReq() + req.symbol = symbol + + if len(setting)>=3: + req.exchange = setting[2] + vtSymbol = '.'.join([symbol, req.exchange]) + + if len(setting)>=5: + req.currency = setting[3] + req.productClass = setting[4] + + self.mainEngine.subscribe(req, setting[1]) + + bar = DrBarData() + self.barDict[vtSymbol] = bar + + if 'active' in drSetting: + d = drSetting['active'] + + # 注意这里的vtSymbol对于IB和LTS接口,应该后缀.交易所 + for activeSymbol, vtSymbol in d.items(): + self.activeSymbolDict[vtSymbol] = activeSymbol + + # 启动数据插入线程 + self.start() + + # 注册事件监听 + self.registerEvent() + + #---------------------------------------------------------------------- + def procecssTickEvent(self, event): + """处理行情推送""" + tick = event.dict_['data'] + vtSymbol = tick.vtSymbol + + # 转化Tick格式 + drTick = DrTickData() + d = drTick.__dict__ + for key in d.keys(): + if key != 'datetime': + d[key] = tick.__getattribute__(key) + drTick.datetime = datetime.strptime(' '.join([tick.date, tick.time]), '%Y%m%d %H:%M:%S.%f') + + # 更新Tick数据 + if vtSymbol in self.tickDict: + self.insertData(TICK_DB_NAME, vtSymbol, drTick) + + if vtSymbol in self.activeSymbolDict: + activeSymbol = self.activeSymbolDict[vtSymbol] + self.insertData(TICK_DB_NAME, activeSymbol, drTick) + + # 发出日志 + self.writeDrLog(u'记录Tick数据%s,时间:%s, last:%s, bid:%s, ask:%s' + %(drTick.vtSymbol, drTick.time, drTick.lastPrice, drTick.bidPrice1, drTick.askPrice1)) + + # 更新分钟线数据 + if vtSymbol in self.barDict: + bar = self.barDict[vtSymbol] + + # 如果第一个TICK或者新的一分钟 + if not bar.datetime or bar.datetime.minute != drTick.datetime.minute: + if bar.vtSymbol: + newBar = copy.copy(bar) + self.insertData(MINUTE_DB_NAME, vtSymbol, newBar) + + if vtSymbol in self.activeSymbolDict: + activeSymbol = self.activeSymbolDict[vtSymbol] + self.insertData(MINUTE_DB_NAME, activeSymbol, newBar) + + self.writeDrLog(u'记录分钟线数据%s,时间:%s, O:%s, H:%s, L:%s, C:%s' + %(bar.vtSymbol, bar.time, bar.open, bar.high, + bar.low, bar.close)) + + bar.vtSymbol = drTick.vtSymbol + bar.symbol = drTick.symbol + bar.exchange = drTick.exchange + + bar.open = drTick.lastPrice + bar.high = drTick.lastPrice + bar.low = drTick.lastPrice + bar.close = drTick.lastPrice + + bar.date = drTick.date + bar.time = drTick.time + bar.datetime = drTick.datetime + bar.volume = drTick.volume + bar.openInterest = drTick.openInterest + # 否则继续累加新的K线 + else: + bar.high = max(bar.high, drTick.lastPrice) + bar.low = min(bar.low, drTick.lastPrice) + bar.close = drTick.lastPrice + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.eventEngine.register(EVENT_TICK, self.procecssTickEvent) + + #---------------------------------------------------------------------- + def insertData(self, dbName, collectionName, data): + """插入数据到数据库(这里的data可以是CtaTickData或者CtaBarData)""" + self.queue.put((dbName, collectionName, data.__dict__)) + + #---------------------------------------------------------------------- + def run(self): + """运行插入线程""" + while self.active: + try: + dbName, collectionName, d = self.queue.get(block=True, timeout=1) + self.mainEngine.dbInsert(dbName, collectionName, d) + except Empty: + pass + #---------------------------------------------------------------------- + def start(self): + """启动""" + self.active = True + self.thread.start() + + #---------------------------------------------------------------------- + def stop(self): + """退出""" + if self.active: + self.active = False + self.thread.join() + + #---------------------------------------------------------------------- + def writeDrLog(self, content): + """快速发出日志事件""" + log = VtLogData() + log.logContent = content + event = Event(type_=EVENT_DATARECORDER_LOG) + event.dict_['data'] = log + self.eventEngine.put(event) + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/dataRecorder/uiDrWidget.py b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/uiDrWidget.py new file mode 100644 index 0000000000..b9a2119023 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/dataRecorder/uiDrWidget.py @@ -0,0 +1,155 @@ +# encoding: UTF-8 + +''' +行情记录模块相关的GUI控制组件 +''' + +import json + +from uiBasicWidget import QtGui, QtCore +from eventEngine import * + + +######################################################################## +class TableCell(QtGui.QTableWidgetItem): + """居中的单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(TableCell, self).__init__() + self.data = None + self.setTextAlignment(QtCore.Qt.AlignCenter) + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + if text == '0' or text == '0.0': + self.setText('') + else: + self.setText(text) + + +######################################################################## +class DrEngineManager(QtGui.QWidget): + """行情数据记录引擎管理组件""" + signal = QtCore.pyqtSignal(type(Event())) + + #---------------------------------------------------------------------- + def __init__(self, drEngine, eventEngine, parent=None): + """Constructor""" + super(DrEngineManager, self).__init__(parent) + + self.drEngine = drEngine + self.eventEngine = eventEngine + + self.initUi() + self.updateSetting() + self.registerEvent() + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setWindowTitle(u'行情数据记录工具') + + # 记录合约配置监控 + tickLabel = QtGui.QLabel(u'Tick记录') + self.tickTable = QtGui.QTableWidget() + self.tickTable.setColumnCount(2) + self.tickTable.verticalHeader().setVisible(False) + self.tickTable.setEditTriggers(QtGui.QTableWidget.NoEditTriggers) + self.tickTable.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch) + self.tickTable.setAlternatingRowColors(True) + self.tickTable.setHorizontalHeaderLabels([u'合约代码', u'接口']) + + barLabel = QtGui.QLabel(u'Bar记录') + self.barTable = QtGui.QTableWidget() + self.barTable.setColumnCount(2) + self.barTable.verticalHeader().setVisible(False) + self.barTable.setEditTriggers(QtGui.QTableWidget.NoEditTriggers) + self.barTable.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch) + self.barTable.setAlternatingRowColors(True) + self.barTable.setHorizontalHeaderLabels([u'合约代码', u'接口']) + + activeLabel = QtGui.QLabel(u'主力合约') + self.activeTable = QtGui.QTableWidget() + self.activeTable.setColumnCount(2) + self.activeTable.verticalHeader().setVisible(False) + self.activeTable.setEditTriggers(QtGui.QTableWidget.NoEditTriggers) + self.activeTable.horizontalHeader().setResizeMode(QtGui.QHeaderView.Stretch) + self.activeTable.setAlternatingRowColors(True) + self.activeTable.setHorizontalHeaderLabels([u'主力代码', u'合约代码']) + + # 日志监控 + self.logMonitor = QtGui.QTextEdit() + self.logMonitor.setReadOnly(True) + self.logMonitor.setMinimumHeight(600) + + # 设置布局 + grid = QtGui.QGridLayout() + + grid.addWidget(tickLabel, 0, 0) + grid.addWidget(barLabel, 0, 1) + grid.addWidget(activeLabel, 0, 2) + grid.addWidget(self.tickTable, 1, 0) + grid.addWidget(self.barTable, 1, 1) + grid.addWidget(self.activeTable, 1, 2) + + vbox = QtGui.QVBoxLayout() + vbox.addLayout(grid) + vbox.addWidget(self.logMonitor) + self.setLayout(vbox) + + #---------------------------------------------------------------------- + def updateLog(self, event): + """更新日志""" + log = event.dict_['data'] + content = '\t'.join([log.logTime, log.logContent]) + self.logMonitor.append(content) + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.signal.connect(self.updateLog) + self.eventEngine.register(EVENT_DATARECORDER_LOG, self.signal.emit) + + #---------------------------------------------------------------------- + def updateSetting(self): + """显示引擎行情记录配置""" + with open(self.drEngine.settingFileName) as f: + drSetting = json.load(f) + + if 'tick' in drSetting: + l = drSetting['tick'] + + for setting in l: + self.tickTable.insertRow(0) + self.tickTable.setItem(0, 0, TableCell(setting[0])) + self.tickTable.setItem(0, 1, TableCell(setting[1])) + + if 'bar' in drSetting: + l = drSetting['bar'] + + for setting in l: + self.barTable.insertRow(0) + self.barTable.setItem(0, 0, TableCell(setting[0])) + self.barTable.setItem(0, 1, TableCell(setting[1])) + + if 'active' in drSetting: + d = drSetting['active'] + + for activeSymbol, symbol in d.items(): + self.activeTable.insertRow(0) + self.activeTable.setItem(0, 0, TableCell(activeSymbol)) + self.activeTable.setItem(0, 1, TableCell(symbol)) + + + + + + + + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/eventEngine.py b/vn.how/tick2trade/vn.trader_t2t/eventEngine.py new file mode 100644 index 0000000000..e800c57c60 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/eventEngine.py @@ -0,0 +1,308 @@ +# encoding: UTF-8 + +# 系统模块 +from Queue import Queue, Empty +from threading import Thread +from time import sleep +from collections import defaultdict + +# 第三方模块 +from PyQt4.QtCore import QTimer + +# 自己开发的模块 +from eventType import * + + +######################################################################## +class EventEngine(object): + """ + 事件驱动引擎 + 事件驱动引擎中所有的变量都设置为了私有,这是为了防止不小心 + 从外部修改了这些变量的值或状态,导致bug。 + + 变量说明 + __queue:私有变量,事件队列 + __active:私有变量,事件引擎开关 + __thread:私有变量,事件处理线程 + __timer:私有变量,计时器 + __handlers:私有变量,事件处理函数字典 + + + 方法说明 + __run: 私有方法,事件处理线程连续运行用 + __process: 私有方法,处理事件,调用注册在引擎中的监听函数 + __onTimer:私有方法,计时器固定事件间隔触发后,向事件队列中存入计时器事件 + start: 公共方法,启动引擎 + stop:公共方法,停止引擎 + register:公共方法,向引擎中注册监听函数 + unregister:公共方法,向引擎中注销监听函数 + put:公共方法,向事件队列中存入新的事件 + + 事件监听函数必须定义为输入参数仅为一个event对象,即: + + 函数 + def func(event) + ... + + 对象方法 + def method(self, event) + ... + + """ + + #---------------------------------------------------------------------- + def __init__(self): + """初始化事件引擎""" + # 事件队列 + self.__queue = Queue() + + # 事件引擎开关 + self.__active = False + + # 事件处理线程 + self.__thread = Thread(target = self.__run) + + # 计时器,用于触发计时器事件 + self.__timer = QTimer() + self.__timer.timeout.connect(self.__onTimer) + + # 这里的__handlers是一个字典,用来保存对应的事件调用关系 + # 其中每个键对应的值是一个列表,列表中保存了对该事件进行监听的函数功能 + self.__handlers = defaultdict(list) + + #---------------------------------------------------------------------- + def __run(self): + """引擎运行""" + while self.__active == True: + try: + event = self.__queue.get(block = True, timeout = 1) # 获取事件的阻塞时间设为1秒 + self.__process(event) + except Empty: + pass + + #---------------------------------------------------------------------- + def __process(self, event): + """处理事件""" + # 检查是否存在对该事件进行监听的处理函数 + if event.type_ in self.__handlers: + # 若存在,则按顺序将事件传递给处理函数执行 + [handler(event) for handler in self.__handlers[event.type_]] + + # 以上语句为Python列表解析方式的写法,对应的常规循环写法为: + #for handler in self.__handlers[event.type_]: + #handler(event) + + #---------------------------------------------------------------------- + def __onTimer(self): + """向事件队列中存入计时器事件""" + # 创建计时器事件 + event = Event(type_=EVENT_TIMER) + + # 向队列中存入计时器事件 + self.put(event) + + #---------------------------------------------------------------------- + def start(self): + """引擎启动""" + # 将引擎设为启动 + self.__active = True + + # 启动事件处理线程 + self.__thread.start() + + # 启动计时器,计时器事件间隔默认设定为1秒 + self.__timer.start(1000) + + #---------------------------------------------------------------------- + def stop(self): + """停止引擎""" + # 将引擎设为停止 + self.__active = False + + # 停止计时器 + self.__timer.stop() + + # 等待事件处理线程退出 + self.__thread.join() + + #---------------------------------------------------------------------- + def register(self, type_, handler): + """注册事件处理函数监听""" + # 尝试获取该事件类型对应的处理函数列表,若无defaultDict会自动创建新的list + handlerList = self.__handlers[type_] + + # 若要注册的处理器不在该事件的处理器列表中,则注册该事件 + if handler not in handlerList: + handlerList.append(handler) + + #---------------------------------------------------------------------- + def unregister(self, type_, handler): + """注销事件处理函数监听""" + # 尝试获取该事件类型对应的处理函数列表,若无则忽略该次注销请求 + handlerList = self.__handlers[type_] + + # 如果该函数存在于列表中,则移除 + if handler in handlerList: + handlerList.remove(handler) + + # 如果函数列表为空,则从引擎中移除该事件类型 + if not handlerList: + del self.__handlers[type_] + + #---------------------------------------------------------------------- + def put(self, event): + """向事件队列中存入事件""" + self.__queue.put(event) + + +######################################################################## +class EventEngine2(object): + """ + 计时器使用python线程的事件驱动引擎 + """ + + #---------------------------------------------------------------------- + def __init__(self): + """初始化事件引擎""" + # 事件队列 + self.__queue = Queue() + + # 事件引擎开关 + self.__active = False + + # 事件处理线程 + self.__thread = Thread(target = self.__run) + + # 计时器,用于触发计时器事件 + self.__timer = Thread(target = self.__runTimer) + self.__timerActive = False # 计时器工作状态 + self.__timerSleep = 1 # 计时器触发间隔(默认1秒) + + # 这里的__handlers是一个字典,用来保存对应的事件调用关系 + # 其中每个键对应的值是一个列表,列表中保存了对该事件进行监听的函数功能 + self.__handlers = defaultdict(list) + + #---------------------------------------------------------------------- + def __run(self): + """引擎运行""" + while self.__active == True: + try: + event = self.__queue.get(block = True, timeout = 1) # 获取事件的阻塞时间设为1秒 + self.__process(event) + except Empty: + pass + + #---------------------------------------------------------------------- + def __process(self, event): + """处理事件""" + # 检查是否存在对该事件进行监听的处理函数 + if event.type_ in self.__handlers: + # 若存在,则按顺序将事件传递给处理函数执行 + [handler(event) for handler in self.__handlers[event.type_]] + + # 以上语句为Python列表解析方式的写法,对应的常规循环写法为: + #for handler in self.__handlers[event.type_]: + #handler(event) + + #---------------------------------------------------------------------- + def __runTimer(self): + """运行在计时器线程中的循环函数""" + while self.__timerActive: + # 创建计时器事件 + event = Event(type_=EVENT_TIMER) + + # 向队列中存入计时器事件 + self.put(event) + + # 等待 + sleep(self.__timerSleep) + + #---------------------------------------------------------------------- + def start(self): + """引擎启动""" + # 将引擎设为启动 + self.__active = True + + # 启动事件处理线程 + self.__thread.start() + + # 启动计时器,计时器事件间隔默认设定为1秒 + self.__timerActive = True + self.__timer.start() + + #---------------------------------------------------------------------- + def stop(self): + """停止引擎""" + # 将引擎设为停止 + self.__active = False + + # 停止计时器 + self.__timerActive = False + self.__timer.join() + + # 等待事件处理线程退出 + self.__thread.join() + + #---------------------------------------------------------------------- + def register(self, type_, handler): + """注册事件处理函数监听""" + # 尝试获取该事件类型对应的处理函数列表,若无defaultDict会自动创建新的list + handlerList = self.__handlers[type_] + + # 若要注册的处理器不在该事件的处理器列表中,则注册该事件 + if handler not in handlerList: + handlerList.append(handler) + + #---------------------------------------------------------------------- + def unregister(self, type_, handler): + """注销事件处理函数监听""" + # 尝试获取该事件类型对应的处理函数列表,若无则忽略该次注销请求 + handlerList = self.__handlers[type_] + + # 如果该函数存在于列表中,则移除 + if handler in handlerList: + handlerList.remove(handler) + + # 如果函数列表为空,则从引擎中移除该事件类型 + if not handlerList: + del self.__handlers[type_] + + #---------------------------------------------------------------------- + def put(self, event): + """向事件队列中存入事件""" + self.__queue.put(event) + + +######################################################################## +class Event: + """事件对象""" + + #---------------------------------------------------------------------- + def __init__(self, type_=None): + """Constructor""" + self.type_ = type_ # 事件类型 + self.dict_ = {} # 字典用于保存具体的事件数据 + + +#---------------------------------------------------------------------- +def test(): + """测试函数""" + import sys + from datetime import datetime + from PyQt4.QtCore import QCoreApplication + + def simpletest(event): + print u'处理每秒触发的计时器事件:%s' % str(datetime.now()) + + app = QCoreApplication(sys.argv) + + ee = EventEngine2() + ee.register(EVENT_TIMER, simpletest) + ee.start() + + app.exec_() + + +# 直接运行脚本可以进行测试 +if __name__ == '__main__': + test() \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/eventType.py b/vn.how/tick2trade/vn.trader_t2t/eventType.py new file mode 100644 index 0000000000..1b3ccaa462 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/eventType.py @@ -0,0 +1,64 @@ +# encoding: UTF-8 + +''' +本文件仅用于存放对于事件类型常量的定义。 + +由于python中不存在真正的常量概念,因此选择使用全大写的变量名来代替常量。 +这里设计的命名规则以EVENT_前缀开头。 + +常量的内容通常选择一个能够代表真实意义的字符串(便于理解)。 + +建议将所有的常量定义放在该文件中,便于检查是否存在重复的现象。 +''' + +# 系统相关 +EVENT_TIMER = 'eTimer' # 计时器事件,每隔1秒发送一次 +EVENT_LOG = 'eLog' # 日志事件,全局通用 + +# Gateway相关 +EVENT_TICK = 'eTick.' # TICK行情事件,可后接具体的vtSymbol +EVENT_TRADE = 'eTrade.' # 成交回报事件 +EVENT_ORDER = 'eOrder.' # 报单回报事件 +EVENT_POSITION = 'ePosition.' # 持仓回报事件 +EVENT_ACCOUNT = 'eAccount.' # 账户回报事件 +EVENT_CONTRACT = 'eContract.' # 合约基础信息回报事件 +EVENT_ERROR = 'eError.' # 错误回报事件 + +# CTA模块相关 +EVENT_CTA_LOG = 'eCtaLog' # CTA相关的日志事件 +EVENT_CTA_STRATEGY = 'eCtaStrategy.' # CTA策略状态变化事件 + +# 行情记录模块相关 +EVENT_DATARECORDER_LOG = 'eDataRecorderLog' # 行情记录日志更新事件 + +# Wind接口相关 +EVENT_WIND_CONNECTREQ = 'eWindConnectReq' # Wind接口请求连接事件 + + +#---------------------------------------------------------------------- +def test(): + """检查是否存在内容重复的常量定义""" + check_dict = {} + + global_dict = globals() + + for key, value in global_dict.items(): + if '__' not in key: # 不检查python内置对象 + if value in check_dict: + check_dict[value].append(key) + else: + check_dict[value] = [key] + + for key, value in check_dict.items(): + if len(value)>1: + print u'存在重复的常量定义:' + str(key) + for name in value: + print name + print '' + + print u'测试完毕' + + +# 直接运行脚本可以进行测试 +if __name__ == '__main__': + test() \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/riskManager/RM_setting.json b/vn.how/tick2trade/vn.trader_t2t/riskManager/RM_setting.json new file mode 100644 index 0000000000..ab0453d9e1 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/riskManager/RM_setting.json @@ -0,0 +1,8 @@ +{ + "orderFlowClear": 1, + "workingOrderLimit": 20, + "tradeLimit": 100, + "orderSizeLimit": 10, + "active": true, + "orderFlowLimit": 10 +} \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/riskManager/__init__.py b/vn.how/tick2trade/vn.trader_t2t/riskManager/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/vn.how/tick2trade/vn.trader_t2t/riskManager/rmEngine.py b/vn.how/tick2trade/vn.trader_t2t/riskManager/rmEngine.py new file mode 100644 index 0000000000..d90e2a23eb --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/riskManager/rmEngine.py @@ -0,0 +1,217 @@ +# encoding: UTF-8 + +''' +本文件中实现了风控引擎,用于提供一系列常用的风控功能: +1. 委托流控(单位时间内最大允许发出的委托数量) +2. 总成交限制(每日总成交数量限制) +3. 单笔委托的委托数量控制 +''' + +import json +import os +import platform + +from eventEngine import * +from vtConstant import * +from vtGateway import VtLogData + + +######################################################################## +class RmEngine(object): + """风控引擎""" + settingFileName = 'RM_setting.json' + path = os.path.abspath(os.path.dirname(__file__)) + settingFileName = os.path.join(path, settingFileName) + + name = u'风控模块' + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine): + """Constructor""" + self.mainEngine = mainEngine + self.eventEngine = eventEngine + + # 是否启动风控 + self.active = False + + # 流控相关 + self.orderFlowCount = EMPTY_INT # 单位时间内委托计数 + self.orderFlowLimit = EMPTY_INT # 委托限制 + self.orderFlowClear = EMPTY_INT # 计数清空时间(秒) + self.orderFlowTimer = EMPTY_INT # 计数清空时间计时 + + # 单笔委托相关 + self.orderSizeLimit = EMPTY_INT # 单笔委托最大限制 + + # 成交统计相关 + self.tradeCount = EMPTY_INT # 当日成交合约数量统计 + self.tradeLimit = EMPTY_INT # 当日成交合约数量限制 + + # 活动合约相关 + self.workingOrderLimit = EMPTY_INT # 活动合约最大限制 + + self.loadSetting() + self.registerEvent() + + #---------------------------------------------------------------------- + def loadSetting(self): + """读取配置""" + with open(self.settingFileName) as f: + d = json.load(f) + + # 设置风控参数 + self.active = d['active'] + + self.orderFlowLimit = d['orderFlowLimit'] + self.orderFlowClear = d['orderFlowClear'] + + self.orderSizeLimit = d['orderSizeLimit'] + + self.tradeLimit = d['tradeLimit'] + + self.workingOrderLimit = d['workingOrderLimit'] + + #---------------------------------------------------------------------- + def saveSetting(self): + """保存风控参数""" + with open(self.settingFileName, 'w') as f: + # 保存风控参数 + d = {} + + d['active'] = self.active + + d['orderFlowLimit'] = self.orderFlowLimit + d['orderFlowClear'] = self.orderFlowClear + + d['orderSizeLimit'] = self.orderSizeLimit + + d['tradeLimit'] = self.tradeLimit + + d['workingOrderLimit'] = self.workingOrderLimit + + # 写入json + jsonD = json.dumps(d, indent=4) + f.write(jsonD) + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.eventEngine.register(EVENT_TRADE, self.updateTrade) + self.eventEngine.register(EVENT_TIMER, self.updateTimer) + + #---------------------------------------------------------------------- + def updateTrade(self, event): + """更新成交数据""" + trade = event.dict_['data'] + self.tradeCount += trade.volume + + #---------------------------------------------------------------------- + def updateTimer(self, event): + """更新定时器""" + self.orderFlowTimer += 1 + + # 如果计时超过了流控清空的时间间隔,则执行清空 + if self.orderFlowTimer >= self.orderFlowClear: + self.orderFlowCount = 0 + self.orderFlowTimer = 0 + + #---------------------------------------------------------------------- + def writeRiskLog(self, content): + """快速发出日志事件""" + # 发出报警提示音 + + if platform.uname() == 'Windows': + import winsound + winsound.PlaySound("SystemHand", winsound.SND_ASYNC) + + # 发出日志事件 + log = VtLogData() + log.logContent = content + log.gatewayName = self.name + event = Event(type_=EVENT_LOG) + event.dict_['data'] = log + self.eventEngine.put(event) + + #---------------------------------------------------------------------- + def checkRisk(self, orderReq): + """检查风险""" + # 如果没有启动风控检查,则直接返回成功 + if not self.active: + return True + + # 检查委托数量 + if orderReq.volume > self.orderSizeLimit: + self.writeRiskLog(u'单笔委托数量%s,超过限制%s' + %(orderReq.volume, self.orderSizeLimit)) + return False + + # 检查成交合约量 + if self.tradeCount >= self.tradeLimit: + self.writeRiskLog(u'今日总成交合约数量%s,超过限制%s' + %(self.tradeCount, self.tradeLimit)) + return False + + # 检查流控 + if self.orderFlowCount >= self.orderFlowLimit: + self.writeRiskLog(u'委托流数量%s,超过限制每%s秒%s' + %(self.orderFlowCount, self.orderFlowClear, self.orderFlowLimit)) + return False + + # 检查总活动合约 + workingOrderCount = len(self.mainEngine.getAllWorkingOrders()) + if workingOrderCount >= self.workingOrderLimit: + self.writeRiskLog(u'当前活动委托数量%s,超过限制%s' + %(workingOrderCount, self.workingOrderLimit)) + return False + + # 对于通过风控的委托,增加流控计数 + self.orderFlowCount += 1 + + return True + + #---------------------------------------------------------------------- + def clearOrderFlowCount(self): + """清空流控计数""" + self.orderFlowCount = 0 + self.writeRiskLog(u'清空流控计数') + + #---------------------------------------------------------------------- + def clearTradeCount(self): + """清空成交数量计数""" + self.tradeCount = 0 + self.writeRiskLog(u'清空总成交计数') + + #---------------------------------------------------------------------- + def setOrderFlowLimit(self, n): + """设置流控限制""" + self.orderFlowLimit = n + + #---------------------------------------------------------------------- + def setOrderFlowClear(self, n): + """设置流控清空时间""" + self.orderFlowClear = n + + #---------------------------------------------------------------------- + def setOrderSizeLimit(self, n): + """设置委托最大限制""" + self.orderSizeLimit = n + + #---------------------------------------------------------------------- + def setTradeLimit(self, n): + """设置成交限制""" + self.tradeLimit = n + + #---------------------------------------------------------------------- + def setWorkingOrderLimit(self, n): + """设置活动合约限制""" + self.workingOrderLimit = n + + #---------------------------------------------------------------------- + def switchEngineStatus(self): + """开关风控引擎""" + self.active = not self.active + + if self.active: + self.writeRiskLog(u'风险管理功能启动') + else: + self.writeRiskLog(u'风险管理功能停止') diff --git a/vn.how/tick2trade/vn.trader_t2t/riskManager/uiRmWidget.py b/vn.how/tick2trade/vn.trader_t2t/riskManager/uiRmWidget.py new file mode 100644 index 0000000000..66708b6e2e --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/riskManager/uiRmWidget.py @@ -0,0 +1,135 @@ +# encoding: UTF-8 + +''' +风控模块相关的GUI控制组件 +''' + + +from uiBasicWidget import QtGui, QtCore +from eventEngine import * + + +######################################################################## +class RmSpinBox(QtGui.QSpinBox): + """调整参数用的数值框""" + + #---------------------------------------------------------------------- + def __init__(self, value): + """Constructor""" + super(RmSpinBox, self).__init__() + + self.setMinimum(0) + self.setMaximum(1000000) + + self.setValue(value) + + + + +######################################################################## +class RmLine(QtGui.QFrame): + """水平分割线""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(RmLine, self).__init__() + self.setFrameShape(self.HLine) + self.setFrameShadow(self.Sunken) + + + + +######################################################################## +class RmEngineManager(QtGui.QWidget): + """风控引擎的管理组件""" + + #---------------------------------------------------------------------- + def __init__(self, rmEngine, eventEngine, parent=None): + """Constructor""" + super(RmEngineManager, self).__init__(parent) + + self.rmEngine = rmEngine + self.eventEngine = eventEngine + + self.initUi() + self.updateEngineStatus() + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setWindowTitle(u'风险管理') + + # 设置界面 + self.buttonSwitchEngineStatus = QtGui.QPushButton(u'风控模块未启动') + + self.spinOrderFlowLimit = RmSpinBox(self.rmEngine.orderFlowLimit) + self.spinOrderFlowClear = RmSpinBox(self.rmEngine.orderFlowClear) + self.spinOrderSizeLimit = RmSpinBox(self.rmEngine.orderSizeLimit) + self.spinTradeLimit = RmSpinBox(self.rmEngine.tradeLimit) + self.spinWorkingOrderLimit = RmSpinBox(self.rmEngine.workingOrderLimit) + + buttonClearOrderFlowCount = QtGui.QPushButton(u'清空流控计数') + buttonClearTradeCount = QtGui.QPushButton(u'清空总成交计数') + buttonSaveSetting = QtGui.QPushButton(u'保存设置') + + Label = QtGui.QLabel + grid = QtGui.QGridLayout() + grid.addWidget(Label(u'工作状态'), 0, 0) + grid.addWidget(self.buttonSwitchEngineStatus, 0, 1) + grid.addWidget(RmLine(), 1, 0, 1, 2) + grid.addWidget(Label(u'流控上限'), 2, 0) + grid.addWidget(self.spinOrderFlowLimit, 2, 1) + grid.addWidget(Label(u'流控清空(秒)'), 3, 0) + grid.addWidget(self.spinOrderFlowClear, 3, 1) + grid.addWidget(RmLine(), 4, 0, 1, 2) + grid.addWidget(Label(u'单笔委托上限'), 5, 0) + grid.addWidget(self.spinOrderSizeLimit, 5, 1) + grid.addWidget(RmLine(), 6, 0, 1, 2) + grid.addWidget(Label(u'总成交上限'), 7, 0) + grid.addWidget(self.spinTradeLimit, 7, 1) + grid.addWidget(RmLine(), 8, 0, 1, 2) + grid.addWidget(Label(u'活动订单上限'), 9, 0) + grid.addWidget(self.spinWorkingOrderLimit, 9, 1) + + hbox = QtGui.QHBoxLayout() + hbox.addWidget(buttonClearOrderFlowCount) + hbox.addWidget(buttonClearTradeCount) + hbox.addStretch() + hbox.addWidget(buttonSaveSetting) + + vbox = QtGui.QVBoxLayout() + vbox.addLayout(grid) + vbox.addLayout(hbox) + self.setLayout(vbox) + + # 连接组件信号 + self.spinOrderFlowLimit.valueChanged.connect(self.rmEngine.setOrderFlowLimit) + self.spinOrderFlowClear.valueChanged.connect(self.rmEngine.setOrderFlowClear) + self.spinOrderSizeLimit.valueChanged.connect(self.rmEngine.setOrderSizeLimit) + self.spinTradeLimit.valueChanged.connect(self.rmEngine.setTradeLimit) + self.spinWorkingOrderLimit.valueChanged.connect(self.rmEngine.setWorkingOrderLimit) + + self.buttonSwitchEngineStatus.clicked.connect(self.switchEngineSatus) + buttonClearOrderFlowCount.clicked.connect(self.rmEngine.clearOrderFlowCount) + buttonClearTradeCount.clicked.connect(self.rmEngine.clearTradeCount) + buttonSaveSetting.clicked.connect(self.rmEngine.saveSetting) + + # 设为固定大小 + self.setFixedSize(self.sizeHint()) + + #---------------------------------------------------------------------- + def switchEngineSatus(self): + """控制风控引擎开关""" + self.rmEngine.switchEngineStatus() + self.updateEngineStatus() + + #---------------------------------------------------------------------- + def updateEngineStatus(self): + """更新引擎状态""" + if self.rmEngine.active: + self.buttonSwitchEngineStatus.setText(u'风控模块运行中') + else: + self.buttonSwitchEngineStatus.setText(u'风控模块未启动') + + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/uiBasicWidget.py b/vn.how/tick2trade/vn.trader_t2t/uiBasicWidget.py new file mode 100644 index 0000000000..d28b48bf47 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/uiBasicWidget.py @@ -0,0 +1,1143 @@ +# encoding: UTF-8 + +import json +import csv +import os +from collections import OrderedDict + +from PyQt4 import QtGui, QtCore + +from eventEngine import * +from vtFunction import * +from vtGateway import * + + +#---------------------------------------------------------------------- +def loadFont(): + """载入字体设置""" + fileName = 'VT_setting.json' + path = os.path.abspath(os.path.dirname(__file__)) + fileName = os.path.join(path, fileName) + + try: + f = file(fileName) + setting = json.load(f) + family = setting['fontFamily'] + size = setting['fontSize'] + font = QtGui.QFont(family, size) + except: + font = QtGui.QFont(u'微软雅黑', 12) + return font + +BASIC_FONT = loadFont() + + +######################################################################## +class BasicCell(QtGui.QTableWidgetItem): + """基础的单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(BasicCell, self).__init__() + self.data = None + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + if text == '0' or text == '0.0': + self.setText('') + else: + self.setText(text) + + +######################################################################## +class NumCell(QtGui.QTableWidgetItem): + """用来显示数字的单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(NumCell, self).__init__() + self.data = None + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + # 考虑到NumCell主要用来显示OrderID和TradeID之类的整数字段, + # 这里的数据转化方式使用int类型。但是由于部分交易接口的委托 + # 号和成交号可能不是纯数字的形式,因此补充了一个try...except + try: + num = int(text) + self.setData(QtCore.Qt.DisplayRole, num) + except ValueError: + self.setText(text) + + +######################################################################## +class DirectionCell(QtGui.QTableWidgetItem): + """用来显示买卖方向的单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(DirectionCell, self).__init__() + self.data = None + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + if text == DIRECTION_LONG or text == DIRECTION_NET: + self.setForeground(QtGui.QColor('red')) + elif text == DIRECTION_SHORT: + self.setForeground(QtGui.QColor('green')) + self.setText(text) + + +######################################################################## +class NameCell(QtGui.QTableWidgetItem): + """用来显示合约中文的单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(NameCell, self).__init__() + + self.mainEngine = mainEngine + self.data = None + + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + if self.mainEngine: + # 首先尝试正常获取合约对象 + contract = self.mainEngine.getContract(text) + + # 如果能读取合约信息 + if contract: + self.setText(contract.name) + + +######################################################################## +class BidCell(QtGui.QTableWidgetItem): + """买价单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(BidCell, self).__init__() + self.data = None + + self.setForeground(QtGui.QColor('black')) + self.setBackground(QtGui.QColor(255,174,201)) + + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + self.setText(text) + + +######################################################################## +class AskCell(QtGui.QTableWidgetItem): + """买价单元格""" + + #---------------------------------------------------------------------- + def __init__(self, text=None, mainEngine=None): + """Constructor""" + super(AskCell, self).__init__() + self.data = None + + self.setForeground(QtGui.QColor('black')) + self.setBackground(QtGui.QColor(160,255,160)) + + if text: + self.setContent(text) + + #---------------------------------------------------------------------- + def setContent(self, text): + """设置内容""" + self.setText(text) + + +######################################################################## +class BasicMonitor(QtGui.QTableWidget): + """ + 基础监控 + + headerDict中的值对应的字典格式如下 + {'chinese': u'中文名', 'cellType': BasicCell} + + """ + signal = QtCore.pyqtSignal(type(Event())) + + #---------------------------------------------------------------------- + def __init__(self, mainEngine=None, eventEngine=None, parent=None): + """Constructor""" + super(BasicMonitor, self).__init__(parent) + + self.mainEngine = mainEngine + self.eventEngine = eventEngine + + # 保存表头标签用 + self.headerDict = OrderedDict() # 有序字典,key是英文名,value是对应的配置字典 + self.headerList = [] # 对应self.headerDict.keys() + + # 保存相关数据用 + self.dataDict = {} # 字典,key是字段对应的数据,value是保存相关单元格的字典 + self.dataKey = '' # 字典键对应的数据字段 + + # 监控的事件类型 + self.eventType = '' + + # 字体 + self.font = None + + # 保存数据对象到单元格 + self.saveData = False + + # 默认不允许根据表头进行排序,需要的组件可以开启 + self.sorting = False + + # 初始化右键菜单 + self.initMenu() + + #---------------------------------------------------------------------- + def setHeaderDict(self, headerDict): + """设置表头有序字典""" + self.headerDict = headerDict + self.headerList = headerDict.keys() + + #---------------------------------------------------------------------- + def setDataKey(self, dataKey): + """设置数据字典的键""" + self.dataKey = dataKey + + #---------------------------------------------------------------------- + def setEventType(self, eventType): + """设置监控的事件类型""" + self.eventType = eventType + + #---------------------------------------------------------------------- + def setFont(self, font): + """设置字体""" + self.font = font + + #---------------------------------------------------------------------- + def setSaveData(self, saveData): + """设置是否要保存数据到单元格""" + self.saveData = saveData + + #---------------------------------------------------------------------- + def initTable(self): + """初始化表格""" + # 设置表格的列数 + col = len(self.headerDict) + self.setColumnCount(col) + + # 设置列表头 + labels = [d['chinese'] for d in self.headerDict.values()] + self.setHorizontalHeaderLabels(labels) + + # 关闭左边的垂直表头 + self.verticalHeader().setVisible(False) + + # 设为不可编辑 + self.setEditTriggers(self.NoEditTriggers) + + # 设为行交替颜色 + self.setAlternatingRowColors(True) + + # 设置允许排序 + self.setSortingEnabled(self.sorting) + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册GUI更新相关的事件监听""" + self.signal.connect(self.updateEvent) + self.eventEngine.register(self.eventType, self.signal.emit) + + #---------------------------------------------------------------------- + def updateEvent(self, event): + """收到事件更新""" + data = event.dict_['data'] + self.updateData(data) + + #---------------------------------------------------------------------- + def updateData(self, data): + """将数据更新到表格中""" + # 如果允许了排序功能,则插入数据前必须关闭,否则插入新的数据会变乱 + if self.sorting: + self.setSortingEnabled(False) + + # 如果设置了dataKey,则采用存量更新模式 + if self.dataKey: + key = data.__getattribute__(self.dataKey) + # 如果键在数据字典中不存在,则先插入新的一行,并创建对应单元格 + if key not in self.dataDict: + self.insertRow(0) + d = {} + for n, header in enumerate(self.headerList): + content = safeUnicode(data.__getattribute__(header)) + cellType = self.headerDict[header]['cellType'] + cell = cellType(content, self.mainEngine) + + if self.font: + cell.setFont(self.font) # 如果设置了特殊字体,则进行单元格设置 + + if self.saveData: # 如果设置了保存数据对象,则进行对象保存 + cell.data = data + + self.setItem(0, n, cell) + d[header] = cell + self.dataDict[key] = d + # 否则如果已经存在,则直接更新相关单元格 + else: + d = self.dataDict[key] + for header in self.headerList: + content = safeUnicode(data.__getattribute__(header)) + cell = d[header] + cell.setContent(content) + + if self.saveData: # 如果设置了保存数据对象,则进行对象保存 + cell.data = data + # 否则采用增量更新模式 + else: + self.insertRow(0) + for n, header in enumerate(self.headerList): + content = safeUnicode(data.__getattribute__(header)) + cellType = self.headerDict[header]['cellType'] + cell = cellType(content, self.mainEngine) + + if self.font: + cell.setFont(self.font) + + if self.saveData: + cell.data = data + + self.setItem(0, n, cell) + + # 调整列宽 + self.resizeColumns() + + # 重新打开排序 + if self.sorting: + self.setSortingEnabled(True) + + #---------------------------------------------------------------------- + def resizeColumns(self): + """调整各列的大小""" + self.horizontalHeader().resizeSections(QtGui.QHeaderView.ResizeToContents) + + #---------------------------------------------------------------------- + def setSorting(self, sorting): + """设置是否允许根据表头排序""" + self.sorting = sorting + + #---------------------------------------------------------------------- + def saveToCsv(self): + """保存表格内容到CSV文件""" + # 先隐藏右键菜单 + self.menu.close() + + # 获取想要保存的文件名 + path = QtGui.QFileDialog.getSaveFileName(self, '保存数据', '', 'CSV(*.csv)') + + try: + if not path.isEmpty(): + with open(unicode(path), 'wb') as f: + writer = csv.writer(f) + + # 保存标签 + headers = [header.encode('gbk') for header in self.headerList] + writer.writerow(headers) + + # 保存每行内容 + for row in range(self.rowCount()): + rowdata = [] + for column in range(self.columnCount()): + item = self.item(row, column) + if item is not None: + rowdata.append( + unicode(item.text()).encode('gbk')) + else: + rowdata.append('') + writer.writerow(rowdata) + except IOError: + pass + + #---------------------------------------------------------------------- + def initMenu(self): + """初始化右键菜单""" + self.menu = QtGui.QMenu(self) + + saveAction = QtGui.QAction(u'保存内容', self) + saveAction.triggered.connect(self.saveToCsv) + + self.menu.addAction(saveAction) + + #---------------------------------------------------------------------- + def contextMenuEvent(self, event): + """右键点击事件""" + self.menu.popup(QtGui.QCursor.pos()) + + +######################################################################## +class MarketMonitor(BasicMonitor): + """市场监控组件""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(MarketMonitor, self).__init__(mainEngine, eventEngine, parent) + + # 设置表头有序字典 + d = OrderedDict() + d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell} + d['vtSymbol'] = {'chinese':u'名称', 'cellType':NameCell} + d['lastPrice'] = {'chinese':u'最新价', 'cellType':BasicCell} + d['preClosePrice'] = {'chinese':u'昨收盘价', 'cellType':BasicCell} + d['volume'] = {'chinese':u'成交量', 'cellType':BasicCell} + d['openInterest'] = {'chinese':u'持仓量', 'cellType':BasicCell} + d['openPrice'] = {'chinese':u'开盘价', 'cellType':BasicCell} + d['highPrice'] = {'chinese':u'最高价', 'cellType':BasicCell} + d['lowPrice'] = {'chinese':u'最低价', 'cellType':BasicCell} + d['bidPrice1'] = {'chinese':u'买一价', 'cellType':BidCell} + d['bidVolume1'] = {'chinese':u'买一量', 'cellType':BidCell} + d['askPrice1'] = {'chinese':u'卖一价', 'cellType':AskCell} + d['askVolume1'] = {'chinese':u'卖一量', 'cellType':AskCell} + d['time'] = {'chinese':u'时间', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + # 设置数据键 + self.setDataKey('vtSymbol') + + # 设置监控事件类型 + self.setEventType(EVENT_TICK) + + # 设置字体 + self.setFont(BASIC_FONT) + + # 设置允许排序 + self.setSorting(True) + + # 初始化表格 + self.initTable() + + # 注册事件监听 + self.registerEvent() + + +######################################################################## +class LogMonitor(BasicMonitor): + """日志监控""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(LogMonitor, self).__init__(mainEngine, eventEngine, parent) + + d = OrderedDict() + d['logTime'] = {'chinese':u'时间', 'cellType':BasicCell} + d['logContent'] = {'chinese':u'内容', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.setEventType(EVENT_LOG) + self.setFont(BASIC_FONT) + self.initTable() + self.registerEvent() + + +######################################################################## +class ErrorMonitor(BasicMonitor): + """错误监控""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(ErrorMonitor, self).__init__(mainEngine, eventEngine, parent) + + d = OrderedDict() + d['errorTime'] = {'chinese':u'错误时间', 'cellType':BasicCell} + d['errorID'] = {'chinese':u'错误代码', 'cellType':BasicCell} + d['errorMsg'] = {'chinese':u'错误信息', 'cellType':BasicCell} + d['additionalInfo'] = {'chinese':u'补充信息', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.setEventType(EVENT_ERROR) + self.setFont(BASIC_FONT) + self.initTable() + self.registerEvent() + + +######################################################################## +class TradeMonitor(BasicMonitor): + """成交监控""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(TradeMonitor, self).__init__(mainEngine, eventEngine, parent) + + d = OrderedDict() + d['tradeID'] = {'chinese':u'成交编号', 'cellType':NumCell} + d['orderID'] = {'chinese':u'委托编号', 'cellType':NumCell} + d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell} + d['vtSymbol'] = {'chinese':u'名称', 'cellType':NameCell} + d['direction'] = {'chinese':u'方向', 'cellType':DirectionCell} + d['offset'] = {'chinese':u'开平', 'cellType':BasicCell} + d['price'] = {'chinese':u'价格', 'cellType':BasicCell} + d['volume'] = {'chinese':u'数量', 'cellType':BasicCell} + d['tradeTime'] = {'chinese':u'成交时间', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.setEventType(EVENT_TRADE) + self.setFont(BASIC_FONT) + self.setSorting(True) + + self.initTable() + self.registerEvent() + + +######################################################################## +class OrderMonitor(BasicMonitor): + """委托监控""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(OrderMonitor, self).__init__(mainEngine, eventEngine, parent) + + self.mainEngine = mainEngine + + d = OrderedDict() + d['orderID'] = {'chinese':u'委托编号', 'cellType':NumCell} + d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell} + d['vtSymbol'] = {'chinese':u'名称', 'cellType':NameCell} + d['direction'] = {'chinese':u'方向', 'cellType':DirectionCell} + d['offset'] = {'chinese':u'开平', 'cellType':BasicCell} + d['price'] = {'chinese':u'价格', 'cellType':BasicCell} + d['totalVolume'] = {'chinese':u'委托数量', 'cellType':BasicCell} + d['tradedVolume'] = {'chinese':u'成交数量', 'cellType':BasicCell} + d['status'] = {'chinese':u'状态', 'cellType':BasicCell} + d['orderTime'] = {'chinese':u'委托时间', 'cellType':BasicCell} + d['cancelTime'] = {'chinese':u'撤销时间', 'cellType':BasicCell} + d['frontID'] = {'chinese':u'前置编号', 'cellType':BasicCell} + d['sessionID'] = {'chinese':u'会话编号', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.setDataKey('vtOrderID') + self.setEventType(EVENT_ORDER) + self.setFont(BASIC_FONT) + self.setSaveData(True) + self.setSorting(True) + + self.initTable() + self.registerEvent() + self.connectSignal() + + #---------------------------------------------------------------------- + def connectSignal(self): + """连接信号""" + # 双击单元格撤单 + self.itemDoubleClicked.connect(self.cancelOrder) + + #---------------------------------------------------------------------- + def cancelOrder(self, cell): + """根据单元格的数据撤单""" + order = cell.data + + req = VtCancelOrderReq() + req.symbol = order.symbol + req.exchange = order.exchange + req.frontID = order.frontID + req.sessionID = order.sessionID + req.orderID = order.orderID + self.mainEngine.cancelOrder(req, order.gatewayName) + + +######################################################################## +class PositionMonitor(BasicMonitor): + """持仓监控""" + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(PositionMonitor, self).__init__(mainEngine, eventEngine, parent) + + d = OrderedDict() + d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell} + d['vtSymbol'] = {'chinese':u'名称', 'cellType':NameCell} + d['direction'] = {'chinese':u'方向', 'cellType':DirectionCell} + d['position'] = {'chinese':u'持仓量', 'cellType':BasicCell} + d['ydPosition'] = {'chinese':u'昨持仓', 'cellType':BasicCell} + d['frozen'] = {'chinese':u'冻结量', 'cellType':BasicCell} + d['price'] = {'chinese':u'价格', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.setDataKey('vtPositionName') + self.setEventType(EVENT_POSITION) + self.setFont(BASIC_FONT) + self.setSaveData(True) + + self.initTable() + self.registerEvent() + + +######################################################################## +class AccountMonitor(BasicMonitor): + """账户监控""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(AccountMonitor, self).__init__(mainEngine, eventEngine, parent) + + d = OrderedDict() + d['accountID'] = {'chinese':u'账户', 'cellType':BasicCell} + d['preBalance'] = {'chinese':u'昨结', 'cellType':BasicCell} + d['balance'] = {'chinese':u'净值', 'cellType':BasicCell} + d['available'] = {'chinese':u'可用', 'cellType':BasicCell} + d['commission'] = {'chinese':u'手续费', 'cellType':BasicCell} + d['margin'] = {'chinese':u'保证金', 'cellType':BasicCell} + d['closeProfit'] = {'chinese':u'平仓盈亏', 'cellType':BasicCell} + d['positionProfit'] = {'chinese':u'持仓盈亏', 'cellType':BasicCell} + d['gatewayName'] = {'chinese':u'接口', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.setDataKey('vtAccountID') + self.setEventType(EVENT_ACCOUNT) + self.setFont(BASIC_FONT) + self.initTable() + self.registerEvent() + + +######################################################################## +class TradingWidget(QtGui.QFrame): + """简单交易组件""" + signal = QtCore.pyqtSignal(type(Event())) + + directionList = [DIRECTION_LONG, + DIRECTION_SHORT] + + offsetList = [OFFSET_OPEN, + OFFSET_CLOSE, + OFFSET_CLOSEYESTERDAY, + OFFSET_CLOSETODAY] + + priceTypeList = [PRICETYPE_LIMITPRICE, + PRICETYPE_MARKETPRICE, + PRICETYPE_FAK, + PRICETYPE_FOK] + + exchangeList = [EXCHANGE_NONE, + EXCHANGE_CFFEX, + EXCHANGE_SHFE, + EXCHANGE_DCE, + EXCHANGE_CZCE, + EXCHANGE_SSE, + EXCHANGE_SZSE, + EXCHANGE_SGE, + EXCHANGE_HKEX, + EXCHANGE_SMART, + EXCHANGE_ICE, + EXCHANGE_CME, + EXCHANGE_NYMEX, + EXCHANGE_GLOBEX, + EXCHANGE_IDEALPRO] + + currencyList = [CURRENCY_NONE, + CURRENCY_CNY, + CURRENCY_USD] + + productClassList = [PRODUCT_NONE, + PRODUCT_EQUITY, + PRODUCT_FUTURES, + PRODUCT_OPTION, + PRODUCT_FOREX] + + gatewayList = [''] + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine, parent=None): + """Constructor""" + super(TradingWidget, self).__init__(parent) + self.mainEngine = mainEngine + self.eventEngine = eventEngine + + self.symbol = '' + + # 添加交易接口 + self.gatewayList.extend(mainEngine.gatewayDict.keys()) + + self.initUi() + self.connectSignal() + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setWindowTitle(u'交易') + self.setMaximumWidth(400) + self.setFrameShape(self.Box) # 设置边框 + self.setLineWidth(1) + + # 左边部分 + labelSymbol = QtGui.QLabel(u'代码') + labelName = QtGui.QLabel(u'名称') + labelDirection = QtGui.QLabel(u'方向类型') + labelOffset = QtGui.QLabel(u'开平') + labelPrice = QtGui.QLabel(u'价格') + labelVolume = QtGui.QLabel(u'数量') + labelPriceType = QtGui.QLabel(u'价格类型') + labelExchange = QtGui.QLabel(u'交易所') + labelCurrency = QtGui.QLabel(u'货币') + labelProductClass = QtGui.QLabel(u'产品类型') + labelGateway = QtGui.QLabel(u'交易接口') + + self.lineSymbol = QtGui.QLineEdit() + self.lineName = QtGui.QLineEdit() + + self.comboDirection = QtGui.QComboBox() + self.comboDirection.addItems(self.directionList) + + self.comboOffset = QtGui.QComboBox() + self.comboOffset.addItems(self.offsetList) + + self.spinPrice = QtGui.QDoubleSpinBox() + self.spinPrice.setDecimals(4) + self.spinPrice.setMinimum(0) + self.spinPrice.setMaximum(100000) + + self.spinVolume = QtGui.QSpinBox() + self.spinVolume.setMinimum(0) + self.spinVolume.setMaximum(1000000) + + self.comboPriceType = QtGui.QComboBox() + self.comboPriceType.addItems(self.priceTypeList) + + self.comboExchange = QtGui.QComboBox() + self.comboExchange.addItems(self.exchangeList) + + self.comboCurrency = QtGui.QComboBox() + self.comboCurrency.addItems(self.currencyList) + + self.comboProductClass = QtGui.QComboBox() + self.comboProductClass.addItems(self.productClassList) + + self.comboGateway = QtGui.QComboBox() + self.comboGateway.addItems(self.gatewayList) + + gridleft = QtGui.QGridLayout() + gridleft.addWidget(labelSymbol, 0, 0) + gridleft.addWidget(labelName, 1, 0) + gridleft.addWidget(labelDirection, 2, 0) + gridleft.addWidget(labelOffset, 3, 0) + gridleft.addWidget(labelPrice, 4, 0) + gridleft.addWidget(labelVolume, 5, 0) + gridleft.addWidget(labelPriceType, 6, 0) + gridleft.addWidget(labelExchange, 7, 0) + gridleft.addWidget(labelCurrency, 8, 0) + gridleft.addWidget(labelProductClass, 9, 0) + gridleft.addWidget(labelGateway, 10, 0) + + gridleft.addWidget(self.lineSymbol, 0, 1) + gridleft.addWidget(self.lineName, 1, 1) + gridleft.addWidget(self.comboDirection, 2, 1) + gridleft.addWidget(self.comboOffset, 3, 1) + gridleft.addWidget(self.spinPrice, 4, 1) + gridleft.addWidget(self.spinVolume, 5, 1) + gridleft.addWidget(self.comboPriceType, 6, 1) + gridleft.addWidget(self.comboExchange, 7, 1) + gridleft.addWidget(self.comboCurrency, 8, 1) + gridleft.addWidget(self.comboProductClass, 9, 1) + gridleft.addWidget(self.comboGateway, 10, 1) + + # 右边部分 + labelBid1 = QtGui.QLabel(u'买一') + labelBid2 = QtGui.QLabel(u'买二') + labelBid3 = QtGui.QLabel(u'买三') + labelBid4 = QtGui.QLabel(u'买四') + labelBid5 = QtGui.QLabel(u'买五') + + labelAsk1 = QtGui.QLabel(u'卖一') + labelAsk2 = QtGui.QLabel(u'卖二') + labelAsk3 = QtGui.QLabel(u'卖三') + labelAsk4 = QtGui.QLabel(u'卖四') + labelAsk5 = QtGui.QLabel(u'卖五') + + self.labelBidPrice1 = QtGui.QLabel() + self.labelBidPrice2 = QtGui.QLabel() + self.labelBidPrice3 = QtGui.QLabel() + self.labelBidPrice4 = QtGui.QLabel() + self.labelBidPrice5 = QtGui.QLabel() + self.labelBidVolume1 = QtGui.QLabel() + self.labelBidVolume2 = QtGui.QLabel() + self.labelBidVolume3 = QtGui.QLabel() + self.labelBidVolume4 = QtGui.QLabel() + self.labelBidVolume5 = QtGui.QLabel() + + self.labelAskPrice1 = QtGui.QLabel() + self.labelAskPrice2 = QtGui.QLabel() + self.labelAskPrice3 = QtGui.QLabel() + self.labelAskPrice4 = QtGui.QLabel() + self.labelAskPrice5 = QtGui.QLabel() + self.labelAskVolume1 = QtGui.QLabel() + self.labelAskVolume2 = QtGui.QLabel() + self.labelAskVolume3 = QtGui.QLabel() + self.labelAskVolume4 = QtGui.QLabel() + self.labelAskVolume5 = QtGui.QLabel() + + labelLast = QtGui.QLabel(u'最新') + self.labelLastPrice = QtGui.QLabel() + self.labelReturn = QtGui.QLabel() + + self.labelLastPrice.setMinimumWidth(60) + self.labelReturn.setMinimumWidth(60) + + gridRight = QtGui.QGridLayout() + gridRight.addWidget(labelAsk5, 0, 0) + gridRight.addWidget(labelAsk4, 1, 0) + gridRight.addWidget(labelAsk3, 2, 0) + gridRight.addWidget(labelAsk2, 3, 0) + gridRight.addWidget(labelAsk1, 4, 0) + gridRight.addWidget(labelLast, 5, 0) + gridRight.addWidget(labelBid1, 6, 0) + gridRight.addWidget(labelBid2, 7, 0) + gridRight.addWidget(labelBid3, 8, 0) + gridRight.addWidget(labelBid4, 9, 0) + gridRight.addWidget(labelBid5, 10, 0) + + gridRight.addWidget(self.labelAskPrice5, 0, 1) + gridRight.addWidget(self.labelAskPrice4, 1, 1) + gridRight.addWidget(self.labelAskPrice3, 2, 1) + gridRight.addWidget(self.labelAskPrice2, 3, 1) + gridRight.addWidget(self.labelAskPrice1, 4, 1) + gridRight.addWidget(self.labelLastPrice, 5, 1) + gridRight.addWidget(self.labelBidPrice1, 6, 1) + gridRight.addWidget(self.labelBidPrice2, 7, 1) + gridRight.addWidget(self.labelBidPrice3, 8, 1) + gridRight.addWidget(self.labelBidPrice4, 9, 1) + gridRight.addWidget(self.labelBidPrice5, 10, 1) + + gridRight.addWidget(self.labelAskVolume5, 0, 2) + gridRight.addWidget(self.labelAskVolume4, 1, 2) + gridRight.addWidget(self.labelAskVolume3, 2, 2) + gridRight.addWidget(self.labelAskVolume2, 3, 2) + gridRight.addWidget(self.labelAskVolume1, 4, 2) + gridRight.addWidget(self.labelReturn, 5, 2) + gridRight.addWidget(self.labelBidVolume1, 6, 2) + gridRight.addWidget(self.labelBidVolume2, 7, 2) + gridRight.addWidget(self.labelBidVolume3, 8, 2) + gridRight.addWidget(self.labelBidVolume4, 9, 2) + gridRight.addWidget(self.labelBidVolume5, 10, 2) + + # 发单按钮 + buttonSendOrder = QtGui.QPushButton(u'发单') + buttonCancelAll = QtGui.QPushButton(u'全撤') + + size = buttonSendOrder.sizeHint() + buttonSendOrder.setMinimumHeight(size.height()*2) # 把按钮高度设为默认两倍 + buttonCancelAll.setMinimumHeight(size.height()*2) + + # 整合布局 + hbox = QtGui.QHBoxLayout() + hbox.addLayout(gridleft) + hbox.addLayout(gridRight) + + vbox = QtGui.QVBoxLayout() + vbox.addLayout(hbox) + vbox.addWidget(buttonSendOrder) + vbox.addWidget(buttonCancelAll) + vbox.addStretch() + + self.setLayout(vbox) + + # 关联更新 + buttonSendOrder.clicked.connect(self.sendOrder) + buttonCancelAll.clicked.connect(self.cancelAll) + self.lineSymbol.returnPressed.connect(self.updateSymbol) + + #---------------------------------------------------------------------- + def updateSymbol(self): + """合约变化""" + # 读取组件数据 + symbol = str(self.lineSymbol.text()) + exchange = unicode(self.comboExchange.currentText()) + currency = unicode(self.comboCurrency.currentText()) + productClass = unicode(self.comboProductClass.currentText()) + gatewayName = unicode(self.comboGateway.currentText()) + + # 查询合约 + if exchange: + vtSymbol = '.'.join([symbol, exchange]) + contract = self.mainEngine.getContract(vtSymbol) + else: + vtSymbol = symbol + contract = self.mainEngine.getContract(symbol) + + if contract: + vtSymbol = contract.vtSymbol + gatewayName = contract.gatewayName + self.lineName.setText(contract.name) + exchange = contract.exchange # 保证有交易所代码 + + # 清空价格数量 + self.spinPrice.setValue(0) + self.spinVolume.setValue(0) + + # 清空行情显示 + self.labelBidPrice1.setText('') + self.labelBidPrice2.setText('') + self.labelBidPrice3.setText('') + self.labelBidPrice4.setText('') + self.labelBidPrice5.setText('') + self.labelBidVolume1.setText('') + self.labelBidVolume2.setText('') + self.labelBidVolume3.setText('') + self.labelBidVolume4.setText('') + self.labelBidVolume5.setText('') + self.labelAskPrice1.setText('') + self.labelAskPrice2.setText('') + self.labelAskPrice3.setText('') + self.labelAskPrice4.setText('') + self.labelAskPrice5.setText('') + self.labelAskVolume1.setText('') + self.labelAskVolume2.setText('') + self.labelAskVolume3.setText('') + self.labelAskVolume4.setText('') + self.labelAskVolume5.setText('') + self.labelLastPrice.setText('') + self.labelReturn.setText('') + + # 重新注册事件监听 + self.eventEngine.unregister(EVENT_TICK + self.symbol, self.signal.emit) + self.eventEngine.register(EVENT_TICK + vtSymbol, self.signal.emit) + + # 订阅合约 + req = VtSubscribeReq() + req.symbol = symbol + req.exchange = exchange + req.currency = currency + req.productClass = productClass + + self.mainEngine.subscribe(req, gatewayName) + + # 更新组件当前交易的合约 + self.symbol = vtSymbol + + #---------------------------------------------------------------------- + def updateTick(self, event): + """更新行情""" + tick = event.dict_['data'] + + if tick.vtSymbol == self.symbol: + self.labelBidPrice1.setText(str(tick.bidPrice1)) + self.labelAskPrice1.setText(str(tick.askPrice1)) + self.labelBidVolume1.setText(str(tick.bidVolume1)) + self.labelAskVolume1.setText(str(tick.askVolume1)) + + if tick.bidPrice2: + self.labelBidPrice2.setText(str(tick.bidPrice2)) + self.labelBidPrice3.setText(str(tick.bidPrice3)) + self.labelBidPrice4.setText(str(tick.bidPrice4)) + self.labelBidPrice5.setText(str(tick.bidPrice5)) + + self.labelAskPrice2.setText(str(tick.askPrice2)) + self.labelAskPrice3.setText(str(tick.askPrice3)) + self.labelAskPrice4.setText(str(tick.askPrice4)) + self.labelAskPrice5.setText(str(tick.askPrice5)) + + self.labelBidVolume2.setText(str(tick.bidVolume2)) + self.labelBidVolume3.setText(str(tick.bidVolume3)) + self.labelBidVolume4.setText(str(tick.bidVolume4)) + self.labelBidVolume5.setText(str(tick.bidVolume5)) + + self.labelAskVolume2.setText(str(tick.askVolume2)) + self.labelAskVolume3.setText(str(tick.askVolume3)) + self.labelAskVolume4.setText(str(tick.askVolume4)) + self.labelAskVolume5.setText(str(tick.askVolume5)) + + self.labelLastPrice.setText(str(tick.lastPrice)) + + if tick.preClosePrice: + rt = (tick.lastPrice/tick.preClosePrice)-1 + self.labelReturn.setText(('%.2f' %(rt*100))+'%') + else: + self.labelReturn.setText('') + + #---------------------------------------------------------------------- + def connectSignal(self): + """连接Signal""" + self.signal.connect(self.updateTick) + + #---------------------------------------------------------------------- + def sendOrder(self): + """发单""" + symbol = str(self.lineSymbol.text()) + exchange = unicode(self.comboExchange.currentText()) + currency = unicode(self.comboCurrency.currentText()) + productClass = unicode(self.comboProductClass.currentText()) + gatewayName = unicode(self.comboGateway.currentText()) + + # 查询合约 + if exchange: + vtSymbol = '.'.join([symbol, exchange]) + contract = self.mainEngine.getContract(vtSymbol) + else: + vtSymbol = symbol + contract = self.mainEngine.getContract(symbol) + + if contract: + gatewayName = contract.gatewayName + exchange = contract.exchange # 保证有交易所代码 + + req = VtOrderReq() + req.symbol = symbol + req.exchange = exchange + req.price = self.spinPrice.value() + req.volume = self.spinVolume.value() + req.direction = unicode(self.comboDirection.currentText()) + req.priceType = unicode(self.comboPriceType.currentText()) + req.offset = unicode(self.comboOffset.currentText()) + req.currency = currency + req.productClass = productClass + + self.mainEngine.sendOrder(req, gatewayName) + + #---------------------------------------------------------------------- + def cancelAll(self): + """一键撤销所有委托""" + l = self.mainEngine.getAllWorkingOrders() + for order in l: + req = VtCancelOrderReq() + req.symbol = order.symbol + req.exchange = order.exchange + req.frontID = order.frontID + req.sessionID = order.sessionID + req.orderID = order.orderID + self.mainEngine.cancelOrder(req, order.gatewayName) + + #---------------------------------------------------------------------- + def closePosition(self, cell): + """根据持仓信息自动填写交易组件""" + # 读取持仓数据,cell是一个表格中的单元格对象 + pos = cell.data + symbol = pos.symbol + + # 更新交易组件的显示合约 + self.lineSymbol.setText(symbol) + self.updateSymbol() + + # 自动填写信息 + self.comboPriceType.setCurrentIndex(self.priceTypeList.index(PRICETYPE_LIMITPRICE)) + self.comboOffset.setCurrentIndex(self.offsetList.index(OFFSET_CLOSE)) + self.spinVolume.setValue(pos.position) + + if pos.direction == DIRECTION_LONG or pos.direction == DIRECTION_NET: + self.comboDirection.setCurrentIndex(self.directionList.index(DIRECTION_SHORT)) + else: + self.comboDirection.setCurrentIndex(self.directionList.index(DIRECTION_LONG)) + + # 价格留待更新后由用户输入,防止有误操作 + + +######################################################################## +class ContractMonitor(BasicMonitor): + """合约查询""" + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, parent=None): + """Constructor""" + super(ContractMonitor, self).__init__(parent=parent) + + self.mainEngine = mainEngine + + d = OrderedDict() + d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell} + d['exchange'] = {'chinese':u'交易所', 'cellType':BasicCell} + d['vtSymbol'] = {'chinese':u'vt系统代码', 'cellType':BasicCell} + d['name'] = {'chinese':u'名称', 'cellType':BasicCell} + d['productClass'] = {'chinese':u'合约类型', 'cellType':BasicCell} + d['size'] = {'chinese':u'大小', 'cellType':BasicCell} + d['priceTick'] = {'chinese':u'最小价格变动', 'cellType':BasicCell} + #d['strikePrice'] = {'chinese':u'期权行权价', 'cellType':BasicCell} + #d['underlyingSymbol'] = {'chinese':u'期权标的物', 'cellType':BasicCell} + #d['optionType'] = {'chinese':u'期权类型', 'cellType':BasicCell} + self.setHeaderDict(d) + + self.initUi() + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setWindowTitle(u'合约查询') + self.setMinimumSize(800, 800) + self.setFont(BASIC_FONT) + self.initTable() + self.addMenuAction() + + #---------------------------------------------------------------------- + def showAllContracts(self): + """显示所有合约数据""" + l = self.mainEngine.getAllContracts() + d = {'.'.join([contract.exchange, contract.symbol]):contract for contract in l} + l2 = d.keys() + l2.sort(reverse=True) + + self.setRowCount(len(l2)) + row = 0 + + for key in l2: + contract = d[key] + + for n, header in enumerate(self.headerList): + content = safeUnicode(contract.__getattribute__(header)) + cellType = self.headerDict[header]['cellType'] + cell = cellType(content) + + if self.font: + cell.setFont(self.font) # 如果设置了特殊字体,则进行单元格设置 + + self.setItem(row, n, cell) + + row = row + 1 + + #---------------------------------------------------------------------- + def refresh(self): + """刷新""" + self.menu.close() # 关闭菜单 + self.clearContents() + self.setRowCount(0) + self.showAllContracts() + + #---------------------------------------------------------------------- + def addMenuAction(self): + """增加右键菜单内容""" + refreshAction = QtGui.QAction(u'刷新', self) + refreshAction.triggered.connect(self.refresh) + + self.menu.addAction(refreshAction) + + #---------------------------------------------------------------------- + def show(self): + """显示""" + super(ContractMonitor, self).show() + self.refresh() + + diff --git a/vn.how/tick2trade/vn.trader_t2t/uiMainWindow.py b/vn.how/tick2trade/vn.trader_t2t/uiMainWindow.py new file mode 100644 index 0000000000..f8804b1f50 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/uiMainWindow.py @@ -0,0 +1,413 @@ +# encoding: UTF-8 + +import psutil + +from uiBasicWidget import * +from ctaAlgo.uiCtaWidget import CtaEngineManager +from dataRecorder.uiDrWidget import DrEngineManager +from riskManager.uiRmWidget import RmEngineManager + +######################################################################## +class MainWindow(QtGui.QMainWindow): + """主窗口""" + signalStatusBar = QtCore.pyqtSignal(type(Event())) + + #---------------------------------------------------------------------- + def __init__(self, mainEngine, eventEngine): + """Constructor""" + super(MainWindow, self).__init__() + + self.mainEngine = mainEngine + self.eventEngine = eventEngine + + self.widgetDict = {} # 用来保存子窗口的字典 + + self.initUi() + self.loadWindowSettings('custom') + + #---------------------------------------------------------------------- + def initUi(self): + """初始化界面""" + self.setWindowTitle('VnTrader') + self.initCentral() + self.initMenu() + self.initStatusBar() + + #---------------------------------------------------------------------- + def initCentral(self): + """初始化中心区域""" + widgetMarketM, dockMarketM = self.createDock(MarketMonitor, u'行情', QtCore.Qt.RightDockWidgetArea) + widgetLogM, dockLogM = self.createDock(LogMonitor, u'日志', QtCore.Qt.BottomDockWidgetArea) + widgetErrorM, dockErrorM = self.createDock(ErrorMonitor, u'错误', QtCore.Qt.BottomDockWidgetArea) + widgetTradeM, dockTradeM = self.createDock(TradeMonitor, u'成交', QtCore.Qt.BottomDockWidgetArea) + widgetOrderM, dockOrderM = self.createDock(OrderMonitor, u'委托', QtCore.Qt.RightDockWidgetArea) + widgetPositionM, dockPositionM = self.createDock(PositionMonitor, u'持仓', QtCore.Qt.BottomDockWidgetArea) + widgetAccountM, dockAccountM = self.createDock(AccountMonitor, u'资金', QtCore.Qt.BottomDockWidgetArea) + widgetTradingW, dockTradingW = self.createDock(TradingWidget, u'交易', QtCore.Qt.LeftDockWidgetArea) + + self.tabifyDockWidget(dockTradeM, dockErrorM) + self.tabifyDockWidget(dockTradeM, dockLogM) + self.tabifyDockWidget(dockPositionM, dockAccountM) + + dockTradeM.raise_() + dockPositionM.raise_() + + # 连接组件之间的信号 + widgetPositionM.itemDoubleClicked.connect(widgetTradingW.closePosition) + + # 保存默认设置 + self.saveWindowSettings('default') + + #---------------------------------------------------------------------- + def initMenu(self): + """初始化菜单""" + # 创建操作 + connectCtpAction = QtGui.QAction(u'连接CTP', self) + connectCtpAction.triggered.connect(self.connectCtp) + + connectLtsAction = QtGui.QAction(u'连接LTS', self) + connectLtsAction.triggered.connect(self.connectLts) + + connectKsotpAction = QtGui.QAction(u'连接金仕达期权', self) + connectKsotpAction.triggered.connect(self.connectKsotp) + + connectFemasAction = QtGui.QAction(u'连接飞马', self) + connectFemasAction.triggered.connect(self.connectFemas) + + connectXspeedAction = QtGui.QAction(u'连接飞创', self) + connectXspeedAction.triggered.connect(self.connectXspeed) + + connectKsgoldAction = QtGui.QAction(u'连接金仕达黄金', self) + connectKsgoldAction.triggered.connect(self.connectKsgold) + + connectSgitAction = QtGui.QAction(u'连接飞鼠', self) + connectSgitAction.triggered.connect(self.connectSgit) + + connectWindAction = QtGui.QAction(u'连接Wind', self) + connectWindAction.triggered.connect(self.connectWind) + + connectIbAction = QtGui.QAction(u'连接IB', self) + connectIbAction.triggered.connect(self.connectIb) + + connectShzdAction = QtGui.QAction(u'连接直达', self) + connectShzdAction.triggered.connect(self.connectShzd) + + connectOandaAction = QtGui.QAction(u'连接OANDA', self) + connectOandaAction.triggered.connect(self.connectOanda) + + connectOkcoinAction = QtGui.QAction(u'连接OKCOIN', self) + connectOkcoinAction.triggered.connect(self.connectOkcoin) + + connectDbAction = QtGui.QAction(u'连接数据库', self) + connectDbAction.triggered.connect(self.mainEngine.dbConnect) + + testAction = QtGui.QAction(u'测试', self) + testAction.triggered.connect(self.test) + + exitAction = QtGui.QAction(u'退出', self) + exitAction.triggered.connect(self.close) + + aboutAction = QtGui.QAction(u'关于', self) + aboutAction.triggered.connect(self.openAbout) + + contractAction = QtGui.QAction(u'查询合约', self) + contractAction.triggered.connect(self.openContract) + + drAction = QtGui.QAction(u'行情数据记录', self) + drAction.triggered.connect(self.openDr) + + ctaAction = QtGui.QAction(u'CTA策略', self) + ctaAction.triggered.connect(self.openCta) + + rmAction = QtGui.QAction(u'风险管理', self) + rmAction.triggered.connect(self.openRm) + + restoreAction = QtGui.QAction(u'还原', self) + restoreAction.triggered.connect(self.restoreWindow) + + # 创建菜单 + menubar = self.menuBar() + + # 设计为只显示存在的接口 + sysMenu = menubar.addMenu(u'系统') + if 'CTP' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectCtpAction) + if 'LTS' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectLtsAction) + if 'FEMAS' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectFemasAction) + if 'XSPEED' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectXspeedAction) + if 'KSOTP' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectKsotpAction) + if 'KSGOLD' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectKsgoldAction) + if 'SGIT' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectSgitAction) + sysMenu.addSeparator() + if 'IB' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectIbAction) + if 'SHZD' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectShzdAction) + if 'OANDA' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectOandaAction) + if 'OKCOIN' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectOkcoinAction) + sysMenu.addSeparator() + if 'Wind' in self.mainEngine.gatewayDict: + sysMenu.addAction(connectWindAction) + sysMenu.addSeparator() + sysMenu.addAction(connectDbAction) + sysMenu.addSeparator() + sysMenu.addAction(exitAction) + + functionMenu = menubar.addMenu(u'功能') + functionMenu.addAction(contractAction) + functionMenu.addAction(drAction) + functionMenu.addAction(rmAction) + + # 算法相关 + algoMenu = menubar.addMenu(u'算法') + algoMenu.addAction(ctaAction) + + # 帮助 + helpMenu = menubar.addMenu(u'帮助') + helpMenu.addAction(restoreAction) + helpMenu.addAction(aboutAction) + helpMenu.addAction(testAction) + + #---------------------------------------------------------------------- + def initStatusBar(self): + """初始化状态栏""" + self.statusLabel = QtGui.QLabel() + self.statusLabel.setAlignment(QtCore.Qt.AlignLeft) + + self.statusBar().addPermanentWidget(self.statusLabel) + self.statusLabel.setText(self.getCpuMemory()) + + self.sbCount = 0 + self.sbTrigger = 10 # 10秒刷新一次 + self.signalStatusBar.connect(self.updateStatusBar) + self.eventEngine.register(EVENT_TIMER, self.signalStatusBar.emit) + + #---------------------------------------------------------------------- + def updateStatusBar(self, event): + """在状态栏更新CPU和内存信息""" + self.sbCount += 1 + + if self.sbCount == self.sbTrigger: + self.sbCount = 0 + self.statusLabel.setText(self.getCpuMemory()) + + #---------------------------------------------------------------------- + def getCpuMemory(self): + """获取CPU和内存状态信息""" + cpuPercent = psutil.cpu_percent() + memoryPercent = psutil.virtual_memory().percent + return u'CPU使用率:%d%% 内存使用率:%d%%' % (cpuPercent, memoryPercent) + + #---------------------------------------------------------------------- + def connectCtp(self): + """连接CTP接口""" + self.mainEngine.connect('CTP') + + #---------------------------------------------------------------------- + def connectLts(self): + """连接LTS接口""" + self.mainEngine.connect('LTS') + + #---------------------------------------------------------------------- + def connectKsotp(self): + """连接金仕达期权接口""" + self.mainEngine.connect('KSOTP') + + #---------------------------------------------------------------------- + def connectFemas(self): + """连接飞马接口""" + self.mainEngine.connect('FEMAS') + + #---------------------------------------------------------------------- + def connectXspeed(self): + """连接飞马接口""" + self.mainEngine.connect('XSPEED') + + #---------------------------------------------------------------------- + def connectKsgold(self): + """连接金仕达黄金接口""" + self.mainEngine.connect('KSGOLD') + + #---------------------------------------------------------------------- + def connectSgit(self): + """连接飞鼠接口""" + self.mainEngine.connect('SGIT') + + #---------------------------------------------------------------------- + def connectWind(self): + """连接Wind接口""" + self.mainEngine.connect('Wind') + + #---------------------------------------------------------------------- + def connectIb(self): + """连接Ib""" + self.mainEngine.connect('IB') + + #---------------------------------------------------------------------- + def connectShzd(self): + """连接Ib""" + self.mainEngine.connect('SHZD') + + #---------------------------------------------------------------------- + def connectOanda(self): + """连接OANDA""" + self.mainEngine.connect('OANDA') + + #---------------------------------------------------------------------- + def connectOkcoin(self): + """连接OKCOIN""" + self.mainEngine.connect('OKCOIN') + + #---------------------------------------------------------------------- + def test(self): + """测试按钮用的函数""" + # 有需要使用手动触发的测试函数可以写在这里 + pass + + #---------------------------------------------------------------------- + def openAbout(self): + """打开关于""" + try: + self.widgetDict['aboutW'].show() + except KeyError: + self.widgetDict['aboutW'] = AboutWidget(self) + self.widgetDict['aboutW'].show() + + #---------------------------------------------------------------------- + def openContract(self): + """打开合约查询""" + try: + self.widgetDict['contractM'].show() + except KeyError: + self.widgetDict['contractM'] = ContractMonitor(self.mainEngine) + self.widgetDict['contractM'].show() + + #---------------------------------------------------------------------- + def openCta(self): + """打开CTA组件""" + try: + self.widgetDict['ctaM'].showMaximized() + except KeyError: + self.widgetDict['ctaM'] = CtaEngineManager(self.mainEngine.ctaEngine, self.eventEngine) + self.widgetDict['ctaM'].showMaximized() + + #---------------------------------------------------------------------- + def openDr(self): + """打开行情数据记录组件""" + try: + self.widgetDict['drM'].showMaximized() + except KeyError: + self.widgetDict['drM'] = DrEngineManager(self.mainEngine.drEngine, self.eventEngine) + self.widgetDict['drM'].showMaximized() + + #---------------------------------------------------------------------- + def openRm(self): + """打开组件""" + try: + self.widgetDict['rmM'].show() + except KeyError: + self.widgetDict['rmM'] = RmEngineManager(self.mainEngine.rmEngine, self.eventEngine) + self.widgetDict['rmM'].show() + + #---------------------------------------------------------------------- + def closeEvent(self, event): + """关闭事件""" + reply = QtGui.QMessageBox.question(self, u'退出', + u'确认退出?', QtGui.QMessageBox.Yes | + QtGui.QMessageBox.No, QtGui.QMessageBox.No) + + if reply == QtGui.QMessageBox.Yes: + for widget in self.widgetDict.values(): + widget.close() + self.saveWindowSettings('custom') + + self.mainEngine.exit() + event.accept() + else: + event.ignore() + + #---------------------------------------------------------------------- + def createDock(self, widgetClass, widgetName, widgetArea): + """创建停靠组件""" + widget = widgetClass(self.mainEngine, self.eventEngine) + dock = QtGui.QDockWidget(widgetName) + dock.setWidget(widget) + dock.setObjectName(widgetName) + dock.setFeatures(dock.DockWidgetFloatable|dock.DockWidgetMovable) + self.addDockWidget(widgetArea, dock) + return widget, dock + + #---------------------------------------------------------------------- + def saveWindowSettings(self, settingName): + """保存窗口设置""" + settings = QtCore.QSettings('vn.trader', settingName) + settings.setValue('state', self.saveState()) + settings.setValue('geometry', self.saveGeometry()) + + #---------------------------------------------------------------------- + def loadWindowSettings(self, settingName): + """载入窗口设置""" + settings = QtCore.QSettings('vn.trader', settingName) + # 这里由于PyQt4的版本不同,settings.value('state')调用返回的结果可能是: + # 1. None(初次调用,注册表里无相应记录,因此为空) + # 2. QByteArray(比较新的PyQt4) + # 3. QVariant(以下代码正确执行所需的返回结果) + # 所以为了兼容考虑,这里加了一个try...except,如果是1、2的情况就pass + # 可能导致主界面的设置无法载入(每次退出时的保存其实是成功了) + try: + self.restoreState(settings.value('state').toByteArray()) + self.restoreGeometry(settings.value('geometry').toByteArray()) + except AttributeError: + pass + + #---------------------------------------------------------------------- + def restoreWindow(self): + """还原默认窗口设置(还原停靠组件位置)""" + self.loadWindowSettings('default') + self.showMaximized() + + +######################################################################## +class AboutWidget(QtGui.QDialog): + """显示关于信息""" + + #---------------------------------------------------------------------- + def __init__(self, parent=None): + """Constructor""" + super(AboutWidget, self).__init__(parent) + + self.initUi() + + #---------------------------------------------------------------------- + def initUi(self): + """""" + self.setWindowTitle(u'关于VnTrader') + + text = u""" + Developed by traders, for traders. + + License:MIT + + Website:www.vnpy.org + + Github:www.github.com/vnpy/vnpy + + """ + + label = QtGui.QLabel() + label.setText(text) + label.setMinimumWidth(500) + + vbox = QtGui.QVBoxLayout() + vbox.addWidget(label) + + self.setLayout(vbox) + \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/vnpy.ico b/vn.how/tick2trade/vn.trader_t2t/vnpy.ico new file mode 100644 index 0000000000..d70135991c Binary files /dev/null and b/vn.how/tick2trade/vn.trader_t2t/vnpy.ico differ diff --git a/vn.how/tick2trade/vn.trader_t2t/vtConstant.py b/vn.how/tick2trade/vn.trader_t2t/vtConstant.py new file mode 100644 index 0000000000..b401411f2e --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/vtConstant.py @@ -0,0 +1,81 @@ +# encoding: UTF-8 + +# 默认空值 +EMPTY_STRING = '' +EMPTY_UNICODE = u'' +EMPTY_INT = 0 +EMPTY_FLOAT = 0.0 + +# 方向常量 +DIRECTION_NONE = u'无方向' +DIRECTION_LONG = u'多' +DIRECTION_SHORT = u'空' +DIRECTION_UNKNOWN = u'未知' +DIRECTION_NET = u'净' +DIRECTION_SELL = u'卖出' # IB接口 + +# 开平常量 +OFFSET_NONE = u'无开平' +OFFSET_OPEN = u'开仓' +OFFSET_CLOSE = u'平仓' +OFFSET_CLOSETODAY = u'平今' +OFFSET_CLOSEYESTERDAY = u'平昨' +OFFSET_UNKNOWN = u'未知' + +# 状态常量 +STATUS_NOTTRADED = u'未成交' +STATUS_PARTTRADED = u'部分成交' +STATUS_ALLTRADED = u'全部成交' +STATUS_CANCELLED = u'已撤销' +STATUS_UNKNOWN = u'未知' + +# 合约类型常量 +PRODUCT_EQUITY = u'股票' +PRODUCT_FUTURES = u'期货' +PRODUCT_OPTION = u'期权' +PRODUCT_INDEX = u'指数' +PRODUCT_COMBINATION = u'组合' +PRODUCT_FOREX = u'外汇' +PRODUCT_UNKNOWN = u'未知' +PRODUCT_SPOT = u'现货' +PRODUCT_DEFER = u'延期' +PRODUCT_NONE = '' + +# 价格类型常量 +PRICETYPE_LIMITPRICE = u'限价' +PRICETYPE_MARKETPRICE = u'市价' +PRICETYPE_FAK = u'FAK' +PRICETYPE_FOK = u'FOK' + +# 期权类型 +OPTION_CALL = u'看涨期权' +OPTION_PUT = u'看跌期权' + +# 交易所类型 +EXCHANGE_SSE = 'SSE' # 上交所 +EXCHANGE_SZSE = 'SZSE' # 深交所 +EXCHANGE_CFFEX = 'CFFEX' # 中金所 +EXCHANGE_SHFE = 'SHFE' # 上期所 +EXCHANGE_CZCE = 'CZCE' # 郑商所 +EXCHANGE_DCE = 'DCE' # 大商所 +EXCHANGE_SGE = 'SGE' # 上金所 +EXCHANGE_UNKNOWN = 'UNKNOWN'# 未知交易所 +EXCHANGE_NONE = '' # 空交易所 +EXCHANGE_HKEX = 'HKEX' # 港交所 + +EXCHANGE_SMART = 'SMART' # IB智能路由(股票、期权) +EXCHANGE_NYMEX = 'NYMEX' # IB 期货 +EXCHANGE_GLOBEX = 'GLOBEX' # CME电子交易平台 +EXCHANGE_IDEALPRO = 'IDEALPRO' # IB外汇ECN + +EXCHANGE_CME = 'CME' # CME交易所 +EXCHANGE_ICE = 'ICE' # ICE交易所 + +EXCHANGE_OANDA = 'OANDA' # OANDA外汇做市商 +EXCHANGE_OKCOIN = 'OKCOIN' # OKCOIN比特币交易所 + +# 货币类型 +CURRENCY_USD = 'USD' # 美元 +CURRENCY_CNY = 'CNY' # 人民币 +CURRENCY_UNKNOWN = 'UNKNOWN' # 未知货币 +CURRENCY_NONE = '' # 空货币 \ No newline at end of file diff --git a/vn.how/tick2trade/vn.trader_t2t/vtEngine.py b/vn.how/tick2trade/vn.trader_t2t/vtEngine.py new file mode 100644 index 0000000000..83f2da06b1 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/vtEngine.py @@ -0,0 +1,409 @@ +# encoding: UTF-8 + +import shelve +from collections import OrderedDict + +from pymongo import MongoClient +from pymongo.errors import ConnectionFailure + +from eventEngine import * +from vtGateway import * +from vtFunction import loadMongoSetting + +from ctaAlgo.ctaEngine import CtaEngine +from dataRecorder.drEngine import DrEngine +from riskManager.rmEngine import RmEngine + + +######################################################################## +class MainEngine(object): + """主引擎""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + # 创建事件引擎 + self.eventEngine = EventEngine2() + self.eventEngine.start() + + # 创建数据引擎 + self.dataEngine = DataEngine(self.eventEngine) + + # MongoDB数据库相关 + self.dbClient = None # MongoDB客户端对象 + + # 调用一个个初始化函数 + self.initGateway() + + # 扩展模块 + self.ctaEngine = CtaEngine(self, self.eventEngine) + self.drEngine = DrEngine(self, self.eventEngine) + self.rmEngine = RmEngine(self, self.eventEngine) + + self.eventEngine.register(EVENT_TICK, self.orderTest) + + #---------------------------------------------------------------------- + def initGateway(self): + """初始化接口对象""" + # 用来保存接口对象的字典 + self.gatewayDict = OrderedDict() + + # 创建我们想要接入的接口对象 + try: + from ctpGateway.ctpGateway import CtpGateway + self.addGateway(CtpGateway, 'CTP') + self.gatewayDict['CTP'].setQryEnabled(True) + except Exception, e: + print e + + try: + from ltsGateway.ltsGateway import LtsGateway + self.addGateway(LtsGateway, 'LTS') + self.gatewayDict['LTS'].setQryEnabled(True) + except Exception, e: + print e + + try: + from xtpGateway.xtpGateway import XtpGateway + self.addGateway(XtpGateway, 'XTP') + self.gatewayDict['XTP'].setQryEnabled(True) + except Exception, e: + print e + + try: + from ksotpGateway.ksotpGateway import KsotpGateway + self.addGateway(KsotpGateway, 'KSOTP') + self.gatewayDict['KSOTP'].setQryEnabled(True) + except Exception, e: + print e + + try: + from femasGateway.femasGateway import FemasGateway + self.addGateway(FemasGateway, 'FEMAS') + self.gatewayDict['FEMAS'].setQryEnabled(True) + except Exception, e: + print e + + try: + from xspeedGateway.xspeedGateway import XspeedGateway + self.addGateway(XspeedGateway, 'XSPEED') + self.gatewayDict['XSPEED'].setQryEnabled(True) + except Exception, e: + print e + + try: + from ksgoldGateway.ksgoldGateway import KsgoldGateway + self.addGateway(KsgoldGateway, 'KSGOLD') + self.gatewayDict['KSGOLD'].setQryEnabled(True) + except Exception, e: + print e + + try: + from sgitGateway.sgitGateway import SgitGateway + self.addGateway(SgitGateway, 'SGIT') + self.gatewayDict['SGIT'].setQryEnabled(True) + except Exception, e: + print e + + try: + from windGateway.windGateway import WindGateway + self.addGateway(WindGateway, 'Wind') + except Exception, e: + print e + + try: + from ibGateway.ibGateway import IbGateway + self.addGateway(IbGateway, 'IB') + except Exception, e: + print e + + try: + from shzdGateway.shzdGateway import ShzdGateway + self.addGateway(ShzdGateway, 'SHZD') + self.gatewayDict['SHZD'].setQryEnabled(True) + except Exception, e: + print e + + try: + from oandaGateway.oandaGateway import OandaGateway + self.addGateway(OandaGateway, 'OANDA') + self.gatewayDict['OANDA'].setQryEnabled(True) + except Exception, e: + print e + + try: + from okcoinGateway.okcoinGateway import OkcoinGateway + self.addGateway(OkcoinGateway, 'OKCOIN') + self.gatewayDict['OKCOIN'].setQryEnabled(True) + except Exception, e: + print e + + #---------------------------------------------------------------------- + def addGateway(self, gateway, gatewayName=None): + """创建接口""" + self.gatewayDict[gatewayName] = gateway(self.eventEngine, gatewayName) + + #---------------------------------------------------------------------- + def connect(self, gatewayName): + """连接特定名称的接口""" + if gatewayName in self.gatewayDict: + gateway = self.gatewayDict[gatewayName] + gateway.connect() + else: + self.writeLog(u'接口不存在:%s' %gatewayName) + + #---------------------------------------------------------------------- + def subscribe(self, subscribeReq, gatewayName): + """订阅特定接口的行情""" + if gatewayName in self.gatewayDict: + gateway = self.gatewayDict[gatewayName] + gateway.subscribe(subscribeReq) + else: + self.writeLog(u'接口不存在:%s' %gatewayName) + + #---------------------------------------------------------------------- + def sendOrder(self, orderReq, gatewayName): + """对特定接口发单""" + # 如果风控检查失败则不发单 + if not self.rmEngine.checkRisk(orderReq): + return '' + + if gatewayName in self.gatewayDict: + gateway = self.gatewayDict[gatewayName] + return gateway.sendOrder(orderReq) + else: + self.writeLog(u'接口不存在:%s' %gatewayName) + + #---------------------------------------------------------------------- + def cancelOrder(self, cancelOrderReq, gatewayName): + """对特定接口撤单""" + if gatewayName in self.gatewayDict: + gateway = self.gatewayDict[gatewayName] + gateway.cancelOrder(cancelOrderReq) + else: + self.writeLog(u'接口不存在:%s' %gatewayName) + + #---------------------------------------------------------------------- + def qryAccont(self, gatewayName): + """查询特定接口的账户""" + if gatewayName in self.gatewayDict: + gateway = self.gatewayDict[gatewayName] + gateway.qryAccount() + else: + self.writeLog(u'接口不存在:%s' %gatewayName) + + #---------------------------------------------------------------------- + def qryPosition(self, gatewayName): + """查询特定接口的持仓""" + if gatewayName in self.gatewayDict: + gateway = self.gatewayDict[gatewayName] + gateway.qryPosition() + else: + self.writeLog(u'接口不存在:%s' %gatewayName) + + #---------------------------------------------------------------------- + def exit(self): + """退出程序前调用,保证正常退出""" + # 安全关闭所有接口 + for gateway in self.gatewayDict.values(): + gateway.close() + + # 停止事件引擎 + self.eventEngine.stop() + + # 停止数据记录引擎 + self.drEngine.stop() + + # 保存数据引擎里的合约数据到硬盘 + self.dataEngine.saveContracts() + + #---------------------------------------------------------------------- + def writeLog(self, content): + """快速发出日志事件""" + log = VtLogData() + log.logContent = content + event = Event(type_=EVENT_LOG) + event.dict_['data'] = log + self.eventEngine.put(event) + + #---------------------------------------------------------------------- + def dbConnect(self): + """连接MongoDB数据库""" + if not self.dbClient: + # 读取MongoDB的设置 + host, port = loadMongoSetting() + + try: + # 设置MongoDB操作的超时时间为0.5秒 + self.dbClient = MongoClient(host, port, connectTimeoutMS=500) + + # 调用server_info查询服务器状态,防止服务器异常并未连接成功 + self.dbClient.server_info() + + self.writeLog(u'MongoDB连接成功') + except ConnectionFailure: + self.writeLog(u'MongoDB连接失败') + + #---------------------------------------------------------------------- + def dbInsert(self, dbName, collectionName, d): + """向MongoDB中插入数据,d是具体数据""" + if self.dbClient: + db = self.dbClient[dbName] + collection = db[collectionName] + collection.insert_one(d) + + #---------------------------------------------------------------------- + def dbQuery(self, dbName, collectionName, d): + """从MongoDB中读取数据,d是查询要求,返回的是数据库查询的指针""" + if self.dbClient: + db = self.dbClient[dbName] + collection = db[collectionName] + cursor = collection.find(d) + return cursor + else: + return None + + #---------------------------------------------------------------------- + def dbUpdate(self, dbName, collectionName, d, flt, upsert=False): + """向MongoDB中更新数据,d是具体数据,flt是过滤条件,upsert代表若无是否要插入""" + if self.dbClient: + db = self.dbClient[dbName] + collection = db[collectionName] + collection.replace_one(flt, d, upsert) + + #---------------------------------------------------------------------- + def getContract(self, vtSymbol): + """查询合约""" + return self.dataEngine.getContract(vtSymbol) + + #---------------------------------------------------------------------- + def getAllContracts(self): + """查询所有合约(返回列表)""" + return self.dataEngine.getAllContracts() + + #---------------------------------------------------------------------- + def getOrder(self, vtOrderID): + """查询委托""" + return self.dataEngine.getOrder(vtOrderID) + + #---------------------------------------------------------------------- + def getAllWorkingOrders(self): + """查询所有的活跃的委托(返回列表)""" + return self.dataEngine.getAllWorkingOrders() + + #---------------------------------------------------------------------- + def orderTest(self, event): + """""" + tick = event.dict_['data'] + + req = VtOrderReq() + req.symbol = tick.symbol + req.price = tick.lastPrice + req.direction = DIRECTION_LONG + req.offset = OFFSET_OPEN + req.priceType = PRICETYPE_LIMITPRICE + req.volume = 1 + + order_time = self.sendOrder(req, tick.gatewayName) + + print u'耗时:', (order_time - tick.tick_time)*100000/tick.frequency_time, u'微秒' + + + +######################################################################## +class DataEngine(object): + """数据引擎""" + contractFileName = 'ContractData.vt' + + #---------------------------------------------------------------------- + def __init__(self, eventEngine): + """Constructor""" + self.eventEngine = eventEngine + + # 保存合约详细信息的字典 + self.contractDict = {} + + # 保存委托数据的字典 + self.orderDict = {} + + # 保存活动委托数据的字典(即可撤销) + self.workingOrderDict = {} + + # 读取保存在硬盘的合约数据 + self.loadContracts() + + # 注册事件监听 + self.registerEvent() + + #---------------------------------------------------------------------- + def updateContract(self, event): + """更新合约数据""" + contract = event.dict_['data'] + self.contractDict[contract.vtSymbol] = contract + self.contractDict[contract.symbol] = contract # 使用常规代码(不包括交易所)可能导致重复 + + #---------------------------------------------------------------------- + def getContract(self, vtSymbol): + """查询合约对象""" + try: + return self.contractDict[vtSymbol] + except KeyError: + return None + + #---------------------------------------------------------------------- + def getAllContracts(self): + """查询所有合约对象(返回列表)""" + return self.contractDict.values() + + #---------------------------------------------------------------------- + def saveContracts(self): + """保存所有合约对象到硬盘""" + f = shelve.open(self.contractFileName) + f['data'] = self.contractDict + f.close() + + #---------------------------------------------------------------------- + def loadContracts(self): + """从硬盘读取合约对象""" + f = shelve.open(self.contractFileName) + if 'data' in f: + d = f['data'] + for key, value in d.items(): + self.contractDict[key] = value + f.close() + + #---------------------------------------------------------------------- + def updateOrder(self, event): + """更新委托数据""" + order = event.dict_['data'] + self.orderDict[order.vtOrderID] = order + + # 如果订单的状态是全部成交或者撤销,则需要从workingOrderDict中移除 + if order.status == STATUS_ALLTRADED or order.status == STATUS_CANCELLED: + if order.vtOrderID in self.workingOrderDict: + del self.workingOrderDict[order.vtOrderID] + # 否则则更新字典中的数据 + else: + self.workingOrderDict[order.vtOrderID] = order + + #---------------------------------------------------------------------- + def getOrder(self, vtOrderID): + """查询委托""" + try: + return self.orderDict[vtOrderID] + except KeyError: + return None + + #---------------------------------------------------------------------- + def getAllWorkingOrders(self): + """查询所有活动委托(返回列表)""" + return self.workingOrderDict.values() + + #---------------------------------------------------------------------- + def registerEvent(self): + """注册事件监听""" + self.eventEngine.register(EVENT_CONTRACT, self.updateContract) + self.eventEngine.register(EVENT_ORDER, self.updateOrder) + + + diff --git a/vn.how/tick2trade/vn.trader_t2t/vtFunction.py b/vn.how/tick2trade/vn.trader_t2t/vtFunction.py new file mode 100644 index 0000000000..c14286e0ff --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/vtFunction.py @@ -0,0 +1,54 @@ +# encoding: UTF-8 + +""" +包含一些开发中常用的函数 +""" + +import os +import decimal +import json +from datetime import datetime + +MAX_NUMBER = 10000000000000 +MAX_DECIMAL = 4 + +#---------------------------------------------------------------------- +def safeUnicode(value): + """检查接口数据潜在的错误,保证转化为的字符串正确""" + # 检查是数字接近0时会出现的浮点数上限 + if type(value) is int or type(value) is float: + if value > MAX_NUMBER: + value = 0 + + # 检查防止小数点位过多 + if type(value) is float: + d = decimal.Decimal(str(value)) + if abs(d.as_tuple().exponent) > MAX_DECIMAL: + value = round(value, ndigits=MAX_DECIMAL) + + return unicode(value) + +#---------------------------------------------------------------------- +def loadMongoSetting(): + """载入MongoDB数据库的配置""" + fileName = 'VT_setting.json' + path = os.path.abspath(os.path.dirname(__file__)) + fileName = os.path.join(path, fileName) + + try: + f = file(fileName) + setting = json.load(f) + host = setting['mongoHost'] + port = setting['mongoPort'] + except: + host = 'localhost' + port = 27017 + + return host, port + +#---------------------------------------------------------------------- +def todayDate(): + """获取当前本机电脑时间的日期""" + return datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) + + diff --git a/vn.how/tick2trade/vn.trader_t2t/vtGateway.py b/vn.how/tick2trade/vn.trader_t2t/vtGateway.py new file mode 100644 index 0000000000..3967c1a62b --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/vtGateway.py @@ -0,0 +1,440 @@ +# encoding: UTF-8 + +import time + +from eventEngine import * + +from vtConstant import * + + +######################################################################## +class VtGateway(object): + """交易接口""" + + #---------------------------------------------------------------------- + def __init__(self, eventEngine, gatewayName): + """Constructor""" + self.eventEngine = eventEngine + self.gatewayName = gatewayName + + #---------------------------------------------------------------------- + def onTick(self, tick): + """市场行情推送""" + # 通用事件 + event1 = Event(type_=EVENT_TICK) + event1.dict_['data'] = tick + self.eventEngine.put(event1) + + # 特定合约代码的事件 + event2 = Event(type_=EVENT_TICK+tick.vtSymbol) + event2.dict_['data'] = tick + self.eventEngine.put(event2) + + #---------------------------------------------------------------------- + def onTrade(self, trade): + """成交信息推送""" + # 通用事件 + event1 = Event(type_=EVENT_TRADE) + event1.dict_['data'] = trade + self.eventEngine.put(event1) + + # 特定合约的成交事件 + event2 = Event(type_=EVENT_TRADE+trade.vtSymbol) + event2.dict_['data'] = trade + self.eventEngine.put(event2) + + #---------------------------------------------------------------------- + def onOrder(self, order): + """订单变化推送""" + # 通用事件 + event1 = Event(type_=EVENT_ORDER) + event1.dict_['data'] = order + self.eventEngine.put(event1) + + # 特定订单编号的事件 + event2 = Event(type_=EVENT_ORDER+order.vtOrderID) + event2.dict_['data'] = order + self.eventEngine.put(event2) + + #---------------------------------------------------------------------- + def onPosition(self, position): + """持仓信息推送""" + # 通用事件 + event1 = Event(type_=EVENT_POSITION) + event1.dict_['data'] = position + self.eventEngine.put(event1) + + # 特定合约代码的事件 + event2 = Event(type_=EVENT_POSITION+position.vtSymbol) + event2.dict_['data'] = position + self.eventEngine.put(event2) + + #---------------------------------------------------------------------- + def onAccount(self, account): + """账户信息推送""" + # 通用事件 + event1 = Event(type_=EVENT_ACCOUNT) + event1.dict_['data'] = account + self.eventEngine.put(event1) + + # 特定合约代码的事件 + event2 = Event(type_=EVENT_ACCOUNT+account.vtAccountID) + event2.dict_['data'] = account + self.eventEngine.put(event2) + + #---------------------------------------------------------------------- + def onError(self, error): + """错误信息推送""" + # 通用事件 + event1 = Event(type_=EVENT_ERROR) + event1.dict_['data'] = error + self.eventEngine.put(event1) + + #---------------------------------------------------------------------- + def onLog(self, log): + """日志推送""" + # 通用事件 + event1 = Event(type_=EVENT_LOG) + event1.dict_['data'] = log + self.eventEngine.put(event1) + + #---------------------------------------------------------------------- + def onContract(self, contract): + """合约基础信息推送""" + # 通用事件 + event1 = Event(type_=EVENT_CONTRACT) + event1.dict_['data'] = contract + self.eventEngine.put(event1) + + #---------------------------------------------------------------------- + def connect(self): + """连接""" + pass + + #---------------------------------------------------------------------- + def subscribe(self, subscribeReq): + """订阅行情""" + pass + + #---------------------------------------------------------------------- + def sendOrder(self, orderReq): + """发单""" + pass + + #---------------------------------------------------------------------- + def cancelOrder(self, cancelOrderReq): + """撤单""" + pass + + #---------------------------------------------------------------------- + def qryAccount(self): + """查询账户资金""" + pass + + #---------------------------------------------------------------------- + def qryPosition(self): + """查询持仓""" + pass + + #---------------------------------------------------------------------- + def close(self): + """关闭""" + pass + + +######################################################################## +class VtBaseData(object): + """回调函数推送数据的基础类,其他数据类继承于此""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.gatewayName = EMPTY_STRING # Gateway名称 + self.rawData = None # 原始数据 + + +######################################################################## +class VtTickData(VtBaseData): + """Tick行情数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtTickData, self).__init__() + + # 代码相关 + self.symbol = EMPTY_STRING # 合约代码 + self.exchange = EMPTY_STRING # 交易所代码 + self.vtSymbol = EMPTY_STRING # 合约在vt系统中的唯一代码,通常是 合约代码.交易所代码 + + # 成交数据 + self.lastPrice = EMPTY_FLOAT # 最新成交价 + self.lastVolume = EMPTY_INT # 最新成交量 + self.volume = EMPTY_INT # 今天总成交量 + self.openInterest = EMPTY_INT # 持仓量 + self.time = EMPTY_STRING # 时间 11:20:56.5 + self.date = EMPTY_STRING # 日期 20151009 + + # 常规行情 + self.openPrice = EMPTY_FLOAT # 今日开盘价 + self.highPrice = EMPTY_FLOAT # 今日最高价 + self.lowPrice = EMPTY_FLOAT # 今日最低价 + self.preClosePrice = EMPTY_FLOAT + + self.upperLimit = EMPTY_FLOAT # 涨停价 + self.lowerLimit = EMPTY_FLOAT # 跌停价 + + # 五档行情 + self.bidPrice1 = EMPTY_FLOAT + self.bidPrice2 = EMPTY_FLOAT + self.bidPrice3 = EMPTY_FLOAT + self.bidPrice4 = EMPTY_FLOAT + self.bidPrice5 = EMPTY_FLOAT + + self.askPrice1 = EMPTY_FLOAT + self.askPrice2 = EMPTY_FLOAT + self.askPrice3 = EMPTY_FLOAT + self.askPrice4 = EMPTY_FLOAT + self.askPrice5 = EMPTY_FLOAT + + self.bidVolume1 = EMPTY_INT + self.bidVolume2 = EMPTY_INT + self.bidVolume3 = EMPTY_INT + self.bidVolume4 = EMPTY_INT + self.bidVolume5 = EMPTY_INT + + self.askVolume1 = EMPTY_INT + self.askVolume2 = EMPTY_INT + self.askVolume3 = EMPTY_INT + self.askVolume4 = EMPTY_INT + self.askVolume5 = EMPTY_INT + + +######################################################################## +class VtTradeData(VtBaseData): + """成交数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtTradeData, self).__init__() + + # 代码编号相关 + self.symbol = EMPTY_STRING # 合约代码 + self.exchange = EMPTY_STRING # 交易所代码 + self.vtSymbol = EMPTY_STRING # 合约在vt系统中的唯一代码,通常是 合约代码.交易所代码 + + self.tradeID = EMPTY_STRING # 成交编号 + self.vtTradeID = EMPTY_STRING # 成交在vt系统中的唯一编号,通常是 Gateway名.成交编号 + + self.orderID = EMPTY_STRING # 订单编号 + self.vtOrderID = EMPTY_STRING # 订单在vt系统中的唯一编号,通常是 Gateway名.订单编号 + + # 成交相关 + self.direction = EMPTY_UNICODE # 成交方向 + self.offset = EMPTY_UNICODE # 成交开平仓 + self.price = EMPTY_FLOAT # 成交价格 + self.volume = EMPTY_INT # 成交数量 + self.tradeTime = EMPTY_STRING # 成交时间 + + +######################################################################## +class VtOrderData(VtBaseData): + """订单数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtOrderData, self).__init__() + + # 代码编号相关 + self.symbol = EMPTY_STRING # 合约代码 + self.exchange = EMPTY_STRING # 交易所代码 + self.vtSymbol = EMPTY_STRING # 合约在vt系统中的唯一代码,通常是 合约代码.交易所代码 + + self.orderID = EMPTY_STRING # 订单编号 + self.vtOrderID = EMPTY_STRING # 订单在vt系统中的唯一编号,通常是 Gateway名.订单编号 + + # 报单相关 + self.direction = EMPTY_UNICODE # 报单方向 + self.offset = EMPTY_UNICODE # 报单开平仓 + self.price = EMPTY_FLOAT # 报单价格 + self.totalVolume = EMPTY_INT # 报单总数量 + self.tradedVolume = EMPTY_INT # 报单成交数量 + self.status = EMPTY_UNICODE # 报单状态 + + self.orderTime = EMPTY_STRING # 发单时间 + self.cancelTime = EMPTY_STRING # 撤单时间 + + # CTP/LTS相关 + self.frontID = EMPTY_INT # 前置机编号 + self.sessionID = EMPTY_INT # 连接编号 + + +######################################################################## +class VtPositionData(VtBaseData): + """持仓数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtPositionData, self).__init__() + + # 代码编号相关 + self.symbol = EMPTY_STRING # 合约代码 + self.exchange = EMPTY_STRING # 交易所代码 + self.vtSymbol = EMPTY_STRING # 合约在vt系统中的唯一代码,合约代码.交易所代码 + + # 持仓相关 + self.direction = EMPTY_STRING # 持仓方向 + self.position = EMPTY_INT # 持仓量 + self.frozen = EMPTY_INT # 冻结数量 + self.price = EMPTY_FLOAT # 持仓均价 + self.vtPositionName = EMPTY_STRING # 持仓在vt系统中的唯一代码,通常是vtSymbol.方向 + + # 20151020添加 + self.ydPosition = EMPTY_INT # 昨持仓 + + +######################################################################## +class VtAccountData(VtBaseData): + """账户数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtAccountData, self).__init__() + + # 账号代码相关 + self.accountID = EMPTY_STRING # 账户代码 + self.vtAccountID = EMPTY_STRING # 账户在vt中的唯一代码,通常是 Gateway名.账户代码 + + # 数值相关 + self.preBalance = EMPTY_FLOAT # 昨日账户结算净值 + self.balance = EMPTY_FLOAT # 账户净值 + self.available = EMPTY_FLOAT # 可用资金 + self.commission = EMPTY_FLOAT # 今日手续费 + self.margin = EMPTY_FLOAT # 保证金占用 + self.closeProfit = EMPTY_FLOAT # 平仓盈亏 + self.positionProfit = EMPTY_FLOAT # 持仓盈亏 + + +######################################################################## +class VtErrorData(VtBaseData): + """错误数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtErrorData, self).__init__() + + self.errorID = EMPTY_STRING # 错误代码 + self.errorMsg = EMPTY_UNICODE # 错误信息 + self.additionalInfo = EMPTY_UNICODE # 补充信息 + + self.errorTime = time.strftime('%X', time.localtime()) # 错误生成时间 + + +######################################################################## +class VtLogData(VtBaseData): + """日志数据类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtLogData, self).__init__() + + self.logTime = time.strftime('%X', time.localtime()) # 日志生成时间 + self.logContent = EMPTY_UNICODE # 日志信息 + + +######################################################################## +class VtContractData(VtBaseData): + """合约详细信息类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + super(VtContractData, self).__init__() + + self.symbol = EMPTY_STRING # 代码 + self.exchange = EMPTY_STRING # 交易所代码 + self.vtSymbol = EMPTY_STRING # 合约在vt系统中的唯一代码,通常是 合约代码.交易所代码 + self.name = EMPTY_UNICODE # 合约中文名 + + self.productClass = EMPTY_UNICODE # 合约类型 + self.size = EMPTY_INT # 合约大小 + self.priceTick = EMPTY_FLOAT # 合约最小价格TICK + + # 期权相关 + self.strikePrice = EMPTY_FLOAT # 期权行权价 + self.underlyingSymbol = EMPTY_STRING # 标的物合约代码 + self.optionType = EMPTY_UNICODE # 期权类型 + + +######################################################################## +class VtSubscribeReq(object): + """订阅行情时传入的对象类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.symbol = EMPTY_STRING # 代码 + self.exchange = EMPTY_STRING # 交易所 + + # 以下为IB相关 + self.productClass = EMPTY_UNICODE # 合约类型 + self.currency = EMPTY_STRING # 合约货币 + self.expiry = EMPTY_STRING # 到期日 + self.strikePrice = EMPTY_FLOAT # 行权价 + self.optionType = EMPTY_UNICODE # 期权类型 + + +######################################################################## +class VtOrderReq(object): + """发单时传入的对象类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.symbol = EMPTY_STRING # 代码 + self.exchange = EMPTY_STRING # 交易所 + self.price = EMPTY_FLOAT # 价格 + self.volume = EMPTY_INT # 数量 + + self.priceType = EMPTY_STRING # 价格类型 + self.direction = EMPTY_STRING # 买卖 + self.offset = EMPTY_STRING # 开平 + + # 以下为IB相关 + self.productClass = EMPTY_UNICODE # 合约类型 + self.currency = EMPTY_STRING # 合约货币 + self.expiry = EMPTY_STRING # 到期日 + self.strikePrice = EMPTY_FLOAT # 行权价 + self.optionType = EMPTY_UNICODE # 期权类型 + + +######################################################################## +class VtCancelOrderReq(object): + """撤单时传入的对象类""" + + #---------------------------------------------------------------------- + def __init__(self): + """Constructor""" + self.symbol = EMPTY_STRING # 代码 + self.exchange = EMPTY_STRING # 交易所 + + # 以下字段主要和CTP、LTS类接口相关 + self.orderID = EMPTY_STRING # 报单号 + self.frontID = EMPTY_STRING # 前置机号 + self.sessionID = EMPTY_STRING # 会话号 + + + + + + + + + + diff --git a/vn.how/tick2trade/vn.trader_t2t/vtMain.py b/vn.how/tick2trade/vn.trader_t2t/vtMain.py new file mode 100644 index 0000000000..d6098a6b48 --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/vtMain.py @@ -0,0 +1,55 @@ +# encoding: UTF-8 + +import sys +import os +import ctypes +import platform + +import vtPath +from vtEngine import MainEngine +from uiMainWindow import * + +# 文件路径名 +path = os.path.abspath(os.path.dirname(__file__)) +ICON_FILENAME = 'vnpy.ico' +ICON_FILENAME = os.path.join(path, ICON_FILENAME) + +SETTING_FILENAME = 'VT_setting.json' +SETTING_FILENAME = os.path.join(path, SETTING_FILENAME) + +#---------------------------------------------------------------------- +def main(): + """主程序入口""" + # 重载sys模块,设置默认字符串编码方式为utf8 + reload(sys) + sys.setdefaultencoding('utf8') + + # 设置Windows底部任务栏图标 + if 'Windows' in platform.uname() : + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('vn.trader') + + # 初始化Qt应用对象 + app = QtGui.QApplication(sys.argv) + app.setWindowIcon(QtGui.QIcon(ICON_FILENAME)) + app.setFont(BASIC_FONT) + + # 设置Qt的皮肤 + try: + f = file(SETTING_FILENAME) + setting = json.load(f) + if setting['darkStyle']: + import qdarkstyle + app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False)) + except: + pass + + # 初始化主引擎和主窗口对象 + mainEngine = MainEngine() + mainWindow = MainWindow(mainEngine, mainEngine.eventEngine) + mainWindow.showMaximized() + + # 在主线程中启动Qt事件循环 + sys.exit(app.exec_()) + +if __name__ == '__main__': + main() diff --git a/vn.how/tick2trade/vn.trader_t2t/vtPath.py b/vn.how/tick2trade/vn.trader_t2t/vtPath.py new file mode 100644 index 0000000000..e3da26fa1e --- /dev/null +++ b/vn.how/tick2trade/vn.trader_t2t/vtPath.py @@ -0,0 +1,24 @@ +# encoding: UTF-8 + +""" +用于vn.trader的运行目录环境设置 +""" + +import os +import sys + +# 将根目录路径添加到环境变量中 +ROOT_PATH = os.path.abspath(os.path.dirname(__file__)) +sys.path.append(ROOT_PATH) + +# 将功能模块的目录路径添加到环境变量中 +# 若各目录下存在同名文件可能导致异常,请注意测试 +MODULE_PATH = {} +MODULE_PATH['CTA'] = os.path.join(ROOT_PATH, 'ctaAlgo') +MODULE_PATH['RM'] = os.path.join(ROOT_PATH, 'riskManager') +MODULE_PATH['DR'] = os.path.join(ROOT_PATH, 'dataRecorder') + +# 添加到环境变量中 +for path in MODULE_PATH.values(): + if path not in sys.path: + sys.path.append(path)