✨ 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,113 @@
|
||||
# 债券 / 债券指数估值
|
||||
|
||||
### `bondIvDuration()`
|
||||
|
||||
返回当前债券指数指定日的久期,与系统参数(证券,时间)相关。
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"CSIH01006");
|
||||
SetSysParam(PN_Date(),20200924T);
|
||||
return BondIVDuration(); //结果:6.9821
|
||||
```
|
||||
|
||||
### `bondIvMaturityYield()`
|
||||
|
||||
返回当前债券指数指定日的到期收益率,与系统参数(证券,时间)相关。
|
||||
|
||||
返回:float
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"CSIH01006");
|
||||
SetSysParam(PN_Date(),20200924T);
|
||||
return BondIVMaturityYield(); //结果:3.0545
|
||||
```
|
||||
|
||||
### `bondIvqk(begt, endt)`
|
||||
|
||||
返回当前债券指数的区间债券估值数据,与系统参数(证券,时间)相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------ | -------- | ------------- |
|
||||
| `begt` | datetime | 日期,开始日期 |
|
||||
| `endt` | datetime | 日期,截止日期 |
|
||||
|
||||
返回:array
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(),"CSIH01006");
|
||||
SetSysParam(PN_Date(),20200924T);
|
||||
return BondIVQK(20200914T,20200924T);
|
||||
```
|
||||
|
||||
### `bondIvCloseDuration()`
|
||||
|
||||
返回当前债券指数指定日的收盘价久期,与系统参数(证券,时间)相关。
|
||||
|
||||
返回:REAL
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
// "CSIH01006"中证国债在20200924的收盘价久期。
|
||||
setSysParam(pn_stock(),"CSIH01006");
|
||||
setSysParam(PN_Date(),20200924T);
|
||||
return bondIvCloseDuration();//结果:0
|
||||
```
|
||||
|
||||
### `bondIvConvexity()`
|
||||
|
||||
返回当前债券指数指定日的凸性,与系统参数(证券,时间)相关。
|
||||
|
||||
返回:REAL
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
// "CSIH01006"中证国债在20200924的凸性。
|
||||
setSysParam(pn_stock(),"CSIH01006");
|
||||
setSysParam(PN_Date(),20200924T);
|
||||
return bondIvConvexity(); //结果:54.3261
|
||||
```
|
||||
|
||||
### `bondIvqk2(n)`
|
||||
|
||||
返回当前债券指数N日债券估值数据,与系统参数(证券,时间)相关。
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `n` | Integer | 整型,N日 |
|
||||
|
||||
返回:Array
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
// "CSIH01006"中证国债在20200924的5日债券估值数据
|
||||
setSysParam(pn_stock(),"CSIH01006");
|
||||
setSysParam(PN_Date(),20200924T);
|
||||
return bondIvqk2(5);
|
||||
结果:
|
||||
```
|
||||
|
||||
### `bondIvRemainDuration()`
|
||||
|
||||
返回当前债券指数在指定日的剩余期限,与系统参数(证券,时间)相关。
|
||||
|
||||
返回:REAL
|
||||
|
||||
#### 示例
|
||||
|
||||
```tsl
|
||||
// "CSIH01006"中证国债在20200924的剩余期限。
|
||||
setSysParam(pn_stock(),"CSIH01006");
|
||||
setSysParam(PN_Date(),20200924T);
|
||||
return bondIvRemainDuration(); //结果:0
|
||||
```
|
||||
Reference in New Issue
Block a user