📝 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
+10 -11
View File
@@ -1,6 +1,6 @@
# 数据仓库 / N日
### `deltaOfNDay(exp, n)`
## `deltaOfNDay(exp, n)`
当前值-前N日值。
@@ -11,7 +11,7 @@
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
@@ -19,7 +19,7 @@ SetSysParam(pn_date(),20231010T);
return DeltaOfNDay(@close(),5);
```
### `percentRankOfNDay(exp, n, cache_str)`
## `percentRankOfNDay(exp, n, cache_str)`
当前值在最近N天的百分位排名,Nan值不参与排名。
@@ -31,7 +31,7 @@ return DeltaOfNDay(@close(),5);
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
@@ -39,7 +39,7 @@ SetSysParam(pn_date(),20231030T);
return PercentRankOfNDay(@close(),10,"");
```
### `signedPower(exp, n)`
## `signedPower(exp, n)`
符号次方。特殊当x=0时,N<0,返回NanN=0, 返回1N>0, 返回0。
@@ -50,7 +50,7 @@ return PercentRankOfNDay(@close(),10,"");
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
@@ -58,7 +58,7 @@ SetSysParam(pn_date(),20231030T);
return SignedPower(@close(),3);
```
### `slopeofNday(exp1, exp2, n, cache_str)`
## `slopeofNday(exp1, exp2, n, cache_str)`
N日线性回归系数。
@@ -71,7 +71,7 @@ N日线性回归系数。
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
@@ -79,7 +79,7 @@ SetSysParam(pn_date(),20231030T);
return SlopeofNday(@close(),@open(),30,"");
```
### `wmaofNday(exp, n, cache_astr)`
## `wmaofNday(exp, n, cache_astr)`
N日衰减加权。最新值权重最大,权重归一化,结果同DecayAvgOfNDay。
@@ -91,11 +91,10 @@ N日衰减加权。最新值权重最大,权重归一化,结果同DecayAvgOf
返回:float
#### 示例
### 示例
```tsl
SetSysParam(pn_stock(),"SH600585");
SetSysParam(pn_date(),20231030T);
return WmaofNday(@open(),30,"");
```