Back to skills
SKILL.md
Fund Sip Planner
ASecurity基金定投规划 - 智能定投策略设计与回测工具。 当用户需要设计定投计划、计算定投收益、选择定投策略、回测定投方案时使用此技能。 支持固定定投、智能定投(均线/估值/趋势)、定投回测、止盈止损策略。 触发关键词:定投、基金定投、定投计划、定投策略、智能定投、定投回测、定投收益。
- 232 stars
- 0 votes
- 0 copies
- 5 views
- Added September 7, 2026
Works with
Security analysis
100/100Pro scans all 6 files and shows the line behind each finding
npx -y skills add aifinlab/FinClaw --skill fund-sip-planner --agent claude-codeAre you the author of Fund Sip Planner?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/aifinlab-fund-sip-planner)---
name: fund-sip-planner
description: |
基金定投规划 - 智能定投策略设计与回测工具。
当用户需要设计定投计划、计算定投收益、选择定投策略、回测定投方案时使用此技能。
支持固定定投、智能定投(均线/估值/趋势)、定投回测、止盈止损策略。
触发关键词:定投、基金定投、定投计划、定投策略、智能定投、定投回测、定投收益。
---
# 基金定投规划 (Fund SIP Planner)
智能定投策略设计与回测工具,帮助用户制定科学的定投计划。
## 功能概述
- **定投计划设计**: 目标金额、定投周期、扣款日规划
- **固定定投**: 固定金额、固定频率的传统定投
- **智能定投**: 基于均线/估值/趋势的动态金额调整
- **定投回测**: 历史数据回测验证策略效果
- **止盈止损**: 目标收益率触发、最大回撤控制
- **收益计算**: 定投收益率、年化收益、累计收益
## 使用方法
### 命令行调用
```bash
# 基础定投计划
fund-sip --target 100000 --monthly 2000 --years 5
# 智能定投(均线策略)
fund-sip --target 100000 --strategy ma --base-amount 2000
# 定投回测
fund-sip --backtest --fund 000001 --amount 1000 --years 3
```
### Python API
```python
from fund_sip_planner import SIPPlanner
planner = SIPPlanner()
# 设计定投计划
plan = planner.create_plan(
target_amount=100000,
monthly_amount=2000,
years=5
)
# 智能定投回测
backtest = planner.backtest(
fund_code='000001',
strategy='ma',
base_amount=1000,
years=3
)
```
## 定投策略
### 1. 固定定投
每期投入固定金额,不择时。
```
定投金额 = 固定金额
优点: 简单省心,摊平成本
缺点: 无法利用市场波动
```
### 2. 均线定投策略
基于价格与均线的偏离度动态调整金额。
```
偏离度 = (当前价格 - 均线) / 均线
定投金额 = 基础金额 × (1 - 偏离度 × 调整系数)
当价格低于均线时多投,高于均线时少投。
```
| 偏离度 | 调整系数 | 定投倍数 |
|:---|:---:|:---:|
| < -20% | 1.5x | 2.0x |
| -20% ~ -10% | 1.2x | 1.5x |
| -10% ~ 10% | 1.0x | 1.0x |
| 10% ~ 20% | 0.8x | 0.8x |
| > 20% | 0.6x | 0.5x |
### 3. 估值定投策略
基于估值分位数动态调整金额。
```
定投金额 = 基础金额 × 估值调整系数
低估值(分位数<30%): 2.0x
中估值(30%-70%): 1.0x
高估值(分位数>70%): 0.5x
```
### 4. 趋势定投策略
基于技术指标判断趋势方向。
```
上升趋势: 1.0x (谨慎追高)
震荡趋势: 1.2x (逢低加仓)
下降趋势: 1.8x (越跌越买)
```
## 止盈止损策略
### 目标收益率止盈
| 目标收益率 | 止盈操作 |
|:---|:---|
| 10% | 赎回10%仓位 |
| 15% | 赎回25%仓位 |
| 20% | 赎回50%仓位 |
| 30% | 全部赎回 |
### 最大回撤止损
```
当前回撤 = (历史最高净值 - 当前净值) / 历史最高净值
回撤 > 10%: 关注
回撤 > 15%: 暂停定投
回撤 > 20%: 考虑止损
```
## 输出格式
### 定投计划报告
```json
{
"plan_id": "SIP_20260321_001",
"created_at": "2026-03-21",
"target_amount": 100000,
"monthly_amount": 2000,
"years": 5,
"strategy": "fixed",
"total_periods": 60,
"expected_return": 0.08,
"projected_value": 147746,
"projected_profit": 27746,
"schedule": [
{
"period": 1,
"date": "2026-04-01",
"amount": 2000,
"cumulative_investment": 2000,
"projected_value": 2013
}
]
}
```
## 示例
### 示例1: 基础定投计划
**输入**:
```
定投目标10万,每月定投2000元,投资5年
```
**输出**:
```
📊 定投计划报告
定投目标: ¥100,000
每月定投: ¥2,000
投资期限: 5年 (60期)
定投策略: 固定定投
预期收益:
累计投入: ¥120,000
预期总值: ¥147,746
预期收益: ¥27,746 (23.1%)
年化收益: 8.0%
定投日历:
扣款日: 每月1日
首次扣款: 2026-04-01
预计达成: 2028-08 (第29期)
建议:
✅ 建议设置自动扣款,避免断供
⚠️ 市场波动可能影响实际收益
📈 建议设置15%止盈目标
```
### 示例2: 智能定投回测
**输入**:
```
回测基金000001的均线定投策略,基础金额1000元,投资3年
```
**输出**:
```
📊 定投回测报告
基金: 华夏成长混合 (000001)
回测区间: 2023-03-21 ~ 2026-03-21
策略: 均线定投 (60日均线)
基础金额: ¥1,000
回测结果:
固定定投 均线定投 提升
累计投入: ¥36,000 ¥42,500 +18%
期末市值: ¥45,230 ¥52,860 +17%
总收益: ¥9,230 ¥10,360 +12%
收益率: 25.6% 24.4% -1.2pp
年化收益: 7.9% 7.6% -0.3pp
平均成本: ¥1.52 ¥1.45 -4.6%
分析:
✅ 均线定投降低了平均成本
✅ 在市场下跌时自动多投
⚠️ 但投入金额增加了18%
💡 适合波动较大的市场
```
## 注意事项
1. 定投需要长期坚持,建议3年以上
2. 智能定投可能增加投入金额,需预留资金
3. 回测结果不代表未来表现
4. 止盈后可根据情况重新开启定投
5. 建议结合市场估值判断定投时机
6. 定投不是万能,极端行情需灵活调整
## 依赖
```
numpy>=1.20.0
pandas>=1.3.0
```
## 作者
FinClaw - 上海财经大学金融研究工具
Files in this skill
- LICENSE
- SKILL.md
- requirements.txt
- scripts/fund_sip_planner.py
- scripts/fund_sip_planner_v2.py
- scripts/main.py
Attribution
Comments
Loading comments…