用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/openJiuwen-ai/agent-store --skill rebalancing-strategy命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | rebalancing-strategy |
| description | 再平衡策略,支持日历再平衡、阈值再平衡与最优频率分析。适用于组合再平衡理论与实践的。回测未考虑冲击成本、税费与流动性约束,不适用于实盘资产管理,不构成投资建议。 |
| version | 1.0.0 |
| author | wangyi |
再平衡策略工具,支持日历再平衡、阈值再平衡,并分析最优再平衡频率,仅使用 Python 标准库。
📌 说明:本工具基于简化模型实现,仅使用 Python 标准库。结果仅供学习参考,不构成投资建议。
weight_deviations(current_weights, target_weights)计算权重偏离。 必填: current_weights, target_weights
max_deviation(current_weights, target_weights)计算最大绝对权重偏离。 必填: current_weights, target_weights
needs_rebalance_threshold(current_weights, target_weights, threshold=0.05, method='absolute')判断是否需要阈值再平衡。 必填: current_weights, target_weights
calculate_turnover(current_weights, target_weights)计算再平衡的换手率。 必填: current_weights, target_weights
execute_rebalance(current_weights, target_weights, transaction_cost_rate=0.001)执行再平衡并计算成本。 必填: current_weights, target_weights
calendar_rebalance_simulation(returns_history, initial_weights, frequency=12, transaction_cost_rate=0.001)日历再平衡回测模拟。 必填: returns_history, initial_weights
threshold_rebalance_simulation(returns_history, initial_weights, threshold=0.05, method='absolute', transaction_cost_rate=0.001)阈值再平衡回测模拟。 必填: returns_history, initial_weights
optimal_frequency_analysis(returns_history, initial_weights, frequencies=None, transaction_cost_rate=0.001)分析不同再平衡频率的效果,寻找最优频率。 必填: returns_history, initial_weights
python scripts/main.py \
--returns-history <returns_history> \
--initial-weights <initial_weights> \
--frequencies <frequencies> \
--transaction-cost-rate <transaction_cost_rate>