Files
playbook/skills/tsl-api-reference/references/codegen/dotnet/indices/basic_info.md
T
csh c0bf0358e0 📝 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.
2026-07-07 16:47:03 +08:00

1.9 KiB

指数 / 基本信息

getBkWeightByDate2(index_id, benchmark_id, end_t)

本模型从基准指数BenchmarkID的成分股权重数据中获取目标指数IndexID的成份股,并取其权重进行归一处理,计算目标指数IndexID的成分股权重。 使用时需注意: 1.基准指数BenchmarkID的选取比较重要,比如申万二级和三级行业,可以选择对应的申万一级行业指数作为估算的基准指数,经测算是较为接近的; 2.目标指数IndexID的成分股必须可获取; 3.基准指数BenchmarkID的成分股应包含目标指数IndexID的成分股; 4.如果BenchmarkID为nil,则取默认基准指数--SH000985 中证全指

参数 类型 说明
index_id string 指数,指数
benchmark_id string 指数,基准指数
end_t datetime 日期,截止日期

返回:array

getIndexes(market_id)

获取指定市场的最新的指数代码列表,与sp_time()无关,不能获取历史数据。

参数 类型 说明
market_id int 整型,市场代码

返回:array

indexCount(market_id)

获取指定市场最新的指数个数,与sp_time()无关。

参数 类型 说明
market_id int 整型,市场代码

返回:int

isIndex(index_id)

判断IndexID是否为指数代码

参数 类型 说明
index_id string 指数代码

返回:bool

markIndex()

返回证券最新对应的指数ID,与系统股票pn_stock()相关。 类型 指数ID 深交所证券 SZ399001 上交所证券 SH000001

返回:string

示例

Setsysparam(pn_stock(),'SZ000002') ;
Return MarkIndex();