✨ feat(skills): add tsl api reference skill
Bundle the TSL API index and markdown references under the skill, route TSL docs to use it, and update the codegen index generator to maintain the bundled data.
This commit is contained in:
@@ -0,0 +1,501 @@
|
||||
# 基金 / 分级基金
|
||||
|
||||
### `fundAdjustNav1(end_t)`
|
||||
|
||||
获取T-1调整后单位净值(预估净值)。与系统股票pn_stock()相关。 注: T日如果是拆分基准日,那么基金公司将会公布拆分折算后的净值,其与T-1日的量纲不同,此处将对T-1日的净值进行调整至经过拆分折算调整后的净值。 一般用于分级基金
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundAdjustNAV1(20180903T);
|
||||
```
|
||||
|
||||
### `fundAdjustNav2(end_t)`
|
||||
|
||||
获取T-1调整前单位净值(预估折溢价)。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundAdjustNAV2(20180822T);
|
||||
```
|
||||
|
||||
### `fundBenchmarkReturn4(end_t)`
|
||||
|
||||
基准预估涨幅(%)。与系统股票pn_stock()、当前时间pn_date()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundBenchmarkReturn4(20180903T);
|
||||
```
|
||||
|
||||
### `fundCalculatedNav4(end_t)`
|
||||
|
||||
获取基金的母基金预估净值。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundCalculatedNAV4(20180903T);
|
||||
```
|
||||
|
||||
### `fundCalculatedNavAvgError(begt, end_t)`
|
||||
|
||||
获取基金的母基金预估净值相对误差的均值(%),即区间预估与真实净值之差的均值。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `begt` | datetime | 日期类型,开始日 |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundCalculatedNAVAvgError(20160101T,20180903T);
|
||||
```
|
||||
|
||||
### `fundHsl(begt, end_t)`
|
||||
|
||||
分级子基金换手率(%)。与系统股票pn_stock()相关。 注:仅支持分级基金
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `begt` | datetime | 日期类型,开始日 |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"SZ150169");
|
||||
return FundHSL(20180101T,20180903T);
|
||||
```
|
||||
|
||||
### `fundMarketShare(endt, t)`
|
||||
|
||||
基金T和T-1流通份额(万),与系统参数(证券代码)相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------ | -------- | ------------ |
|
||||
| `endt` | datetime | 日期。截止日 |
|
||||
| `t` | int | 整数。 |
|
||||
|
||||
返回:int
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(PN_Stock(),'OF159001');
|
||||
return FundMarketShare(20231215T,0);
|
||||
```
|
||||
|
||||
### `fundShareIncrease(endt)`
|
||||
|
||||
基金份额变动数目,数据从基金.份额变动表(324)中取。与系统股票pn_stock()、相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------ | -------- | -------- |
|
||||
| `endt` | datetime | 日期类型 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF000092");
|
||||
Return FundShareIncrease(20170703T);
|
||||
```
|
||||
|
||||
### `fundTrackingError(begt, end_t)`
|
||||
|
||||
获取基金的母基金跟踪误差(%),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `begt` | datetime | 日期类型,开始日 |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundTrackingError(20160101T,20180903T);
|
||||
```
|
||||
|
||||
### `fundTrueNavAll(end_t, fund_type)`
|
||||
|
||||
获取基金的T日基金真实净值(用于计算折溢价)。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ----------- | -------- | -------------------- |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
| `fund_type` | any | 用户自定义,基金类别 |
|
||||
|
||||
返回:float
|
||||
|
||||
### `fundVirtualTrackingError(begt, end_t)`
|
||||
|
||||
获取基金的母基金预估净值相对误差的标准差(%),即区间预估与真实净值之差的均值。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------- | -------- | ---------------- |
|
||||
| `begt` | datetime | 日期类型,开始日 |
|
||||
| `end_t` | datetime | 日期类型,截止日 |
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
setsysparam(pn_stock(),"OF161028");
|
||||
return FundVirtualTrackingError(20160101T,20180903T);
|
||||
```
|
||||
|
||||
### `getAllStructuredFunds()`
|
||||
|
||||
获取所有分级子基金可在交易所交易的母基金,与当前时间pn_date()相关。
|
||||
|
||||
返回:Array
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
return getAllStructuredFunds();
|
||||
结果:
|
||||
```
|
||||
|
||||
### `fundHslOfA4(end_t)`
|
||||
|
||||
获取基金的分级A类换手率(%),与系统股票pn_stock()、当前时间pn_date()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级A类换手率(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundHslOfA4(20180903T);
|
||||
//结果:1.48574824
|
||||
```
|
||||
|
||||
### `fundDiscountRatioOfA4(end_t)`
|
||||
|
||||
获取基金的分级A类指定日折溢价率(%),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级A类指定日折溢价率(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundDiscountRatioOfA4(20180903T);
|
||||
//结果:-6.08175474
|
||||
```
|
||||
|
||||
### `fundShareIncreaseofA(end_t)`
|
||||
|
||||
获取基金的分级A类份额变动数目,数据取表基金.份额变动表(324),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级A类份额增长
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundShareIncreaseofA(20180903T);
|
||||
//结果:-50000
|
||||
```
|
||||
|
||||
### `fundVirtualDiscountRatioOfB4(end_t)`
|
||||
|
||||
获取基金的分级B类预估折价率(%),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级B类预估折价率(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundVirtualDiscountRatioOfB4(20180903T);
|
||||
//结果:5.00532481
|
||||
```
|
||||
|
||||
### `fundNavLeverage4(end_t)`
|
||||
|
||||
获取基金的分级B类净值杠杆,与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级B类净值杠杆
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundNavLeverage4(20180903T);
|
||||
//结果:2.07036247
|
||||
```
|
||||
|
||||
### `fundHslOfB4(end_t)`
|
||||
|
||||
获取基金的分级B类换手率(%),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级B类换手率(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundHslOfB4(20180903T);
|
||||
//结果:1.48574824
|
||||
```
|
||||
|
||||
### `fundShareLeverage()`
|
||||
|
||||
获取基金的份额杠杆,与系统股票pn_stock()相关。
|
||||
|
||||
返回:Integer
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028的份额杠杆
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundShareLeverage();
|
||||
//结果:2
|
||||
```
|
||||
|
||||
### `fundShareIncreaseofB(end_t)`
|
||||
|
||||
获取基金的分级B类份额增长,数据取表基金.份额变动表(324),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Integer
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级B类份额增长
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundShareIncreaseofB(20180903T);
|
||||
//结果:-50000
|
||||
```
|
||||
|
||||
### `fundCalculatedNavOfB4(end_t)`
|
||||
|
||||
获取基金的分级B类预估净值,与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级B类预估净值
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundCalculatedNavOfB4(20180903T);
|
||||
//结果:0.939
|
||||
```
|
||||
|
||||
### `fundPriceLeverage4(end_t)`
|
||||
|
||||
获取基金的分级B类价格杠杆,与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的分级B类价格杠杆
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundPriceLeverage4(20180903T);
|
||||
//结果:1.96957404
|
||||
```
|
||||
|
||||
### `fundCalculatedNavError4(end_t)`
|
||||
|
||||
获取基金的母基金预估净值相对误差(%),与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的母基金预估净值相对误差(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundCalculatedNavError4(20180903T);
|
||||
//结果:0
|
||||
```
|
||||
|
||||
### `fundVirtualDiscountRatio4(end_t)`
|
||||
|
||||
获取基金的母基金预估折价率(%),即区间预估与真实净值之差的均值。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的母基金预估折价率(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundVirtualDiscountRatio4(20180903T);
|
||||
//结果:-0.72091
|
||||
```
|
||||
|
||||
### `fundVirtualPrice4(end_t)`
|
||||
|
||||
获取基金的母基金虚拟价格。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的母基金虚拟价格
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundVirtualPrice4(20180903T);
|
||||
//结果:0.964
|
||||
```
|
||||
|
||||
### `fundVirtualNawzf4(end_t)`
|
||||
|
||||
获取基金预估净值涨幅(%)。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日的基金预估净值涨幅(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundVirtualNawzf4(20180903T);
|
||||
//结果:-1.5213
|
||||
```
|
||||
|
||||
### `fundShareIncreaseOfRatio(end_t)`
|
||||
|
||||
获取分级A和B类份额增长率(%)。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `end_t` | DateTime | 日期类型,截止日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回基金OF161028在2018年9月3日,获取分级A和B类份额增长率(%)
|
||||
setSysParam(pn_stock(),"OF161028");
|
||||
return fundShareIncreaseOfRatio(20180903T);
|
||||
//结果:-0.04951
|
||||
```
|
||||
|
||||
### `getDepositRate(hbid, int_day)`
|
||||
|
||||
指定日指定银行存款利率。与系统股票pn_stock()相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `hbid` | String | 字符串类型; |
|
||||
| `int_day` | Integer | 整数类型,整型日期,如20250206表示2025年2月6日 |
|
||||
|
||||
返回:Real
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
//返回2018年9月3日的银行存款利率
|
||||
return getDepositRate("IR000001",20180903);
|
||||
//或return GetDepositRate("IR000001",datetoint(20180903T));
|
||||
//结果:0.35
|
||||
```
|
||||
Reference in New Issue
Block a user