Files
playbook/skills/tsl-api-reference/references/codegen/dotnet/fundamentals/misc.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

2799 lines
75 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 财务基本面 / 其他
## `BK_FinacialItemTopN(r_date, info_id, show_number)`
返回财务指标前N名股票,数据类型为数据表,板块为pn_bk()设置的当前系统板块
| 参数 | 类型 | 说明 |
| ------------- | -------- | ---------------- |
| `r_date` | datetime | 报告期 |
| `info_id` | string | 基本面,排序字段 |
| `show_number` | any | 整数,返回个数 |
返回:array
## `Block_Shareholders_Holding(bk_name, rdate, dtype)`
指定板块,十大股东、十大流通股东股东持有情况
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------- |
| `bk_name` | string | 市场和板块,板块名称 |
| `rdate` | datetime | 报告期,报告期 |
| `dtype` | any | 用户自定义,数据类型 |
返回:array
## `Block_Shareholders_HoldingConcentration(bk_name, rdate, p_rdate, d_type)`
指定板块,十大股东、十大流通股东持股集中度
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------- |
| `bk_name` | string | 市场和板块,板块名称 |
| `rdate` | datetime | 报告期,报告期 |
| `p_rdate` | any | 报告期,对比报告期 |
| `d_type` | any | 用户自定义,数据类型 |
返回:array
## `CSStruc7_4(r_date)`
经营活动现金流出占现金流出合计比(%),与系统参数(证券,时间)相关。 1、支持报告期、TTM、最近会计年度、单季度的提取,用法如下, 在调用模型之前,通过设置系统参数指定对应算法: 1)不设置时,默认提取指定报告期RDate的数据,见【范例1】 2)设置SetSysParam(CT_TTMData(),True),表示获取TTM数据,见【范例2】 3)设置SetSysParam(CT_YearData(),True)与setsysparam(CT_RecentYear(),N)表示获取最近N个会计年度数据,见【范例3】 4)设置SetSysParam(CT_QuarterData(),True),表示获取单季度的数据,见【范例4】 5)当同时设置多个参数时,按优先级从高到低:TTM>单季度>最近N个会计年度 2、支持通过设置当前时间获取调整前与调整后数据,见【范例5】
| 参数 | 类型 | 说明 |
| -------- | -------- | -------------- |
| `r_date` | datetime | 整数,报告期。 |
返回:float
## `CSStruc7_5(r_date)`
投资活动现金流出占现金流出合计比(%),与系统参数(证券,时间)相关。 1、支持报告期、TTM、最近会计年度、单季度的提取,用法如下, 在调用模型之前,通过设置系统参数指定对应算法: 1)不设置时,默认提取指定报告期RDate的数据,见【范例1】 2)设置SetSysParam(CT_TTMData(),True),表示获取TTM数据,见【范例2】 3)设置SetSysParam(CT_YearData(),True)与setsysparam(CT_RecentYear(),N)表示获取最近N个会计年度数据,见【范例3】 4)设置SetSysParam(CT_QuarterData(),True),表示获取单季度的数据,见【范例4】 5)当同时设置多个参数时,按优先级从高到低:TTM>单季度>最近N个会计年度 2、支持通过设置当前时间获取调整前与调整后数据,见【范例5】
| 参数 | 类型 | 说明 |
| -------- | -------- | -------------- |
| `r_date` | datetime | 整数,报告期。 |
返回:float
## `EPS_Q(r_date)`
季度的每股收益。 (1)按照季度的算法,计算出RDate季度的归属于母公司所有者的净利润V1【注1】; (2)取出RDate当天的总股本数据V2; (3)季度的每股收益=V1/V2。
| 参数 | 类型 | 说明 |
| -------- | -------- | -------------- |
| `r_date` | datetime | 整数,报告期。 |
返回:float
## `fund_ManagerRiskAdjustedReturn(d_type)`
基金经理\_风险调整收益及风险
| 参数 | 类型 | 说明 |
| -------- | ---- | ------------------- |
| `d_type` | any | 用户自定义,任职情况 |
返回:bool
## `fund_PurchaseRedemption(show_number, report_date_show_order)`
申购赎回
| 参数 | 类型 | 说明 |
| ------------------------ | ---- | ------------------- |
| `show_number` | any | 用户自定义,显示个数 |
| `report_date_show_order` | bool | object |
返回:bool
## `funds_ABSHoldDetail(bk_name, rdate, top_n)`
资产支持证券明细
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------- |
| `bk_name` | string | 市场和板块,板块名称 |
| `rdate` | datetime | 报告期,报告期 |
| `top_n` | any | 用户自定义,取前N名 |
返回:bool
## `Funds_BondHoldCentralization(bk_name, r_date)`
持债集中度
| 参数 | 类型 | 说明 |
| --------- | -------- | ------------------- |
| `bk_name` | string | 市场和板块,板块名称 |
| `r_date` | datetime | 报告期,报告期 |
返回:bool
## `getReportFinanceByTime(id, timeable, next, day)`
查找比当前日期大的报告期数据;与当前股票相关。
| 参数 | 类型 | 说明 |
| ---------- | -------- | ---------------------------- |
| `id` | int | 整数,基本面ID |
| `timeable` | bool | 布尔值,表示是否和时间相关; |
| `next` | bool | 布尔值,表示是否向后查找; |
| `day` | datetime | 日期; |
返回:float
### 示例
```tsl
oV:=BackUpSystemParameters2();
setsysparam(pn_stock(),'SH600000');
endt:=inttodate(20130909);
v:=GetReportFinanceByTime(44059,0,0,endt);
return v;//结果:3468442000000
```
## `GrowRatio1_4(r_date)`
营业费用增长率(%),与系统参数(证券代码)相关 1、支持报告期、TTM、最近会计年度、单季度的提取,用法如下, 在调用模型之前,通过设置系统参数指定对应算法: 1)不设置时,默认提取指定报告期RDate的数据,见【范例1】 2)设置SetSysParam(CT_TTMData(),True),表示获取TTM数据,见【范例2】 3)设置SetSysParam(CT_YearData(),True)与setsysparam(CT_RecentYear(),N)表示获取最近N个会计年度数据,见【范例3】 4)设置SetSysParam(CT_QuarterData(),True),表示获取单季度的数据,见【范例4】 5)当同时设置多个参数时,按优先级从高到低:TTM>单季度>最近N个会计年度 2、支持通过设置当前时间获取调整前与调整后数据,见【范例5】
| 参数 | 类型 | 说明 |
| -------- | -------- | -------- |
| `r_date` | datetime | 报告期。 |
返回:float
## `investmentIncomeRatio(report_date)`
投资收益比例(%) 1、支持报告期、TTM、最近会计年度、单季度的提取,用法如下, 在调用模型之前,通过设置系统参数指定对应算法: 1)不设置时,默认提取指定报告期RDate的数据,见【范例1】 2)设置SetSysParam(CT_TTMData(),True),表示获取TTM数据,见【范例2】 3)设置SetSysParam(CT_YearData(),True)与setsysparam(CT_RecentYear(),N)表示获取最近N个会计年度数据,见【范例3】 4)设置SetSysParam(CT_QuarterData(),True),表示获取单季度的数据,见【范例4】 5)当同时设置多个参数时,按优先级从高到低:TTM>单季度>最近N个会计年度 2、支持通过设置当前时间获取调整前与调整后数据,见【范例5】
| 参数 | 类型 | 说明 |
| ------------- | ---- | -------------- |
| `report_date` | int | 整数,报告期。 |
返回:float
### 示例
```tsl
setsysparam(pn_stock(),'SH600004');
setsysparam(pn_date(),20250919T);
v:=InvestmentIncomeRatio(20241231);
return v;//结果:10.074
```
## `magicSum(items, starty, end_y)`
对所有项目总体进行求和
| 参数 | 类型 | 说明 |
| -------- | ----- | ---------------- |
| `items` | array | 基本面数组,项目 |
| `starty` | int | 整数,开始年 |
| `end_y` | int | 整数,截止年 |
返回:float
### 示例
```tsl
setsysparam(pn_stock(),"SZ000002");
return MagicSum(array(46033),0,2003);
```
## `mainCostRatio(report_date)`
主营成本比例(%) 1、支持报告期、TTM、最近会计年度、单季度的提取,用法如下, 在调用模型之前,通过设置系统参数指定对应算法: 1)不设置时,默认提取指定报告期RDate的数据,见【范例1】 2)设置SetSysParam(CT_TTMData(),True),表示获取TTM数据,见【范例2】 3)设置SetSysParam(CT_YearData(),True)与setsysparam(CT_RecentYear(),N)表示获取最近N个会计年度数据,见【范例3】 4)设置SetSysParam(CT_QuarterData(),True),表示获取单季度的数据,见【范例4】 5)当同时设置多个参数时,按优先级从高到低:TTM>单季度>最近N个会计年度 2、支持通过设置当前时间获取调整前与调整后数据,见【范例5】
| 参数 | 类型 | 说明 |
| ------------- | ---- | -------------- |
| `report_date` | int | 整数,报告期。 |
返回:float
### 示例
```tsl
setsysparam(pn_stock(),'SH600004');
setsysparam(pn_date(),20250919T);
v:=MainCostRatio(20241231);
return v;//结果:72.9537
```
## `mainShareholders(stock_id)`
股票&基金主要股东
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | string | 证券代码 |
返回:array
## `NOPLAT_(r_date, _type, t)`
返回NOPLAT=EBIT\*(1-所得税税率)EBIT为息税前利润
| 参数 | 类型 | 说明 |
| -------- | ----- | ------------------------ |
| `r_date` | int | 报告期。 |
| `_type` | int | 用户自定义,EBIT计算方法 |
| `t` | float | 实数,税率(%) |
返回:float
### 示例
```tsl
oV:=BackUpSystemParameters2();
setsysparam(pn_stock(),'SZ000002');
v:=NOPLAT(20170930,3,14.07);
return v;
```
## `profitDistribution(stock_id)`
股票&基金&债券分红/送股
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | string | 证券代码 |
返回:array
## `Stock_GetDataFromInfoTable(stockid, fieldarr, rdate1, rdate2, info_id)`
Stock_GetDataFromInfoTable 相关函数。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ----------------------- |
| `stockid` | string | 证券,证券代码 |
| `fieldarr` | array | 一维字符串数组,字段数据 |
| `rdate1` | any | 报告期,开始报告期 |
| `rdate2` | any | 报告期,截止报告期 |
| `info_id` | string | 整数, |
返回:any
## `Stock_HGFormatDate(tdate)`
Stock_HGFormatDate 相关函数。
| 参数 | 类型 | 说明 |
| ------- | -------- | ----- |
| `tdate` | datetime | 日期, |
返回:any
## `Stock_Issue()`
返回新股上市数据。
返回:array
## `Stocks_HxCompare(bk_name, stocks, r_date, info_id_arr, show_style, two_dim_type, unit_type)`
返回指定板块指定年份区间主要财务数据横比。
| 参数 | 类型 | 说明 |
| -------------- | -------- | ------------------------ |
| `bk_name` | string | 字符串类型,板块名称 |
| `stocks` | array | 字符串类型,股票列表 |
| `r_date` | datetime | 报告期类型,报告期 |
| `info_id_arr` | array | 数组类型,基本面内容列表 |
| `show_style` | any | 整型,显示方式 |
| `two_dim_type` | any | 整型,显示格式 |
| `unit_type` | any | 整型,显示单位 |
返回:array
## `TSWEB_Block_HSGIndustryInfo(bkid, end_t, industry_type)`
报表,沪深港通板块最新行业市值及最近1月变动(金额单位:亿元/亿港币)
| 参数 | 类型 | 说明 |
| --------------- | -------- | ---------------------------------------------------------------- |
| `bkid` | string | 字符串。一个或多个板块代码,多个代码以英文分号“;”隔开,取值如下: |
| `end_t` | datetime | TDateTime类型。截止日期 |
| `industry_type` | any | 整型。所属行业,取值如下: |
返回:array
## `TSWEB_FC_FundDataMaxDate(fund_arr, info_id, fname, end_t)`
指定板块指定表的数据最大日期
| 参数 | 类型 | 说明 |
| ---------- | -------- | ----------------------- |
| `fund_arr` | array | 一维字符串数组,证券列表 |
| `info_id` | string | 整数,表ID |
| `fname` | string | 字符串,时间字段名称 |
| `end_t` | datetime | 日期,截止日期 |
返回:array
## `TSWEB_Fund_UnitsAndHoldersEtfSRConstituentStock(fundid)`
基金-份额及变动-ETF申购赎回-成分股
| 参数 | 类型 | 说明 |
| -------- | ------ | ------------- |
| `fundid` | string | 证券,基金代码 |
返回:array
## `TSWEB_Fund_UnitsAndHoldersTradingSeat(fundid, n, sorttype, rdatetype)`
基金-份额及持有人-持有人--交易席位-交易席位
| 参数 | 类型 | 说明 |
| ----------- | ------ | --------------------- |
| `fundid` | string | 证券,基金代码 |
| `n` | any | 用户自定义,报告期个数 |
| `sorttype` | bool | object |
| `rdatetype` | any | 用户自定义,报告期类型 |
返回:array
## `TSWEB_Industry_HSGHoldingChangeTopN_N(indus_name, end_t, industry_type)`
报表,指定日陆股通指定行业最近一月增减持5大股票(市值单位:亿元)
| 参数 | 类型 | 说明 |
| --------------- | -------- | ------------------------- |
| `indus_name` | string | 字符串。行业名称 |
| `end_t` | datetime | TDateTime类型。截止日期 |
| `industry_type` | any | 整型。所属行业,取值如下: |
返回:array
## `TSWEB_Stock_ConsumerPriceIndex(stock_id, begt, endt, month)`
TSWEB_Stock_ConsumerPriceIndex 相关函数。
| 参数 | 类型 | 说明 |
| ---------- | -------- | ------------------- |
| `stock_id` | string | 证券,证券代码 |
| `begt` | datetime | 日期,开始日期 |
| `endt` | datetime | 日期,截止日期 |
| `month` | any | 用户自定义,报告类型 |
返回:any
## `TSWEB_Stock_IPOGetData(stock_id, industry_type)`
返回指定股票的发行上市基本信息
| 参数 | 类型 | 说明 |
| --------------- | ------ | ------------------------- |
| `stock_id` | string | 字符串。证券代码 |
| `industry_type` | any | 整型。所属行业,取值如下: |
返回:array
## `TSWEB_Stock_MoneySupply(stock_id, begt, endt, month)`
TSWEB_Stock_MoneySupply 相关函数。
| 参数 | 类型 | 说明 |
| ---------- | -------- | ------------------- |
| `stock_id` | string | 证券,证券代码 |
| `begt` | datetime | 日期,开始日期 |
| `endt` | datetime | 日期,截止日期 |
| `month` | any | 用户自定义,报告类型 |
返回:any
## `TSWEB_Stock_SocialFinancingScale(stock_id, begt, endt, month)`
TSWEB_Stock_SocialFinancingScale 相关函数。
| 参数 | 类型 | 说明 |
| ---------- | -------- | ------------------- |
| `stock_id` | string | 证券,证券代码 |
| `begt` | datetime | 日期,开始日期 |
| `endt` | datetime | 日期,截止日期 |
| `month` | any | 用户自定义,报告类型 |
返回:any
## `timeCalc()`
时间运算教学函数。记录当前时间NOW()与休眠一秒后的时间差,返回字符串信息。
返回:String
### 示例
```tsl
return timeCalc();
//返回:’运行了1.00秒’
```
## `dataUnitConversion(data, unit_num, fields)`
数据单位换算函数,适用于:1.实数;2.数组
| 参数 | 类型 | 说明 |
| ---------- | ------- | ----------------------------------------------------------------------------------- |
| `data` | Array | 数据表类型,数据 |
| `unit_num` | Integer | 整数,单位 |
| `fields` | Array | 一维字符串数组,字段,如果不填字段,表示所有数字型的数据都做单位换算,否则只有指定列 |
返回:array
## `structureRatioReport(t)`
财务数据表结构分析。
| 参数 | 类型 | 说明 |
| ---- | ----- | -------------- |
| `t` | Array | 数组。数据表。 |
返回:Array
### 示例
```tsl
//计算万科A利润分配表的结构分析
t:=interestDistribute("SZ000002",0);
return structureRatioReport(t);
```
## `structureCompare(t1, t2, end_t, end_t2, show_detail, right_type, s_type)`
股票市场结构分析。
| 参数 | 类型 | 说明 |
| ------------- | --------- | ------------------------- |
| `t1` | Array | 数组。数据表。 |
| `t2` | Array | 数组。数据表。 |
| `end_t` | TDateTime | 日期。截止日期。 |
| `end_t2` | TDateTime | 日期。同比日期。 |
| `show_detail` | Integer | 整数。是否显示详情。 |
| `right_type` | Integer | 整数。加权方式,取值如下: |
| `s_type` | Integer | 整数。股票类型,取值如下: |
返回:Array
### 示例
```tsl
t1:=shareStructure("深证A股;上证A股;中小企业板",20200730T,3000,6000,500,0);
t2:=shareStructure("深证A股;上证A股;中小企业板",20190730T,3000,6000,500,0);
return structureCompare(t1,t2,20200730T,20190730T,0,0,1);
结果:
```
## `dataUnitConversion3(t, fields, unit_type, data_type)`
数据单位换算函数(显示单位)
| 参数 | 类型 | 说明 |
| ----------- | ------- | --------------------------------- |
| `t` | Array | 数据表类型,数据集 |
| `fields` | Array | 一维字符串数组,需要转换单位的字段 |
| `unit_type` | Integer | 用户自定义,单位 |
| `data_type` | Integer | 用户自定义,单位类型 |
返回:any
### 示例
```tsl
//给data数据的金额列换算单位
data:=array(("日期":20251029,"金额":110000,"数量":100));
return dataUnitConversion3(data,array("金额"),2);
```
## `md(table_name)`
支持时间序列字段为表格类型,用于取时间序列的表格 ,证券、时间相关,当MD数据不存在时返回NIL
| 参数 | 类型 | 说明 |
| ------------ | ------ | -------------- |
| `table_name` | String | 字符串型,表名 |
返回:Any
### 示例
```tsl
stock_id := "BTS000033";
end_t := 20170301T;
setSysParam(pn_stock(),stock_id);
setSysParam(PN_Date(),end_t);
return md("债券期限结构");
//结果:
```
## `idToDate(id)`
报告期ID->日期,将报告期转换为具体的日期的整数形式,月份是00的话将表示某年的的第几周转化为具体日期的整数值,否则直接返回ID
| 参数 | 类型 | 说明 |
| ---- | ------- | ------ |
| `id` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return idToDate(20120010);
//返回2012年第10周对应的日期的整数值
//结果:20120309
return idToDate(20111231);
//返回2011年年报对应的日期的整数值
//结果:20111231
```
## `idToStr(report_id)`
将报告期以中文形式输出,如:20120331则输出2012年第一季报,如果月份为00并且日小于54(一年的周数),则输出第几周,如:20120012,则输出2012年第12周报;
| 参数 | 类型 | 说明 |
| ----------- | ------- | -------- |
| `report_id` | Integer | 报告日期 |
返回:String
### 示例
```tsl
return idToStr(20111231);
//返回”2011年年报”
//结果:”2011年年报”
return idToStr(20120012);
//结果:”2012年第12周报”
```
## `ifArrayId(id)`
判断是否为表格类型
| 参数 | 类型 | 说明 |
| ---- | ------- | -------- |
| `id` | Integer | 基本面ID |
返回:Boolean
### 示例
```tsl
return ifArrayId(44);
//返回1,表示44是表格类型
//结果:1
```
## `ifReportId(id)`
判断要取得的数据是否与报告期相关
| 参数 | 类型 | 说明 |
| ---- | ------- | ---------------------------------------------------- |
| `id` | Integer | 基本面表格中某一字段对应的ID,如44002,表44的002字段 |
返回:Boolean
### 示例
```tsl
return ifReportId(44002);
//返回1,表示与报告期相关
//结果:1
return ifReportId(65000);
//返回0,表示与报告期无关
//结果:0
```
## `ifBaseId(id)`
判断要取得的数据是否与报告期无关
| 参数 | 类型 | 说明 |
| ---- | ------- | -------------------------------------------------- |
| `id` | Integer | 基本面表格中某一字段的ID,如44002,是表44的002字段 |
返回:Boolean
### 示例
```tsl
return ifBaseId(65000);
//返回1,表示与报告期无关
//结果:1
return ifBaseId(44002);
//返回0,表示与报告期相关
//结果:0
```
## `infoArrayEx(info_id, rdate)`
获取证券在报告期RDate的InfoId基本面数据,与系统当前股票有关
| 参数 | 类型 | 说明 |
| --------- | ------- | -------- |
| `info_id` | Integer | 基本面ID |
| `rdate` | Integer | 报告期 |
返回:Array
### 示例
```tsl
setSysParam(pn_stock(),"SZ000002");
return infoArrayEx(44,20111231);
//返回万科年报的合并资产负债表
结果:
```
## `reportValueByRight(stock_id)`
指定日加权后的与报告期相关的数据
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------------------------------------------------- |
| `stock_id` | String | 股票代码EndT:截止日期InfoId:基本面数据IDRight:加权 |
返回:Real
### 示例
```tsl
stock_id :="SH600004";
end_t :=intToDate(20111231);
return reportValueByRight (stock_id,end_t,44002,1);
//返回”SH600004”在2011-12-31加权后的货币资金
//结果:854257105.09
```
## `stockBase(stock_id, info_id)`
与报告期无关基本面数据,取最新的
| 参数 | 类型 | 说明 |
| ---------- | ------- | -------- |
| `stock_id` | String | 股票代码 |
| `info_id` | integer | 基本面ID |
返回:Any
### 示例
```tsl
return stockBase("SH600004",22002);
//结果:20070327  //股东大会公告日,返回整数类型
return stockBase("SH600004",10002);
//结果:“广州白云国际机场股份有限公司”  //公司中文名称,字符串类型
```
## `stockBaseEx(stock_id, index)`
与报告期无关基本面数据
| 参数 | 类型 | 说明 |
| ---------- | ------- | -------------------------------- |
| `stock_id` | String | 股票代码InfoId:基本面ID |
| `index` | Integer | 整数,取第几条,-1表示最新的一条 |
返回:(返回类型和获取的数据有关)
### 示例
```tsl
return stockBaseEx("SH600000",22002,-1);
//返回最新的”股东大会公告日”
//结果:20100331   //整数类型
return stockBaseEx("SH600000",22002,1);
//返回序号为1(即第2条)的”股东大会公告日”
//结果:20040601
```
## `stockInfoArray(stock_id)`
股票某一基本面的所有历史数据
| 参数 | 类型 | 说明 |
| ---------- | ------ | ----------------------- |
| `stock_id` | String | 证券InfoId:基本面数据ID |
返回:Array
### 示例
```tsl
return stockInfoArray("SH600004",44);
//返回”SH600004”的合并资产负债表(44)的历史数据
结果:
```
## `stockReport(stock_id, info_id, report_date)`
返回与报告期相关数据
| 参数 | 类型 | 说明 |
| ------------- | -------- | -------- |
| `stock_id` | String | 股票代码 |
| `info_id` | Integer | 基本面ID |
| `report_date` | Integer) | 报告期 |
返回:返回股票在某一报告期与报告期相关的InfoID数据
### 示例
```tsl
return stockReport("SH600000",44002,20091231);
//返回”SH600004”2009-12-31的货币资金
//结果:1157096238.65  //返回实数类型
return stockReport("SH600000",44146,20091231);
//返回”SH600004”2009-12-31的会计准则
//结果:新    //返回字符串类型
```
## `basicInfoExt2()`
获取基本面信息,比BasicInfoEx3返回的信息基本更全面
返回:Array
### 示例
```tsl
return basicInfoExt2();
结果:
```
## `basicInfoEx3()`
返回三大报表的基本面信息
返回:Array
### 示例
```tsl
return basicInfoEx3();
//返回基本面信息
结果:
```
## `getLastReportFinance(id, timeable)`
获取报告最后的财务值;
| 参数 | 类型 | 说明 |
| ---------- | ------- | ---------------------------- |
| `id` | Integer | 整数,基本面ID |
| `timeable` | Bool | 布尔值,表示是否和时间相关; |
返回:Real
### 示例
```tsl
o_v:=BackUpSystemParameters2();
//取浦发银行最后报告的资产总计
setSysParam(pn_stock(),'SH600000');
v:=getLastReportFinance(44059,0);
return v;//结果:3468442000000
```
## `getReportFinanceByTime2(id, time)`
财务报告,查找比当前日期小的报告期的财务数据
| 参数 | 类型 | 说明 |
| ------ | ------- | ---------------------------- |
| `id` | integer | 整数,基本面ID; |
| `time` | Boolean | 布尔值,表示是否和时间相关; |
返回:real
### 示例
```tsl
o_v:=BackUpSystemParameters2();
//取浦发银行比当前日期小的报告期的资产总计数据
setSysParam(pn_stock(),'SH600000');
v:=getReportFinanceByTime2(44059,0);
return v;//结果:3468442000000
```
## `infoArrayEx2(info_id, changed_field_name, changed_value)`
按照截止日取Infoarray的数据。
| 参数 | 类型 | 说明 |
| -------------------- | ------- | --------------------- |
| `info_id` | integer | 整型,表ID |
| `changed_field_name` | String | 字符串,发生变化的字段 |
| `changed_value` | integer | 数值,指定字段的数值 |
返回:Array,TableArray
## `stocksinfoarrayex(stockarr, infoid, datefield, begt, endt)`
按截止日取一段时间InfoArray
| 参数 | 类型 | 说明 |
| ----------- | ---------------- | ---- |
| `stockarr` | Array,TableArray | |
| `infoid` | integer | |
| `datefield` | string | |
| `begt` | TDateTime | |
| `endt` | TDateTime | |
返回:Array,TableArray
## `infoIdExt(id, r_date)`
截止日不大于RDate的最近的id值,与系统参数(证券)相关,对于财务数据还与系统参数(日期)相关。
| 参数 | 类型 | 说明 |
| -------- | ------- | ------------------------------ |
| `id` | Integer | 整数。财务指标和其他信息的ID。 |
| `r_date` | Integer | 整数。截止日,报告期ID。 |
返回:Real
### 示例
```tsl
setSysParam(PN_Stock(),'OF000001');
rendt:=dateToInt(20200411T);//星期六
return infoIdExt(328003,rendt);
//返回的星期五净值InfoIdExt(328003,20200410):1.11
```
## `reportdateqj(rdate)`
报告期期间开始日期
| 参数 | 类型 | 说明 |
| ------- | ----- | ---------------- |
| `rdate` | rdate | integer,报表日期 |
返回:real
## `rDateListBetweenYear(from_y, end_y, r_date_type)`
返回FromY到EndY之间的RdateType类的报告期
| 参数 | 类型 | 说明 |
| ------------- | ------- | ---------- |
| `from_y` | integer | 起始年份 |
| `end_y` | integer | 截止年份 |
| `r_date_type` | integer | 报告期类型 |
返回:Array,TableArray
### 示例
```tsl
return rDateListBetweenYear(2005,2010,0);
//返回2005年到2010年的全部报告期
结果:
```
## `getRDateByYear(t, beg_y, end_y, show1_q, show2_q, show3_q, show4_q)`
选取复符合条件的报告期,按照Show1QShow2QShow3QShow4Q是否为真来表示是够选取一季报,中报,年报,选取的年份区间在BegY,EndY内
| 参数 | 类型 | 说明 |
| --------- | ---------- | ---------------------------------------------------------------------------- |
| `t` | TableArray | 数据表,必须含有”截止日”或者”ReportDate”字段,其字段下的数据必须是报告期日期 |
| `beg_y` | Integer | 整数,选取的开始年份 |
| `end_y` | Integer | 整数,选取的结束年份 |
| `show1_q` | Boolean | 布尔类型,是否选取一季报 |
| `show2_q` | Boolean | 布尔类型,是否选取中报 |
| `show3_q` | Boolean | 布尔类型,是否选取三季报 |
| `show4_q` | Boolean | 布尔类型,是否选取年报 |
返回:Array
### 示例
```tsl
t:=array(("截止日":20120930),("截止日":20120331),("截止日":20120923),("截止日":20120912));
return getRDateByYear(t,2012,2012,1,1,1,0);
//选取一季报,中报,三季报
结果:
```
## `reportHistOfHg(end_y)`
获取从BegYear到EndYear的月末列表
| 参数 | 类型 | 说明 |
| ------- | ---- | ---------------- |
| `end_y` | | 整数(截止年份) |
返回:Array
### 示例
```tsl
return reportHistOfHg(2009,2010);
//返回2009年至2010每个月的月末列表
结果:
```
## `previousReportDateList(rdate, n, rdatetype)`
返回指定报告期前N个报告期序列
| 参数 | 类型 | 说明 |
| ----------- | ------- | ------------------------------------ |
| `rdate` | Integer | 整型,指定报告期 |
| `n` | Integer | 整型,向前推N个报告期(为负则向后推) |
| `rdatetype` | Integer | 整型,报告期类型 |
返回:Array
### 示例
```tsl
//20201231的前4个报告期
return previousReportDateList(20201231,4,0);
//返回:array(20200930,20200630,20200331,20191231)
```
## `rDateListBetween(t, beg_r_date, end_r_date, key_field, sort_order, r_date_type)`
指定区间的报告期数据。
| 参数 | 类型 | 说明 |
| ------------- | ------- | ------------------------------------- |
| `t` | Array | 数组。数据 |
| `beg_r_date` | Integer | 整数。起始报告期 |
| `end_r_date` | Integer | 整数。截止报告期 |
| `key_field` | String | 字符串。关键字段 |
| `sort_order` | Integer | 用户自定义。排序,取值如下: |
| `r_date_type` | Integer | 用户自定义。返回报告期类型,取值如下: |
返回:Array
## `wordRDateShowField(r_date, cr_date)`
Word中报告期显示格式1。
| 参数 | 类型 | 说明 |
| --------- | ------- | ---------------- |
| `r_date` | Integer | 整数。报告期 |
| `cr_date` | Integer | 整数。最新报告期 |
返回:String
### 示例
```tsl
return wordRDateShowField(20121231,20130630);
//结果:2012A
```
## `wordRDateShowField2(r_date)`
Word中报告期显示格式2。
| 参数 | 类型 | 说明 |
| -------- | ------- | ------------ |
| `r_date` | Integer | 整数。报告期 |
返回:String
### 示例
```tsl
return wordRDateShowField2(20121231);
//结果:2012
```
## `rDateListQk(begt, endt, r_date_type)`
区间报告期序列。
| 参数 | 类型 | 说明 |
| ------------- | --------- | ------------------------------------- |
| `begt` | TDateTime | 日期。开始日 |
| `endt` | TDateTime | 日期。截止日 |
| `r_date_type` | Integer | 用户自定义。返回报告期类型,取值如下: |
返回:Array
### 示例
```tsl
return rDateListQk(20111231T,20130630T,0);
结果:
```
## `previousReportDateList2(rdate, n, r_date_type)`
返回指定报告期前N个报告期
| 参数 | 类型 | 说明 |
| ------------- | ------- | ------------------------------------ |
| `rdate` | Integer | 报告期,指定报告期 |
| `n` | Integer | 整数,向前推N个报告期(为负则向后推) |
| `r_date_type` | Integer | 用户自定义,报告期类型 |
返回:date
### 示例
```tsl
20191231的前1个报告期
return previousReportDateList2(20191231,1,0); //返回:array(20190930)
```
## `hbValue(rdate, info_id, get_the_nearest)`
按季度取环比数据。若GetTheNearest为真时,则取指定报告期的值,若GetTheNearest为假时,则取最接近的报告期的值。
| 参数 | 类型 | 说明 |
| ----------------- | ------- | ---------------------------------------- |
| `rdate` | Integer | 报告期 |
| `info_id` | Integer | 基本面 |
| `get_the_nearest` | Boolean | 1取指定报告期的值,0找最接近的报告期的值 |
返回:Real
### 示例
```tsl
setSysParam(pn_Stock(),"SZ000002");
return hbValue(20101231,44002,1);
//返回万科2010年第4季度的货币资金
//结果:37816932911.84
```
## `hbShowField(r_date)`
显示报告期的季度名称
| 参数 | 类型 | 说明 |
| -------- | ---- | ------ |
| `r_date` | | 报告期 |
返回:String
### 示例
```tsl
return hbShowField(20111231);
//返回2011-12-31的季度名称
//结果:”2011-4Q”
```
## `hbReportDate(r_date)`
环比报告期(RDate的前一个报告期),如果是一季报,则返回第一个报告期
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return hbReportDate(20111231);
//返回2011-12-31环比报告期
//结果:20110930
return hbReportDate(20110331);
//返回2011-03-31的报告期
//结果:20110331
```
## `hbReportDateOfOneQuarter(r_date)`
环比报告期(获取RDate的上一个报告期)
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return hbReportDateOfOneQuarter(20111231);
//2011-12-31环比报告期
//结果:20110930
return hbReportDateOfOneQuarter(20110331);
//结果:20101231
```
## `hbValuePs(rdate, info_id, get_the_nearest)`
环比数据(每股)
| 参数 | 类型 | 说明 |
| ----------------- | ------- | ---------------------------------------- |
| `rdate` | integer | 报告期 |
| `info_id` | integer | 基本面ID |
| `get_the_nearest` | Boolean | 1取指定报告期的值,0找最接近的报告期的值 |
返回:Real
### 示例
```tsl
setSysParam(pn_Stock(),"SZ000002");
return hbValuePs(20100930,44002,1);
//返回万科2010第三季度的货币资金
//结果:2.868836
```
## `hbShowField2(r_date)`
指定报告期的季度名称
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:String
### 示例
```tsl
return hbShowField2(20111231);
//返回2011年年报的环比显示
//结果:”11-4Q”
```
## `beginReportDate(r_date)`
期初报告期,财务上按照年度进行结算,比如:2002一季度的期初报告期是2001年年报,2002年报的期初报告期也是2001年年报
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return beginReportDate(20111231);
//返回2011年年报期初报告期
//结果:20101231
```
## `beginReportValue(stock_id, id, endt)`
期初报告期数据
| 参数 | 类型 | 说明 |
| ---------- | --------- | -------- |
| `stock_id` | String | 股票代码 |
| `id` | integer | 字段id |
| `endt` | TDateTime | 截止日 |
返回:real
### 示例
```tsl
end_t := intToDate(20111130);
return beginReportValue("SH600004",9,end_t);
//返回”SH600004的期初报告期9对应的id为46078的数据
//结果:587778570.54
```
## `previousReportDate(r_date)`
同比报告期(前)
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return previousReportDate(20111231);
//返回2011年报的同比报告期
//结果:20101231
```
## `previuosReportDateList(end_t, n)`
前N个会计年度报告期
| 参数 | 类型 | 说明 |
| ------- | --------- | ------ |
| `end_t` | TDateTime | 截止日 |
| `n` | Integer | 索引号 |
返回:Array
### 示例
```tsl
return previuosReportDateList(intToDate(20111001),2);
//返回截止2011-10-01前2个会计年度报告期
结果:
```
## `priorReportDate(r_date)`
同比报告期(后)
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return priorReportDate(20101231);
//返回2010年报的报告期同比报告期(后)
//结果:20111231
```
## `previousReportDateEx(r_date, n, _type)`
前报告期(通用)
| 参数 | 类型 | 说明 |
| -------- | ------- | ------------------------ |
| `r_date` | Integer | 报告期 |
| `n` | Integer | 前N个报告期或者前N个季度 |
| `_type` | Integer | 0是年度标准,1季度标准 |
返回:Integer
### 示例
```tsl
return previousReportDateEx(20111231,2,0);
//返回2011年报前报告期
//结果:20091231
```
## `previousReportDateOfHg(r_date)`
同比报告期(宏观)
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return previousReportDateOfHg(20111231);
//返回2011年报的同比报告期
//结果:20101231
```
## `reportDateListByNumber(end_t, year_report_number, quarter_report_number, add_end_t, listed_date)`
返回到截止日的最新的N个年报+M个季报
| 参数 | 类型 | 说明 |
| ----------------------- | --------- | ---------------------- |
| `end_t` | TDateTime | 截止日 |
| `year_report_number` | Integer | 最近N年 |
| `quarter_report_number` | Integer | 最近M个季度 |
| `add_end_t` | Boolean | 把指定的截止日期返回来 |
| `listed_date` | Boolean | 删除未上市的报告期 |
返回:返回到最新日期的最近的N个年报+M个季报
### 示例
```tsl
setSysParam(pn_Stock(),"SZ00002");
return reportDateListByNumber(intToDate(20111021),3,2,1,0);
//返回最新日期的最近的3个年报+2个季报,同时把指定的截止日期也返回
结果:
```
## `hbhbGrowRatio(r_date, info_id)`
环比之环比变动(%)。与系统股股票有关
| 参数 | 类型 | 说明 |
| --------- | ----- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `info_id` | Int | 基本面类型,基本面 |
返回:Real
### 示例
```tsl
//返回平安银行在2010年6月30日的环比之环比变动(%)
setSysParam(PN_Stock(),'SZ000001');
return hbhbGrowRatio(20100630,46002);
//结果:8.02
```
## `hbtbGrowRatio(r_date, info_id)`
环比之同比变动(%)。与系统股票有关
| 参数 | 类型 | 说明 |
| --------- | ----- | ------------------ |
| `r_date` | RDate | 报告期类型,报告期 |
| `info_id` | Int | 基本面类型,基本面 |
返回:Real
### 示例
```tsl
//返回平安银行在2010年6月30日的环比之同比变动(%)
setSysParam(PN_Stock(),'SZ000001');
return hbtbGrowRatio(20100630,46002);
//结果:18.27
```
## `hbValue2(r_date, info_id, info_id2, get_the_nearest)`
环比数据(按季度),与系统参数(证券代码,时间)相关。
| 参数 | 类型 | 说明 |
| ----------------- | ------- | ------------------------------ |
| `r_date` | Integer | 整数。报告期 |
| `info_id` | Integer | 整数。基本面 |
| `info_id2` | Integer | 整数。基本面ID2 |
| `get_the_nearest` | Integer | 整数。如无指定报告,找最接近的 |
返回:Real
### 示例
```tsl
//SZ000728 2022第四季度归母净利润季度数据(业绩快报)
setSysParam(pn_stock(),"SZ000728");
setSysParam(PN_Date(),20230327T);
return hbValue2(20221231,41006,46078,0);
//结果:558706055.49
```
## `hbValuePs2(r_date, info_id, info_id2, get_the_nearest)`
环比数据(每股),与系统参数(证券代码,时间)相关。
| 参数 | 类型 | 说明 |
| ----------------- | ------- | ------------------------ |
| `r_date` | Integer | 整数。报告期 |
| `info_id` | Integer | 整数。基本面 |
| `info_id2` | Integer | 整数。基本面ID2 |
| `get_the_nearest` | Integer | 整数。是否取最接近报告期 |
返回:Real
### 示例
```tsl
//SZ000728 20221231的第四季度基本每股收益(业绩快报)
setSysParam(pn_stock(),"SZ000728");
setSysParam(PN_Date(),20230327T);
return hbValuePs2(20221231,41006,46078,0);
//结果:0.128032651854782
```
## `previousReportDateOfQuarter(r_date, n)`
按照季报标准的前一个报告期
| 参数 | 类型 | 说明 |
| -------- | ----- | ----------------------------- |
| `r_date` | RDate | 报告期类型,报告期 |
| `n` | Int | 整型类型,索引号,其取值如下: |
返回:Integer
### 示例
```tsl
//返回2010年6月30日按照季报标准的前一个报告期
return previousReportDateOfQuarter(20100630,1);
//结果:20100331
```
## `previousReportDate2(rdate, n, rdatetype)`
当前报告期的第N个报告期,返回指定报告期的第N个报告期
| 参数 | 类型 | 说明 |
| ----------- | ------- | ------------------------------------ |
| `rdate` | Integer | 整型,指定报告期 |
| `n` | Integer | 整型,向前第N个报告期(为负则向后推) |
| `rdatetype` | Integer | 整型,报告期类型 |
返回:Integer
### 示例
```tsl
//20191231的上一个年报报告期
return previousReportDate2(20191231,4,0); //返回:20181231
```
## `reportDateType(r_date)`
返回报告期的报告期类型
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
return reportDateType(20111231);
//返回2011年报的报告期类型
//结果:4
```
## `getRDateArrByType(t, type_arr)`
取最近N个报告期。
| 参数 | 类型 | 说明 |
| ---------- | ------- | ------ |
| `t` | Array | 数组。 |
| `type_arr` | Integer | 整数。 |
返回:Array
## `reportExistsExt(id, rdate)`
判断指定报告是否存在
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------- |
| `id` | ID | 基本面 |
| `rdate` | TDateTime | 报告期日期 |
返回:Boolean
### 示例
```tsl
setSysParam(pn_stock(),'SH600000');
return reportExistsExt(44008,20120331);
//结果:1  //表示浦发银行的2012年一季报存在
```
## `filterRDateByEps(s_type, beg_r_date, end_r_date, r_date_type)`
取出在一定范围内的最新N个报告期(由EPS判断)
| 参数 | 类型 | 说明 |
| ------------- | ---- | ------------------------------- |
| `s_type` | Int | 整型类型,证券类型,其取值如下: |
| `beg_r_date` | Int | 报告期类型 |
| `end_r_date` | Int | 报告期类型 |
| `r_date_type` | Int | 整数 |
返回:Array
### 示例
```tsl
//返回平安银行最新的N个报告期
setSysParam(PN_Stock(),'SZ000001');  //设置股票代码
beg_r_date:=19981231;
end_r_date:=20040930;
return filterRDateByEps(0,beg_r_date,end_r_date,1);
//结果:
```
## `newReportDateOfEndT2(end_t)`
按公布日取出最新报告期。与系统参数(证券代码,报告类型)相关
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------------- |
| `end_t` | TDateTime | 日期类型,截止日 |
返回:Integer
### 示例
```tsl
//取得SZ000002(万科)截止到20100706的最新报告期(按公布日)
setSysParam(pn_stock(),'SZ000002');
end_t:=intToDate(20100706);
return newReportDateOfEndT2(end_t);
//结果:20100331
```
## `getTopNrDateByEps(s_type, r_date_type, n)`
最新N个报告期(由EPS判断)。与系统股票有关
| 参数 | 类型 | 说明 |
| ------------- | ------- | --------------------------------- |
| `s_type` | Integer | 整型类型,证券类型,其取值如下: |
| `r_date_type` | Integer | 整型类型,报告期类型,其取值如下: |
| `n` | Integer | 整型类型,显示个数,其取值如下: |
返回:Array
### 示例
```tsl
//取得SZ000002(万科)的最新4个年报报告期(由EPS判断)
setSysParam(pn_stock(),'SZ000002');
return getTopNrDateByEps(0,4,4);
//结果:
```
## `getTopNrDateByInfoId(info_id, r_date_type, n)`
最新N个报告期(由InfoId判断)。与系统股票有关
| 参数 | 类型 | 说明 |
| ------------- | ------- | --------------------------------- |
| `info_id` | Integer | 基本面类型,证券类型 |
| `r_date_type` | Integer | 整型类型,报告期类型,其取值如下: |
| `n` | Integer | 整型类型,显示个数,其取值如下: |
返回:Array
### 示例
```tsl
//取得SZ000002(万科)的最新4个年报报告期(由InfoId判断)
setSysParam(pn_stock(),'SZ000002');
return getTopNrDateByInfoId(46002,4,4);
//结果:
```
## `newReportDateOfYear2(end_t)`
按公布日取出最新年度报告期时间。与系统股票有关
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------------- |
| `end_t` | TDateTime | 日期类型,截止日 |
返回:Integer
### 示例
```tsl
//取得SZ000002(万科)截止到20100706的最新年度报告期(按公布日)
setSysParam(pn_stock(),'SZ000002');
end_t:=intToDate(20100706);
return newReportDateOfYear2(end_t);
//结果:20091231
```
## `getTopNrDateByTable(t, key_field, r_date_type, n)`
根据数据表取出最新N个报告期。与系统股票有关
| 参数 | 类型 | 说明 |
| ------------- | ------- | --------------------------------- |
| `t` | Ayyay | 数据表类型,数据表 |
| `key_field` | String | 字符串类型,关键字 |
| `r_date_type` | Integer | 整型类型,报告期类型,其取值如下: |
| `n` | Integer | 整数类型,显示个数 |
返回:Array
## `newPrevReportDatebyEndt(endt)`
返回指定日最新的报告期(与公布日、证券无关)
| 参数 | 类型 | 说明 |
| ------ | ---- | ------------- |
| `endt` | Date | 日期,指定日期 |
返回:Integer
### 示例
```tsl
//20191201最近的报告期
return newPrevReportDatebyEndt(20191201T); //返回: 20190930
```
## `reportDateListOfNYear(end_t, n, info_id)`
最近N个会计年度(只取年度数据),与系统参数(证券代码)相关。
| 参数 | 类型 | 说明 |
| --------- | --------- | ------------------ |
| `end_t` | TDateTime | 日期。截止日期 |
| `n` | Integer | 整数。会计年度个数 |
| `info_id` | Integer | 整数。基本面ID |
返回:Array
### 示例
```tsl
setSysParam(PN_Stock(),'SZ000002');
return reportDateListOfNYear(20040227T,5,42002);
结果:
```
## `newExpressReportDateOfEndT(end_t)`
返回指定日最新可以取得到的业绩快报报告期,与系统参数(证券代码)相关。
| 参数 | 类型 | 说明 |
| ------- | --------- | ------------ |
| `end_t` | TDateTime | 日期。截止日 |
返回:Integer
### 示例
```tsl
setSysParam(PN_Stock(),'SZ300423');
return newExpressReportDateOfEndT(intToDate(20190227));
//返回结果为:20171231
```
## `newForcastReportDateOfEndT(end_t)`
返回指定日最新可以取得到的业绩预测报告期,与系统参数(证券代码)相关。
| 参数 | 类型 | 说明 |
| ------- | --------- | ------------ |
| `end_t` | TDateTime | 日期。截止日 |
返回:Integer
### 示例
```tsl
setSysParam(PN_Stock(),'SZ300423');
return newForcastReportDateOfEndT(intToDate(20180709));
//返回结果为:20180630
```
## `newReportDateByType2(end_t, r_date_type)`
返回指定日最新指定类型报告期,与系统参数(证券代码)相关。
| 参数 | 类型 | 说明 |
| ------------- | --------- | --------------------------------- |
| `end_t` | TDateTime | 日期。截止日 |
| `r_date_type` | Integer | 用户自定义。报告期类型,取值如下: |
返回:Integer
### 示例
```tsl
setSysParam(PN_Stock(),'SH600276');
return newReportDateByType2(intToDate(20090217),5);
//最新中报或年报,返回结果为:20080630
```
## `newReportDateOfEndT4(end_t)`
按财报发布规则的最新报告期,只适用于A股
| 参数 | 类型 | 说明 |
| ------- | ---- | ------------ |
| `end_t` | Date | 日期,截止日 |
返回:Int
### 示例
```tsl
end_t := 20241206t;
return newReportDateOfEndT4(end_t);// 20240930
```
## `newReportDateOfYear4(end_t)`
按财报发布规则的最新年度报告期,只适用于A股
| 参数 | 类型 | 说明 |
| ------- | ---- | ------------ |
| `end_t` | Date | 日期, 截止日 |
返回:Int
### 示例
```tsl
end_t := 20241206t;
return newReportDateOfYear4(end_t);// 20231231
```
## `newReportDateOfYear(r_date, info_id)`
向后兼容-最新的年度报告期(按公布日),此模型,是向后兼容的,最好不要使用
| 参数 | 类型 | 说明 |
| --------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
| `info_id` | Integer | 基本面 |
返回:Integer
### 示例
```tsl
setSysParam(pn_Stock(),"SZ000002");
return newReportDateOfYear(20111231, 44002);
//结果:20101231
```
## `newReportDateOfEndT(r_date, info_id)`
向后兼容-最新的报告期(截止日),模型,是向后兼容的,最好不要使用
| 参数 | 类型 | 说明 |
| --------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
| `info_id` | Integer | 基本面 |
返回:Integer
### 示例
```tsl
setSysParam(pn_Stock(),"SZ000002");
return newReportDateOfEndT(20111231, 44002);
//结果:20111231
```
## `newReportDate(r_date)`
向后兼容-最新报告期(按EPS判断),模型,是向后兼容的,最好不要使用
| 参数 | 类型 | 说明 |
| -------- | ------- | ------ |
| `r_date` | Integer | 报告期 |
返回:Integer
### 示例
```tsl
setSysParam(pn_Stock(),"SZ000002");
return newReportDate(20111231);
//返回股票SZ000002的最新报告期
//结果:20111231
```
## `cashFlowSheet(stockid, merge_or_parent)`
股票现金流量表
| 参数 | 类型 | 说明 |
| ----------------- | ------- | -------------- |
| `stockid` | String | 股票代码 |
| `merge_or_parent` | Integer | 现金流量表类型 |
返回:Array
### 示例
```tsl
return cashFlowSheet("SH600004",0);
//返回”SH600004”的合并现金流量表
结果:
```
## `tableAudit(stock_id)`
报表审计
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 股票代码 |
返回:Array
### 示例
```tsl
return tableAudit("SZ000002");
//返回万科的报表审计
结果:
```
## `interestSheet(stock_id, merge_or_parent)`
股票损益表。
| 参数 | 类型 | 说明 |
| ----------------- | ------- | ------------------------------------- |
| `stock_id` | String | 字符串。股票代码 |
| `merge_or_parent` | Integer | 用户自定义。资产负债表类型,取值如下: |
返回:Array
## `taxRate(stock_id)`
税率。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `balanceSheet(stock_id, merge_or_parent)`
股票&基金资产负债表
| 参数 | 类型 | 说明 |
| ----------------- | ------- | -------------- |
| `stock_id` | Stirng | 股票代码 |
| `merge_or_parent` | Integer | 资产负债表类型 |
返回:Array
### 示例
```tsl
return balanceSheet("SH600834", 0);
//返回”SH600834”股票&基金资产负债表
结果:
```
## `financialItems(stock_id)`
股票&基金财务指标
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 股票代码 |
返回:Array
### 示例
```tsl
return financialItems("SH600579");
//返回”SH600579”的财务指标
结果:
```
## `interestDistribute(stock_id, merge_or_parent)`
股票&基金利润分配表
| 参数 | 类型 | 说明 |
| ----------------- | ------- | -------------- |
| `stock_id` | String | 股票代码 |
| `merge_or_parent` | Integer | 利润分配表类型 |
返回:Array
### 示例
```tsl
return interestDistribute("SH600004",0);
//返回”SH600004”的合并现利润分配表
结果:
```
## `issueInfo(stock_id)`
股票&基金&债券发行表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return issueInfo("SZ000002");
//返回万科A的发行表
结果:
```
## `reportByEvent(stock_id, _type)`
报表(InfoArray)
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------------- |
| `stock_id` | String | 证券代码 |
| `_type` | String | 主营收入及成本 |
返回:Array
### 示例
```tsl
return reportByEvent("SZ000002","主营收入及成本");
//返回万科主营收入及成本报表
结果:
```
## `shareStruct(stock_id)`
股票&基金股本变更表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return shareStruct("SZ000002");
//返回万科A的股本变更表
结果:
```
## `stockArchieve(stock_id)`
股票&基金上市公司档案
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return stockArchieve("SZ000002");
//返回万科A的档案表
结果:
```
## `stockNameHistory(stock_id)`
股票&基金名称档案表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return stockNameHistory("SZ000002");
//返回万科A的名称档案表
结果:
```
## `stockList(stock_id)`
股票&基金上市。
| 参数 | 类型 | 说明 |
| ---------- | ------ | --------------------- |
| `stock_id` | String | 字符串。股票&基金代码 |
返回:Array
### 示例
```tsl
// "SH600834"的上市数据
return stockList("SH600834");
```
## `stockSpectatus(stock_id)`
股票&基金&债券招股/招募/募债说明书
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------------------------- |
| `stock_id` | String | 字符串。股票&基金&债券代码 |
返回:Array
### 示例
```tsl
// "SH600834"的招募说明书
return stockSpectatus("SH600834");
```
## `collectMoneyExplain(stock_id)`
股票募集资金投入说明表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return collectMoneyExplain("SZ000002");
//返回万科A的募集资金投入说明表
结果:
```
## `collectMoneyWay(stock_id)`
募集资金投向
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return collectMoneyWay("SZ000002");
//返回万科募集资金投向
结果:
```
## `mainNegotiableShareholders(stock_id)`
股票主要流通股东
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 证券代码 |
返回:Array
### 示例
```tsl
return mainNegotiableShareholders("SZ000002");
//返回万科A的主要流通股东
结果:
```
## `shareholderAmount(stock_id)`
股东户数
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 股票代码 |
返回:Array
### 示例
```tsl
return shareholderAmount("SZ000002");
//返回万科股东户数
结果:
```
## `stockCode(stock_id)`
股票代码对照表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 股票代码 |
返回:Array
### 示例
```tsl
return stockCode("SZ000002");
//返回万科A的股票代码对照表
结果:
```
## `StockDistribution(stock_id)`
股票配股表
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------ |
| `stock_id` | String | 证券类型,股票代码 |
返回:Array,返回股票配股表
## `Stock_Distribution(stock_id)`
股票配股表
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------ |
| `stock_id` | String | 证券类型,股票代码 |
返回:Array
### 示例
```tsl
//返回万科的配股表
return stockDistribution('SZ000002');
//结果:
```
## `StockMoreIssue(stock_id)`
股票增发表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 股票代码 |
返回:Array,返回股票增发表
## `Stock_MoreIssue(stock_id)`
股票增发表
| 参数 | 类型 | 说明 |
| ---------- | ------ | -------- |
| `stock_id` | String | 股票代码 |
返回:Array
### 示例
```tsl
return stockMoreIssue("SZ000002");
//返回万科A的股票增发表
结果:
```
## `specialTreat(stock_id)`
股票特别处理表,天软目前没有提供此数据
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------ |
| `stock_id` | String | 证券类型,股票代码 |
返回:Array
## `splitSpectatus(stock_id)`
股票招股说明书表,天软目前没有提供此数据
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------ |
| `stock_id` | String | 证券类型,股票代码 |
返回:Array
## `companyLeaderShareholders(stock_id)`
股票公司管理层持股表
| 参数 | 类型 | 说明 |
| ---------- | ------ | ------------------ |
| `stock_id` | String | 证券类型,股票代码 |
返回:Array
### 示例
```tsl
//返回万科股票公司管理层持股表
return companyLeaderShareholders('SZ000002');
//结果:
```
## `accountingReportNotes(stock_id)`
会计报表附注。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `collectMoney(stock_id)`
募集资金。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `companyLeader(stock_id)`
管理层人事。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `contactMeans(stock_id)`
联络方式。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `disobey(stock_id)`
股票违规。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `govShareCut(stock_id)`
股票国有股减持表。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `govShareDistribution(stock_id)`
国有股配售。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `legalDistribution(stock_id)`
法人配售。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `mainRelativeCompanys(stock_id)`
主要关联公司。
| 参数 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| `stock_id` | String | 字符串。股票代码 |
返回:Array
## `amountCommission(fund_id)`
交易量及佣金
| 参数 | 类型 | 说明 |
| --------- | ------ | -------- |
| `fund_id` | String | 基金代码 |
返回:Array
### 示例
```tsl
return amountCommission("SH500003");
//返回”SH500003”的交易量及佣金
结果:
```
## `fundEnlarge(fund_id)`
基金基金扩募表
| 参数 | 类型 | 说明 |
| --------- | ------ | -------- |
| `fund_id` | String | 基金代码 |
返回:Array
### 示例
```tsl
return fundEnlarge("SZ184695");
//返回”SZ184695”的基金扩募表
结果:
```
## `investmentRatio(fund_id)`
基金资产配置
| 参数 | 类型 | 说明 |
| --------- | ------ | -------- |
| `fund_id` | String | 基金代码 |
返回:Array
### 示例
```tsl
return investmentRatio("SZ184691")
//返回”SZ184691”的资产配置
结果:
```
## `netAssetWeeklyList(fund_id)`
基金资产净值周表
| 参数 | 类型 | 说明 |
| --------- | ------ | -------- |
| `fund_id` | String | 基金代码 |
返回:Array
### 示例
```tsl
return netAssetWeeklyList("SZ184691");
//返回”SZ184691”的资产净值周表
结果:
```
## `fundMainShareHolders(fund_id)`
基金主要持有人
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------ |
| `fund_id` | String | 证券类型,基金代码 |
返回:Array
### 示例
```tsl
//返回"SZ184695"的基金主要持有人
return fundMainShareHolders('SZ184695');
//结果:
```
## `fundSellStock(fund_id)`
基金剔除股票(废弃),此函数已废弃
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------ |
| `fund_id` | String | 证券类型,基金代码 |
返回:Array
## `fundStockComposite(fund_id)`
基金投资组合表
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------------ |
| `fund_id` | String | 证券类型,基金代码 |
返回:Array
### 示例
```tsl
//返回“SZ184701”的基金投资组合情况
return fundStockComposite('SZ184701');
//结果:
```
## `establishment(fund_id)`
基金设立表。
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------- |
| `fund_id` | String | 字符串。基金代码 |
返回:Array
## `fundInvestAdviser(fund_id)`
基金管理人情况。
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------- |
| `fund_id` | String | 字符串。基金代码 |
返回:Array
## `fundTrusteeInfo(fund_id)`
基金托管人情况表。
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------- |
| `fund_id` | String | 字符串。基金代码 |
返回:Array
## `profitSheet(fund_id)`
基金收益及分配表。
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------- |
| `fund_id` | String | 字符串。基金代码 |
返回:Array
## `sponsorInfo(fund_id)`
基金发起人情况。
| 参数 | 类型 | 说明 |
| --------- | ------ | ---------------- |
| `fund_id` | String | 字符串。基金代码 |
返回:Array
## `bondRateChange(bond_id)`
二级市场浮动利率债券利率变动表。
| 参数 | 类型 | 说明 |
| --------- | ------ | ------------ |
| `bond_id` | String | 字符串。债券 |
返回:Array
## `govBondCoefficient(bond_code)`
国债折算率表。
| 参数 | 类型 | 说明 |
| ----------- | ------ | ---------------- |
| `bond_code` | String | 字符串。国债代码 |
返回:Array
## `hgInfo(int_end_t)`
回购基本信息,与系统参数(证券代码)相关。
| 参数 | 类型 | 说明 |
| ----------- | ------- | ------------ |
| `int_end_t` | Integer | 整数。截止日 |
返回:Array
### 示例
```tsl
setSysParam(PN_Stock(),'SZ131811');
return hgInfo(20151006);
结果:
```
## `newreportdateofendt3(endt)`
最新报告期(按公布日)列表,报告数据一般会延迟公布,如:SH600276?恒瑞医药2008-12-31的公布日期是2009-02-18
| 参数 | 类型 | 说明 |
| ------ | ---- | ------ |
| `endt` | date | 截止日 |
返回:array
## `FundIndustryComposite(fund_id)`
基金行业股票投资组合
| 参数 | 类型 | 说明 |
| --------- | ------ | -------- |
| `fund_id` | String | 基金代码 |
返回:Array,返回基金行业股票投资组合
## `Fund_IndustryComposite(fund_id)`
基金行业股票投资组合
| 参数 | 类型 | 说明 |
| --------- | ------ | -------- |
| `fund_id` | String | 基金代码 |
返回:Array
### 示例
```tsl
return fundIndustryComposite("SZ184691");
//返回SZ184691的行业股票投资组合
结果:
```
## `closeStructure(bk_name, end_t, low_v, high_v, step_v)`
返回指定板块指定日期收盘价结构表相关数据。
| 参数 | 类型 | 说明 |
| --------- | ------ | -------------------- |
| `bk_name` | String | 字符串类型,板块名称 |
| `end_t` | Date | 日期类型,截止日期 |
| `low_v` | Real | 实数,下限 |
| `high_v` | Real | 实数,上限 |
| `step_v` | Real | 实数,间距 |
返回:Array
### 示例
```tsl
//返回上证A股在20201231收盘价结构表相关的数据
return closeStructure("上证A股",20201231T,0,10,1);
//结果:
```
## `gfGraphGroup(n1, n3)`
gfGraphGroup函数教学函数。返回当前股票在截止日N(默认180)个周期的成交量,180个N1周期的平均成交量,180个N3周期的平均成交量的组合图形,与系统参数(股票,周期,时间,复权,周期个数N)相关。
| 参数 | 类型 | 说明 |
| ---- | ------- | ---- |
| `n1` | integer | 整数 |
| `n3` | integer | 整数 |
返回:any
### 示例
```tsl
setSysParam(PN_Stock(),'sz000001');
setSysParam(PN_Cycle(),cy_day());
setSysParam(PN_Date(),20180801T);
return gfGraphGroup(5,10);//返回平安银行在2018年8月1日的180个日线成交量,5日平均成交量,10日平均成交量的组合图形
返回:
```
## `gfLineType(_type)`
graph教学函数。返回指定股票在截止日的N(默认180)个周期的行情数据(开盘价,收盘价,最高价,最低价)和交易时间图形,与系统参数(股票,时间,周期,复权,周期个数N)相关,Type表示图形种类。
| 参数 | 类型 | 说明 |
| ------- | ------- | -------- |
| `_type` | integer | 图形类型 |
返回:any
### 示例
```tsl
setSysParam(PN_Stock(),'sz000001');
setSysParam(PN_Cycle(),cy_day());
setSysParam(PN_Date(),20180801T);
return gfLineType(2);
返回:
```
## `getTreeSumByClassPath(data, node_name, path_name, sum_name, if_lever0, if_tree_id)`
根据分类路径树层求和
| 参数 | 类型 | 说明 |
| ------------ | ------- | -------------------------------------------------------------------------------------------------------- |
| `data` | DBData | 二维数组,原数据、包含NodeName、PathName、SumName字段,若需外部传入id与pid,需增加“分类ID”、“节点ID”字段 |
| `node_name` | String | 字符串, 节点字段名称,如“名称” |
| `path_name` | String | 字符串,分类路径字段名称,如“分类路径”,分类路径PathName,不同层级之间以 单斜杠“\”连接 |
| `sum_name` | String | 字符串或一维数组,分类求和字段名称,如“取值”;对多个字段求和时为一维数组 |
| `if_lever0` | Boolean | 布尔, 是否输出第0层,缺省表示不输出 |
| `if_tree_id` | Boolean | 布尔,是否返回树ID,缺省表示不返回“id”、“pid”字段 |
返回:Array
### 示例
```tsl
data:=array(
("名称":"风格收益(%)","取值":1.2,"分类路径":"总收益(%)"),
("名称":"Alpha(%)","取值":0.6,"分类路径":"总收益(%)\\选股Alpha(%)"),
("名称":"残差(%)","取值":0.2,"分类路径":"总收益(%)\\选股Alpha(%)"));
node_name:="名称";
path_name:="分类路径";
sum_name:="取值";
if_lever0:=0;
if_tree_id:=1;
return getTreeSumByClassPath(data,node_name,path_name,sum_name,if_lever0,if_tree_id);
```
## `tradeDetails(beg_t, end_t, return_type)`
返回指定证券在指定区间的交易明细数据。
| 参数 | 类型 | 说明 |
| ------------- | ----- | ------------------------------ |
| `beg_t` | Date | 日期类型,开始日期 |
| `end_t` | Date | 日期类型,截止日期 |
| `return_type` | Cycle | 字符串类型,返回数据的周期类型 |
返回:Array
### 示例
```tsl
//返回天山股份在2020-01-01至2020-01-10期间日线的交易明细
setSysParam(pn_stock(),'SZ000877');
return tradeDetails(20200101T,20200110T,cy_day());
```
## `getpfinfobytype(t, _type, ex_date_field, decision_declare_date_field)`
股票分红送配数据。
| 参数 | 类型 | 说明 |
| ----------------------------- | ------- | ------------------------- |
| `t` | Array | 数组。数据表。 |
| `_type` | Integer | 整数。返回类型,取值如下: |
| `ex_date_field` | String | 字符串。除权除息日字段。 |
| `decision_declare_date_field` | String | 字符串。决案公告日字段。 |
返回:Array
### 示例
```tsl
t:=reportEventQk("SZ000002",20201231,"分红送股");
return getpfinfobytype(t,1,PD_EXDateField(),PD_DecisionDeclareDateField());
结果:
```
## `regionStructure(end_t)`
股票地域结构表。
| 参数 | 类型 | 说明 |
| ------- | --------- | ---------------- |
| `end_t` | TDateTime | 日期。截止日期。 |
返回:Array
### 示例
```tsl
return regionStructure(20100430T);
结果:
```
## `zxCompareReturn(stock_id, from_year, to_year, _type, info_id_arr)`
股票基本面数据纵向比较。
| 参数 | 类型 | 说明 |
| ------------- | ------- | --------------------------- |
| `stock_id` | String | 字符串。股票代码。 |
| `from_year` | Integer | 整数。起始年限。 |
| `to_year` | Integer | 整数。截止年限。 |
| `_type` | Integer | 整数。报告期类型,取值如下: |
| `info_id_arr` | Array | 数组。基本面数组。 |
返回:Array
### 示例
```tsl
return zxCompareReturn("SZ000002",2010,2020,1,array(46002,46008));
结果:
```
## `zxCompare(stock_id, from_year, to_year, _type, info_id_arr, compare_type)`
股票基本面数据纵向比较。
| 参数 | 类型 | 说明 |
| -------------- | ------- | --------------------------- |
| `stock_id` | String | 字符串。股票代码。 |
| `from_year` | Integer | 整数。起始年限。 |
| `to_year` | Integer | 整数。截止年限。 |
| `_type` | Integer | 整数。报告期类型,取值如下: |
| `info_id_arr` | Array | 数组。基本面数组。 |
| `compare_type` | Integer | 整数。比较方法,取值如下: |
返回:Array
### 示例
```tsl
return zxCompare("SZ000002",2010,2020,1,array(46002,46008),0,0);
结果:
```
## `pnaStructure(bk_name, end_t, low_v, high_v, step_v)`
返回指定板块指定日期市净率结构表相关数据。
| 参数 | 类型 | 说明 |
| --------- | ------ | -------------------- |
| `bk_name` | String | 字符串类型,板块名称 |
| `end_t` | Date | 日期类型,截止日期 |
| `low_v` | Real | 实数,下限 |
| `high_v` | Real | 实数,上限 |
| `step_v` | Real | 实数,间距 |
返回:Array
### 示例
```tsl
//返回上证A股在20201231市净率结构表相关的数据
return pnaStructure("上证A股",20201231T,0,10,1);
//结果:
```
## `getBtStocksByBegTEndT(bk_name, beg_t, end_t)`
大宗交易-获取区间板块成分
| 参数 | 类型 | 说明 |
| --------- | --------- | ------------------- |
| `bk_name` | String | 市场和板块,板块名称 |
| `beg_t` | TDateTime | 日期,开始日期 |
| `end_t` | TDateTime | 日期,截止日期 |
返回:array
## `getBlockValueFromArray(t, right_type, sample_select)`
板块市盈率(复合)。
| 参数 | 类型 | 说明 |
| --------------- | ------- | --------------------------- |
| `t` | Array | 数组。数据表。 |
| `right_type` | Integer | 整数。加权方式,取值如下: |
| `sample_select` | Integer | 整数。样本股选择,取值如下: |
返回:Real
## `handleExcept()`
Try-Except教学函数。对字符串‘123x’进行整形转字符串,如果捕获到错误,则返回整数0。
返回:integer
### 示例
```tsl
return handleExcept();
//返回:0
```
## `initdatasample(initdatatype, n)`
初始化数据
| 参数 | 类型 | 说明 |
| -------------- | --------- | ----------------------------------- |
| `initdatatype` | usrdefine | usrdefine,初始化类型 |
| `n` | integer | integer,数组的长度,二维N\*N,一维N |
返回:array