📝 docs(tsl): sync api skill with corrected codegen

Mirror docs/tsl/codegen into the bundled tsl-api-reference skill and rebuild the function index.

Remove invalid duplicate API entries for cb_delistedbydate, createhttpsession, exportJsonString, and Anova_Bartlett so exact lookup returns the canonical entries.
This commit is contained in:
csh
2026-07-07 16:47:03 +08:00
parent bbf6977f57
commit c0bf0358e0
278 changed files with 45212 additions and 35782 deletions
@@ -1,6 +1,6 @@
# 债券 / 中间函数
### `bondDaysBetweenPreviousCouponandNextCoupon(settlement_date)`
## `bondDaysBetweenPreviousCouponandNextCoupon(settlement_date)`
上一个付息日与下一个付息日之间的天数
@@ -10,7 +10,7 @@
返回:int
### `bondDaysBetweenPreviousCouponandSettlement(settlement_date)`
## `bondDaysBetweenPreviousCouponandSettlement(settlement_date)`
计息天数,上一个付息日与结算日之间的天数。
@@ -20,7 +20,7 @@
返回:int
### `bondEndDateNewestPayment(settlement_date)`
## `bondEndDateNewestPayment(settlement_date)`
当前计息年度的截止日
@@ -30,7 +30,7 @@
返回:datetime
### `bondNumbersBetween(beg_t, end_t, frequency)`
## `bondNumbersBetween(beg_t, end_t, frequency)`
结算日至到期日的债券付息次数(中间函数)
@@ -42,7 +42,7 @@
返回:int
### `bondNumbersBetweenSettlementandFutureDay(end_t, future_t)`
## `bondNumbersBetweenSettlementandFutureDay(end_t, future_t)`
评估日与未来评估日之间的付息次数
@@ -53,7 +53,7 @@
返回:int
### `bondPreviousCouponDateCalculator(settlement_date, dated_date, maturity_date)`
## `BondPreviousCouponDate_Calculator(settlement_date, dated_date, maturity_date)`
上一付息日(中间函数)
@@ -65,7 +65,7 @@
返回:datetime
### `bondYearsBetween(beg_t, end_t)`
## `bondYearsBetween(beg_t, end_t)`
两个日期之间的整年数
@@ -76,7 +76,7 @@
返回:int
### `bondYearsBetweenDatedandSettlement(settlement_date)`
## `bondYearsBetweenDatedandSettlement(settlement_date)`
到期一次还本付息债券起息日至结算日的整年数
@@ -86,7 +86,7 @@
返回:int
### `tEncodeDate(y, m, d)`
## `tEncodeDate(y, m, d)`
年月日组合成日期
@@ -98,7 +98,7 @@
返回:TDataTime
### `tEncodeDate2(day, d)`
## `tEncodeDate2(day, d)`
日期与日重组
@@ -109,19 +109,19 @@
返回:TDataTime
### `bondRemainPayNumber(goal_date, end_t, f)`
## `bondRemainPayNumber(goal_date, end_t, f)`
债券剩余的付息次数,与系统股票相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `goal_date` | TDataTime | 日期类型,到期日 |
| `end_t` | TDataTime | 日期类型,交易日 |
| `f` | Int | 整数类型,付息频率 |
| 参数 | 类型 | 说明 |
| ----------- | --------- | ------------------ |
| `goal_date` | TDataTime | 日期类型,到期日 |
| `end_t` | TDataTime | 日期类型,交易日 |
| `f` | Int | 整数类型,付息频率 |
返回:Integer
#### 示例
### 示例
```tsl
//返回'BK000002'在2003年4月18日剩余的付息次数
@@ -133,19 +133,19 @@ return bondRemainPayNumber(goal_date,end_t,f);
//结果:8
```
### `bondCoupDayBs(goal_date, end_t, f)`
## `bondCoupDayBs(goal_date, end_t, f)`
当前付息期内截止到交易日的天数,与系统股票相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `goal_date` | TDataTime | 日期类型,到期日 |
| `end_t` | TDataTime | 日期类型,交易日 |
| `f` | Int | 整数类型,付息频率 |
| 参数 | 类型 | 说明 |
| ----------- | --------- | ------------------ |
| `goal_date` | TDataTime | 日期类型,到期日 |
| `end_t` | TDataTime | 日期类型,交易日 |
| `f` | Int | 整数类型,付息频率 |
返回:Integer
#### 示例
### 示例
```tsl
//返回'BK000002'在2003年3月18日当前付息期内截止到交易日的天数
@@ -157,147 +157,147 @@ return bondCoupDayBs(goal_date,end_t,f);
//结果:334
```
### `bondDuration(bond_type, y, t, c, f)`
## `bondDuration(bond_type, y, t, c, f)`
债券的久期,与系统股票相关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `bond_type` | Int | 用户自定义,债券类型,其取值如下: |
| `y` | Real | 实数,到期收益率/年 |
| `t` | Real | 实数,到期支付期 |
| `c` | Real | 实数,息票率/年 |
| `f` | Int | 整数,付息频率 |
| 参数 | 类型 | 说明 |
| ----------- | ---- | --------------------------------- |
| `bond_type` | Int | 用户自定义,债券类型,其取值如下: |
| `y` | Real | 实数,到期收益率/年 |
| `t` | Real | 实数,到期支付期 |
| `c` | Real | 实数,息票率/年 |
| `f` | Int | 整数,付息频率 |
返回:Real
#### 示例
### 示例
```tsl
return bondDuration(0,0.0799999982118607,40,0.100000001490116,2);
//结果:19.74
```
### `bondProvider()`
## `bondProvider()`
债券数据来源系统参数
返回:Real
### `bondDaysBetweenDatedandMaturityDate()`
## `bondDaysBetweenDatedandMaturityDate()`
零息债券起息日到到期日的实际天数
返回:Integer
### `bondDaysBetweenDatedandSettlement(settlement_date)`
## `bondDaysBetweenDatedandSettlement(settlement_date)`
零息债券起息日到结算日的实际天数
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:Integer
### `bondDaysBetweenSettlementandMaturity(settlement_date)`
## `bondDaysBetweenSettlementandMaturity(settlement_date)`
结算日至到期日的剩余天数
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:Integer
### `bondDaysBetweenSettlementandNextCoupon(settlement_date)`
## `bondDaysBetweenSettlementandNextCoupon(settlement_date)`
结算日至下一个付息日的计息天数
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:Integer
### `bondNextCouponDate(settlement_date)`
## `bondNextCouponDate(settlement_date)`
结算日对应的下一个付息日
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:TDateTime
### `bondNumbersBetweenSettlementandMaturity(settlement_date)`
## `bondNumbersBetweenSettlementandMaturity(settlement_date)`
剩余付息次数,结算日至到期日剩余付息次数。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:Real
### `bondPreviousCouponDate(settlement_date)`
## `bondPreviousCouponDate(settlement_date)`
结算日对应的上一个付息日
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:TDateTime
### `bondYearsBetweenDatedandMaturity()`
## `bondYearsBetweenDatedandMaturity()`
起息日到到期日的整年数
返回:Integer
### `bondYearsBetweenSettlementandMaturity(settlement_date)`
## `bondYearsBetweenSettlementandMaturity(settlement_date)`
结算日至到期日剩余整年数
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:Integer
### `bondRemainDuration(settlement_date)`
## `bondRemainDuration(settlement_date)`
结算日至到期日的剩余期限(单位:年)
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:Real
### `bondBeginDateNewestPayment(settlement_date)`
## `bondBeginDateNewestPayment(settlement_date)`
当前计息年度的起始日,根据债券的起息日和结算日计算
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ----------------- | --------- | ------ |
| `settlement_date` | TDateTime | 结算日 |
返回:TDateTime
### `bondPayMentByEndt(bondarr, endt)`
## `bondPayMentByEndt(bondarr, endt)`
债券数组在指定日是否有付息以及相应的数据
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `bondarr` | Array | 一维数组,债券数组 |
| `endt` | TDateTime | 日期型时间,截止日 |
| 参数 | 类型 | 说明 |
| --------- | --------- | ------------------ |
| `bondarr` | Array | 一维数组,债券数组 |
| `endt` | TDateTime | 日期型时间,截止日 |
返回:TableArray
#### 示例
### 示例
```tsl
bondarr:=array('SH196237','SZ101516','SH175901');
@@ -306,18 +306,18 @@ return bondPayMentByEndt(bondarr,endt);
//结果
```
### `getBondMaturityTradeData(endt, tpgp)`
## `getBondMaturityTradeData(endt, tpgp)`
债券到期兑付本金转化为交易数据
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `endt` | TDateTime | 日期型时间,截止日 |
| 参数 | 类型 | 说明 |
| ------ | ---------- | ------------------ |
| `endt` | TDateTime | 日期型时间,截止日 |
| `tpgp` | TableArray | 数据表类型,昨持仓 |
返回:TableArray
#### 示例
### 示例
```tsl
end_t:=intToDate(20170613);
@@ -329,17 +329,17 @@ return getBondMaturityTradeData(end_t,tpgp);
//结果
```
### `bondDataCheck(end_t)`
## `bondDataCheck(end_t)`
债券是否上市,与系统参数(债券代码)相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------- |
| `end_t` | TDateTime | 截止日期。 |
返回:Integer
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),"SH127352");
@@ -347,38 +347,38 @@ return bondDataCheck(20180101T);
//结果:1
```
### `bondInterest(face_value, legal_coupon_rate, goal_date, end_t, f)`
## `bondInterest(face_value, legal_coupon_rate, goal_date, end_t, f)`
债券应计利息。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `face_value` | Real | 实数。面值。 |
| `legal_coupon_rate` | Real | 实数。票面利率。 |
| `goal_date` | TDateTime | 日期。到期日。 |
| `end_t` | TDateTime | 日期。截止日期。 |
| `f` | Integer | 整数。付息频率。 |
| 参数 | 类型 | 说明 |
| ------------------- | --------- | ---------------- |
| `face_value` | Real | 实数。面值。 |
| `legal_coupon_rate` | Real | 实数。票面利率。 |
| `goal_date` | TDateTime | 日期。到期日。 |
| `end_t` | TDateTime | 日期。截止日期。 |
| `f` | Integer | 整数。付息频率。 |
返回:Real
#### 示例
### 示例
```tsl
return bondInterest(100,0.08,20101101T,20101010T,1);
//结果:7.5178
```
### `bondNegotiableShares(bond_id)`
## `bondNegotiableShares(bond_id)`
债券流通股。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------ |
| `bond_id` | String | 字符串。债券代码。 |
返回:Real
#### 示例
### 示例
```tsl
return bondNegotiableShares("SH120102");