# 金融 / 指数 / 估值指标 ## `index_pb2(right_type, sample_select)` 声明:function 返回指定日市净率(最新年报),与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | --------------------------------- | | `right_type` | integer | 用户自定义。加权方式,取值如下: | | `sample_select` | integer | 用户自定义。样本股选择,取值如下: | 返回:float ### 示例 范例01:"SH000300"在2023-05-22 全部样本股总股本加权指定日市净率(最新年报) ```tsl // "SH000300"在2023-05-22 全部样本股总股本加权指定日市净率(最新年报) SetSysParam(pn_stock(), "SH000300"); SetSysParam(PN_Date(), 20230522T); return Index_PB2(0, 0); // 输出:1.30 ``` ## `index_pcf(right_type, sample_select)` 声明:function 提取指定日的指数市现率,与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | -------------------------------------- | | `right_type` | integer | 加权方式,0为总股本加权,1为中位数 | | `sample_select` | integer | 样本股选择,0为全部样本股,1为剔除亏损 | 返回:integer ### 示例 范例01:结果: 11.34 ```tsl setsysparam(pn_stock(), 'SH000300'); setsysparam(pn_date(), 20180727T); return Index_PCF(0, 0); // 输出:11.34 ``` ## `index_pcf2(right_type, sample_select)` 声明:function 返回指定日市现率(最新年报),与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | --------------------------------- | | `right_type` | integer | 用户自定义。加权方式,取值如下: | | `sample_select` | integer | 用户自定义。样本股选择,取值如下: | 返回:float ### 示例 范例01:"SH000300"在2023-05-22 全部样本股总股本加权指定日市现率(最新年报) ```tsl // "SH000300"在2023-05-22 全部样本股总股本加权指定日市现率(最新年报) SetSysParam(pn_stock(), "SH000300"); SetSysParam(PN_Date(), 20230522T); return Index_PCF2(0, 0); // 输出:4.52 ``` ## `index_pe2(right_type, sample_select)` 声明:function 返回指定日市盈率(最新年报),与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | --------------------------------- | | `right_type` | integer | 用户自定义。加权方式,取值如下: | | `sample_select` | integer | 用户自定义。样本股选择,取值如下: | 返回:float ### 示例 范例01:"SH000300"在2023-05-22 全部样本股总股本加权指定日市盈率(最新年报) ```tsl // "SH000300"在2023-05-22 全部样本股总股本加权指定日市盈率(最新年报) SetSysParam(pn_stock(), "SH000300"); SetSysParam(PN_Date(), 20230522T); return Index_PE2(0, 0); // 输出:12.37 ``` ## `index_psR(right_type, sample_select)` 声明:function 提取指定日的指数市销率,与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | -------------------------------------- | | `right_type` | integer | 加权方式,0为总股本加权,1为中位数 | | `sample_select` | integer | 样本股选择,0为全部样本股,1为剔除亏损 | 返回:integer ### 示例 范例01:结果: 1.27 ```tsl setsysparam(pn_stock(), 'SH000300'); setsysparam(pn_date(), 20180727T); return Index_PSR(0, 0); // 输出:1.27 ``` ## `index_psR2(right_type, sample_select)` 声明:function 返回指定日市销率(最新年报),与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | --------------------------------- | | `right_type` | integer | 用户自定义。加权方式,取值如下: | | `sample_select` | integer | 用户自定义。样本股选择,取值如下: | 返回:float ### 示例 范例01:"SH000300"在2023-05-22 全部样本股总股本加权指定日市销率(最新年报) ```tsl // "SH000300"在2023-05-22 全部样本股总股本加权指定日市销率(最新年报) SetSysParam(pn_stock(), "SH000300"); SetSysParam(PN_Date(), 20230522T); return Index_PSR2(0, 0); // 输出:1.23 ``` ## `index_val_firstday()` 声明:function 返回指数估值衍生开始日,与系统参数(证券代码)相关 返回:float ### 示例 范例01:返回:38450(2005-04-08) ```tsl return spec(Index_Val_Firstday(), 'SH000300'); // 输出:38450(2005-04-08) ``` ## `index_val_lastUpday()` 声明:function 返回指数估值衍生实际计算日期,与系统参数(证券代码)相关 返回:float|datetime ### 示例 范例01:调用 Index_Val_LastUpday ```tsl return spec(Index_Val_LastUpday(), 'SH000300'); ``` ## `index_value(right_type, sample_select, index_type)` 声明:function 返回指数估值中间函数,与系统参数(证券代码,时间)相关 | 参数 | 类型 | 说明 | | --------------- | ------- | --------------------- | | `right_type` | integer | 用户自定义。取值如下: | | `sample_select` | integer | 用户自定义。取值如下: | | `index_type` | integer | 用户自定义。取值如下: | 返回:float ### 示例 范例01:结果:12.19 ```tsl SetSysParam(pn_stock(), "SH000300"); SetSysParam(PN_Date(), 20230522T); return Index_Value(0, 0, 1); // 输出:12.19 ```