# 金融 / 金融工程 / 指数计算 / 中间函数 ## `indexBacktesing_getStockShares(endt, shares_type, stock)` 声明:function 返回本模型用于维护股票类指数每日获取股本数据 注意:这里的股本函数有效日的限制,参考 IndexBacktesing_UnpdateStockShares | 参数 | 类型 | 说明 | | ------------- | ----------- | --------------------- | | `endt` | datetime | 日期,截止日 | | `shares_type` | user_define | 用户自定义,股本类型 | | `stock` | string | 字符串,一维字符串数组 | 返回:float ### 示例 范例01:万科2026/05/18的流通股本 ```tsl // 万科2026/05/18的流通股本 StockID := "SZ000002"; Endt := 20260518T; ShareType := 3; return IndexBacktesing_GetStockShares(Endt, ShareType, StockID); // 9716935865 ``` ## `indexBacktesing_unpdateStockShares(stock_table, endt, shares_type)` 声明:function 返回指数计算-股本数据-股票更新(结合股本有效日) 目的:1、主要是减少股本数据的提取 2、用于每日股本加权方式的计算 特性: 结合股本结构表的股本数据更新接口 假设所有的股本数据的变动,都依赖 股本结构 16 (以A股为例) 约定: 3、先适配A股 4、与 PN_ChangedDateMode系统参数相关,见StockShareDate。且假设前后一致。 效用: 全A 2年 10s | 参数 | 类型 | 说明 | | ------------- | ----------- | ----------------------------- | | `stock_table` | array | 二维字符串数组,一维字符串数组 | | `endt` | datetime | 日期,截止日 | | `shares_type` | user_define | 用户自定义,股本类型 | 返回:array ### 示例 范例01:调用 IndexBacktesing_UnpdateStockShares ```tsl stks := `array('代码':getbkbydate('SH000985', today())); mtic; for day := 20200101T to 20230201T do begin IndexBacktesing_UnpdateStockShares(stks, day, 3); end echo mtoc; return stks; ```