commit
8d74af2c62
@ -7,7 +7,7 @@ if (CMAKE_COMPILER_IS_GNUC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif ()
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
|
||||
|
||||
option(USE_64BITS "comiple 64bits" ON)
|
||||
if (USE_64BITS)
|
||||
@ -16,7 +16,14 @@ if (USE_64BITS)
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
||||
endif()
|
||||
|
||||
set(CTPAPI_PATH ctpapi)
|
||||
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
|
||||
@ -47,17 +54,27 @@ if (BUILD_CTP_TD)
|
||||
endif()
|
||||
|
||||
|
||||
set(PYTHON_INCLUDE_PATH C:/Python27/include)
|
||||
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
|
||||
set(Boost_USE_STATIC_LIBS ON) #链接boost静态库
|
||||
if (WIN32)
|
||||
set(Boost_USE_STATIC_LIBS ON) #链接boost静态库
|
||||
endif()
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
find_package(Boost 1.57.0 COMPONENTS python thread date_time system chrono REQUIRED) # 如果boost库没有完全编译,需要将编译的库明确地指出,否者message(${Boost_LIBRARIES})会出错
|
||||
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()
|
||||
|
15
vn.ctp/build.sh
Executable file
15
vn.ctp/build.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/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 2
|
||||
ln -fs `pwd`/lib/libvnctpmd.so ../vnctpmd/test/vnctpmd.so
|
||||
ln -fs `pwd`/lib/libvnctptd.so ../vnctptd/test/vnctptd.so
|
||||
popd
|
158
vn.ctp/ctpapi/x64_linux/ThostFtdcMdApi.h
Normal file
158
vn.ctp/ctpapi/x64_linux/ThostFtdcMdApi.h
Normal file
@ -0,0 +1,158 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
///@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) {};
|
||||
|
||||
///登出请求响应
|
||||
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);
|
||||
|
||||
///删除接口对象本身
|
||||
///@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 RegisterNameServer优先于RegisterFront
|
||||
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;
|
||||
|
||||
|
||||
///登出请求
|
||||
virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
|
||||
protected:
|
||||
~CThostFtdcMdApi(){};
|
||||
};
|
||||
|
||||
#endif
|
620
vn.ctp/ctpapi/x64_linux/ThostFtdcTraderApi.h
Normal file
620
vn.ctp/ctpapi/x64_linux/ThostFtdcTraderApi.h
Normal file
@ -0,0 +1,620 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
///@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) {};
|
||||
|
||||
///登出请求响应
|
||||
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 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 OnRspQryProductGroup(CThostFtdcProductGroupField *pProductGroup, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
||||
|
||||
///请求查询报单手续费响应
|
||||
virtual void OnRspQryInstrumentOrderCommRate(CThostFtdcInstrumentOrderCommRateField *pInstrumentOrderCommRate, 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 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 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 = "");
|
||||
|
||||
///删除接口对象本身
|
||||
///@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 RegisterNameServer优先于RegisterFront
|
||||
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;
|
||||
|
||||
|
||||
///登出请求
|
||||
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 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 ReqQryProductGroup(CThostFtdcQryProductGroupField *pQryProductGroup, int nRequestID) = 0;
|
||||
|
||||
///请求查询报单手续费
|
||||
virtual int ReqQryInstrumentOrderCommRate(CThostFtdcQryInstrumentOrderCommRateField *pQryInstrumentOrderCommRate, 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 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
|
6276
vn.ctp/ctpapi/x64_linux/ThostFtdcUserApiDataType.h
Normal file
6276
vn.ctp/ctpapi/x64_linux/ThostFtdcUserApiDataType.h
Normal file
File diff suppressed because it is too large
Load Diff
7684
vn.ctp/ctpapi/x64_linux/ThostFtdcUserApiStruct.h
Normal file
7684
vn.ctp/ctpapi/x64_linux/ThostFtdcUserApiStruct.h
Normal file
File diff suppressed because it is too large
Load Diff
9
vn.ctp/ctpapi/x64_linux/error.dtd
Normal file
9
vn.ctp/ctpapi/x64_linux/error.dtd
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!ELEMENT errors (error*)>
|
||||
<!ELEMENT error EMPTY>
|
||||
<!ATTLIST error
|
||||
id CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
prompt CDATA #REQUIRED
|
||||
>
|
||||
|
181
vn.ctp/ctpapi/x64_linux/error.xml
Normal file
181
vn.ctp/ctpapi/x64_linux/error.xml
Normal file
@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="gb2312"?>
|
||||
<!-- edited with XMLSPY v2004 rel. 4 U (http://www.xmlspy.com) by wangzhaodong (ORiON) -->
|
||||
<!DOCTYPE errors SYSTEM "error.dtd">
|
||||
<errors>
|
||||
<error id="NONE" value="0" prompt="CTP:正确"/>
|
||||
<error id="INVALID_DATA_SYNC_STATUS" value="1" prompt="CTP:不在已同步状态"/>
|
||||
<error id="INCONSISTENT_INFORMATION" value="2" prompt="CTP:会话信息不一致"/>
|
||||
<error id="INVALID_LOGIN" value="3" prompt="CTP:不合法的登录"/>
|
||||
<error id="USER_NOT_ACTIVE" value="4" prompt="CTP:用户不活跃"/>
|
||||
<error id="DUPLICATE_LOGIN" value="5" prompt="CTP:重复的登录"/>
|
||||
<error id="NOT_LOGIN_YET" value="6" prompt="CTP:还没有登录"/>
|
||||
<error id="NOT_INITED" value="7" prompt="CTP:还没有初始化"/>
|
||||
<error id="FRONT_NOT_ACTIVE" value="8" prompt="CTP:前置不活跃"/>
|
||||
<error id="NO_PRIVILEGE" value="9" prompt="CTP:无此权限"/>
|
||||
<error id="CHANGE_OTHER_PASSWORD" value="10" prompt="CTP:修改别人的口令"/>
|
||||
<error id="USER_NOT_FOUND" value="11" prompt="CTP:找不到该用户"/>
|
||||
<error id="BROKER_NOT_FOUND" value="12" prompt="CTP:找不到该经纪公司"/>
|
||||
<error id="INVESTOR_NOT_FOUND" value="13" prompt="CTP:找不到投资者"/>
|
||||
<error id="OLD_PASSWORD_MISMATCH" value="14" prompt="CTP:原口令不匹配"/>
|
||||
<error id="BAD_FIELD" value="15" prompt="CTP:报单字段有误"/>
|
||||
<error id="INSTRUMENT_NOT_FOUND" value="16" prompt="CTP:找不到合约"/>
|
||||
<error id="INSTRUMENT_NOT_TRADING" value="17" prompt="CTP:合约不能交易"/>
|
||||
<error id="NOT_EXCHANGE_PARTICIPANT" value="18" prompt="CTP:经纪公司不是交易所的会员"/>
|
||||
<error id="INVESTOR_NOT_ACTIVE" value="19" prompt="CTP:投资者不活跃"/>
|
||||
<error id="NOT_EXCHANGE_CLIENT" value="20" prompt="CTP:投资者未在交易所开户"/>
|
||||
<error id="NO_VALID_TRADER_AVAILABLE" value="21" prompt="CTP:该交易席位未连接到交易所"/>
|
||||
<error id="DUPLICATE_ORDER_REF" value="22" prompt="CTP:报单错误:不允许重复报单"/>
|
||||
<error id="BAD_ORDER_ACTION_FIELD" value="23" prompt="CTP:错误的报单操作字段"/>
|
||||
<error id="DUPLICATE_ORDER_ACTION_REF" value="24" prompt="CTP:撤单已报送,不允许重复撤单"/>
|
||||
<error id="ORDER_NOT_FOUND" value="25" prompt="CTP:撤单找不到相应报单"/>
|
||||
<error id="INSUITABLE_ORDER_STATUS" value="26" prompt="CTP:报单已全成交或已撤销,不能再撤"/>
|
||||
<error id="UNSUPPORTED_FUNCTION" value="27" prompt="CTP:不支持的功能"/>
|
||||
<error id="NO_TRADING_RIGHT" value="28" prompt="CTP:没有报单交易权限"/>
|
||||
<error id="CLOSE_ONLY" value="29" prompt="CTP:只能平仓"/>
|
||||
<error id="OVER_CLOSE_POSITION" value="30" prompt="CTP:平仓量超过持仓量"/>
|
||||
<error id="INSUFFICIENT_MONEY" value="31" prompt="CTP:资金不足"/>
|
||||
<error id="DUPLICATE_PK" value="32" prompt="CTP:主键重复"/>
|
||||
<error id="CANNOT_FIND_PK" value="33" prompt="CTP:找不到主键"/>
|
||||
<error id="CAN_NOT_INACTIVE_BROKER" value="34" prompt="CTP:设置经纪公司不活跃状态失败"/>
|
||||
<error id="BROKER_SYNCHRONIZING" value="35" prompt="CTP:经纪公司正在同步"/>
|
||||
<error id="BROKER_SYNCHRONIZED" value="36" prompt="CTP:经纪公司已同步"/>
|
||||
<error id="SHORT_SELL" value="37" prompt="CTP:现货交易不能卖空"/>
|
||||
<error id="INVALID_SETTLEMENT_REF" value="38" prompt="CTP:不合法的结算引用"/>
|
||||
<error id="CFFEX_NETWORK_ERROR" value="39" prompt="CTP:交易所网络连接失败"/>
|
||||
<error id="CFFEX_OVER_REQUEST" value="40" prompt="CTP:交易所未处理请求超过许可数"/>
|
||||
<error id="CFFEX_OVER_REQUEST_PER_SECOND" value="41" prompt="CTP:交易所每秒发送请求数超过许可数"/>
|
||||
<error id="SETTLEMENT_INFO_NOT_CONFIRMED" value="42" prompt="CTP:结算结果未确认"/>
|
||||
<error id="DEPOSIT_NOT_FOUND" value="43" prompt="CTP:没有对应的入金记录"/>
|
||||
<error id="EXCHANG_TRADING" value="44" prompt="CTP:交易所已经进入连续交易状态"/>
|
||||
<error id="PARKEDORDER_NOT_FOUND" value="45" prompt="CTP:找不到预埋(撤单)单"/>
|
||||
<error id="PARKEDORDER_HASSENDED" value="46" prompt="CTP:预埋(撤单)单已经发送"/>
|
||||
<error id="PARKEDORDER_HASDELETE" value="47" prompt="CTP:预埋(撤单)单已经删除"/>
|
||||
<error id="INVALID_INVESTORIDORPASSWORD" value="48" prompt="CTP:无效的投资者或者密码"/>
|
||||
<error id="INVALID_LOGIN_IPADDRESS" value="49" prompt="CTP:不合法的登录IP地址"/>
|
||||
<error id="OVER_CLOSETODAY_POSITION" value="50" prompt="CTP:平今仓位不足"/>
|
||||
<error id="OVER_CLOSEYESTERDAY_POSITION" value="51" prompt="CTP:平昨仓位不足"/>
|
||||
<error id="BROKER_NOT_ENOUGH_CONDORDER" value="52" prompt="CTP:经纪公司没有足够可用的条件单数量"/>
|
||||
<error id="INVESTOR_NOT_ENOUGH_CONDORDER" value="53" prompt="CTP:投资者没有足够可用的条件单数量"/>
|
||||
<error id="BROKER_NOT_SUPPORT_CONDORDER" value="54" prompt="CTP:经纪公司不支持条件单"/>
|
||||
<error id="RESEND_ORDER_BROKERINVESTOR_NOTMATCH" value="55" prompt="CTP:重发未知单经济公司/投资者不匹配"/>
|
||||
<error id="SYC_OTP_FAILED" value="56" prompt="CTP:同步动态令牌失败"/>
|
||||
<error id="OTP_MISMATCH" value="57" prompt="CTP:动态令牌校验错误"/>
|
||||
<error id="OTPPARAM_NOT_FOUND" value="58" prompt="CTP:找不到动态令牌配置信息"/>
|
||||
<error id="UNSUPPORTED_OTPTYPE" value="59" prompt="CTP:不支持的动态令牌类型"/>
|
||||
<error id="SINGLEUSERSESSION_EXCEED_LIMIT" value="60" prompt="CTP:用户在线会话超出上限"/>
|
||||
<error id="EXCHANGE_UNSUPPORTED_ARBITRAGE" value="61" prompt="CTP:该交易所不支持套利类型报单"/>
|
||||
<error id="NO_CONDITIONAL_ORDER_RIGHT" value="62" prompt="CTP:没有条件单交易权限"/>
|
||||
<error id="AUTH_FAILED" value="63" prompt="CTP:客户端认证失败"/>
|
||||
<error id="NOT_AUTHENT" value="64" prompt="CTP:客户端未认证"/>
|
||||
<error id="SWAPORDER_UNSUPPORTED" value="65" prompt="CTP:该合约不支持互换类型报单"/>
|
||||
<error id="OPTIONS_ONLY_SUPPORT_SPEC" value="66" prompt="CTP:该期权合约只支持投机类型报单"/>
|
||||
<error id="DUPLICATE_EXECORDER_REF" value="67" prompt="CTP:执行宣告错误,不允许重复执行"/>
|
||||
<error id="RESEND_EXECORDER_BROKERINVESTOR_NOTMATCH" value="68" prompt="CTP:重发未知执行宣告经纪公司/投资者不匹配"/>
|
||||
<error id="EXECORDER_NOTOPTIONS" value="69" prompt="CTP:只有期权合约可执行"/>
|
||||
<error id="OPTIONS_NOT_SUPPORT_EXEC" value="70" prompt="CTP:该期权合约不支持执行"/>
|
||||
<error id="BAD_EXECORDER_ACTION_FIELD" value="71" prompt="CTP:执行宣告字段有误"/>
|
||||
<error id="DUPLICATE_EXECORDER_ACTION_REF" value="72" prompt="CTP:执行宣告撤单已报送,不允许重复撤单"/>
|
||||
<error id="EXECORDER_NOT_FOUND" value="73" prompt="CTP:执行宣告撤单找不到相应执行宣告"/>
|
||||
<error id="OVER_EXECUTE_POSITION" value="74" prompt="CTP:执行仓位不足"/>
|
||||
<error id="LOGIN_FORBIDDEN" value="75" prompt="CTP:连续登录失败次数超限,登录被禁止"/>
|
||||
<error id="INVALID_TRANSFER_AGENT" value="76" prompt="CTP:非法银期代理关系"/>
|
||||
<error id="NO_FOUND_FUNCTION" value="77" prompt="CTP:无此功能"/>
|
||||
<error id="SEND_EXCHANGEORDER_FAILED" value="78" prompt="CTP:发送报单失败"/>
|
||||
<error id="SEND_EXCHANGEORDERACTION_FAILED" value="79" prompt="CTP:发送报单操作失败"/>
|
||||
<error id="PRICETYPE_NOTSUPPORT_BYEXCHANGE" value="80" prompt="CTP:交易所不支持的价格类型"/>
|
||||
<error id="BAD_EXECUTE_TYPE" value="81" prompt="CTP:错误的执行类型"/>
|
||||
<error id="BAD_OPTION_INSTR" value="82" prompt="CTP:无效的组合合约"/>
|
||||
<error id="INSTR_NOTSUPPORT_FORQUOTE" value="83" prompt="CTP:该合约不支持询价"/>
|
||||
<error id="RESEND_QUOTE_BROKERINVESTOR_NOTMATCH" value="84" prompt="CTP:重发未知报价经纪公司/投资者不匹配"/>
|
||||
<error id="INSTR_NOTSUPPORT_QUOTE" value="85" prompt="CTP:该合约不支持报价"/>
|
||||
<error id="QUOTE_NOT_FOUND" value="86" prompt="CTP:报价撤单找不到相应报价"/>
|
||||
<error id="OPTIONS_NOT_SUPPORT_ABANDON" value="87" prompt="CTP:该期权合约不支持放弃执行"/>
|
||||
<error id="COMBOPTIONS_SUPPORT_IOC_ONLY" value="88" prompt="CTP:该组合期权合约只支持IOC"/>
|
||||
<error id="OPEN_FILE_FAILED" value="89" prompt="CTP:打开文件失败"/>
|
||||
<error id="NEED_RETRY" value="90" prompt="CTP:查询未就绪,请稍后重试"/>
|
||||
<error id="EXCHANGE_RTNERROR" value="91" prompt="CTP:交易所返回的错误"/>
|
||||
<error id="QUOTE_DERIVEDORDER_ACTIONERROR" value="92" prompt="CTP:报价衍生单要等待交易所返回才能撤单"/>
|
||||
<error id="INSTRUMENTMAP_NOT_FOUND" value="93" prompt="CTP:找不到组合合约映射"/>
|
||||
<!--灾备系统错误代码 -->
|
||||
<error id="NO_TRADING_RIGHT_IN_SEPC_DR" value="101" prompt="CTP:用户在本系统没有报单权限"/>
|
||||
<error id="NO_DR_NO" value="102" prompt="CTP:系统缺少灾备标示号"/>
|
||||
<!--转帐系统错误代码 -->
|
||||
<error id="SEND_INSTITUTION_CODE_ERROR" value="1000" prompt="CTP:银期转账:发送机构代码错误"/>
|
||||
<error id="NO_GET_PLATFORM_SN" value="1001" prompt="CTP:银期转账:取平台流水号错误"/>
|
||||
<error id="ILLEGAL_TRANSFER_BANK" value="1002" prompt="CTP:银期转账:不合法的转账银行"/>
|
||||
<error id="ALREADY_OPEN_ACCOUNT" value="1003" prompt="CTP:银期转账:已经开户"/>
|
||||
<error id="NOT_OPEN_ACCOUNT" value="1004" prompt="CTP:银期转账:未开户"/>
|
||||
<error id="PROCESSING" value="1005" prompt="CTP:银期转账:处理中"/>
|
||||
<error id="OVERTIME" value="1006" prompt="CTP:银期转账:交易超时"/>
|
||||
<error id="RECORD_NOT_FOUND" value="1007" prompt="CTP:银期转账:找不到记录"/>
|
||||
<error id="NO_FOUND_REVERSAL_ORIGINAL_TRANSACTION" value="1008" prompt="CTP:银期转账:找不到被冲正的原始交易"/>
|
||||
<error id="CONNECT_HOST_FAILED" value="1009" prompt="CTP:银期转账:连接主机失败"/>
|
||||
<error id="SEND_FAILED" value="1010" prompt="CTP:银期转账:发送失败"/>
|
||||
<error id="LATE_RESPONSE" value="1011" prompt="CTP:银期转账:迟到应答"/>
|
||||
<error id="REVERSAL_BANKID_NOT_MATCH" value="1012" prompt="CTP:银期转账:冲正交易银行代码错误"/>
|
||||
<error id="REVERSAL_BANKACCOUNT_NOT_MATCH" value="1013" prompt="CTP:银期转账:冲正交易银行账户错误"/>
|
||||
<error id="REVERSAL_BROKERID_NOT_MATCH" value="1014" prompt="CTP:银期转账:冲正交易经纪公司代码错误"/>
|
||||
<error id="REVERSAL_ACCOUNTID_NOT_MATCH" value="1015" prompt="CTP:银期转账:冲正交易资金账户错误"/>
|
||||
<error id="REVERSAL_AMOUNT_NOT_MATCH" value="1016" prompt="CTP:银期转账:冲正交易交易金额错误"/>
|
||||
<error id="DB_OPERATION_FAILED" value="1017" prompt="CTP:银期转账:数据库操作错误"/>
|
||||
<error id="SEND_ASP_FAILURE" value="1018" prompt="CTP:银期转账:发送到交易系统失败"/>
|
||||
<error id="NOT_SIGNIN" value="1019" prompt="CTP:银期转账:没有签到"/>
|
||||
<error id="ALREADY_SIGNIN" value="1020" prompt="CTP:银期转账:已经签到"/>
|
||||
<error id="AMOUNT_OR_TIMES_OVER" value="1021" prompt="CTP:银期转账:金额或次数超限"/>
|
||||
<error id="NOT_IN_TRANSFER_TIME" value="1022" prompt="CTP:银期转账:这一时间段不能转账"/>
|
||||
<error id="BANK_SERVER_ERROR" value="1023" prompt="银行主机错"/>
|
||||
<error id="BANK_SERIAL_IS_REPEALED" value="1024" prompt="CTP:银期转账:银行已经冲正"/>
|
||||
<error id="BANK_SERIAL_NOT_EXIST" value="1025" prompt="CTP:银期转账:银行流水不存在"/>
|
||||
<error id="NOT_ORGAN_MAP" value="1026" prompt="CTP:银期转账:机构没有签约"/>
|
||||
<error id="EXIST_TRANSFER" value="1027" prompt="CTP:银期转账:存在转账,不能销户"/>
|
||||
<error id="BANK_FORBID_REVERSAL" value="1028" prompt="CTP:银期转账:银行不支持冲正"/>
|
||||
<error id="DUP_BANK_SERIAL" value="1029" prompt="CTP:银期转账:重复的银行流水"/>
|
||||
<error id="FBT_SYSTEM_BUSY" value="1030" prompt="CTP:银期转账:转账系统忙,稍后再试"/>
|
||||
<error id="MACKEY_SYNCING" value="1031" prompt="CTP:银期转账:MAC密钥正在同步"/>
|
||||
<error id="ACCOUNTID_ALREADY_REGISTER" value="1032" prompt="CTP:银期转账:资金账户已经登记"/>
|
||||
<error id="BANKACCOUNT_ALREADY_REGISTER" value="1033" prompt="CTP:银期转账:银行账户已经登记"/>
|
||||
<error id="DUP_BANK_SERIAL_REDO_OK" value="1034" prompt="CTP:银期转账:重复的银行流水,重发成功"/>
|
||||
<error id="CURRENCYID_NOT_SUPPORTED" value="1035" prompt="CTP:银期转账:该币种代码不支持"/>
|
||||
<error id="INVALID_MAC" value="1036" prompt="CTP:银期转账:MAC值验证失败"/>
|
||||
<error id="NOT_SUPPORT_SECAGENT_BY_BANK" value="1037" prompt="CTP:银期转账:不支持银行端发起的二级代理商转账和查询"/>
|
||||
<error id="PINKEY_SYNCING" value="1038" prompt="CTP:银期转账:PIN密钥正在同步"/>
|
||||
<error id="SECAGENT_QUERY_BY_CCB" value="1039" prompt="CTP:银期转账:建行发起的二级代理商查询"/>
|
||||
<!-- add for transfer begin -->
|
||||
<error id="NO_VALID_BANKOFFER_AVAILABLE" value="2000" prompt="CTP:该报盘未连接到银行"/>
|
||||
<error id="PASSWORD_MISMATCH" value="2001" prompt="CTP:资金密码错误"/>
|
||||
<error id="DUPLATION_BANK_SERIAL" value="2004" prompt="CTP:银行流水号重复"/>
|
||||
<error id="DUPLATION_OFFER_SERIAL" value="2005" prompt="CTP:报盘流水号重复"/>
|
||||
<error id="SERIAL_NOT_EXSIT" value="2006" prompt="CTP:被冲正流水不存在(冲正交易)"/>
|
||||
<error id="SERIAL_IS_REPEALED" value="2007" prompt="CTP:原流水已冲正(冲正交易)"/>
|
||||
<error id="SERIAL_MISMATCH" value="2008" prompt="CTP:与原流水信息不符(冲正交易)"/>
|
||||
<error id="IdentifiedCardNo_MISMATCH" value="2009" prompt="CTP:证件号码或类型错误"/>
|
||||
<error id="ACCOUNT_NOT_FUND" value="2011" prompt="CTP:资金账户不存在"/>
|
||||
<error id="ACCOUNT_NOT_ACTIVE" value="2012" prompt="CTP:资金账户已经销户"/>
|
||||
<error id="NOT_ALLOW_REPEAL_BYMANUAL" value="2013" prompt="CTP:该交易不能执行手工冲正"/>
|
||||
<error id="AMOUNT_OUTOFTHEWAY" value="2014" prompt="CTP:转帐金额错误"/>
|
||||
<error id="EXCHANGERATE_NOT_FOUND" value="2015" prompt="CTP:找不到汇率"/>
|
||||
<error id="WAITING_OFFER_RSP" value="999999" prompt="CTP:等待银期报盘处理结果"/>
|
||||
<!-- add for transfer end -->
|
||||
<!--换汇系统错误代码 bgn-->
|
||||
<error id="FBE_NO_GET_PLATFORM_SN" value="3001" prompt="CTP:银期换汇:取平台流水号错误"/>
|
||||
<error id="FBE_ILLEGAL_TRANSFER_BANK" value="3002" prompt="CTP:银期换汇:不合法的转账银行"/>
|
||||
<error id="FBE_PROCESSING" value="3005" prompt="CTP:银期换汇:处理中"/>
|
||||
<error id="FBE_OVERTIME" value="3006" prompt="CTP:银期换汇:交易超时"/>
|
||||
<error id="FBE_RECORD_NOT_FOUND" value="3007" prompt="CTP:银期换汇:找不到记录"/>
|
||||
<error id="FBE_CONNECT_HOST_FAILED" value="3009" prompt="CTP:银期换汇:连接主机失败"/>
|
||||
<error id="FBE_SEND_FAILED" value="3010" prompt="CTP:银期换汇:发送失败"/>
|
||||
<error id="FBE_LATE_RESPONSE" value="3011" prompt="CTP:银期换汇:迟到应答"/>
|
||||
<error id="FBE_DB_OPERATION_FAILED" value="3017" prompt="CTP:银期换汇:数据库操作错误"/>
|
||||
<error id="FBE_NOT_SIGNIN" value="3019" prompt="CTP:银期换汇:没有签到"/>
|
||||
<error id="FBE_ALREADY_SIGNIN" value="3020" prompt="CTP:银期换汇:已经签到"/>
|
||||
<error id="FBE_AMOUNT_OR_TIMES_OVER" value="3021" prompt="CTP:银期换汇:金额或次数超限"/>
|
||||
<error id="FBE_NOT_IN_TRANSFER_TIME" value="3022" prompt="CTP:银期换汇:这一时间段不能换汇"/>
|
||||
<error id="FBE_BANK_SERVER_ERROR" value="3023" prompt="CTP:银期换汇:银行主机错"/>
|
||||
<error id="FBE_NOT_ORGAN_MAP" value="3026" prompt="CTP:银期换汇:机构没有签约"/>
|
||||
<error id="FBE_SYSTEM_BUSY" value="3030" prompt="CTP:银期换汇:换汇系统忙,稍后再试"/>
|
||||
<error id="FBE_CURRENCYID_NOT_SUPPORTED" value="3035" prompt="CTP:银期换汇:该币种代码不支持"/>
|
||||
<error id="FBE_WRONG_BANK_ACCOUNT" value="3036" prompt="CTP:银期换汇:银行帐号不正确"/>
|
||||
<error id="FBE_BANK_ACCOUNT_NO_FUNDS" value="3037" prompt="CTP:银期换汇:银行帐户余额不足"/>
|
||||
<error id="FBE_DUP_CERT_NO" value="3038" prompt="CTP:银期换汇:凭证号重复"/>
|
||||
<!--换汇系统错误代码 end-->
|
||||
</errors>
|
BIN
vn.ctp/ctpapi/x64_linux/libthostmduserapi.so
Executable file
BIN
vn.ctp/ctpapi/x64_linux/libthostmduserapi.so
Executable file
Binary file not shown.
BIN
vn.ctp/ctpapi/x64_linux/libthosttraderapi.so
Executable file
BIN
vn.ctp/ctpapi/x64_linux/libthosttraderapi.so
Executable file
Binary file not shown.
@ -19,6 +19,16 @@
|
||||
* [Anaconda1.9.2](http://repo.continuum.io/archive/index.html): 量化相关包的Python发行版
|
||||
* 编译工具:windows下选择visual studio 2013;linux下使用g++。
|
||||
|
||||
Linux: (Debian jessie)
|
||||
* apt-get install build-essential
|
||||
* apt-get install libboost-all-dev
|
||||
* apt-get install python-dev
|
||||
* apt-get install cmake
|
||||
* 下载ctp api tar包,比如v6.3.5_20150803_tradeapi_linux64.tar,重命名ctp api so文件名:
|
||||
** thostmduserapi.so --> libthostmduserapi.so
|
||||
** thosttraderapi.so --> libthosttraderapi.so
|
||||
|
||||
|
||||
# 编译过程
|
||||
-------------
|
||||
|
||||
@ -28,3 +38,6 @@
|
||||
* 点击generate。如果没有错误则配置成功
|
||||
* 进入build目录,双击vn_ctp_api.sln打开解决方案
|
||||
* 点击编译按钮,建议编译release库
|
||||
|
||||
Linux: (Debian jessie)
|
||||
* 当前目录运行build.sh,完成编译
|
||||
|
@ -1,7 +1,6 @@
|
||||
// vnctpmd.cpp : 定义 DLL 应用程序的导出函数。
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "vnctpmd.h"
|
||||
|
||||
///-------------------------------------------------------------------------------------
|
||||
@ -46,7 +45,11 @@ void getChar(dict d, string key, char *value)
|
||||
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
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -817,4 +820,4 @@ BOOST_PYTHON_MODULE(vnctpmd)
|
||||
.def("onRspUnSubForQuoteRsp", pure_virtual(&MdApiWrap::onRspUnSubForQuoteRsp))
|
||||
.def("onRtnForQuoteRsp", pure_virtual(&MdApiWrap::onRtnForQuoteRsp))
|
||||
;
|
||||
};
|
||||
};
|
||||
|
@ -1,7 +1,9 @@
|
||||
//说明部分
|
||||
|
||||
//系统
|
||||
#ifdef WIN32
|
||||
#include "stdafx.h"
|
||||
#endif
|
||||
#include <string>
|
||||
#include <queue>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// vnctptd.cpp : 定义 DLL 应用程序的导出函数。
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "vnctptd.h"
|
||||
|
||||
|
||||
@ -47,7 +46,11 @@ void getChar(dict d, string key, char *value)
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3888,7 +3891,9 @@ void TdApi::processRspQryInvestorPosition(Task task)
|
||||
data["Position"] = task_data.Position;
|
||||
data["FrozenCommission"] = task_data.FrozenCommission;
|
||||
data["CombShortFrozen"] = task_data.CombShortFrozen;
|
||||
#ifdef WIN32
|
||||
data["OptionValue"] = task_data.OptionValue;
|
||||
#endif
|
||||
data["CloseProfitByDate"] = task_data.CloseProfitByDate;
|
||||
data["SettlementPrice"] = task_data.SettlementPrice;
|
||||
data["LongFrozenAmount"] = task_data.LongFrozenAmount;
|
||||
@ -3925,7 +3930,10 @@ void TdApi::processRspQryTradingAccount(Task task)
|
||||
data["AccountID"] = task_data.AccountID;
|
||||
data["Available"] = task_data.Available;
|
||||
data["FundMortgageAvailable"] = task_data.FundMortgageAvailable;
|
||||
#ifdef WIN32
|
||||
data["OptionValue"] = task_data.OptionValue;
|
||||
data["OptionCloseProfit"] = task_data.OptionCloseProfit;
|
||||
#endif
|
||||
data["PreCredit"] = task_data.PreCredit;
|
||||
data["PreMortgage"] = task_data.PreMortgage;
|
||||
data["InterestBase"] = task_data.InterestBase;
|
||||
@ -3941,7 +3949,6 @@ void TdApi::processRspQryTradingAccount(Task task)
|
||||
data["BrokerID"] = task_data.BrokerID;
|
||||
data["FrozenCash"] = task_data.FrozenCash;
|
||||
data["Withdraw"] = task_data.Withdraw;
|
||||
data["OptionValue"] = task_data.OptionValue;
|
||||
data["Balance"] = task_data.Balance;
|
||||
data["SpecProductMargin"] = task_data.SpecProductMargin;
|
||||
data["SpecProductPositionProfitByAlg"] = task_data.SpecProductPositionProfitByAlg;
|
||||
@ -9153,4 +9160,4 @@ BOOST_PYTHON_MODULE(vnctptd)
|
||||
.def("onRtnCancelAccountByBank", pure_virtual(&TdApiWrap::onRtnCancelAccountByBank))
|
||||
.def("onRtnChangeAccountByBank", pure_virtual(&TdApiWrap::onRtnChangeAccountByBank))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,9 @@
|
||||
|
||||
|
||||
//ϵͳ
|
||||
#ifdef WIN32
|
||||
#include "stdafx.h"
|
||||
#endif
|
||||
#include <string>
|
||||
#include <queue>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user