Files
playbook/skills/tsl-api-reference/references/codegen/module/ts-index-fund.md
T

83 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 回测 / 指数基金
## `TSIndexFund`
声明:class
执行指数基金复制与抽样回测,支持基准成分、抽样样本及目标配置权重计算
<!-- tags: 调用 组合权重 资产配置 历史模拟 策略验证 基金产品 基金研究 基准指数 -->
### `backTest()`
声明:function
执行指数基金跟踪回测主流程;调用其他查询接口前通常先运行本方法
<!-- tags: 历史模拟 指数基金 策略验证 -->
可见性:`public`
### `getTimeSeries()`
声明:function
获取指数基金调仓日期序列;非日动态平衡场景可重写
<!-- tags: 查询 调仓日期 动态平衡 -->
可见性:`public`
返回:array
### `getIndexWeight(v_end_t, v_prev_end_t)`
声明:function
获取 T 日可用的 T-1 日基准指数成分及权重;可重写
<!-- tags: 查询 指数成分 基准权重 T-1日 -->
可见性:`public`
| 参数 | 类型 | 说明 |
| -------------- | ----------- | -------------------------------------------------- |
| `v_end_t` | t_date_time | TDateTimeT 日 2 vPrevEndTTDateTimeT-1 日 |
| `v_prev_end_t` | t_date_time | 上一期报告/调仓截止日,用于确定区间边界 |
返回:array
### `getSamples(v_end_t, v_prev_end_t)`
声明:function
根据基准指数成分计算抽样样本;自定义抽样方法时可重写
<!-- tags: 计算 指数抽样 样本股 -->
可见性:`public`
| 参数 | 类型 | 说明 |
| -------------- | ----------- | -------------------------------------------------- |
| `v_end_t` | t_date_time | TDateTimeT 日 2 vPrevEndTTDateTimeT-1 日 |
| `v_prev_end_t` | t_date_time | 上一期报告/调仓截止日,用于确定区间边界 |
返回:array
### `getSampleWeight(v_end_t, v_prev_end_t)`
声明:function
计算抽样样本的目标配置比例;自定义配比方法时可重写
<!-- tags: 计算 目标配置 样本权重 指数复制 -->
可见性:`public`
| 参数 | 类型 | 说明 |
| -------------- | ----------- | -------------------------------------------------- |
| `v_end_t` | t_date_time | TDateTimeT 日 2 vPrevEndTTDateTimeT-1 日 |
| `v_prev_end_t` | t_date_time | 上一期报告/调仓截止日,用于确定区间边界 |
返回:array