Skip to content

Commit

Permalink
升级 CTP 版本到 6.7.2
Browse files Browse the repository at this point in the history
升级 native-lib-loader 到 2.5.0
  • Loading branch information
RationalityFrontline committed Feb 16, 2024
1 parent 5231eaf commit ef4275c
Show file tree
Hide file tree
Showing 11 changed files with 1,448 additions and 8 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
[当前已封装的 CTP 版本](https://search.maven.org/artifact/org.rationalityfrontline/jctp)
```
6.7.2-1.0.5
6.7.2_CP-1.0.5
6.6.9-1.0.5
6.6.9_CP-1.0.5
6.6.1_P1-1.0.5
Expand Down Expand Up @@ -57,7 +59,7 @@ repositories {
}

dependencies {
implementation("org.rationalityfrontline:jctp:6.6.9-1.0.5")
implementation("org.rationalityfrontline:jctp:6.7.2-1.0.5")
}
```

Expand All @@ -67,7 +69,7 @@ dependencies {
<dependency>
<groupId>org.rationalityfrontline</groupId>
<artifactId>jctp</artifactId>
<version>6.6.9-1.0.5</version>
<version>6.7.2-1.0.5</version>
</dependency>
```
**Jar:**
Expand All @@ -77,7 +79,7 @@ dependencies {
使用 Jar 包前请先添加 [native-lib-loader](https://github.com/scijava/native-lib-loader) 依赖:
```kotlin
dependencies {
implementation("org.scijava:native-lib-loader:2.4.0")
implementation("org.scijava:native-lib-loader:2.5.0")
}
```

Expand Down Expand Up @@ -118,7 +120,7 @@ https://github.com/scijava/native-lib-loader
JCTP is released under the [Apache 2.0 license](https://github.com/ktrader-tech/jctp/blob/master/LICENSE).

```
Copyright 2020-2023 RationalityFrontline
Copyright 2020-2024 RationalityFrontline
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
96 changes: 96 additions & 0 deletions cpp/src/ThostFtdcTraderApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,54 @@ class CThostFtdcTraderSpi

///投资者产品SPBM明细查询响应
virtual void OnRspQryInvestorProdSPBMDetail(CThostFtdcInvestorProdSPBMDetailField *pInvestorProdSPBMDetail, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///投资者商品组SPMM记录查询响应
virtual void OnRspQryInvestorCommoditySPMMMargin(CThostFtdcInvestorCommoditySPMMMarginField *pInvestorCommoditySPMMMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///投资者商品群SPMM记录查询响应
virtual void OnRspQryInvestorCommodityGroupSPMMMargin(CThostFtdcInvestorCommodityGroupSPMMMarginField *pInvestorCommodityGroupSPMMMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///SPMM合约参数查询响应
virtual void OnRspQrySPMMInstParam(CThostFtdcSPMMInstParamField *pSPMMInstParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///SPMM产品参数查询响应
virtual void OnRspQrySPMMProductParam(CThostFtdcSPMMProductParamField *pSPMMProductParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///SPBM附加跨品种抵扣参数查询响应
virtual void OnRspQrySPBMAddOnInterParameter(CThostFtdcSPBMAddOnInterParameterField *pSPBMAddOnInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RCAMS产品组合信息查询响应
virtual void OnRspQryRCAMSCombProductInfo(CThostFtdcRCAMSCombProductInfoField *pRCAMSCombProductInfo, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RCAMS同合约风险对冲参数查询响应
virtual void OnRspQryRCAMSInstrParameter(CThostFtdcRCAMSInstrParameterField *pRCAMSInstrParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RCAMS品种内风险对冲参数查询响应
virtual void OnRspQryRCAMSIntraParameter(CThostFtdcRCAMSIntraParameterField *pRCAMSIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RCAMS跨品种风险折抵参数查询响应
virtual void OnRspQryRCAMSInterParameter(CThostFtdcRCAMSInterParameterField *pRCAMSInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RCAMS空头期权风险调整参数查询响应
virtual void OnRspQryRCAMSShortOptAdjustParam(CThostFtdcRCAMSShortOptAdjustParamField *pRCAMSShortOptAdjustParam, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RCAMS策略组合持仓查询响应
virtual void OnRspQryRCAMSInvestorCombPosition(CThostFtdcRCAMSInvestorCombPositionField *pRCAMSInvestorCombPosition, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///投资者品种RCAMS保证金查询响应
virtual void OnRspQryInvestorProdRCAMSMargin(CThostFtdcInvestorProdRCAMSMarginField *pInvestorProdRCAMSMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RULE合约保证金参数查询响应
virtual void OnRspQryRULEInstrParameter(CThostFtdcRULEInstrParameterField *pRULEInstrParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RULE品种内对锁仓折扣参数查询响应
virtual void OnRspQryRULEIntraParameter(CThostFtdcRULEIntraParameterField *pRULEIntraParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///RULE跨品种抵扣参数查询响应
virtual void OnRspQryRULEInterParameter(CThostFtdcRULEInterParameterField *pRULEInterParameter, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};

///投资者产品RULE保证金查询响应
virtual void OnRspQryInvestorProdRULEMargin(CThostFtdcInvestorProdRULEMarginField *pInvestorProdRULEMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
};

class TRADER_API_EXPORT CThostFtdcTraderApi
Expand Down Expand Up @@ -811,6 +859,54 @@ class TRADER_API_EXPORT CThostFtdcTraderApi

///投资者产品SPBM明细查询
virtual int ReqQryInvestorProdSPBMDetail(CThostFtdcQryInvestorProdSPBMDetailField *pQryInvestorProdSPBMDetail, int nRequestID) = 0;

///投资者商品组SPMM记录查询
virtual int ReqQryInvestorCommoditySPMMMargin(CThostFtdcQryInvestorCommoditySPMMMarginField *pQryInvestorCommoditySPMMMargin, int nRequestID) = 0;

///投资者商品群SPMM记录查询
virtual int ReqQryInvestorCommodityGroupSPMMMargin(CThostFtdcQryInvestorCommodityGroupSPMMMarginField *pQryInvestorCommodityGroupSPMMMargin, int nRequestID) = 0;

///SPMM合约参数查询
virtual int ReqQrySPMMInstParam(CThostFtdcQrySPMMInstParamField *pQrySPMMInstParam, int nRequestID) = 0;

///SPMM产品参数查询
virtual int ReqQrySPMMProductParam(CThostFtdcQrySPMMProductParamField *pQrySPMMProductParam, int nRequestID) = 0;

///SPBM附加跨品种抵扣参数查询
virtual int ReqQrySPBMAddOnInterParameter(CThostFtdcQrySPBMAddOnInterParameterField *pQrySPBMAddOnInterParameter, int nRequestID) = 0;

///RCAMS产品组合信息查询
virtual int ReqQryRCAMSCombProductInfo(CThostFtdcQryRCAMSCombProductInfoField *pQryRCAMSCombProductInfo, int nRequestID) = 0;

///RCAMS同合约风险对冲参数查询
virtual int ReqQryRCAMSInstrParameter(CThostFtdcQryRCAMSInstrParameterField *pQryRCAMSInstrParameter, int nRequestID) = 0;

///RCAMS品种内风险对冲参数查询
virtual int ReqQryRCAMSIntraParameter(CThostFtdcQryRCAMSIntraParameterField *pQryRCAMSIntraParameter, int nRequestID) = 0;

///RCAMS跨品种风险折抵参数查询
virtual int ReqQryRCAMSInterParameter(CThostFtdcQryRCAMSInterParameterField *pQryRCAMSInterParameter, int nRequestID) = 0;

///RCAMS空头期权风险调整参数查询
virtual int ReqQryRCAMSShortOptAdjustParam(CThostFtdcQryRCAMSShortOptAdjustParamField *pQryRCAMSShortOptAdjustParam, int nRequestID) = 0;

///RCAMS策略组合持仓查询
virtual int ReqQryRCAMSInvestorCombPosition(CThostFtdcQryRCAMSInvestorCombPositionField *pQryRCAMSInvestorCombPosition, int nRequestID) = 0;

///投资者品种RCAMS保证金查询
virtual int ReqQryInvestorProdRCAMSMargin(CThostFtdcQryInvestorProdRCAMSMarginField *pQryInvestorProdRCAMSMargin, int nRequestID) = 0;

///RULE合约保证金参数查询
virtual int ReqQryRULEInstrParameter(CThostFtdcQryRULEInstrParameterField *pQryRULEInstrParameter, int nRequestID) = 0;

///RULE品种内对锁仓折扣参数查询
virtual int ReqQryRULEIntraParameter(CThostFtdcQryRULEIntraParameterField *pQryRULEIntraParameter, int nRequestID) = 0;

///RULE跨品种抵扣参数查询
virtual int ReqQryRULEInterParameter(CThostFtdcQryRULEInterParameterField *pQryRULEInterParameter, int nRequestID) = 0;

///投资者产品RULE保证金查询
virtual int ReqQryInvestorProdRULEMargin(CThostFtdcQryInvestorProdRULEMarginField *pQryInvestorProdRULEMargin, int nRequestID) = 0;
protected:
~CThostFtdcTraderApi(){};
};
Expand Down
155 changes: 153 additions & 2 deletions cpp/src/ThostFtdcUserApiDataType.h
Original file line number Diff line number Diff line change
Expand Up @@ -2572,9 +2572,9 @@ typedef char TThostFtdcClearbarchIDType[6];
#define THOST_FTDC_UET_Login '1'
///登出
#define THOST_FTDC_UET_Logout '2'
///交易成功
///CTP校验通过
#define THOST_FTDC_UET_Trading '3'
///交易失败
///CTP校验失败
#define THOST_FTDC_UET_TradingError '4'
///修改密码
#define THOST_FTDC_UET_UpdatePassword '5'
Expand Down Expand Up @@ -6906,6 +6906,12 @@ typedef int TThostFtdcSpreadIdType;
#define THOST_FTDC_EPF_None '0'
///SPBM算法
#define THOST_FTDC_EPF_SPBM '1'
///RULE算法
#define THOST_FTDC_EPF_RULE '2'
///SPMM算法
#define THOST_FTDC_EPF_SPMM '3'
///RCAMS算法
#define THOST_FTDC_EPF_RCAMS '4'

typedef char TThostFtdcPortfolioType;

Expand All @@ -6914,4 +6920,149 @@ typedef char TThostFtdcPortfolioType;
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcPortfolioDefIDType;

/////////////////////////////////////////////////////////////////////////
///TFtdcWithDrawParamIDType是一个可提参数代码类型
/////////////////////////////////////////////////////////////////////////
///权利金收支是否可提 1 代表可提 0 不可提
#define THOST_FTDC_WDPID_CashIn 'C'

typedef char TThostFtdcWithDrawParamIDType;

/////////////////////////////////////////////////////////////////////////
///TFtdcWithDrawParamValueType是一个可提控制参数内容类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcWithDrawParamValueType[41];

/////////////////////////////////////////////////////////////////////////
///TFtdcInvstTradingRightType是一个投资者交易权限类型
/////////////////////////////////////////////////////////////////////////
///只能平仓
#define THOST_FTDC_ITR_CloseOnly '1'
///不能交易
#define THOST_FTDC_ITR_Forbidden '2'

typedef char TThostFtdcInvstTradingRightType;

/////////////////////////////////////////////////////////////////////////
///TFtdcThostFunctionCodeType是一个Thost终端功能代码类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcThostFunctionCodeType;

/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMDiscountRatioType是一个SPMM折扣率类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcSPMMDiscountRatioType;

/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMModelDescType是一个SPMM模板描述类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMModelDescType[129];

/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMModelIDType是一个SPMM模板ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMModelIDType[33];

/////////////////////////////////////////////////////////////////////////
///TFtdcSPMMProductIDType是一个SPMM商品群商品组ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcSPMMProductIDType[41];

/////////////////////////////////////////////////////////////////////////
///TFtdcInstMarginCalIDType是一个SPMM合约保证金算法类型
/////////////////////////////////////////////////////////////////////////
///标准算法收取双边
#define THOST_FTDC_IMID_BothSide '1'
///单向大边
#define THOST_FTDC_IMID_MMSA '2'
///新组保SPMM
#define THOST_FTDC_IMID_SPMM '3'

typedef char TThostFtdcInstMarginCalIDType;

/////////////////////////////////////////////////////////////////////////
///TFtdcProductIDType是一个产品ID类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcProductIDType[41];

/////////////////////////////////////////////////////////////////////////
///TFtdcHedgeRateType是一个HedgeRate类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcHedgeRateType;

/////////////////////////////////////////////////////////////////////////
///TFtdcRCAMSPriorityType是一个优先级类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcRCAMSPriorityType;

/////////////////////////////////////////////////////////////////////////
///TFtdcAdjustValueType是一个空头期权风险调整标准类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcAdjustValueType;

/////////////////////////////////////////////////////////////////////////
///TFtdcRCAMSCombinationTypeType是一个RCAMS组合类型类型
/////////////////////////////////////////////////////////////////////////
///牛市看涨价差组合
#define THOST_FTDC_ERComb_BUC '0'
///熊市看涨价差组合
#define THOST_FTDC_ERComb_BEC '1'
///熊市看跌价差组合
#define THOST_FTDC_ERComb_BEP '2'
///牛市看跌价差组合
#define THOST_FTDC_ERComb_BUP '3'
///日历价差组合
#define THOST_FTDC_ERComb_CAS '4'

typedef char TThostFtdcRCAMSCombinationTypeType;

/////////////////////////////////////////////////////////////////////////
///TFtdcRuleIdType是一个策略id类型
/////////////////////////////////////////////////////////////////////////
typedef char TThostFtdcRuleIdType[51];

/////////////////////////////////////////////////////////////////////////
///TFtdcPortfTypeType是一个新组保算法启用类型类型
/////////////////////////////////////////////////////////////////////////
///使用初版交易所算法
#define THOST_FTDC_EET_None '0'
///SPBM算法V1.1.0_附加保证金调整
#define THOST_FTDC_EET_SPBM_AddOnHedge '1'

typedef char TThostFtdcPortfTypeType;

/////////////////////////////////////////////////////////////////////////
///TFtdcInstrumentClassType是一个合约类型类型
/////////////////////////////////////////////////////////////////////////
///一般月份合约
#define THOST_FTDC_EIC_Usual '1'
///临近交割合约
#define THOST_FTDC_EIC_Delivery '2'
///非组合合约
#define THOST_FTDC_EIC_NonComb '3'

typedef char TThostFtdcInstrumentClassType;

/////////////////////////////////////////////////////////////////////////
///TFtdcCommodityGroupIDType是一个商品群号类型
/////////////////////////////////////////////////////////////////////////
typedef int TThostFtdcCommodityGroupIDType;

/////////////////////////////////////////////////////////////////////////
///TFtdcStdPositionType是一个标准持仓类型类型
/////////////////////////////////////////////////////////////////////////
typedef double TThostFtdcStdPositionType;

/////////////////////////////////////////////////////////////////////////
///TFtdcProdChangeFlagType是一个品种记录改变状态类型
/////////////////////////////////////////////////////////////////////////
///持仓量和冻结量均无变化
#define THOST_FTDC_PCF_None '0'
///持仓量无变化,冻结量有变化
#define THOST_FTDC_PCF_OnlyFrozen '1'
///持仓量有变化
#define THOST_FTDC_PCF_PositionChange '2'

typedef char TThostFtdcProdChangeFlagType;

#endif
Loading

0 comments on commit ef4275c

Please sign in to comment.