diff --git a/vn.ctp/ctpapi/ThostFtdcTraderApi.h b/vn.ctp/ctpapi/ThostFtdcTraderApi.h
index 93ea0fc7..91b5bdad 100644
--- a/vn.ctp/ctpapi/ThostFtdcTraderApi.h
+++ b/vn.ctp/ctpapi/ThostFtdcTraderApi.h
@@ -100,6 +100,9 @@ public:
///报价操作请求响应
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) {};
@@ -175,6 +178,12 @@ public:
///请求查询二级代理操作员银期权限响应
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) {};
@@ -190,6 +199,12 @@ public:
///请求查询报价响应
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) {};
@@ -244,6 +259,15 @@ public:
///询价通知
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) {};
@@ -262,6 +286,9 @@ public:
///请求查询经纪公司交易算法响应
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) {};
@@ -446,6 +473,9 @@ public:
///报价操作请求
virtual int ReqQuoteAction(CThostFtdcInputQuoteActionField *pInputQuoteAction, int nRequestID) = 0;
+ ///申请组合录入请求
+ virtual int ReqCombActionInsert(CThostFtdcInputCombActionField *pInputCombAction, int nRequestID) = 0;
+
///请求查询报单
virtual int ReqQryOrder(CThostFtdcQryOrderField *pQryOrder, int nRequestID) = 0;
@@ -521,6 +551,12 @@ public:
///请求查询二级代理操作员银期权限
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;
@@ -536,6 +572,12 @@ public:
///请求查询报价
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;
@@ -560,6 +602,9 @@ public:
///请求查询经纪公司交易算法
virtual int ReqQryBrokerTradingAlgos(CThostFtdcQryBrokerTradingAlgosField *pQryBrokerTradingAlgos, int nRequestID) = 0;
+ ///请求查询监控中心用户令牌
+ virtual int ReqQueryCFMMCTradingAccountToken(CThostFtdcQueryCFMMCTradingAccountTokenField *pQueryCFMMCTradingAccountToken, int nRequestID) = 0;
+
///期货发起银行资金转期货请求
virtual int ReqFromBankToFutureByFuture(CThostFtdcReqTransferField *pReqTransfer, int nRequestID) = 0;
diff --git a/vn.ctp/ctpapi/ThostFtdcUserApiDataType.h b/vn.ctp/ctpapi/ThostFtdcUserApiDataType.h
index 15c6e00b..73e95637 100644
--- a/vn.ctp/ctpapi/ThostFtdcUserApiDataType.h
+++ b/vn.ctp/ctpapi/ThostFtdcUserApiDataType.h
@@ -240,7 +240,9 @@ typedef char TThostFtdcIdentifiedCardNoType[51];
///商业登记证
#define THOST_FTDC_ICT_BusinessRegistration 'H'
///港澳永久性居民身份证
-#define THOST_FTDC_ICT_HKMCIDCard 'I'
+#define THOST_FTDC_ICT_HKMCIDCard 'I'
+///人行开户许可证
+#define THOST_FTDC_ICT_AccountsPermits 'J'
///其他证件
#define THOST_FTDC_ICT_OtherCard 'x'
@@ -735,6 +737,8 @@ typedef char TThostFtdcClientIDTypeType;
#define THOST_FTDC_OPT_BidPrice1PlusTwoTicks 'E'
///买一价浮动上浮3个ticks
#define THOST_FTDC_OPT_BidPrice1PlusThreeTicks 'F'
+///五档价
+#define THOST_FTDC_OPT_FiveLevelPrice 'G'
typedef char TThostFtdcOrderPriceTypeType;
@@ -2749,6 +2753,11 @@ typedef int TThostFtdcAMLFileAmountType;
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcCFMMCKeyType[21];
+/////////////////////////////////////////////////////////////////////////
+///TFtdcCFMMCTokenType是一个令牌类型(保证金监管)类型
+/////////////////////////////////////////////////////////////////////////
+typedef char TThostFtdcCFMMCTokenType[21];
+
/////////////////////////////////////////////////////////////////////////
///TFtdcCFMMCKeyKindType是一个动态密钥类别(保证金监管)类型
/////////////////////////////////////////////////////////////////////////
@@ -6095,6 +6104,8 @@ typedef char TThostFtdcStrikeTimeType[13];
#define THOST_FTDC_COMBT_STG '4'
///备兑组合
#define THOST_FTDC_COMBT_PRT '5'
+///时间价差组合
+#define THOST_FTDC_COMBT_CLD '6'
typedef char TThostFtdcCombinationTypeType;
@@ -6140,18 +6151,6 @@ typedef char TThostFtdcActionTypeType;
typedef char TThostFtdcForQuoteStatusType;
-/////////////////////////////////////////////////////////////////////////
-///TFtdcQuotStatusType是一个报价状态类型
-/////////////////////////////////////////////////////////////////////////
-///未知
-#define THOST_FTDC_QTST_Unknown 'a'
-///已经接受
-#define THOST_FTDC_QTST_Accepted 'b'
-///已经撤销
-#define THOST_FTDC_QTST_Canceled 'c'
-
-typedef char TThostFtdcQuotStatusType;
-
/////////////////////////////////////////////////////////////////////////
///TFtdcValueMethodType是一个取值方式类型
/////////////////////////////////////////////////////////////////////////
@@ -6264,4 +6263,14 @@ typedef char TThostFtdcSHFEUploadFileNameType;
typedef char TThostFtdcCFFEXUploadFileNameType;
+/////////////////////////////////////////////////////////////////////////
+///TFtdcCombDirectionType是一个组合指令方向类型
+/////////////////////////////////////////////////////////////////////////
+///申请组合
+#define THOST_FTDC_CMDR_Comb '0'
+///申请拆分
+#define THOST_FTDC_CMDR_UnComb '1'
+
+typedef char TThostFtdcCombDirectionType;
+
#endif
diff --git a/vn.ctp/ctpapi/ThostFtdcUserApiStruct.h b/vn.ctp/ctpapi/ThostFtdcUserApiStruct.h
index ada148c8..45133f28 100644
--- a/vn.ctp/ctpapi/ThostFtdcUserApiStruct.h
+++ b/vn.ctp/ctpapi/ThostFtdcUserApiStruct.h
@@ -654,10 +654,6 @@ struct CThostFtdcTradingAccountField
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
- ///期权平仓盈亏
- TThostFtdcMoneyType OptionCloseProfit;
- ///期权市值
- TThostFtdcMoneyType OptionValue;
};
///投资者持仓
@@ -749,8 +745,6 @@ struct CThostFtdcInvestorPositionField
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
- ///期权市值
- TThostFtdcMoneyType OptionValue;
};
///合约保证金率
@@ -1180,6 +1174,8 @@ struct CThostFtdcLoginInfoField
TThostFtdcPasswordType OneTimePassword;
///能源中心时间
TThostFtdcTimeType INETime;
+ ///查询时是否需要流控
+ TThostFtdcBoolType IsQryControl;
};
///登录信息
@@ -2011,10 +2007,6 @@ struct CThostFtdcSyncingTradingAccountField
TThostFtdcMoneyType SpecProductPositionProfitByAlg;
///特殊产品交易所保证金
TThostFtdcMoneyType SpecProductExchangeMargin;
- ///期权平仓盈亏
- TThostFtdcMoneyType OptionCloseProfit;
- ///期权市值
- TThostFtdcMoneyType OptionValue;
};
///正在同步中的投资者持仓
@@ -2106,8 +2098,6 @@ struct CThostFtdcSyncingInvestorPositionField
TThostFtdcMoneyType StrikeFrozenAmount;
///放弃执行冻结
TThostFtdcVolumeType AbandonFrozen;
- ///期权市值
- TThostFtdcMoneyType OptionValue;
};
///正在同步中的合约保证金率
@@ -3306,6 +3296,12 @@ struct CThostFtdcInputQuoteField
TThostFtdcHedgeFlagType AskHedgeFlag;
///买投机套保标志
TThostFtdcHedgeFlagType BidHedgeFlag;
+ ///衍生卖报单引用
+ TThostFtdcOrderRefType AskOrderRef;
+ ///衍生买报单引用
+ TThostFtdcOrderRefType BidOrderRef;
+ ///应价编号
+ TThostFtdcOrderSysIDType ForQuoteSysID;
};
///输入报价操作
@@ -3422,6 +3418,12 @@ struct CThostFtdcQuoteField
TThostFtdcUserIDType ActiveUserID;
///经纪公司报价编号
TThostFtdcSequenceNoType BrokerQuoteSeq;
+ ///衍生卖报单引用
+ TThostFtdcOrderRefType AskOrderRef;
+ ///衍生买报单引用
+ TThostFtdcOrderRefType BidOrderRef;
+ ///应价编号
+ TThostFtdcOrderSysIDType ForQuoteSysID;
};
///报价操作
@@ -3557,6 +3559,8 @@ struct CThostFtdcExchangeQuoteField
TThostFtdcOrderSysIDType AskOrderSysID;
///买方报单编号
TThostFtdcOrderSysIDType BidOrderSysID;
+ ///应价编号
+ TThostFtdcOrderSysIDType ForQuoteSysID;
};
///交易所报价查询
@@ -3659,6 +3663,8 @@ struct CThostFtdcForQuoteRspField
TThostFtdcTimeType ForQuoteTime;
///业务日期
TThostFtdcDateType ActionDay;
+ ///交易所代码
+ TThostFtdcExchangeIDType ExchangeID;
};
///当前期权合约执行偏移值的详细内容
@@ -3687,6 +3693,199 @@ struct CThostFtdcQryStrikeOffsetField
TThostFtdcInstrumentIDType InstrumentID;
};
+///组合合约安全系数
+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;
+};
+
+///申请组合
+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 CThostFtdcInstrumentOrderCommRateField
+{
+ ///合约代码
+ TThostFtdcInstrumentIDType InstrumentID;
+ ///投资者范围
+ TThostFtdcInvestorRangeType InvestorRange;
+ ///经纪公司代码
+ TThostFtdcBrokerIDType BrokerID;
+ ///投资者代码
+ TThostFtdcInvestorIDType InvestorID;
+ ///投机套保标志
+ TThostFtdcHedgeFlagType HedgeFlag;
+ ///报单手续费
+ TThostFtdcRatioType OrderCommByVolume;
+ ///撤单手续费
+ TThostFtdcRatioType OrderActionCommByVolume;
+};
+
+///报单手续费率查询
+struct CThostFtdcQryInstrumentOrderCommRateField
+{
+ ///经纪公司代码
+ TThostFtdcBrokerIDType BrokerID;
+ ///投资者代码
+ TThostFtdcInvestorIDType InvestorID;
+ ///合约代码
+ TThostFtdcInstrumentIDType InstrumentID;
+};
+
///市场行情
struct CThostFtdcMarketDataField
{
@@ -5278,6 +5477,50 @@ struct CThostFtdcInvestorProductGroupMarginField
TThostFtdcHedgeFlagType HedgeFlag;
};
+///查询监控中心用户令牌
+struct CThostFtdcQueryCFMMCTradingAccountTokenField
+{
+ ///经纪公司代码
+ TThostFtdcBrokerIDType BrokerID;
+ ///投资者代码
+ TThostFtdcInvestorIDType InvestorID;
+};
+
+///监控中心用户令牌
+struct CThostFtdcCFMMCTradingAccountTokenField
+{
+ ///经纪公司代码
+ TThostFtdcBrokerIDType BrokerID;
+ ///经纪公司统一编码
+ TThostFtdcParticipantIDType ParticipantID;
+ ///投资者帐号
+ TThostFtdcAccountIDType AccountID;
+ ///密钥编号
+ TThostFtdcSequenceNoType KeyID;
+ ///动态令牌
+ TThostFtdcCFMMCTokenType Token;
+};
+
+///查询产品组
+struct CThostFtdcQryProductGroupField
+{
+ ///产品代码
+ TThostFtdcInstrumentIDType ProductID;
+ ///交易所代码
+ TThostFtdcExchangeIDType ExchangeID;
+};
+
+///投资者品种/跨品种保证金产品组
+struct CThostFtdcProductGroupField
+{
+ ///产品代码
+ TThostFtdcInstrumentIDType ProductID;
+ ///交易所代码
+ TThostFtdcExchangeIDType ExchangeID;
+ ///产品组代码
+ TThostFtdcInstrumentIDType ProductGroupID;
+};
+
///转帐开户请求
struct CThostFtdcReqOpenAccountField
{
@@ -7390,6 +7633,8 @@ struct CThostFtdcLoginForbiddenUserField
TThostFtdcBrokerIDType BrokerID;
///用户代码
TThostFtdcUserIDType UserID;
+ ///IP地址
+ TThostFtdcIPAddressType IPAddress;
};
///查询禁止登录用户
diff --git a/vn.ctp/ctpapi/error.dtd b/vn.ctp/ctpapi/error.dtd
index 15e50b73..2a067f86 100644
--- a/vn.ctp/ctpapi/error.dtd
+++ b/vn.ctp/ctpapi/error.dtd
@@ -1,9 +1,9 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/vn.ctp/ctpapi/error.xml b/vn.ctp/ctpapi/error.xml
index 419c018d..1c6e7425 100644
--- a/vn.ctp/ctpapi/error.xml
+++ b/vn.ctp/ctpapi/error.xml
@@ -1,118 +1,181 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vn.ctp/ctpapi/thostmduserapi.so b/vn.ctp/ctpapi/thostmduserapi.so
new file mode 100755
index 00000000..956d23ab
Binary files /dev/null and b/vn.ctp/ctpapi/thostmduserapi.so differ
diff --git a/vn.ctp/ctpapi/thosttraderapi.so b/vn.ctp/ctpapi/thosttraderapi.so
new file mode 100755
index 00000000..460e7a3b
Binary files /dev/null and b/vn.ctp/ctpapi/thosttraderapi.so differ
diff --git a/vn.ctp/vnctpmd/vnctpmd/makefile b/vn.ctp/vnctpmd/vnctpmd/makefile
new file mode 100644
index 00000000..0ca166eb
--- /dev/null
+++ b/vn.ctp/vnctpmd/vnctpmd/makefile
@@ -0,0 +1,12 @@
+include ../../../makefile.inc
+
+
+all:
+ $(CXX) $(COMMON_FLAGS) $(INCLUDE) -I$(ROOTPATH)/vn.ctp/ctpapi -c vnctpmd.cpp -o vnctpmd.o
+ $(CXX) $(COMMON_FLAGS) -shared -Wl,-soname,vnctpmd.so -o vnctpmd.so vnctpmd.o -L$(ROOTPATH)/vn.ctp/ctpapi $(LIBRARIES) -l:thostmduserapi.so -l:thosttraderapi.so
+ cp vnctpmd.so ../test
+ cp vnctpmd.so $(ROOTPATH)/vn.demo/ctpdemo
+ cp vnctpmd.so $(ROOTPATH)/vn.strategy/strategydemo
+
+clean:
+ rm *.o *.so
diff --git a/vn.ctp/vnctpmd/vnctpmd/vnctpmd.cpp b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.cpp
index fbc26008..c3717ff2 100644
--- a/vn.ctp/vnctpmd/vnctpmd/vnctpmd.cpp
+++ b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.cpp
@@ -1,7 +1,9 @@
// vnctpmd.cpp : 定义 DLL 应用程序的导出函数。
//
+#ifndef __GNU__
#include "stdafx.h"
+#endif
#include "vnctpmd.h"
///-------------------------------------------------------------------------------------
@@ -817,4 +819,4 @@ BOOST_PYTHON_MODULE(vnctpmd)
.def("onRspUnSubForQuoteRsp", pure_virtual(&MdApiWrap::onRspUnSubForQuoteRsp))
.def("onRtnForQuoteRsp", pure_virtual(&MdApiWrap::onRtnForQuoteRsp))
;
-};
\ No newline at end of file
+};
diff --git a/vn.ctp/vnctpmd/vnctpmd/vnctpmd.h b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.h
index 20ab5b39..d188b680 100644
--- a/vn.ctp/vnctpmd/vnctpmd/vnctpmd.h
+++ b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.h
@@ -1,7 +1,9 @@
//说明部分
//系统
+#ifndef __GNU__
#include "stdafx.h"
+#endif
#include
#include
@@ -39,7 +41,9 @@ using namespace boost;
#define ONRTNFORQUOTERSP 12
-
+#ifdef __GNU__
+#define strcpy_s(dest, len, src) strncpy(dest, src, len)
+#endif
///-------------------------------------------------------------------------------------
///API中的部分组件
///-------------------------------------------------------------------------------------
diff --git a/vn.ctp/vnctpmd/vnctpmd/vnctpmd.o b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.o
new file mode 100644
index 00000000..c3539e0d
Binary files /dev/null and b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.o differ
diff --git a/vn.ctp/vnctpmd/vnctpmd/vnctpmd.so b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.so
new file mode 100755
index 00000000..ae26c319
Binary files /dev/null and b/vn.ctp/vnctpmd/vnctpmd/vnctpmd.so differ
diff --git a/vn.ctp/vnctptd/vnctptd/makefile b/vn.ctp/vnctptd/vnctptd/makefile
new file mode 100644
index 00000000..185d5040
--- /dev/null
+++ b/vn.ctp/vnctptd/vnctptd/makefile
@@ -0,0 +1,12 @@
+include ../../../makefile.inc
+
+
+all:
+ $(CXX) $(COMMON_FLAGS) $(INCLUDE) -I$(ROOTPATH)/vn.ctp/ctpapi -c vnctptd.cpp -o vnctptd.o
+ $(CXX) $(COMMON_FLAGS) -shared -Wl,-soname,vnctptd.so -o vnctptd.so vnctptd.o -L$(ROOTPATH)/vn.ctp/ctpapi $(LIBRARIES) -l:thostmduserapi.so -l:thosttraderapi.so
+ cp vnctptd.so ../test
+ cp vnctptd.so $(ROOTPATH)/vn.demo/ctpdemo
+ cp vnctptd.so $(ROOTPATH)/vn.strategy/strategydemo
+
+clean:
+ rm *.o *.so
diff --git a/vn.ctp/vnctptd/vnctptd/vnctptd.cpp b/vn.ctp/vnctptd/vnctptd/vnctptd.cpp
index 6b6b70e6..56fcd157 100644
--- a/vn.ctp/vnctptd/vnctptd/vnctptd.cpp
+++ b/vn.ctp/vnctptd/vnctptd/vnctptd.cpp
@@ -1,7 +1,9 @@
// vnctptd.cpp : 定义 DLL 应用程序的导出函数。
//
+#ifndef __GNU__
#include "stdafx.h"
+#endif
#include "vnctptd.h"
@@ -3888,7 +3890,9 @@ void TdApi::processRspQryInvestorPosition(Task task)
data["Position"] = task_data.Position;
data["FrozenCommission"] = task_data.FrozenCommission;
data["CombShortFrozen"] = task_data.CombShortFrozen;
+#ifndef __GNU__
data["OptionValue"] = task_data.OptionValue;
+#endif
data["CloseProfitByDate"] = task_data.CloseProfitByDate;
data["SettlementPrice"] = task_data.SettlementPrice;
data["LongFrozenAmount"] = task_data.LongFrozenAmount;
@@ -3925,7 +3929,9 @@ void TdApi::processRspQryTradingAccount(Task task)
data["AccountID"] = task_data.AccountID;
data["Available"] = task_data.Available;
data["FundMortgageAvailable"] = task_data.FundMortgageAvailable;
+#ifndef __GNU__
data["OptionCloseProfit"] = task_data.OptionCloseProfit;
+#endif
data["PreCredit"] = task_data.PreCredit;
data["PreMortgage"] = task_data.PreMortgage;
data["InterestBase"] = task_data.InterestBase;
@@ -3941,7 +3947,9 @@ void TdApi::processRspQryTradingAccount(Task task)
data["BrokerID"] = task_data.BrokerID;
data["FrozenCash"] = task_data.FrozenCash;
data["Withdraw"] = task_data.Withdraw;
+#ifndef __GNU__
data["OptionValue"] = task_data.OptionValue;
+#endif
data["Balance"] = task_data.Balance;
data["SpecProductMargin"] = task_data.SpecProductMargin;
data["SpecProductPositionProfitByAlg"] = task_data.SpecProductPositionProfitByAlg;
@@ -9153,4 +9161,4 @@ BOOST_PYTHON_MODULE(vnctptd)
.def("onRtnCancelAccountByBank", pure_virtual(&TdApiWrap::onRtnCancelAccountByBank))
.def("onRtnChangeAccountByBank", pure_virtual(&TdApiWrap::onRtnChangeAccountByBank))
;
-}
\ No newline at end of file
+}
diff --git a/vn.ctp/vnctptd/vnctptd/vnctptd.h b/vn.ctp/vnctptd/vnctptd/vnctptd.h
index 59e4c60c..061a2e39 100644
--- a/vn.ctp/vnctptd/vnctptd/vnctptd.h
+++ b/vn.ctp/vnctptd/vnctptd/vnctptd.h
@@ -7,7 +7,9 @@
//系统
+#ifndef __GNU__
#include "stdafx.h"
+#endif
#include
#include
@@ -129,6 +131,9 @@ using namespace boost;
#define ONRTNCANCELACCOUNTBYBANK 96
#define ONRTNCHANGEACCOUNTBYBANK 97
+#ifdef __GNU__
+#define strcpy_s(dest, len, src) strncpy(dest, src, len)
+#endif
diff --git a/vn.ctp/vnctptd/vnctptd/vnctptd.o b/vn.ctp/vnctptd/vnctptd/vnctptd.o
new file mode 100644
index 00000000..3273aa6e
Binary files /dev/null and b/vn.ctp/vnctptd/vnctptd/vnctptd.o differ
diff --git a/vn.ctp/vnctptd/vnctptd/vnctptd.so b/vn.ctp/vnctptd/vnctptd/vnctptd.so
new file mode 100755
index 00000000..0b4c2e7c
Binary files /dev/null and b/vn.ctp/vnctptd/vnctptd/vnctptd.so differ