feat(tsl-api-reference): expand API and module coverage

This commit is contained in:
csh
2026-08-14 17:12:55 +08:00
parent 8f1056130d
commit 3d3036ebe1
571 changed files with 47842 additions and 14458 deletions
@@ -0,0 +1,38 @@
# 数据仓库 / 查询和轮询函数
## `query(market_list, stock_id_list, condition, sort_field, field_name_1, expression_1, ...)`
声明:function
从指定市场和证券列表中筛选满足条件的证券,按指定字段排序并返回选定数据列
<!-- tags: 数据仓库 查询 轮询 选股 市场列表 证券列表 报表 -->
| 参数 | 类型 | 说明 |
| --------------- | ------------ | ---------------------------------------------- |
| `market_list` | string | 以分号分隔的市场或板块列表 |
| `stock_id_list` | string | 以分号分隔的证券代码列表 |
| `condition` | boolean | 选股条件,无条件限制时传入 `true` |
| `sort_field` | string | 排序字段,空字符串表示不指定排序字段 |
| `field_name_1` | string | 第一列的显示名称 |
| `expression_1` | t_expression | 第一列的数据表达式 |
| `...` | any | 可选。更多按字段名称、数据表达式成对传入的参数 |
返回:table_array
### 示例
范例01:查询收盘价高于 10 日均线的证券
```tsl
setSysParam(pn_date(), 20110909T);
return query(
"上证A股;创业板",
"SZ000001;SZ000002;SZ000997",
close() > ma(close(), 10),
"",
"证券代码", defaultStockID(),
"证券名称", currentStockName(),
"收盘价", close()
);
```