Fund Buying Decision Pro
/install fund-buying-decision
\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\rbuy_dip\rsell_take_profit\rhold\rskip_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
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install fund-buying-decision - After installation, invoke the skill by name or use
/fund-buying-decision - Provide required inputs per the skill's parameter spec and get structured output
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 101 downloads so far.
How do I install Fund Buying Decision Pro?
Run "/install fund-buying-decision" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Fund Buying Decision Pro free?
Yes, Fund Buying Decision Pro is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Fund Buying Decision Pro support?
Fund Buying Decision Pro is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Fund Buying Decision Pro?
It is built and maintained by Xinhai Zou (@seanmwx); the current version is v1.0.0.