track_asset
Add or update a tracked asset's symbol, investment cap, fees, target weight, and price or daily-move alerts so committee and DCA jobs cover it.
Instructions
Add a symbol to the tracked-asset list, or update an existing entry (idempotent upsert: only the fields you pass are changed). The tracked list decides which symbols the committee and DCA jobs cover. The alert_* parameters set per-asset alert lines the price sentinel checks every few minutes (price lines: 24h cooldown; day-move lines: once per trading day); each one you pass overwrites that line only. To clear a line use set_allocations with a null value. Delivery needs INVEST_EVENT_ALERT=1 on the server (default off — without it a hit is only logged to the event store, nothing is sent).
Use when the user says "track AAPL", wants to change a tracked asset's cap/channel/fees/target weight, or says "alert me when X drops below N" / "tell me if it falls 3% in a day".
Args: symbol: yfinance ticker to track (e.g. "AAPL", "0700.HK", "BTC-USD"). max_single_invest_cny: Per-decision investment cap in CNY. On a new entry it defaults to the strategy-level max_single_invest_cny; optional on update. display_name: Human-friendly name shown in reports. channel: Where the user actually buys it (broker/app name). price_offset_pct: Systematic offset between the quote and the user's actual fill price, in percent (e.g. bank gold spread). sell_fee_pct: Sell-side fee in percent, used by fee-aware math. target_pct: Target weight as a fraction of total assets in [0, 1] (read by rebalance_plan); all tracked assets' weights must sum to <= target_allocation_stock or the write is rejected. alert_price_above / alert_price_below: price lines (status.current_price basis). alert_day_drop_pct / alert_day_rise_pct: the latest daily bar's move vs the previous close, percentage points. alert_drawdown_from_cost_pct: held position below average cost, percentage points.
Returns: The stored asset entry, or {"status": "error", "error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | yfinance ticker to track, e.g. 'AAPL', '0700.HK', 'BTC-USD'. | |
| channel | No | Where the user actually buys it (broker/app name). | |
| target_pct | No | Target weight of this asset as a fraction of total assets, in [0, 1] (0.3 = 30%); read by rebalance_plan. The weights of all tracked assets must sum to <= target_allocation_stock, otherwise the write is rejected and the current sum is reported. Assets without one split the remainder equally. To clear a target use set_allocations with a null value. | |
| display_name | No | Human-friendly name shown in reports. | |
| sell_fee_pct | No | Sell-side fee in percent, used by fee-aware math. | |
| price_offset_pct | No | Systematic offset between quote and actual fill price, in percent (e.g. bank gold spread). | |
| alert_price_above | No | Alert when the price reaches or exceeds this level. Same price basis as status.current_price (held: cost currency, gold booking = CNY per gram; tracked-only: the quote source's own price). | |
| alert_price_below | No | Alert when the price falls to or below this level (same price basis as alert_price_above). Must be below alert_price_above if both are set. | |
| alert_day_drop_pct | No | Alert when the latest daily bar's drop vs the previous close reaches this many percentage points (3 = 3%, not a 0-1 fraction). On a closed market that is the last session; each trading day is reported once. | |
| alert_day_rise_pct | No | Alert when the latest daily bar's rise vs the previous close reaches this many percentage points (3 = 3%); each trading day is reported once. | |
| max_single_invest_cny | No | Per-decision investment cap in CNY. On a new entry, defaults to the strategy-level max_single_invest_cny; optional on update. | |
| alert_drawdown_from_cost_pct | No | Alert when a held position is this many percentage points below its average cost (10 = 10%). Only evaluated for assets you hold. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |