feat(skills): add tsl api reference skill

Bundle the TSL API index and markdown references under the skill, route TSL docs to use it, and update the codegen index generator to maintain the bundled data.
This commit is contained in:
csh
2026-07-07 16:36:15 +08:00
parent 4cd6b9410f
commit e1f7ce052c
267 changed files with 185908 additions and 11996 deletions
@@ -0,0 +1,295 @@
# 数据仓库 / 区间
### `avgOfRepPeriod(exp, begreport, end_year)`
返回当前股票从报告期BegReport到EndYear同季度报告期的Expr指标的平均值,与系统参数(股票)相关。
| 参数 | 类型 | 说明 |
| ----------- | ---- | ------------------ |
| `exp` | Expr | 函数表达式 |
| `begreport` | int | 报告期,开始报告期 |
| `end_year` | int | 年份,截止年份 |
返回:int
#### 示例
```tsl
平安银行2015到2018四个一季报营业收入的平均值
SetSysParam(pn_stock(),'sz000001');
return AvgOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2018);
```
### `avgOfRepPeriod2(exp, beg_report, end_report, report_type)`
表达式区间平均
| 参数 | 类型 | 说明 |
| ------------- | ------ | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_report` | int | 整数,开始报告期 |
| `end_report` | int | 整数,截止报告期 |
| `report_type` | int | 整数,报告期类型 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SZ000001");
return AvgOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
```
### `growthOfRepPeriod2(exp, beg_report, end_report, return_type, report_type)`
表达式区间增长
| 参数 | 类型 | 说明 |
| ------------- | ------ | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_report` | int | 整数,开始报告期 |
| `end_report` | int | 整数,截止报告期 |
| `return_type` | int | 整数,返回类型 |
| `report_type` | int | 整数,报告期类型 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SZ000001");
return GrowthOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,1);
```
### `highestOfRepPeriod2(exp, beg_report, end_report, report_type)`
表达式区间最高
| 参数 | 类型 | 说明 |
| ------------- | ------ | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_report` | int | 整数,开始报告期 |
| `end_report` | int | 整数,截止报告期 |
| `report_type` | int | 整数,报告期类型 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SZ000001");
return HighestOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
```
### `kurtosisOfPeriod(exp, beg_date, end_date)`
表达式区间峰度
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_date` | datetime | 日期,开始日期 |
| `end_date` | datetime | 日期,截止日期 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
return KurtosisOfPeriod(@close(),20230101T,20231010T);
```
### `lowestOfRepPeriod2(exp, beg_report, end_report, report_type)`
表达式区间最低
| 参数 | 类型 | 说明 |
| ------------- | ------ | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_report` | int | 整数,开始报告期 |
| `end_report` | int | 整数,截止报告期 |
| `report_type` | int | 整数,报告期类型 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SZ000001");
return LowestOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
```
### `medianOfPeriod(exp, beg_date, end_date)`
表达式区间中位数
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_date` | datetime | 日期,开始日期 |
| `end_date` | datetime | 日期,截止日期 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
return MedianOfPeriod(@close(),20230101T,20231010T);
```
### `occuredOfPeriod(exp, beg_date, end_date)`
表达式区间发生次数
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_date` | datetime | 日期,开始日期 |
| `end_date` | datetime | 日期,截止日期 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
return OccuredOfPeriod(@IsUp(),20230101T,20231010T);
```
### `occuredOfRepPeriod(exp, begreport, end_year)`
返回当前股票从BegReport到EndYear的同季度报告期数,与系统参数(股票)相关。
| 参数 | 类型 | 说明 |
| ----------- | ---- | ------------------ |
| `exp` | Expr | 布尔公式表达式 |
| `begreport` | int | 报告期,开始报告期 |
| `end_year` | int | 年份,截止年份 |
返回:int
#### 示例
```tsl
SetSysParam(pn_stock(),'SZ000001');
return OccuredOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2018);//即返回2015年到2018年一季报的数量
```
### `percentRankOfPeriod(exp, beg_date, end_date)`
表达式区间分位数
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_date` | datetime | 日期,开始日期 |
| `end_date` | datetime | 日期,截止日期 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
return PercentRankOfPeriod(@close(),20230101T,20231010T);
```
### `skewnessOfPeriod(exp, beg_date, end_date)`
表达式区间偏度
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_date` | datetime | 日期,开始日期 |
| `end_date` | datetime | 日期,截止日期 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
return SkewnessOfPeriod(@close(),20230101T,20231010T);
```
### `stdOfPeriod(exp, beg_date, end_date)`
表达式区间标准差
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_date` | datetime | 日期,开始日期 |
| `end_date` | datetime | 日期,截止日期 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
return StdOfPeriod(@close(),20230101T,20231010T);
```
### `stdOfRepPeriod2(exp, beg_report, end_report, report_type)`
表达式区间标准差
| 参数 | 类型 | 说明 |
| ------------- | ------ | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_report` | int | 整数,开始报告期 |
| `end_report` | int | 整数,截止报告期 |
| `report_type` | int | 整数,报告期类型 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SZ000001");
return StdOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
```
### `sumOfRepPeriod(exp, begreport, end_year)`
返回当前股票Expr指标从报告期BegReport到EndYear同季度报告期的和,与系统参数(股票)相关。
| 参数 | 类型 | 说明 |
| ----------- | ---- | ------------------ |
| `exp` | Expr | 函数表达式 |
| `begreport` | int | 报告期,开始报告期 |
| `end_year` | int | 年份,截止年份 |
返回:int
#### 示例
```tsl
平安银行2015到2018四个一季报营业收入的和
SetSysParam(pn_stock(),'sz000001');
return SumOfRepPeriod(@reportofall(46002,GetSysParam('DefaultRepID')),20150331,2018);
```
### `sumOfRepPeriod2(exp, beg_report, end_report, report_type)`
表达式区间和
| 参数 | 类型 | 说明 |
| ------------- | ------ | ----------------- |
| `exp` | string | 字符串,函数表达式 |
| `beg_report` | int | 整数,开始报告期 |
| `end_report` | int | 整数,截止报告期 |
| `report_type` | int | 整数,报告期类型 |
返回:float
#### 示例
```tsl
SetSysParam(pn_stock(),"SZ000001");
return SumOfRepPeriod2(@reportofall(46002,GetSysParam('DefaultRepID')),20201231,20221231,0);
```