📝 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
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
# 衍生品 / 创设
### `warrantCCirculation1(beg_t, end_t)`
## `warrantCCirculation1(beg_t, end_t)`
区间创设规模(万),与系统证券pn_stock()有关。
@@ -11,7 +11,7 @@
返回:float
### `warrantCCirculation2(beg_t, end_t)`
## `warrantCCirculation2(beg_t, end_t)`
区间创设剩余规模(万),与系统证券pn_stock()有关。
@@ -1,6 +1,6 @@
# 衍生品 / 行权变动
### `warrantECirculation(end_t)`
## `warrantECirculation(end_t)`
指定日权证规模(万),若股票类型为权证,则将表402(权证.权证行权变动)按生效日逆序排列,提取当生效日小于等于截止日时的第一条记录的权证规模/10000;若股票类型不为权证,则返回0,与系统证券pn_stock()有关。
@@ -10,7 +10,7 @@
返回:float
### `warrantEPrice(end_t)`
## `warrantEPrice(end_t)`
指定日行权价,若股票类型为权证,则将表402(权证.权证行权变动)按生效日逆序排列,提取当生效日小于等于截止日时的第一条记录的行权价;若股票类型不为权证,则返回0,与系统证券pn_stock()有关。
@@ -20,7 +20,7 @@
返回:float
### `warrantERate(end_t)`
## `warrantERate(end_t)`
指定日行权比例,当股票类型为权证,则将表402(权证.权证行权变动)按生效日逆序排列,提取当生效日小于等于截止日时的第一条记录的行权比例;若股票类型不为权证,则返回0,与系统证券pn_stock()有关。
@@ -30,7 +30,7 @@
返回:float
### `warrantExerciseQk(end_t, beg_t)`
## `warrantExerciseQk(end_t, beg_t)`
区间行权变动,将表402(权证.权证行权变动)按生效日逆序排列,当生效日等于开始日且小于等于截止日,且变更原因不为权证创设时,从表中提取股票代码、名称、信息发布日、生效日、权证规模(万)、行权价、行权比例和变更原因,与系统证券pn_stock()有关。
@@ -41,18 +41,18 @@
返回:float
### `optionEsiExerciseAmount(end_t, datatype)`
## `optionEsiExerciseAmount(end_t, datatype)`
指定日行权数量,与系统参数(证券代码)相关。如果指定日有行权交收信息,返回指定日期认购/认沽行权数量;如果指定日没有行权交收信息,返回0。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `end_t` | TDateTime | 日期。截止日期 |
| `datatype` | Integer | 用户自定义。取值如下: |
| 参数 | 类型 | 说明 |
| ---------- | --------- | --------------------- |
| `end_t` | TDateTime | 日期。截止日期 |
| `datatype` | Integer | 用户自定义。取值如下: |
返回:Real
#### 示例
### 示例
```tsl
setSysParam(PN_Stock(),'SH510050');
@@ -60,18 +60,18 @@ return optionEsiExerciseAmount(20231227T,0);
//结果:20893
```
### `optionEsiGetdata(stock_id, end_t)`
## `optionEsiGetdata(stock_id, end_t)`
指定日的行权交收信息。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `stock_id` | String | 字符串。股票代码 |
| `end_t` | TDateTime | 日期。截止日期 |
| 参数 | 类型 | 说明 |
| ---------- | --------- | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
| `end_t` | TDateTime | 日期。截止日期 |
返回:Array
#### 示例
### 示例
```tsl
return optionEsiGetdata('SH510050',20231227T);
@@ -1,10 +0,0 @@
# 衍生品
函数数:243
| 叶子 | 文件 | 函数数 |
| --- | --- | ---: |
| 衍生品 / 基本信息 | [衍生品 / 基本信息](basic_info.md) | 218 |
| 衍生品 / 创设 | [衍生品 / 创设](creation.md) | 2 |
| 衍生品 / 行权变动 | [衍生品 / 行权变动](exercise.md) | 6 |
| 衍生品 / 定价 | [衍生品 / 定价](pricing.md) | 17 |
@@ -1,6 +1,6 @@
# 衍生品 / 定价
### `warrantBenchClose(endt)`
## `warrantBenchClose(endt)`
标的收盘价,与系统证券pn_stock()有关。
@@ -10,13 +10,13 @@
返回:float
### `warrantBenchId()`
## `warrantBenchId()`
标的代码。
返回:string
### `warrantBenchVolatility(endt)`
## `warrantBenchVolatility(endt)`
标的证券年波动率(%),标的证券去年到今年截止日(刚好一年)的指定日波动率(%),周期为日线。与系统证券pn_stock()有关。
@@ -26,7 +26,7 @@
返回:float
### `warrantDurationMonth(end_t)`
## `warrantDurationMonth(end_t)`
剩余存续期限(月),即当前日与行权截止日之间相距的月数。
@@ -36,7 +36,7 @@
返回:float
### `warrantGearing(end_t)`
## `warrantGearing(end_t)`
杠杆倍数,标的证券价格/(权证价格/行权比例),与系统证券pn_stock()有关。
@@ -46,7 +46,7 @@
返回:float
### `warrantNzjz(end_t)`
## `warrantNzjz(end_t)`
内在价值,与系统证券pn_stock()有关。
@@ -56,7 +56,7 @@
返回:float
### `warrantOptionTypeByBs(v1, v2)`
## `Warrant_OptionTypeByBS(v1, v2)`
B-S理论价值,若v1为认购,则返回0,若v2为认沽,则返回1。与系统证券pn_stock()有关。
@@ -67,7 +67,7 @@ B-S理论价值,若v1为认购,则返回0,若v2为认沽,则返回1。
返回:bool
### `warrantPriceByBs(end_t)`
## `warrantPriceByBs(end_t)`
B-S理论价值,若权证性质为认购,则返回0,若权证性质为认沽,则返回1。与系统证券pn_stock()有关。
@@ -77,7 +77,7 @@ B-S理论价值,若权证性质为认购,则返回0,若权证性质为认
返回:bool
### `warrantSjjz(end_t)`
## `warrantSjjz(end_t)`
时间价值,即权证价格 - 内在价值,与系统证券pn_stock()有关。
@@ -87,7 +87,7 @@ B-S理论价值,若权证性质为认购,则返回0,若权证性质为认
返回:float
### `warrantYhbdl(end_t, rf)`
## `warrantYhbdl(end_t, rf)`
隐含波动率(%),利用权证性质认沽、标的收盘、权证行权价、无风险收益率(%)、权证现价和剩余存续期限来求出隐含波动率(%)。
@@ -98,7 +98,7 @@ B-S理论价值,若权证性质为认购,则返回0,若权证性质为认
返回:float
### `warrantYjl(end_t)`
## `warrantYjl(end_t)`
溢价率(%)
@@ -108,34 +108,34 @@ B-S理论价值,若权证性质为认购,则返回0,若权证性质为认
返回:float
### `warrantDurationDay(end_t)`
## `warrantDurationDay(end_t)`
剩余存续期限(天),即当前日与行权截止日之间相距的天数。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | -------- | ------------------ |
| `end_t` | DateTime | 日期类型,截止日期 |
返回:Real
### `optionBlackScholesPrice2(contract_type, option_type, s, x, r, std, t, rf)`
## `optionBlackScholesPrice2(contract_type, option_type, s, x, r, std, t, rf)`
依据BS定价模型计算期权的价值
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `contract_type` | UserDefine | 用户自定义,期权品种类型 |
| `option_type` | UserDefine | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `std` | Real | 年化波动率(%),实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
| 参数 | 类型 | 说明 |
| --------------- | ---------- | -------------------------------------------------------- |
| `contract_type` | UserDefine | 用户自定义,期权品种类型 |
| `option_type` | UserDefine | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `std` | Real | 年化波动率(%),实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
返回:Real
#### 示例
### 示例
```tsl
//依据BS定价模型计算期权的价值
@@ -143,26 +143,26 @@ return optionBlackScholesPrice2(0,0,9,10,5,20,12,0);
//0.509121755321823
```
### `optionImpliedVolatilitylu2(contract_type, option_type, s, x, r, close, t, rf, lb, ub)`
## `optionImpliedVolatilitylu2(contract_type, option_type, s, x, r, close, t, rf, lb, ub)`
由期权交易价格依据BS定价模型倒推出的隐含波动率(%),采用二分法优化
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `contract_type` | UserDefine | 用户自定义,期权品种类型 |
| `option_type` | UserDefine | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `close` | Real | 期权交易价格,实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
| `lb` | Real | 二分法求解的下界(%),实数类型 |
| `ub` | Real | 二分法求解的上界(%),实数类型 |
| 参数 | 类型 | 说明 |
| --------------- | ---------- | -------------------------------------------------------- |
| `contract_type` | UserDefine | 用户自定义,期权品种类型 |
| `option_type` | UserDefine | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `close` | Real | 期权交易价格,实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
| `lb` | Real | 二分法求解的下界(%),实数类型 |
| `ub` | Real | 二分法求解的上界(%),实数类型 |
返回:Real
#### 示例
### 示例
```tsl
//计算股票期权的隐含波动率
@@ -170,24 +170,24 @@ return optionImpliedVolatilitylu2(0,0,9,11,2,2,36,0,0,100);
//40.0842725685217
```
### `optionImpliedVolatility2(contract_type, option_type, s, x, r, close, t, rf)`
## `optionImpliedVolatility2(contract_type, option_type, s, x, r, close, t, rf)`
返回期权的隐含波动率
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `contract_type` | Integer | 用户自定义,期权品种类型 |
| `option_type` | Integer | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `close` | Real | 期权交易价格,实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
| 参数 | 类型 | 说明 |
| --------------- | ------- | -------------------------------------------------------- |
| `contract_type` | Integer | 用户自定义,期权品种类型 |
| `option_type` | Integer | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `close` | Real | 期权交易价格,实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
返回:Real
#### 示例
### 示例
```tsl
//依据BS定价模型计算隐含波动率
@@ -196,24 +196,24 @@ return optionImpliedVolatility2(0,0,9,11,2,2,36,0);
备注:与二分法求解1的区别在于,此函数优化上下界已固定,上界(%)为1%,下界为500%
```
### `optionBlackScholesRi2(contract_type, option_type, s, x, r, std, t, rf)`
## `optionBlackScholesRi2(contract_type, option_type, s, x, r, std, t, rf)`
返回期权相关的风险指标
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `contract_type` | Integer | 用户自定义,期权品种类型 |
| `option_type` | Integer | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `std` | Real | 年化波动率(%),实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
| 参数 | 类型 | 说明 |
| --------------- | ------- | -------------------------------------------------------- |
| `contract_type` | Integer | 用户自定义,期权品种类型 |
| `option_type` | Integer | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `std` | Real | 年化波动率(%),实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
返回:Array
#### 示例
### 示例
```tsl
//依据BS定价模型计算期权风险指标
@@ -221,24 +221,24 @@ return optionBlackScholesRi2(0,0,2.365,2.2,2.75,25,12,0);
//结果:
```
### `optionBlackScholesDelta2(contract_type, option_type, s, x, r, std, t, rf)`
## `optionBlackScholesDelta2(contract_type, option_type, s, x, r, std, t, rf)`
返回期权相关的风险指标
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `contract_type` | Integer | 用户自定义,期权品种类型 |
| `option_type` | Integer | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `std` | Real | 年化波动率(%),实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
| 参数 | 类型 | 说明 |
| --------------- | ------- | -------------------------------------------------------- |
| `contract_type` | Integer | 用户自定义,期权品种类型 |
| `option_type` | Integer | 用户自定义,期权类型 |
| `s` | Real | 标的现价,实数类型 |
| `x` | Real | 期权的行权价,实数类型 |
| `r` | Real | 无风险年利率(%),实数类型 |
| `std` | Real | 年化波动率(%),实数类型 |
| `t` | Real | 剩余存续期(月),到期权到期日前的剩余的有效期限,实数类型 |
| `rf` | Real | 标的年化股息率(%),实数类型 |
返回:Real
#### 示例
### 示例
```tsl
//依据BS定价模型计算Delta值