📝 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,12 +1,12 @@
# 因子与量化 / Dev
### `buySample()`
## `buySample()`
买入策略范例,与系统环境变量有关
返回:bool
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'SZ000002');
@@ -14,13 +14,13 @@ SetSysParam(pn_date(),inttodate(20121017));
return BuySample();
```
### `sellSample()`
## `sellSample()`
卖出策略范例,与系统环境变量有关
返回:bool
#### 示例
### 示例
```tsl
SetSysParam(PN_Stock(),'SZ000002');
@@ -28,13 +28,13 @@ SetSysParam(pn_date(),inttodate(20121017));
return sellSample(); //判断万科A在2012-10-17在卖出策略sellSample()下是否卖出, 结果:0
```
### `stockBuyDiff()`
## `stockBuyDiff()`
现价与买入价的差异比,用于做交易策略用,与当前股票有关
返回:float
#### 示例
### 示例
```tsl
SetStockBuyPrice('SZ000002',8.04);
@@ -42,25 +42,25 @@ SetSysParam(PN_Stock(),'SZ000002');
return StockBuyDiff(); //结果:4.47761
```
### `stockBuyPrice()`
## `stockBuyPrice()`
返回当前环境代码的’BuyPrice’对应的系统变量值
返回:any
### `stockBuyTime()`
## `stockBuyTime()`
返回当前环境代码的'BuyTime'对应的系统变量值
返回:datetime
### `stockBuyTimeDiff()`
## `stockBuyTimeDiff()`
返回买入天数,作为交易策略用,与当前股票、时间有关
返回:int
#### 示例
### 示例
```tsl
SetStockBuyTime('SZ000002',inttodate(20121018));
@@ -69,23 +69,23 @@ SetSysParam(PN_Stock(),'SZ000002');
return StockBuyTimeDiff(); //结果:4
```
### `selectStockIndex(stocks, beg_t, end_t, buy_cond, sell_cond, index_id, show_type)`
## `selectStockIndex(stocks, beg_t, end_t, buy_cond, sell_cond, index_id, show_type)`
策略期间,股票组合的收益情况,等比投资,与周期有关
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| `stocks` | Array | 字符串,以分号分割,股票列表 |
| `beg_t` | TDateTime | 日期型时间,策略验证开始时间 |
| `end_t` | TDateTime | 日期型时间,策略验证截止时间 |
| `buy_cond` | Expsression | 布尔公示表达式,策略买入条件 |
| `sell_cond` | Expression | 布尔公示表达式,策略卖出条件 |
| `index_id` | String | 字符串,指数代码 |
| `show_type` | Integer | 整数型,显示类型(图形或者数据表类型),0表示返回图形,1表示数据类型 |
| 参数 | 类型 | 说明 |
| ----------- | ----------- | ----------------------------------------------------------------- |
| `stocks` | Array | 字符串,以分号分割,股票列表 |
| `beg_t` | TDateTime | 日期型时间,策略验证开始时间 |
| `end_t` | TDateTime | 日期型时间,策略验证截止时间 |
| `buy_cond` | Expsression | 布尔公示表达式,策略买入条件 |
| `sell_cond` | Expression | 布尔公示表达式,策略卖出条件 |
| `index_id` | String | 字符串,指数代码 |
| `show_type` | Integer | 整数型,显示类型(图形或者数据表类型),0表示返回图形,1表示数据类型 |
返回:TableArray
#### 示例
### 示例
```tsl
setSysParam(PN_CYCLE(),cy_day());
@@ -94,34 +94,34 @@ intToDate(20120930),@bsByMacd(12,26,9,2),@ssByMacd(12,26,9,2),"SH000001",1);  /
//结果:
```
### `setRetBuyPrice(price)`
## `setRetBuyPrice(price)`
设置一个“tmpBuyPrice”自定义的系统变量的值
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | ---- | ---------- |
| `price` | Real | 实数,价格 |
返回:Integer
#### 示例
### 示例
```tsl
setRetBuyPrice(20);
return getSysParam('tmpBuyPrice'); //结果:20
```
### `setRetSellPrice(price)`
## `setRetSellPrice(price)`
设置一个“tmpSellPrice”自定义的系统变量的值
| 参数 | 类型 | 说明 |
| --- | --- | --- |
| 参数 | 类型 | 说明 |
| ------- | ---- | ---------- |
| `price` | Real | 实数,价格 |
返回:Integer
#### 示例
### 示例
```tsl
setRetSellPrice(50);