✨ feat(tsl-api-reference): expand and reorganize api catalog
Flatten builtin pages, add third-party and platform scopes, and import financial and data warehouse references. Keep the existing generated index without rebuilding after signature normalization.
This commit is contained in:
+58
@@ -0,0 +1,58 @@
|
||||
# 金融 / 组合评价 / 中间函数
|
||||
|
||||
## `pf_returnToCumulativeReturn(t, f_name, return_type)`
|
||||
|
||||
声明:function
|
||||
|
||||
日收益率转复合收益率,returntype决定显示模式,若为1则显示最后一天的复合收益率,为0则显示每天的复合收益率
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ------- | ------------------------ |
|
||||
| `t` | array | 数据表类型,日收益率数据 |
|
||||
| `f_name` | string | 字符串,收益率字段名称 |
|
||||
| `return_type` | integer | 用户自定义,返回类型 |
|
||||
|
||||
返回:float
|
||||
|
||||
### 示例
|
||||
|
||||
范例01:返回:3.54
|
||||
|
||||
```tsl
|
||||
t := array(('日期':20180801T, '涨幅%':1.42051971),
|
||||
|
||||
('日期':20180802T, '涨幅%':1.18018526),
|
||||
|
||||
('日期':20180803T, '涨幅%':0.9023545));
|
||||
|
||||
return pf_ReturnToCumulativeReturn(t, '涨幅%', 1);
|
||||
// 输出:3.54
|
||||
```
|
||||
|
||||
## `riskFreeRateofReturnDayly(rf, cy, rate_type, days_in_1_y)`
|
||||
|
||||
声明:function
|
||||
|
||||
年化无风险收益率转换非年化收益率,与系统参数(股票,时间)相关
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `rf` | real | 实数,年化无风险收益率(%) |
|
||||
| `cy` | string | 周期,非年化收益率周期 |
|
||||
| `rate_type` | integer | 用户自定义,年化收益率折算为非年化收益率方法 显示名 取值 单利 0 复利 1 |
|
||||
| `days_in_1_y` | integer | 用户自定义 250天(仅对折算为日收益率有效) 250 365天(仅对折算为日收益率有效) 365 360天(仅对折算为日收益率有效) 360 50周期(仅对折算为周收益率有效) 50 12月(仅对折算为月收益率有效) 12 交易所交易周期 -1 |
|
||||
|
||||
返回:real
|
||||
|
||||
### 示例
|
||||
|
||||
范例01:返回:0.01
|
||||
|
||||
```tsl
|
||||
SetSysParam(pn_stock(), 'sz000001');
|
||||
|
||||
SetSysParam(PN_Date(), 20180801T);
|
||||
|
||||
return RiskFreeRateofReturnDayly(3, cy_day(), '单利', 250);
|
||||
// 输出:0.01
|
||||
```
|
||||
Reference in New Issue
Block a user