📝 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
@@ -1,6 +1,6 @@
# 财务基本面 / 最近N个会计年度
### `mainIncomeGrowRatioYear(r_date, n)`
## `MainIncomeGrowRatio_Year(r_date, n)`
最近N年的营业收入增长率(%)(复合增长率)。 (1)取向后兼容的最新年报Q1,然后取N年前同期的年报Q2; (2)分别以Q1、Q2为指定报告期,取营业收入(合并利润分配表)得到v1、v2; (3)如果v1/v2>0,营业收入增长率(%)(复合增长率)=(Power(v1/v2,1/N)-1)\*100,否则返回0。
@@ -11,7 +11,7 @@
返回:float
### `mainProfitGrowRatioYear(r_date, n)`
## `MainProfitGrowRatio_Year(r_date, n)`
最近N年的主营业务利润增长率(%)(复合增长率)。 (1)取向后兼容的最新年报Q1,然后取N年前同期的年报Q2; (2)分别以Q1、Q2为指定报告期,取主营业务利润(合并利润分配表)得到v1、v2; (3)如果v1/v2>0,主营业务利润增长率(%)(复合增长率)=(Power(v1/v2,1/N)-1)\*100,否则返回0。
@@ -22,7 +22,7 @@
返回:float
### `netProfitGrowRatioYear(r_date, n)`
## `NetProfitGrowRatio_Year(r_date, n)`
最近N年的净利润增长率(%)(复合增长率)。 (1)取向后兼容的最新年报Q1,然后取N年前同期的年报Q2; (2)分别以Q1、Q2为指定报告期,取归属于母公司所有者的净利润(合并利润分配表)得到v1、v2; (3)如果v1/v2>0,净利润增长率(%)(复合增长率)=(Power(v1/v2,1/N)-1)\*100,否则返回0。
@@ -33,7 +33,7 @@
返回:float
### `operatingProfitGrowRatioYear(r_date, n)`
## `OperatingProfitGrowRatio_Year(r_date, n)`
最近N年的营业利润增长率(%)(复合增长率)。 (1)取向后兼容的最新年报Q1,然后取N年前同期的年报Q2; (2)分别以Q1、Q2为指定报告期,取营业利润(合并利润分配表)得到v1、v2; (3)如果v1/v2>0,营业利润增长率(%)(复合增长率)=(Power(v1/v2,1/N)-1)\*100,否则返回0。
@@ -44,19 +44,19 @@
返回:float
### `fiIn12MonthRatio(r_date, info_id1, info_id2)`
## `fiIn12MonthRatio(r_date, info_id1, info_id2)`
最近12个月财务比率。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | Integer | 整数,报告期; |
| 参数 | 类型 | 说明 |
| ---------- | ------- | ---------------- |
| `r_date` | Integer | 整数,报告期; |
| `info_id1` | Integer | 整数,基本面id |
| `info_id2` | Integer | 整数,基本面id。 |
返回:Real
#### 示例
### 示例
```tsl
//指定2011年报,取万科A的最近12个月财务比率
@@ -68,18 +68,18 @@ return v;
//结果:0.05
```
### `fiIn12MonthPs(r_date, info_id)`
## `fiIn12MonthPs(r_date, info_id)`
最近12个月财务数据(每股)。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | Integer | 整数,报告期; |
| 参数 | 类型 | 说明 |
| --------- | ------- | ---------------- |
| `r_date` | Integer | 整数,报告期; |
| `info_id` | Integer | 整数,基本面id。 |
返回:Real
#### 示例
### 示例
```tsl
//指定2011年报,取万科A的最近12个月净利润(每股)
@@ -90,18 +90,18 @@ return v;
//结果:1.05
```
### `fiIn12Month(r_date, info_id)`
## `fiIn12Month(r_date, info_id)`
最近12个月InfoId所对应财务数据。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | Integer | 整数,报告期; |
| 参数 | 类型 | 说明 |
| --------- | ------- | ---------------- |
| `r_date` | Integer | 整数,报告期; |
| `info_id` | Integer | 整数,基本面id。 |
返回:Real
#### 示例
### 示例
```tsl
//指定2011年报,取万科A的最近12个月净利润
@@ -112,18 +112,18 @@ return v;
//结果:11599606211.77
```
### `fiIn12MonthGrowRatio(r_date, info_id)`
## `fiIn12MonthGrowRatio(r_date, info_id)`
最近12个月财务数据同比增长率(%);
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | Integer | 整数,报告期; |
| 参数 | 类型 | 说明 |
| --------- | ------- | ---------------- |
| `r_date` | Integer | 整数,报告期; |
| `info_id` | Integer | 整数,基本面id。 |
返回:Real
#### 示例
### 示例
```tsl
//指定2011年报,取万科A的最近12个月净利润同比增长率(%)
@@ -134,18 +134,18 @@ return v;
//结果:31.22
```
### `fiIn12MonthPsGrowRatio(r_date, info_id)`
## `fiIn12MonthPsGrowRatio(r_date, info_id)`
最近12个月财务数据(每股)同比增长率(%)。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | Integer | 整数,报告期; |
| 参数 | 类型 | 说明 |
| --------- | ------- | ---------------- |
| `r_date` | Integer | 整数,报告期; |
| `info_id` | Integer | 整数,基本面id。 |
返回:Real
#### 示例
### 示例
```tsl
//指定2011年报,取万科A的最近12个月净利润(每股)同比增长率(%)
@@ -156,19 +156,19 @@ return v;
//结果:31.22
```
### `cagr(v1, v2, n)`
## `cagr(v1, v2, n)`
复合增长率(%)。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `v1` | Real | 实数,终值; |
| `v2` | Real | 实数,初值; |
| `n` | Integer | 整数,年数。 |
| 参数 | 类型 | 说明 |
| ---- | ------- | ------------ |
| `v1` | Real | 实数,终值; |
| `v2` | Real | 实数,初值; |
| `n` | Integer | 整数,年数。 |
返回:Real
#### 示例
### 示例
```tsl
//已知终值为1,初值为2,年数为3年,求复合增长率
@@ -177,20 +177,20 @@ return v;
//结果:-20.63
```
### `annualRatio(r_date, n, info_id1, info_id2)`
## `annualRatio(r_date, n, info_id1, info_id2)`
提取股票的财务比率,与系统股票pn_stock()、当前时间pn_date()相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id1` | Integer | 整数,基本面ID |
| `info_id2` | Integer | 整数,基本面ID2 |
| 参数 | 类型 | 说明 |
| ---------- | ------- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id1` | Integer | 整数,基本面ID |
| `info_id2` | Integer | 整数,基本面ID2 |
返回:Real
#### 示例
### 示例
```tsl
//计算SZ000002去年的营业利润/营业收入
@@ -199,20 +199,20 @@ return annualRatio(20180630,1,46015,46002);
//结果:0.21
```
### `annualRatioGrowRatio(r_date, n, info_id1, info_id2)`
## `annualRatioGrowRatio(r_date, n, info_id1, info_id2)`
提取股票的财务比率复合增长率(%),与系统股票pn_stock()、当前时间pn_date()相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id1` | Integer | 整数,基本面ID1 |
| `info_id2` | Integer | 整数,基本面ID2 |
| 参数 | 类型 | 说明 |
| ---------- | ------- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id1` | Integer | 整数,基本面ID1 |
| `info_id2` | Integer | 整数,基本面ID2 |
返回:Real
#### 示例
### 示例
```tsl
//计算SZ000002去年的净利润/股东权益合计的复合增长率
@@ -221,19 +221,19 @@ return annualRatioGrowRatio(20180630,1,46033,44111);
//结果:0
```
### `annualValue(r_date, n, info_id)`
## `annualValue(r_date, n, info_id)`
提取股票的财务数据,与系统股票pn_stock()、当前时间pn_date()相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
| 参数 | 类型 | 说明 |
| --------- | ------- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
返回:Real
#### 示例
### 示例
```tsl
//计算SZ000002前年的营业利润
@@ -242,19 +242,19 @@ return annualValue(20180630,2,46015);
//结果:39021784520.23
```
### `annualValueGrowRatio(r_date, n, info_id)`
## `annualValueGrowRatio(r_date, n, info_id)`
提取股票的财务数据复合增长率(%),与系统股票pn_stock()、当前时间pn_date()相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
| 参数 | 类型 | 说明 |
| --------- | ------- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
返回:Real
#### 示例
### 示例
```tsl
//计算SZ000002前年营业收入的复合增长率
@@ -263,19 +263,19 @@ return annualValueGrowRatio(20180630,2,46002);
//结果:11.45081019
```
### `annualValuePs(r_date, n, info_id)`
## `annualValuePs(r_date, n, info_id)`
提取股票的每股财务数据,与系统股票pn_stock()、当前时间pn_date()相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
| 参数 | 类型 | 说明 |
| --------- | ------- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
返回:Real
#### 示例
### 示例
```tsl
//计算SZ000002前年的每股净利润
@@ -284,19 +284,19 @@ return annualValuePs(20180630,2,46033);
//结果:2.56815519
```
### `annualValuePsGrowRatio(r_date, n, info_id)`
## `annualValuePsGrowRatio(r_date, n, info_id)`
提取股票的每股财务数据复合增长率(%),与系统股票pn_stock()、当前时间pn_date()相关。
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
| 参数 | 类型 | 说明 |
| --------- | ------- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Integer | 整数,最近N年 |
| `info_id` | | 整数,基本面ID |
返回:Real
#### 示例
### 示例
```tsl
//计算SZ000002前年每股净利润的复合增长率