📝 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 @@
# 数据仓库 / 时间序列统计
### `spMedian(arg1, arg2)`
## `sp_median(arg1, arg2)`
时间序列统计相关函数。
@@ -11,7 +11,7 @@
返回:any
### `spMode(arg1, arg2)`
## `sp_mode(arg1, arg2)`
时间序列统计相关函数。
@@ -22,7 +22,7 @@
返回:any
### `spNorm(stock_id, arg2)`
## `sp_norm(stock_id, arg2)`
时间序列统计相关函数。
@@ -33,7 +33,7 @@
返回:any
### `spProduct(stock_id, arg2)`
## `sp_product(stock_id, arg2)`
时间序列统计相关函数。
@@ -44,7 +44,7 @@
返回:any
### `spRank(arg1, arg2, arg3)`
## `sp_rank(arg1, arg2, arg3)`
时间序列统计相关函数。
@@ -56,19 +56,19 @@
返回:any
### `hhv(exp, n, cache_string)`
## `hhv(exp, n, cache_string)`
返回N日最高的Exp的值,与系统参数(股票、时间、周期等相关),查看相关行情数据说明。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数。N为0时,从上市日算起;注意,计算上市以来的最高/最低时,0必须用常量。比如hhv(high(),0)。不能以变量的方式传递:N:=0; hhv(high(),N),会报错。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数。N为0时,从上市日算起;注意,计算上市以来的最高/最低时,0必须用常量。比如hhv(high(),0)。不能以变量的方式传递:N:=0; hhv(high(),N),会报错。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:real
#### 示例
### 示例
```tsl
//获取万科A(SZ000002)截止2011-09-09日14个交易日内的最高,最低的收盘价以及
@@ -85,33 +85,31 @@ return r;
结果:
```
### `llv(exp, n, cache_string)`
## `llv(exp, n, cache_string)`
返回N日最低的Exp的值,与系统参数(股票、时间、周期等相关),查看相关行情数据说明。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数。N为0时,从上市日算起;N为负数时无效。注意,计算上市以来的最高/最低时,0必须用常量。比如llv(close(),0)。不能以变量的方式:N:=0; llv(close(),N),会报错。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数。N为0时,从上市日算起;N为负数时无效。注意,计算上市以来的最高/最低时,0必须用常量。比如llv(close(),0)。不能以变量的方式:N:=0; llv(close(),N),会报错。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:real
### `ma(exp, n, cache_string)`
## `ma(exp, n, cache_string)`
返回N日Exp的平均值,与系统参数(股票、时间、周期等相关)。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数。N为0时,返回当天值;N为-1时无效。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数。N为0时,返回当天值;N为-1时无效。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:real
#### 示例
### 示例
```tsl
范例一:
@@ -130,20 +128,19 @@ return t;
结果:
```
### `ema(exp, n, cache_string)`
## `ema(exp, n, cache_string)`
返回N日Exp的移动平均,与系统参数(股票、时间、周期等相关)。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式; |
| `n` | integer | 整数,天数;N为-1,0时无效。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式; |
| `n` | integer | 整数,天数;N为-1,0时无效。 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:real
#### 示例
### 示例
```tsl
//获得万科A(SZ000002)在2011-09-09日的10日平滑移动均价
@@ -154,21 +151,20 @@ return ema(close(),n);
// 结果:8.1158
```
### `sma(exp, n, m, cache_string)`
## `sma(exp, n, m, cache_string)`
求Exp的N日平滑移动平均,M为权重。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数 |
| `m` | integer | 整数,权重 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,天数 |
| `m` | integer | 整数,权重 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:real
#### 示例
### 示例
```tsl
//获得万科A(SZ000002)在2011-09-09日的10日平滑移动均价,3为权重
@@ -179,20 +175,19 @@ m := 3;
return sma(close(),n,m);//返回8.0914
```
### `count(exp, n, cache_string)`
## `count(exp, n, cache_string)`
统计N天中表达式Exp值为真的天数。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | 表达式类型 |
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | 表达式类型 |
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:integer
#### 示例
### 示例
```tsl
//上证指数在最近100天内的上涨天数;
@@ -202,20 +197,19 @@ return count(isUp(),100);
//返回47。
```
### `sumN(exp, n, cache_string)`
## `sumN(exp, n, cache_string)`
求Exp的N日累加和。
| 参数 | 类型 | 说明 |
| ------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
| 参数 | 类型 | 说明 |
| -------------- | ----------- | --------------------------------------------------------------------- |
| `exp` | TExpression | TExpression型表达式 |
| `n` | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
| `cache_string` | string | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回:real
#### 示例
### 示例
```tsl
//获得万科A(SZ000002)在2011-09-09日的5日总成交量
@@ -224,8 +218,7 @@ setSysParam(pn_date(),intToDate(20110909));
return sumN(vol(),5); // 返回152502152
```
### `cross(a, b)`
## `cross(a, b)`
A线从下面穿越B线时返回1,从A上面向下穿越B时返回-1,否则返回0。与系统参数(股票、时间、周期等相关)
@@ -236,7 +229,7 @@ A线从下面穿越B线时返回1,从A上面向下穿越B时返回-1,否则
返回:integer
#### 示例
### 示例
```tsl
//万科在指定区间内的均线穿越情况;