# 金融 / 基金 / 基金净值 ## `fundAdjustNAw(end_t, type)` 声明:function 返回指定日基金净值,与系统证券PN_Stock()相关,根据分红拆分计算调整前/后净值 | 参数 | 类型 | 说明 | | ------- | -------- | ---------------------- | | `end_t` | datetime | 日期类型,截止日 | | `type` | integer | 整数类型,返回净值类型 | 返回:real ### 示例 范例01:调用函数 ```tsl setSysParam(Pn_Stock(), "OF000001"); endt := 20230112T; return fundAdjustNaw(endt, 1); // 0.9952 ``` ## `fundIpoC()` 声明:function 返回时点收盘(ETF/LOF),与系统证券pn_stock()与系统时间pn_date()相关 返回:real ### 示例 范例01:调用函数 ```tsl // 取国泰价值最新时点收盘 setSysParam(pn_stock(), 'SZ160215') ; setSysParam(pn_date(), intToDate(20121019)); return fundIpoc(); // 输出:0.72 ``` ## `fundIpoV()` 声明:function 返回时点净值(ETF/LOF),与系统证券pn_stock()、系统时间pn_date()相关 返回:float ### 示例 范例01:调用函数 ```tsl Setsysparam(pn_stock(), 'SZ160215') ; SetSysParam(pn_date(), inttodate(20121019)); Return FundIPOV(); ``` ## `fundMaxMinNAw(beg_t, end_t, type, return_type)` 声明:function 返回取区间内单位(累计)净值的最大或最小值,与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------------- | -------- | ---------- | | `beg_t` | datetime | 开始日期 | | `end_t` | datetime | 截止日期 | | `type` | int | 返回内容 | | `return_type` | int | 返回的类型 | 返回:float ### 示例 范例01:调用函数 ```tsl Setsysparam(pn_stock(), 'OF040001') ; ReturnFundMaxMinNAW(inttodate(20040930), inttodate(20121018), 0, 0); ``` ## `fundMaxMinNAw2(end_t, type, return_type)` 声明:function 返回上市以来至EndT这段时间内单位(累计)净值的最大或最小值,与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------------- | ------- | ---------- | | `end_t` | date | 截止日期 | | `type` | integer | 返回内容 | | `return_type` | integer | 返回的类型 | 返回:real ### 示例 范例01:调用函数 ```tsl // 返回华安创新上市以来到2012年10月18日之间的最大单位净值 setSysParam(pn_stock(), 'OF040001') ; ReturnFundMaxMinNAW2(intToDate(20121018), 0, 0); // 输出:4.452 ``` ## `fundNAwByRateBegtEndt(begt, endt)` 声明:function 返回区间复权单位净值,与系统参数基金代码、复权方式、复权基准日相关 | 参数 | 类型 | 说明 | | ------ | -------- | ------------- | | `begt` | datetime | date,开始日期 | | `endt` | datetime | date,截止日期 | 返回:array ### 示例 范例01:调用函数 ```tsl setsysparam(pn_stock(), "OF000001"); SetSysParam(PN_Rate(), 1) ; SetSysParam(PN_RateDay(), -1); return FundNAWByRateBegtEndt(20210501T, 20210514T); ``` ## `fundNAwByRateEndT(endt)` 声明:function 返回指定日复权单位净值,与系统参数基金代码、复权方式、复权基准日相关 | 参数 | 类型 | 说明 | | ------ | -------- | ----------- | | `endt` | datetime | date,截止日 | 返回:float ## `fundNAwdw()` 声明:function 返回最新单位净值,与系统证券pn_stock()和系统时间pn_date()相关 返回:real ### 示例 范例01:调用函数 ```tsl // 取华安创新在指定日的单位净值 setSysParam(pn_stock(), 'OF040001') ; setSysParam(pn_date(), 20260528T); return fundNawdw(); // 输出:1.86 ``` ## `fundNAwlAccumulativeNetAsset(end_t)` 声明:function 返回基金指定日累计净值,数据取自基金.净值(328)。与系统股票pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | -------- | ------------------ | | `end_t` | datetime | 日期类型,截止日期 | 返回:float ### 示例 范例01:调用函数 ```tsl setsysparam(pn_stock(), "OF162714"); Return FundNAWLAccumulativeNetAsset(20180822T); ``` ## `fundNAwlInfo(beg_t, end_t, type)` 声明:function 返回取区间内每天的净值(详情),与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | ------- | -------- | | `beg_t` | date | 开始日期 | | `end_t` | date | 截止日期 | | `type` | integer | 返回类型 | 返回:array ### 示例 范例01:取华安创新2012年10月10日到2012年10月19日之间的单位净值和累计净值 ```tsl // 取华安创新2012年10月10日到2012年10月19日之间的单位净值和累计净值 Setsysparam(pn_stock(), 'OF040001') ; ReturnFundNAWLInfo(inttodate(20121010), inttodate(20121019), 2); ``` ## `fundNAwlInfo2(end_t, type)` 声明:function 返回指定日净值数据,与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | ------- | -------- | | `end_t` | date | 截止日期 | | `type` | integer | 返回类型 | 返回:real ### 示例 范例01:取华安创新2012年10月19日的单位净值和累计净值 ```tsl // 取华安创新2012年10月19日的单位净值和累计净值 Setsysparam(pn_stock(), 'OF040001') ; ReturnFundNAWLInfo2 (inttodate(20121019), 2); ``` ## `fundNAwlInfoFromBegT(beg_t, end_t, type)` 声明:function 返回区间净值详情(以开始日为基准日计算累计净值),与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | ------- | -------- | | `beg_t` | date | 开始日期 | | `end_t` | date | 截止日期 | | `type` | integer | 返回类型 | 返回:real ### 示例 范例01:取华安创新2012年10月10日到2012年10月19日之间的累计净值 ```tsl // 取华安创新2012年10月10日到2012年10月19日之间的累计净值 Setsysparam(pn_stock(), 'OF040001') ; Return FundNAWLInfoFromBegT(inttodate(20121010), inttodate(20121019), 1); ``` ## `fundNAwlj()` 声明:function 返回最新累计净值,与系统证券pn_stock()和系统时间pn_date()相关 返回:float ### 示例 范例01:调用函数 ```tsl Setsysparam(pn_stock(), 'OF040001') ; ReturnFundNAWLJ(); ``` ## `fundNAwlNetAsset(end_t)` 声明:function 返回基金截止日单位净值,数据取自基金.净值(328)。与系统股票pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | -------- | ------------------ | | `end_t` | datetime | 日期类型,截止日期 | 返回:float ### 示例 范例01:调用函数 ```tsl setsysparam(pn_stock(), "OF162714"); Return FundNAWLNetAsset(20180822T); ``` ## `fundNAwmwfjjdwsy(end_t)` 声明:function 返回基金截止日每万份基金单位收益,数据取自基金.净值(328)。与系统股票pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | --------- | ------------------ | | `end_t` | date_time | 日期类型,截止日期 | 返回:real ### 示例 范例01:调用函数 ```tsl // 基金OF090005在2018年8月22日的每万份基金单位收益。 setSysParam(pn_stock(), "OF090005"); return fundNawmwfjjdwsy(20180822T); // 输出:0.86 ``` ## `fundNAwZf(beg_t, end_t)` 声明:function 返回区间净值增长率(%),与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | ---- | -------- | | `beg_t` | date | 开始日期 | | `end_t` | date | 截止日期 | 返回:real ### 示例 范例01:调用函数 ```tsl // 取华安创新2012年10月10日到2012年10月19日之间的区间净值增长率(%) setSysParam(pn_stock(), 'OF040001') ; ReturnFundNAWZf(intToDate(20121010), intToDate(20121019)); // 输出:0.17 ``` ## `fundNAwZf3()` 声明:function 返回最新日收益率(%),与系统证券pn_stock()相关。 对于非货币基金 若无分红 今日净值增长率=(今日净值-昨日净值)/昨日净值 若有分红 今日净值增长率=(今日净值-(昨日净值-分红)/拆分)/((昨日净值-分红)/拆分)。 对于货币基金 今日净值增长率=区间内的复合收益率 返回:float ### 示例 范例01:调用函数 ```tsl {取华安创新2012年10月19日的最新日收益率(%) 注意,函数必须先设置当前时间,再设置当前股票。原因是设置当前的时间跟时间序列数据有关,如果先设置股票为'OF040001',而开放式基金是没有二级市场交易数据的,之后再设置时间为指定日,会导致当前的时间为0。从而取不出数据。} Setsysparam(pn_date(), inttodate(20121019)); Setsysparam(pn_stock(), 'OF040001') ; Return FundNAWZf3(); ``` ## `fundNAwZf4(end_t)` 声明:function 返回指定日收益率(%),与系统证券pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | ---- | -------- | | `end_t` | date | 截止日期 | 返回:real ### 示例 范例01:调用函数 ```tsl // 取华安创新2012年10月19日的日收益率(%) setSysParam(pn_stock(), 'OF040001') ; ReturnFundNAWZf4(intToDate(20121019)); // 输出:-0.17 ``` ## `fundNAwZf_fh(beg_t, end_t)` 声明:function 返回区间复合收益率(%) , 与系统股票pn_stock()相关。 对于非货币基金 若区间无分红 区间净值增长率=(截止日净值-开始日昨净值)/开始日昨净值。 若区间有分红 区间净值增长率=(1+拆分前的净值增长率)\*(1+分红拆分日的净值增长率)\*(1+分红拆分日后到截止日之间的净值增长率)-1。 对于货币基金 区间净值增长率=区间内的复合收益率 | 参数 | 类型 | 说明 | | ------- | -------- | -------- | | `beg_t` | datetime | 开始日期 | | `end_t` | datetime | 截止日期 | 返回:float ### 示例 范例01:取华安创新2012年10月10日到2012年10月19日之间的区间复合收益率(%) ```tsl // 取华安创新2012年10月10日到2012年10月19日之间的区间复合收益率(%) Setsysparam(pn_stock(), 'OF040001') ; ReturnFundNAWZf_fh(inttodate(20121010), inttodate(20121019)); // 输出:0.17 ``` ## `fundNAwzjqrsyzsdnsyl(end_t)` 声明:function 返回基金截止日最近七日收益折算的年收益率(%),数据取自基金.净值(328)。与系统股票pn_stock()相关 | 参数 | 类型 | 说明 | | ------- | --------- | ------------------ | | `end_t` | date_time | 日期类型,截止日期 | 返回:real ### 示例 范例01:调用函数 ```tsl // 基金OF090005在2018年8月22日的最近七日收益折算的年收益率。 setSysParam(pn_stock(), "OF090005"); return fundNawzjqrsyzsdnsyl (20180822T); // 输出:3.243 ``` ## `fundNetAssetperUnitInReportDate(r_date)` 声明:function 返回单位净值(报告期),与系统参数(证券代码)相关 | 参数 | 类型 | 说明 | | -------- | ---- | ------------ | | `r_date` | int | 整数。报告期 | 返回:float ### 示例 范例01:调用函数 ```tsl SetSysParam(PN_Stock(), 'SH500001'); return FundNetAssetperUnitInReportDate(20211231); ``` ## `fundZjRatio4()` 声明:function 返回ETF时点折价率,与系统参数(证券代码,时间,周期)相关 返回:float ### 示例 范例01:调用函数 ```tsl SetSysParam(pn_stock(), "OF512610"); SetSysParam(PN_Date(), 20200924T); return FundZjRatio4(); // 输出:-0.14 ```