← 返回 Skills 市场
seanmwx

Fund Buying Decision Pro

作者 Xinhai Zou · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
101
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fund-buying-decision
功能描述
Parameterize and apply a Chinese mutual-fund buy, add, reduce, or hold strategy driven by price drawdown, recurring DCA, cash-pool management, and position l...
使用说明 (SKILL.md)

\r \r

Fund Buying Decision\r

\r

Overview\r

\r Use this skill to keep a reusable fund trading framework in one place.\r Prefer changing the parameter block below instead of rewriting numeric rules in prose.\r \r Return one explicit action per decision cycle:\r \r

  • buy_dca\r
  • buy_dip\r
  • sell_take_profit\r
  • hold\r
  • skip_data_missing\r \r If multiple actions trigger on the same day, prefer the risk-reducing action and keep the one-trade-per-day rule.\r \r

Strategy Parameters\r

\r Edit editable first. Keep fixed stable unless the strategy shape really changes.\r \r

strategy_parameters:\r
  editable:\r
    capital:\r
      initial_cash: 1000\r
      weekly_dca_amount: 100\r
      monthly_cash_pool_inflow: 1000\r
\r
    scheduling:\r
      weekly_pretrade_reminder:\r
        weekday: monday\r
        time_local: "09:00"\r
      weekly_dca:\r
        weekday: tuesday\r
      weekly_trade_reminder:\r
        weekday: tuesday\r
        time_local: "09:30"\r
      monthly_cash_inflow:\r
        schedule_type: second_to_last_business_day\r
        day_of_month: null\r
      monthly_cash_inflow_reminder:\r
        schedule_type: second_to_last_business_day\r
        day_of_month: null\r
        time_local: "10:00"\r
\r
    price_state:\r
      dip_thresholds_pct: [5, 10, 15]\r
      dip_base_buy_amounts: [100, 150, 200]\r
\r
    take_profit:\r
      profit_thresholds_pct: [10, 20]\r
      profit_sell_ratios_pct: [10, 20]\r
\r
    risk:\r
      max_position_ratio_pct: 80\r
      min_position_ratio_pct: 20\r
\r
  fixed:\r
    universe:\r
      allowed_fund_types:\r
        - index_fund\r
        - equity_fund\r
      disallowed_fund_types:\r
        - bond_fund\r
        - money_market_fund\r
\r
    capital:\r
      fee_rate_source: fund_current_rate\r
\r
    scheduling:\r
      trade_cutoff_local_time: "15:00"\r
      backtest_execution_mode: next_trading_day\r
      max_trades_per_day: 1\r
\r
    price_state:\r
      recent_high_lookback_trading_days: 20\r
      min_trading_days_between_adds: 5\r
```\r
\r
## Parameter Groups\r
\r
Use these two buckets when maintaining the strategy:\r
\r
- `editable`\r
  `capital.initial_cash`\r
  `capital.weekly_dca_amount`\r
  `capital.monthly_cash_pool_inflow`\r
  `scheduling.weekly_pretrade_reminder.weekday`\r
  `scheduling.weekly_pretrade_reminder.time_local`\r
  `scheduling.weekly_dca.weekday`\r
  `scheduling.weekly_trade_reminder.weekday`\r
  `scheduling.weekly_trade_reminder.time_local`\r
  `scheduling.monthly_cash_inflow.schedule_type`\r
  `scheduling.monthly_cash_inflow.day_of_month`\r
  `scheduling.monthly_cash_inflow_reminder.schedule_type`\r
  `scheduling.monthly_cash_inflow_reminder.day_of_month`\r
  `scheduling.monthly_cash_inflow_reminder.time_local`\r
  `price_state.dip_thresholds_pct`\r
  `price_state.dip_base_buy_amounts`\r
  `take_profit.profit_thresholds_pct`\r
  `take_profit.profit_sell_ratios_pct`\r
  `risk.max_position_ratio_pct`\r
  `risk.min_position_ratio_pct`\r
\r
- `fixed`\r
  `universe.allowed_fund_types`\r
  `universe.disallowed_fund_types`\r
  `capital.fee_rate_source`\r
  `scheduling.trade_cutoff_local_time`\r
  `scheduling.backtest_execution_mode`\r
  `scheduling.max_trades_per_day`\r
  `price_state.recent_high_lookback_trading_days`\r
  `price_state.min_trading_days_between_adds`\r
\r
## State Boundary\r
\r
Treat `SKILL.md` as strategy configuration only. Do not store live account state in this file.\r
\r
- `SKILL.md` is the source of truth for strategy rules, thresholds, schedules, and default initialization values.\r
- SQLite is the source of truth for live account state and history.\r
- Real account fields such as `cash_pool`, `position_units`, `avg_cost_price`, `account_id`, and executed trades must live in the database, not in `SKILL.md`.\r
- `capital.initial_cash` is only the default starting amount used when initializing a new strategy account.\r
  It is not the current live cash balance after trading starts.\r
- After an account exists, update live state only through:\r
  `python {baseDir}/scripts/manage_strategy_account.py ...`\r
  `python {baseDir}/scripts/record_strategy_trade.py ...`\r
  `python {baseDir}/scripts/confirm_strategy_action.py ...`\r
- Do not edit `capital.initial_cash` in `SKILL.md` to reflect a new live balance.\r
  If the user adds cash or changes holdings, write that change to SQLite instead.\r
\r
## Required Inputs\r
\r
Do not invent missing inputs. If a required field is unavailable, return `skip_data_missing` and explain what is missing.\r
\r
Required runtime inputs:\r
\r
- `fund_code`\r
- `current_price`\r
- `cost_price`\r
- `cash_pool`\r
- `position_value`\r
- `recent_high`\r
- `today`\r
- `trade_time_local`\r
- `last_add_trade_date`\r
- `is_weekly_dca_day`\r
- `is_monthly_cash_inflow_day`\r
\r
Derived values:\r
\r
- `total_asset = cash_pool + position_value`\r
- `position_ratio = position_value / total_asset`\r
- `drawdown_pct = (recent_high - current_price) / recent_high * 100`\r
- `profit_pct = (current_price - cost_price) / cost_price * 100`\r
- `effective_fee_rate_pct = imported fund current_rate when available`\r
\r
## Daily Workflow\r
\r
1. Refresh or read fund data.\r
   For Eastmoney price data, run `python {baseDir}/scripts/import_eastmoney_pingzhongdata.py 011598` or replace `011598` with another fund code.\r
2. If today and the current local time match the configured `weekly_pretrade_reminder`, issue the weekly pretrade reminder.\r
3. If today and the current local time match the configured `weekly_trade_reminder`, issue the trading reminder and then evaluate the strategy.\r
4. If today and the current local time match the configured `monthly_cash_inflow_reminder`, remind the user to add the monthly cash inflow.\r
5. Record the monthly cash inflow only after it is actually added to `cash_pool`.\r
   Use `python {baseDir}/scripts/record_strategy_trade.py 011598 --trade-type cash_inflow --gross-amount 1000`.\r
6. Update `current_price`, `recent_high`, `total_asset`, and `position_ratio`.\r
7. Evaluate take-profit rules first when both buy and sell could trigger on the same day.\r
8. Evaluate dip-buy rules only if the add-spacing rule is satisfied and cash is available.\r
9. Evaluate weekly DCA only if no higher-priority trade was selected.\r
10. Re-check max and min position limits after sizing the candidate trade.\r
11. Execute at the configured cutoff rule.\r
   For backtests, prefer `next_trading_day` execution to avoid future leakage.\r
\r
## Scheduling Rules\r
\r
- `weekly_pretrade_reminder.weekday` and `weekly_pretrade_reminder.time_local` control the weekly pretrade reminder schedule.\r
- `weekly_trade_reminder.weekday` and `weekly_trade_reminder.time_local` control the weekly trade reminder schedule.\r
- `weekly_dca.weekday` controls which weekday counts as the DCA trading day.\r
- `monthly_cash_inflow.schedule_type` controls the monthly cash-inflow date used by the strategy state.\r
- `monthly_cash_inflow_reminder.schedule_type` and `monthly_cash_inflow_reminder.time_local` control the monthly reminder trigger.\r
- Supported monthly `schedule_type` values are:\r
  - `second_to_last_business_day`\r
  - `last_business_day`\r
  - `day_of_month`\r
- When `schedule_type = day_of_month`, fill `day_of_month` with an integer such as `15` or `28`.\r
\r
## Decision Rules\r
\r
### DCA\r
\r
- Use `weekly_dca_amount` as the fixed recurring DCA amount.\r
- Size the actual DCA as `min(weekly_dca_amount, cash_pool)`.\r
- Skip DCA if there is already a higher-priority trade on the same day.\r
\r
### Dip Buy\r
\r
- Compute `drawdown_pct` from `recent_high`.\r
- Use only the deepest triggered threshold from `dip_thresholds_pct`.\r
- Map that threshold to the aligned base amount in `dip_base_buy_amounts`.\r
- Size the actual buy as the minimum of:\r
  - base buy amount\r
  - available `cash_pool`\r
  - remaining room under `max_position_ratio_pct`\r
- Reject the dip buy if the last add trade is within `min_trading_days_between_adds`.\r
\r
### Take Profit\r
\r
- Use only the highest triggered threshold from `profit_thresholds_pct`.\r
- Map that threshold to the aligned sell ratio in `profit_sell_ratios_pct`.\r
- Size the actual sell so the post-trade position ratio does not go below `min_position_ratio_pct`.\r
- Send sell proceeds back into `cash_pool`.\r
\r
### Position And Cash Controls\r
\r
- Keep all buys funded by `cash_pool`.\r
- Keep monthly inflows and sell proceeds inside `cash_pool`.\r
- Never exceed `max_position_ratio_pct`.\r
- Never reduce below `min_position_ratio_pct`.\r
- Include the imported fund `current_rate` in trade sizing when the user requires fees.\r
\r
## Fund Detail Reporting\r
\r
- Use `python {baseDir}/scripts/report_fund_details.py 011598 --refresh` to fetch and summarize a fund.\r
- Include the latest available fund identity, fee rate, minimum subscription, net worth, recent 20-trading-day high, drawdown, return metrics, stock-position estimate, manager information, asset allocation, holder structure, and top holdings.\r
- If local data is missing, allow the reporting script to refresh the SQLite database first.\r
\r
## Drawdown Alerts\r
\r
- Use `python {baseDir}/scripts/check_fund_alert.py 004475` to check drawdown alerts against the configured `dip_thresholds_pct` tiers in `SKILL.md`.\r
- To override the default tiers at runtime, repeat `--threshold-pct`, for example:\r
  `python {baseDir}/scripts/check_fund_alert.py 004475 --threshold-pct 5 --threshold-pct 10 --threshold-pct 15`\r
- This script only computes the alert state and returns structured output.\r
- Do not implement email or Feishu delivery inside this skill.\r
  If the user wants delivery, hand the alert result to the dedicated notification skill instead.\r
\r
## Strategy Runtime Commands\r
\r
Default SQLite location:\r
\r
- `~/.fund_buying_decision/fund_buying_decision.db`\r
- Use `--db ~/.fund_buying_decision/\x3Cname>.db` when you want a separate database file for another account set or experiment.\r
\r
- Initialize or overwrite the stored account state:\r
  `python {baseDir}/scripts/manage_strategy_account.py upsert 011598 --account-id main --cash-pool 1000 --position-units 0 --fund-type equity_fund`\r
- Record a real cash flow or manual trade:\r
  `python {baseDir}/scripts/record_strategy_trade.py 011598 --account-id main --trade-type cash_inflow --gross-amount 1000`\r
- Generate reminders and evaluate the strategy:\r
  `python {baseDir}/scripts/evaluate_strategy.py 011598 --account-id main --refresh`\r
- Confirm and execute the currently suggested strategy trade only after the user agrees:\r
  `python {baseDir}/scripts/confirm_strategy_action.py 011598 --account-id main --refresh --expected-action buy_dca`\r
- Check whether a drawdown alert is triggered:\r
  `python {baseDir}/scripts/check_fund_alert.py 004475`\r
\r
## References To Load\r
\r
- `references/strategy_parameters.md`\r
  Use when revising thresholds, clarifying formulas, or resolving ambiguous parameter choices.\r
- `references/data_inputs.md`\r
  Use when working with the SQLite importer, mapping database tables to strategy inputs, planning the next strategy-state tables, or assembling a fund detail report.\r
安全使用建议
This skill appears to do what it claims: fetch Eastmoney fund JS pages, parse them, and maintain a local SQLite account and trade history while providing strategy decisions. Before installing or running: - Review the included Python files (they are present and will be executed) so you understand what will run locally. - Be aware the default DB is created under your home directory (~/.fund_buying_decision/fund_buying_decision.db); move or change the path if you prefer isolation. - The importer fetches data from fund.eastmoney.com; if you need an offline or air-gapped run, disable network access or use pre-populated DB snapshots. - No cloud credentials or secrets are requested by this skill, but if you adapt the code to integrate with brokers or messaging services, those additions would require credentials—inspect such changes carefully. - As with any script that writes local state, consider running it in a controlled environment (virtualenv / sandbox) and back up your data before trusting automated apply/confirm commands.
功能分析
Type: OpenClaw Skill Name: fund-buying-decision Version: 1.0.0 The skill bundle provides a comprehensive framework for simulating and managing Chinese mutual fund investment strategies. It includes scripts for fetching real-time market data from Eastmoney (import_eastmoney_pingzhongdata.py), evaluating trading rules based on drawdown and DCA (strategy_engine.py), and maintaining account state in a local SQLite database. The code is well-structured, uses safe parsing methods like ast.literal_eval for external data, and contains no evidence of malicious intent, data exfiltration, or unauthorized system access.
能力评估
Purpose & Capability
The name/description (fund buy/add/reduce/hold strategy) matches the included scripts: evaluation, confirmation, account management, reporting, and an importer that fetches Eastmoney fund data. No unrelated services, credentials, or binaries are required.
Instruction Scope
SKILL.md instructs the agent/user to run the bundled Python scripts and defines required runtime inputs. The instructions do not ask to read unrelated files or environment secrets. They do require network access to fetch Eastmoney JS pages and local SQLite read/write for account state, both of which are consistent with the stated task.
Install Mechanism
There is no install spec (instruction-only), but the repository includes multiple Python scripts that the agent/user is expected to execute. No external downloads, package registries, or archive extraction are used. Running the scripts will create and modify a local SQLite DB under the user's home directory by default.
Credentials
The skill declares no required env vars or credentials (ok). It does, however, require filesystem access (creates ~/.fund_buying_decision/fund_buying_decision.db by default) and network access to https://fund.eastmoney.com/pingzhongdata/{fund_code}.js to import market data. Those accesses are proportional to the purpose but are important to be aware of.
Persistence & Privilege
always is false and the skill does not request elevated platform privileges. It persists its own data to a local SQLite DB (normal for this kind of tool) and does not modify other skills or system-wide agent configurations.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fund-buying-decision
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fund-buying-decision 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Implements a parameterized Chinese mutual fund trading strategy with clear configuration boundaries and decision workflow. - Defines flexible buy, add, reduce, or hold rules based on price drawdown, DCA, cash management, and position limits. - All strategy rules and thresholds centralized in SKILL.md under editable and fixed parameter groups. - Provides explicit daily decision outputs (`buy_dca`, `buy_dip`, `sell_take_profit`, `hold`, `skip_data_missing`). - Separates live strategy state (in SQLite) from configuration (in SKILL.md). - Documents required runtime inputs and strategy application workflow.
元数据
Slug fund-buying-decision
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Fund Buying Decision Pro 是什么?

Parameterize and apply a Chinese mutual-fund buy, add, reduce, or hold strategy driven by price drawdown, recurring DCA, cash-pool management, and position l... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 101 次。

如何安装 Fund Buying Decision Pro?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fund-buying-decision」即可一键安装,无需额外配置。

Fund Buying Decision Pro 是免费的吗?

是的,Fund Buying Decision Pro 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Fund Buying Decision Pro 支持哪些平台?

Fund Buying Decision Pro 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Fund Buying Decision Pro?

由 Xinhai Zou(@seanmwx)开发并维护,当前版本 v1.0.0。

💬 留言讨论