📝 docs(tsl): complete and lint codegen reference

This commit is contained in:
csh
2026-07-07 16:46:51 +08:00
parent 16e0992dd2
commit bbf6977f57
232 changed files with 39191 additions and 29763 deletions
+25 -25
View File
@@ -1,6 +1,6 @@
# 数据仓库 / 向导函数
### `compositeRatioValue(v1, v2, n)`
## `compositeRatioValue(v1, v2, n)`
返回初值V1到末值V2的复合增长率。
@@ -12,7 +12,7 @@
返回:float
### `growthOfRepPeriod(expr, r_date, result_type)`
## `growthOfRepPeriod(expr, r_date, result_type)`
表达式Exp某个指标在报告期Rdate的同比增长,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。
@@ -24,7 +24,7 @@
返回:any
### `growthWithLowestOfPeriod(exp, beg_date, end_date, return_type)`
## `growthWithLowestOfPeriod(exp, beg_date, end_date, return_type)`
返回表达式Exp在区间BegDate到EndDate中的最小值与在EndDate的值的偏离,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。。
@@ -37,14 +37,14 @@
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),'SZ000001');
return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
```
### `isNull(arg1)`
## `isNull(arg1)`
判断条件是否成立。
@@ -54,7 +54,7 @@ return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
返回:bool
### `occuredRepIdOfRepPeriod(expr, beg_report, end_year)`
## `occuredRepIdOfRepPeriod(expr, beg_report, end_year)`
在区间BegReport到EndYear年中,与BegReport报告期同比的报告期中返回表达式exp为真的报告期。
@@ -66,26 +66,26 @@ return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
返回:any
### `positionOfIndustry()`
## `positionOfIndustry()`
向导函数相关函数。
返回:any
### `ratioValueByType(v1, v2, _type, n)`
## `ratioValueByType(v1, v2, _type, n)`
依据返回类型type,返回初值V1到末值V2的增长/增长率/复合增长率。
| 参数 | 类型 | 说明 |
| ------ | ---- | ------------------------ |
| `v1` | int | 实数,初值 |
| `v2` | int | 实数,末值 |
| 参数 | 类型 | 说明 |
| ------- | ---- | ------------------------ |
| `v1` | int | 实数,初值 |
| `v2` | int | 实数,末值 |
| `_type` | int | 用户自定义,返回数据类型 |
| `n` | int | 整数,期数或交易天数 |
| `n` | int | 整数,期数或交易天数 |
返回:float
### `reduceWithHighestOfPeriod(exp, beg_date, end_date, return_type)`
## `reduceWithHighestOfPeriod(exp, beg_date, end_date, return_type)`
返回表达式Exp在区间BegDate到EndDate中的最大值与在EndDate的值的偏离,ReturnType决定返回偏离值(增加值)还是偏离率(增速%)。
@@ -98,20 +98,20 @@ return GrowthWithLowestOfPeriod(@close(),20180801T,20180903T,0);
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),'SZ000001');
return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
```
### `relativeStrengthOfIndustry()`
## `relativeStrengthOfIndustry()`
向导函数相关函数。
返回:any
### `reportOfListed(id, report_id)`
## `reportOfListed(id, report_id)`
返回指定报告期ReportID的基本面ID数据。如果该证券未上市,则返回0,函数与系统参数(股票、时间)相关。
@@ -122,7 +122,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
返回:any
### `reportPerShareOfListed(id, report_id)`
## `reportPerShareOfListed(id, report_id)`
指定报告期ReportID的基本面ID数据/总股本。如果该证券未上市,则返回0,函数与系统参数(股票、时间)相关。
@@ -133,7 +133,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
返回:any
### `reportValueOfPeriod(exp, beg_report, end_report, report_type, reportvalue)`
## `reportValueOfPeriod(exp, beg_report, end_report, report_type, reportvalue)`
区间财务数据
@@ -147,7 +147,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
返回:array
### `simplyRatioValue(v1, v2)`
## `simplyRatioValue(v1, v2)`
返回初值V1到末值V2的增长率。若V1<0,则直接返回0。
@@ -158,7 +158,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
返回:float
### `stockTrailingAvgByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
## `stockTrailingAvgByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
获取基于指定日推移阶段的日均指标
@@ -172,7 +172,7 @@ return ReduceWithHighestOfPeriod(@close(),20180801T,20180803T,0);
返回:float
#### 示例
### 示例
```tsl
获取万科A过去1年的日均成交金额
@@ -183,7 +183,7 @@ exp := "Amount()";
return StockTrailingAvgByEndT(Endt,RefType,Exp);
```
### `stockTrailingStdByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
## `stockTrailingStdByEndT(endt, ref_type, exp, is_exclude_ipo, n)`
获取基于指定日推移阶段的指标标准差
@@ -197,7 +197,7 @@ return StockTrailingAvgByEndT(Endt,RefType,Exp);
返回:float
#### 示例
### 示例
```tsl
获取万科A过去1年的日收益率标准差
@@ -208,7 +208,7 @@ exp := "stockzf3()";
return StockTrailingStdByEndT(Endt,RefType,Exp); // 1.69
```
### `techCalUnit(expression)`
## `TechCal_Unit(expression)`
向导函数相关函数。