# 基金 / 行业配置 ### `fundIciValue(rdate, name)` 指定行业配置相关数据,与系统参数(基金)相关。 | 参数 | 类型 | 说明 | | ------- | ------ | ---------------- | | `rdate` | int | 整数。指定报告期 | | `name` | string | 字符串。行业名称 | 返回:array #### 示例 ```tsl SetSysParam(PN_Stock(),'OF000001'); return FundICIValue(20221231,'制造业'); ``` ### `fundIcNoN(rdate, top_n, field)` 第N名行业配置相关数据,与系统参数(基金)相关。 | 参数 | 类型 | 说明 | | ------- | ------ | ---------------- | | `rdate` | int | 整数。指定报告期 | | `top_n` | int | 整数。第N | | `field` | string | 字符串。列名 | 返回:float #### 示例 ```tsl SetSysParam(PN_Stock(),'OF000001'); return FundICNoN(20221231,3,'市值'); ``` ### `fundIcSumN(rdate, top_n, field)` 前N名行业配置相关数据,与系统参数(基金)相关。 | 参数 | 类型 | 说明 | | ------- | ------ | ---------------- | | `rdate` | int | 整数。指定报告期 | | `top_n` | int | 整数。前N | | `field` | string | 字符串。列名 | 返回:float #### 示例 ```tsl SetSysParam(PN_Stock(),'OF000001'); return FundICSumN(20221231,3,'市值'); ``` ### `fundindustrynamelv1(extype)` 基金一级行业 | 参数 | 类型 | 说明 | | --- | --- | --- | | `extype` | usrdefine | usrdefine,是否延伸判断,不延伸判断=0延伸判断=1 | 返回:string ### `fundsindustrynamelv(fundarr, extype, lv)` 基金列表行业 | 参数 | 类型 | 说明 | | --- | --- | --- | | `fundarr` | array of string | array of string,基金列表 | | `extype` | usrdefine | usrdefine,延伸判断,不延伸判断=0延伸判断=1 | | `lv` | usrdefine | usrdefine,行业级别 | 返回:array ### `fundindustrynamelv3(extype)` 基金三级行业 | 参数 | 类型 | 说明 | | --- | --- | --- | | `extype` | usrdefine | usrdefine,是否延伸判断,不延伸判断=0延伸判断=1 | 返回:string ### `fundindustrynamelv2(extype)` 基金二级行业 | 参数 | 类型 | 说明 | | --- | --- | --- | | `extype` | usrdefine | usrdefine,是否延伸判断,不延伸判断=0延伸判断=1 | 返回:string ### `fundindustrynamelv4(extype)` 基金四级行业 | 参数 | 类型 | 说明 | | --- | --- | --- | | `extype` | usrdefine | usrdefine,是否延伸判断,不延伸判断=0延伸判断=1 | 返回:string ### `fundindustryname(industrytype, extype)` 基金行业 | 参数 | 类型 | 说明 | | --- | --- | --- | | `industrytype` | usrdefine | usrdefine,行业级别 | | `extype` | usrdefine | usrdefine,延伸判断,不延伸判断=0延伸判断=1 | 返回:string ### `fundindustrygetmatchstr(industrytype, extype)` 基金行业匹配串 | 参数 | 类型 | 说明 | | --- | --- | --- | | `industrytype` | usrdefine | usrdefine,行业级别 | | `extype` | usrdefine | usrdefine,延伸判断,不延伸判断=0延伸判断=1 | 返回:string ### `fundindustrymatchstring()` 基金行业匹配串 返回:string ### `fundIcCentralization(report_date, to_no)` 基金指定报告期的前N名行业集中度(%) | 参数 | 类型 | 说明 | | --- | --- | --- | | `report_date` | Integer | 报告期 | | `to_no` | Integer | 用户自定义 | 返回:Real #### 示例 ```tsl //返回华安创新2010年一季报持有的前3大行业的集中度 setSysParam(pn_stock(),'OF040001'); r_date:=20100331; return fundIcCentralization(r_date,3); //结果:52.49 ``` ### `fundIcMarketValue(report_date, industry_name)` 返回基金指定报告期的指定行业投资市值,与系统证券pn_stock()相关。 | 参数 | 类型 | 说明 | | --- | --- | --- | | `report_date` | integer | 报告期 | | `industry_name` | String | 行业名称 | 返回:real #### 示例 ```tsl //返回华安创新2010年一季报持有的金融、保险业的股票的市值和 setSysParam(pn_stock(),'OF040001'); r_date:=20100331; return fundIcMarketValue(r_date,'金融、保险业'); //结果:828593000 ``` ### `fundIcMarketValue2GrowRatio(r_date, r_date2, to_no)` 返回基金的前N名行业市值变比(%),与系统证券pn_stock()相关。 | 参数 | 类型 | 说明 | | --- | --- | --- | | `r_date` | Integer | 报告期 | | `r_date2` | Integer | 报告期 | | `to_no` | Integer | 用户自定义 | 返回:Real #### 示例 ```tsl //返回华安创新2011年中报和2010年中报持有的前十名行业的市值变动比 setSysParam(pn_stock(),'OF040001'); r_date1:=20110630; r_date2:=20100630; return fundIcMarketValue2GrowRatio(r_date1,r_date2,10); //结果:29.29 ``` ### `fundicindustrypercent2(rdate, name)` 指定行业市值占总值比(%),与系统参数证券(基金)相关。 | 参数 | 类型 | 说明 | | --- | --- | --- | | `rdate` | Integer | 整型,指定报告期 | | `name` | String | 字符串,行业名称 | 返回:REAL #### 示例 ```tsl // "OF000001"在20191231指定行业"金融业"市值占总值比(%) setSysParam(pn_stock(),"OF000001"); return fundicindustrypercent2(20191231,"金融业"); //结果:5.57438513631856 ``` ### `fundicnonname(rdate, topn)` 第N名行业名称,与系统参数证券(基金)相关。 | 参数 | 类型 | 说明 | | --- | --- | --- | | `rdate` | Integer | 整型,指定报告期 | | `topn` | Integer | 整型,第N | 返回:STRING #### 示例 ```tsl // "OF000001"在20191231第1名行业名称 setSysParam(pn_stock(),"OF000001"); return fundicnonname(20191231,1); //结果:制造业 ``` ### `fundinfoindustryname1()` 返回银河基金分类的一级行业名称 返回:String #### 示例 ```tsl //华夏成长在20210302的银河一级行业编码 setSysParam(pn_stock(),"OF000001"); setSysParam(pn_date(),20210302T); return fundinfoindustryname1(); //返回:银河混合型 ``` ### `fundinfoindustryname2()` 返回指定基金的银河二级行业名称 返回:String #### 示例 ```tsl //华夏成长在20210302的银河二级行业名称 setSysParam(pn_stock(),"OF000001"); setSysParam(pn_date(),20210302T); return fundinfoindustryname2(); //返回:银河偏股型 ``` ### `fundyhindustryid1()` 返回指定基金银河一级行业编码 返回:String #### 示例 ```tsl //华夏成长在20210302的银河一级行业编码 setSysParam(pn_stock(),"OF000001"); setSysParam(pn_date(),20210302T); return fundyhindustryid1(); //返回:YHFL020000 ``` ### `fundyhindustryid2()` 返回指定基金银河二级行业编码 返回:String #### 示例 ```tsl //华夏成长在20210302的银河二级行业编码 setSysParam(pn_stock(),"OF000001"); setSysParam(pn_date(),20210302T); return fundyhindustryid2(); //返回:YHFL020100 ``` ### `fundYhIndustryArr(industry_type, level_n, end_t)` 指定日指定级别基金分类列表,默认返回银河分类的一级分类列表 | 参数 | 类型 | 说明 | | --- | --- | --- | | `industry_type` | String | 字符串。基金分类 | | `level_n` | Integer | 整数。基金级数 | | `end_t` | TDateTime | 日期。截止日期 | 返回:Array #### 示例 ```tsl // 在20210302的银河基金分类的1级分类成分 return fundYhIndustryArr('YHFL',1,20210302T); ``` ### `fundIndustryInfoLvN(fundid, end_t, level, industry_type, vtype)` 返回指定基金指定日期指定级别的类型名称,默认取银河基金分类的一级基金类型编码。 | 参数 | 类型 | 说明 | | --- | --- | --- | | `fundid` | String | 字符串。基金代码 | | `end_t` | TDateTime | 日期。截止日期 | | `level` | Integer | 整数。分类级别 | | `industry_type` | String | 字符串。基金分类名称 | | `vtype` | Integer | 整数。返回值类型,取值如下: | 返回:String #### 示例 ```tsl // 华夏成长在20201207的一级类型名称 return fundIndustryInfoLvN('OF000001',20210301T,1,'YHFL',1); //返回:银河混合型 ``` ### `fundGetIndustrydata(fundid, endt, level, industry_type)` 基金指定日期有效的基金分类数据。 | 参数 | 类型 | 说明 | | --- | --- | --- | | `fundid` | String | 字符串。基金代码 | | `endt` | TDateTime | 日期。截止日期 | | `level` | Integer | 整数。类别级数(1,2) | | `industry_type` | String | 字符串。基金属性名称 | 返回:Array #### 示例 ```tsl // 华夏成长在20201207的有效的基金分类数据 return fundGetIndustrydata('OF000001',20210301T,1,'YHFL'); 结果: ``` ### `ieFundBondIndustryByType()` 基金.债券投资组合(按债券品种分类) 返回:array ### `ieFundBondIndustryByMaturity()` 基金.债券投资组合(按偿还期限分类) 返回:array ### `fundScIndustryNameField()` 基金持股-行业名称。根据数据库提供商返回对应的值 返回:string ### `fundScb2IndustryNameField()` 累计买入超净值2%-行业名称。根据数据库提供商返回对应的值 返回:string ### `fundScs2IndustryNameField()` 累计卖出超净值2%-行业名称。根据数据库提供商返回对应的值 返回:string ### `fundBsIndustryNameField()` 债券配置-债券类型。根据数据库提供商返回对应的值 返回:string ### `portfolioBackTestingQuantityIndustryComposite(end_t, t_gp)` 策略验证-数量类组合-t日行业配置,由tGP数据表中按行业统计个各行业的市值和排名 | 参数 | 类型 | 说明 | | ------- | -------- | ----------------------- | | `end_t` | datetime | 日期型时间,t日 | | `t_gp` | array | 数据表类型,t日持股明细 | 返回:array ### `fundHdIndustryRotationSkill(fund_id, beg_t, end_t, style_type, date_type, hold_type, typ)` 基金行业轮动能力因子计算模型 | 参数 | 类型 | 说明 | | ------------ | -------- | -------------------- | | `fund_id` | string | 字符串类型,证券代码 | | `beg_t` | datetime | 日期类型,开始日 | | `end_t` | datetime | 日期类型,截止日 | | `style_type` | any | 整数型,风格类型 | | `date_type` | any | 整数型,当期类型 | | `hold_type` | any | 整数型,持仓类型 | | `typ` | any | 整数型,输出指标选择 | 返回:array ### `fundIndustryCentralization(show_number, report_date_show_order)` 返回指定基金最近N个报告期的行业集中度数据,与系统参数(证券代码)相关。 | 参数 | 类型 | 说明 | | ------------------------ | ---- | -------------------- | | `show_number` | any | 整数,显示个数 | | `report_date_show_order` | bool | 布尔类型,报告期逆排 | 返回:array ### `fundSwIndustryComposite(show_number, unit_type, report_date_show_order)` 申万行业配置 | 参数 | 类型 | 说明 | | ------------------------ | ---- | ------------------- | | `show_number` | any | 用户自定义,显示个数 | | `unit_type` | any | 用户自定义,显示单位 | | `report_date_show_order` | bool | object | 返回:bool ### `fundsIndustryCentralization(bk_name, r_date, sort_by, sort_order, return_number)` 返回指定板块指定报告期基金行业集中度数据。 | 参数 | 类型 | 说明 | | --------------- | -------- | -------------------- | | `bk_name` | string | 字符串类型,板块名称 | | `r_date` | datetime | 报告期类型,报告期 | | `sort_by` | any | 整型,排序字段 | | `sort_order` | any | 整型,排序方式 | | `return_number` | any | 整型,返回个数 | 返回:array ### `fundIndustryCompositeChangeCall(fund_arr, r_date, r_date2, sort_by, sort_order, return_number)` 基金行业配置及变化。 | 参数 | 类型 | 说明 | | --------------- | -------- | -------------------------------------- | | `fund_arr` | array | 数组。基金列表。 | | `r_date` | datetime | 整数。报告期。 | | `r_date2` | any | 整数。同比报告期。 | | `sort_by` | string | 字符串。排序字段,取值如下: | | `sort_order` | any | 整数。排序方法,1表示正序,0表示逆序。 | | `return_number` | any | 整数。返回个数。 | 返回:array ### `fundsSwIndustryComposite(bk_name, end_t, show_number, sort_type, unit_type)` 申万行业配置 | 参数 | 类型 | 说明 | | ------------- | -------- | ------------------- | | `bk_name` | string | 市场和板块,板块名称 | | `end_t` | datetime | 日期,截止日期 | | `show_number` | any | 用户自定义,显示个数 | | `sort_type` | bool | object | | `unit_type` | any | 用户自定义,显示单位 | 返回:bool ### `fundBlockIndustryComposite(r_date, r_date2)` 返回报告期基金管理公司在指定行业的行业配置数据。 | 参数 | 类型 | 说明 | | --------- | -------- | ---------------------- | | `r_date` | datetime | 报告期类型,报告期 | | `r_date2` | any | 报告期类型,同比报告期 | 返回:array ### `fundBlockIndustryCentralization(bk_names, end_t, show_number, show_order, unit_type)` 行业集中度 | 参数 | 类型 | 说明 | | ------------- | -------- | ------------------- | | `bk_names` | string | 市场和板块,板块名称 | | `end_t` | datetime | 日期,截止日期 | | `show_number` | any | 用户自定义,显示个数 | | `show_order` | bool | object | | `unit_type` | any | 用户自定义,显示单位 | 返回:bool