mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-18 18:04:32 +08:00
v2
This commit is contained in:
@@ -14,6 +14,16 @@
|
||||
"type": "string",
|
||||
"description": "策略描述,可选。"
|
||||
},
|
||||
"is_public": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
"description": "是否发布到策略市场。"
|
||||
},
|
||||
"config_visible": {
|
||||
"type": "bool",
|
||||
"default": true,
|
||||
"description": "发布到市场后,是否允许别人查看策略配置。"
|
||||
},
|
||||
"lang": {
|
||||
"type": "enum",
|
||||
"values": ["zh", "en"],
|
||||
@@ -26,6 +36,10 @@
|
||||
"default": "ai_trading",
|
||||
"description": "策略类型:ai_trading(AI 量化)或 grid_trading(网格策略)。"
|
||||
},
|
||||
"symbol": {
|
||||
"type": "string",
|
||||
"description": "网格策略的交易对,例如 BTCUSDT。"
|
||||
},
|
||||
"source_type": {
|
||||
"type": "enum",
|
||||
"values": ["static", "ai500", "oi_top", "oi_low", "mixed"],
|
||||
@@ -41,7 +55,7 @@
|
||||
},
|
||||
"primary_timeframe": {
|
||||
"type": "string",
|
||||
"values": ["1m", "3m", "5m", "15m", "30m", "1h", "4h", "1d"],
|
||||
"values": ["1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w"],
|
||||
"description": "主 K 线周期,例如 5m、15m、1h。"
|
||||
},
|
||||
"selected_timeframes": {
|
||||
@@ -106,6 +120,12 @@
|
||||
"min": 0,
|
||||
"description": "网格总投入金额,grid_trading 类型专用。"
|
||||
},
|
||||
"leverage": {
|
||||
"type": "int",
|
||||
"min": 1,
|
||||
"max": 5,
|
||||
"description": "网格策略杠杆倍数,手动页面当前范围 1~5。"
|
||||
},
|
||||
"upper_price": {
|
||||
"type": "float",
|
||||
"description": "网格上边界价格,grid_trading 类型专用。"
|
||||
@@ -337,6 +357,7 @@
|
||||
},
|
||||
"validation_rules": [
|
||||
"btceth_max_leverage 和 altcoin_max_leverage 范围均为 1~20,超出时自动收敛并告知用户。",
|
||||
"grid_trading 的 leverage 需与手动页面一致,范围 1~5,超出时自动收敛并告知用户。",
|
||||
"min_confidence 范围 0~100,超出时自动收敛并告知用户。",
|
||||
"grid_trading 类型时,lower_price 必须小于 upper_price,否则提示用户修正。",
|
||||
"grid_count 最小为 2,低于 2 时提示用户修正。",
|
||||
@@ -352,7 +373,7 @@
|
||||
"create": {
|
||||
"description": "创建策略模板。至少需要名称,其他配置可按需追问或按默认值补齐。",
|
||||
"required_slots": ["name"],
|
||||
"optional_slots": ["description", "lang", "strategy_type", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "grid_count", "total_investment", "upper_price", "lower_price", "distribution", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage", "min_position_size"],
|
||||
"optional_slots": ["description", "is_public", "config_visible", "lang", "strategy_type", "symbol", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "grid_count", "total_investment", "leverage", "upper_price", "lower_price", "distribution", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage", "min_position_size"],
|
||||
"goal": "创建一个可供 trader 绑定使用的策略模板。",
|
||||
"dynamic_rules": [
|
||||
"若用户只是要给 trader 绑定现有策略,应优先在父任务里补 strategy 槽位,而不是误开新的 create。",
|
||||
@@ -366,7 +387,7 @@
|
||||
"update": {
|
||||
"description": "更新策略模板的任意可编辑字段。",
|
||||
"required_slots": ["target_ref"],
|
||||
"optional_slots": ["name", "description", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "grid_count", "total_investment", "upper_price", "lower_price", "distribution", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage", "min_position_size"],
|
||||
"optional_slots": ["name", "description", "is_public", "config_visible", "symbol", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "grid_count", "total_investment", "leverage", "upper_price", "lower_price", "distribution", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage", "min_position_size"],
|
||||
"goal": "更新一个已有策略模板的指定配置,而不覆盖未提及字段。",
|
||||
"dynamic_rules": [
|
||||
"只更新用户明确提到的字段,不要覆盖未提及的字段。",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "trader_management",
|
||||
"kind": "management",
|
||||
"domain": "trader",
|
||||
"description": "当用户想创建、查看、修改、删除、启动或停止交易员时调用。适用于用户提到交易员名称、绑定交易所、绑定模型、绑定策略、保证金模式、扫描频率、竞技场显示、运行状态等管理需求。不用于排查交易员启动失败、未下单、收益异常、仓位异常等诊断问题。创建交易员时必须收齐名称、交易所、模型、策略;其中交易所、模型、策略既可以直接选择用户已有可用资源,也可以在当前主流程里先新建/启用对应资源,再继续完成交易员创建。",
|
||||
"description": "当用户想创建、查看、修改、删除、启动或停止交易员时调用。交易员是装配层,核心是名称以及绑定的交易所、模型、策略;编辑交易员默认只换绑定,不修改这些依赖对象的内部配置。若用户要改策略参数、模型配置或交易所凭证,应切到各自的 management skill。创建交易员时必须收齐名称、交易所、模型、策略;其中交易所、模型、策略既可以直接选择用户已有可用资源,也可以在当前主流程里先新建/启用对应资源,再继续完成交易员创建。不用于排查交易员启动失败、未下单、收益异常、仓位异常等诊断问题。",
|
||||
"intents": [
|
||||
"创建交易员",
|
||||
"修改交易员",
|
||||
@@ -40,11 +40,6 @@
|
||||
"default": 5,
|
||||
"description": "AI 扫描决策间隔,单位分钟,手动面板可配置范围 3~60 分钟。超出范围会自动收敛到边界值并告知用户。"
|
||||
},
|
||||
"initial_balance": {
|
||||
"type": "float",
|
||||
"min": 100.0,
|
||||
"description": "初始资金,手动面板最低 100。超出范围会自动收敛到最低值并告知用户。"
|
||||
},
|
||||
"is_cross_margin": {
|
||||
"type": "bool",
|
||||
"default": true,
|
||||
@@ -105,7 +100,7 @@
|
||||
"ai_model_id 对应的模型配置必须已启用(enabled=true)且配置完整(api_key、custom_model_name 不为空;custom_api_url 若填写必须为合法 HTTPS),否则无法创建或启动交易员。",
|
||||
"strategy_id 对应的策略模板必须存在,否则无法创建交易员。",
|
||||
"scan_interval_minutes 超出 3~60 范围时,系统自动收敛到边界值,并通过 LLM 告知用户已调整,询问是否接受。",
|
||||
"initial_balance 低于 100 时,系统自动收敛到 100,并通过 LLM 告知用户已调整。",
|
||||
"交易员初始余额由系统在创建时自动读取绑定交易所账户净值,不接受用户手动设置、充值或修改。",
|
||||
"启动交易员前,绑定的模型必须已启用且完整,绑定的交易所也必须已启用且通过对应交易所的完整性校验,否则拒绝启动并明确指出缺哪一项。",
|
||||
"若绑定的是 OKX 交易所,启用前必须已有 passphrase;若绑定的是 Hyperliquid,启用前必须已有 wallet_addr;若绑定的是 Aster,启用前必须已有 user、signer、private_key;若绑定的是 Lighter,启用前必须已有 wallet_addr 和 api_key_private_key。",
|
||||
"btc_eth_leverage 和 altcoin_leverage 若超出系统允许范围,应自动收敛或提示用户修正。",
|
||||
@@ -117,7 +112,7 @@
|
||||
"create": {
|
||||
"description": "创建新的交易员。若缺少交易所、模型或策略,可在当前流程内先选择已有资源,或切去对应 skill 新建/启用后自动回流继续。",
|
||||
"required_slots": ["name", "exchange", "model", "strategy"],
|
||||
"optional_slots": ["auto_start", "scan_interval_minutes", "initial_balance", "is_cross_margin", "show_in_competition", "btc_eth_leverage", "altcoin_leverage", "trading_symbols", "custom_prompt", "override_base_prompt", "system_prompt_template", "use_ai500", "use_oi_top"],
|
||||
"optional_slots": ["auto_start", "scan_interval_minutes", "is_cross_margin", "show_in_competition", "btc_eth_leverage", "altcoin_leverage", "trading_symbols", "custom_prompt", "override_base_prompt", "system_prompt_template", "use_ai500", "use_oi_top"],
|
||||
"goal": "创建并初始化一个交易员。",
|
||||
"dynamic_rules": [
|
||||
"若用户提到的交易所、模型或策略已经存在且可用,应优先直接补入对应槽位,不要重新创建。",
|
||||
@@ -125,21 +120,21 @@
|
||||
"子任务成功后,系统会恢复当前交易员草稿并继续补齐剩余槽位。",
|
||||
"scan_interval_minutes 超出 3~60 时,自动收敛并告知用户。",
|
||||
"若用户明确想覆盖杠杆、币种范围或提示词,应允许在创建阶段一并收集 btc_eth_leverage、altcoin_leverage、trading_symbols、custom_prompt、override_base_prompt、system_prompt_template、use_ai500、use_oi_top。",
|
||||
"不要向用户收集或确认初始余额;创建时由系统自动读取绑定交易所账户净值作为初始余额。",
|
||||
"创建完成后询问用户是否立即启动(auto_start),启动前再次确认。"
|
||||
],
|
||||
"success_output": "返回 trader_id,并给出创建结果摘要(名称、绑定的交易所/模型/策略、是否已启动)。",
|
||||
"failure_output": "用人话指出缺失依赖项,或说明当前正在进入哪个依赖子任务。"
|
||||
},
|
||||
"update": {
|
||||
"description": "更新已有交易员的任意可编辑字段。",
|
||||
"description": "更新已有交易员,但默认只处理改名或换绑策略、交易所、模型。",
|
||||
"required_slots": ["target_ref"],
|
||||
"optional_slots": ["name", "exchange_id", "ai_model_id", "strategy_id", "scan_interval_minutes", "initial_balance", "is_cross_margin", "show_in_competition", "btc_eth_leverage", "altcoin_leverage", "trading_symbols", "custom_prompt", "override_base_prompt", "system_prompt_template", "use_ai500", "use_oi_top"],
|
||||
"goal": "更新一个已有交易员的配置,但只修改用户明确要求变更的字段。",
|
||||
"optional_slots": ["name", "exchange_id", "ai_model_id", "strategy_id"],
|
||||
"goal": "更新一个已有交易员的名称或绑定关系,但不改动策略、模型、交易所内部配置。",
|
||||
"dynamic_rules": [
|
||||
"只更新用户明确提到的字段,不要覆盖未提及的字段。",
|
||||
"换绑交易所/模型/策略时,新的资源必须已存在且已启用,否则提示用户先启用或新建。",
|
||||
"scan_interval_minutes 超出 3~60 时,自动收敛并告知用户。",
|
||||
"若用户修改的是交易员级杠杆、指定币对、提示词或选币来源,也应走 update,而不是误导去改策略。"
|
||||
"如果用户实际上是想修改策略参数、模型配置或交易所凭证,不要继续留在 trader update;应切到对应 management skill。"
|
||||
],
|
||||
"success_output": "返回更新后的 trader_id 与简短配置摘要,明确哪些字段已经生效。",
|
||||
"failure_output": "明确指出目标交易员不存在、依赖资源不可用,或哪一个字段值仍需用户补充/修正。"
|
||||
|
||||
Reference in New Issue
Block a user