feat(tsl-api-reference): expand and reorganize api catalog

Flatten builtin pages, add third-party and platform scopes, and import financial and data warehouse references.

Keep the existing generated index without rebuilding after signature normalization.
This commit is contained in:
csh
2026-08-10 18:26:24 +08:00
parent 2938300acb
commit 9010829c6d
1186 changed files with 243901 additions and 219769 deletions
@@ -0,0 +1,230 @@
# 金融 / 板块 / 基本情况 / 其它
## `getAllBkList()`
声明:function
得到所有的板块列表,其中包括用户板块列表
返回:array
### 示例
范例01:调用函数
```tsl
// 返回所有板块列表
return getAllBkList ();
部分结果:
1000材料
1000成长
1000工业
1000公用
1000价值
1000金融
1000可选
1000能源
1000消费
1000信息
1000医药
100低波
```
## `getFCompany()`
声明:function
金融类公司列表
返回:array
### 示例
范例01:调用 GetFCompany
```tsl
return GetFCompany();
```
## `getStocks()`
声明:function
返回深证A股,深证B股,深证基金,上证A股,上证B股,上证基金的股票列表
返回:array
### 示例
范例01:调用函数
```tsl
// 返回股票列表
return getStocks();
```
## `isValueBetweeMaxAndMin(tb, field_name, lowvalue, highvalue)`
声明:function
从一张表中返回指定字段的数值在指定区间段内的个数
| 参数 | 类型 | 说明 |
| ------------ | ------ | ---------------- |
| `tb` | array | 一维数字数组 |
| `field_name` | string | 字符串,字段名称 |
| `lowvalue` | real | 实数,区间低值 |
| `highvalue` | real | 实数,区间高值 |
返回:integer
### 示例
范例01:调用函数
```tsl
t := select * from tradetable datekey 20180801T to 20180802T of 'sz000001' end ;
return isValueBetweeMaxAndMin(t, 'close', 0, 5);
// 输出:54 ,即平安银行在2018年8月1号成交明细中有54条成交记录的收盘价在0-5之间。
```
## `marketList()`
声明:function
返回市场常用列表,仅包括深证A股、深证B股、深证基金、上证A股、上证B股、上证基金。如果需要获得其他目录下的板块列表,请使用函数GetBKList,使用方法参见该函数的函数说明
返回:array
### 示例
范例01:返回市场列表
```tsl
return MarketList();
// 输出:市场列表
```
## `stocksACount(stock_arr, end_t)`
声明:function
返回指定日已上市的A股个数
| 参数 | 类型 | 说明 |
| ----------- | -------- | ------------------------ |
| `stock_arr` | array | 一维字符串数组,股票列表 |
| `end_t` | datetime | 日期,统计截止日期 |
返回:int
### 示例
范例01:返回A股20180919日上市的A股个数
```tsl
stockArr := getbk("A股");
return StocksACount(stockArr, 20180919T);
// 输出:3542
```
## `stocksBCount(stock_arr, end_t)`
声明:function
返回StockArr股票列表中,在指定日上市的B股个数。函数通过上市第一个交易日进行判断。注意,设置的周期会影响到该判断,如果是日线,则获取第一个日线日期判断,如果是分钟线,则获取第一个分钟数据进行判断。建议调用该函数时,设置周期为日线
| 参数 | 类型 | 说明 |
| ----------- | --------- | ------------------------ |
| `stock_arr` | array | 一维字符串数组,股票列表 |
| `end_t` | date_time | 日期,统计截止日期 |
返回:int
### 示例
范例01:调用函数
```tsl
// 返回上证B股20180919日上市的B股个数
stock_arr := getBk("上证B股");
return stocksBCount(stock_arr, 20180919T);
// 输出:50
```
## `stocksCountByTypeId(stock_arr, id_1, id_2, end_t)`
声明:function
返回指定日列表中指定类型的股票数量.,类型是StockType对应的数字,由ID1和ID2设置,具体如下:
| 参数 | 类型 | 说明 |
| ----------- | --------- | --------------------------------- |
| `stock_arr` | array | 一维字符串数组,股票列表 |
| `id_1` | int | 整数,StockType股票类型对应的数字 |
| `id_2` | int | 整数,StockType股票类型对应的数字 |
| `end_t` | date_time | 日期,统计截止日期 |
返回:整数
### 示例
范例01:调用函数
```tsl
// 返回深圳A股截止20180925日股票数量
stock_arr := getBk('A股');
end_t := 20180925T;
return stocksCountByTypeId(stock_arr, 1, 0, end_t);
// 输出:2110
```
## `stocksJjCount(stock_arr, beg_t, end_t)`
声明:function
返回begT到endt之间上市的基金个数
| 参数 | 类型 | 说明 |
| ----------- | --------- | ------------------------ |
| `stock_arr` | array | 一维字符串数组,股票列表 |
| `beg_t` | date_time | 日期,统计开始日期 |
| `end_t` | date_time | 日期,统计截止日期 |
返回:int
### 示例
范例01:调用函数
```tsl
stock_arr := array('SZ184691', 'SH500003');
beg_t := 19971019T;
end_t := 20021019T;
return stocksJjCount(stock_arr, beg_t, end_t);
// 输出:2
```
## `tradeBkExist(bk_arr, b_kname)`
声明:function
判断板块列表BKArr是否包含板块Bkname,如果包含则返回1,否则返回0
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------------ |
| `bk_arr` | array | 一维字符串数组,板块列表 |
| `b_kname` | string | 字符串,板块名称 |
返回:boolean
### 示例
范例01:调用函数
```tsl
bk_arr := array('安徽', '深圳');
return tradeBkExist(bk_arr, '安徽');
// 输出:1
```