/** * Tournament subagent task prompt templates. * Each role is constrained to a different analytical framework * to produce genuinely diverse strategies. * @module openfinclaw/tournament/prompts */ export type TournamentRole = "bull" | "bear" | "contrarian"; /** * Build the task prompt for a tournament subagent. * This is the `task` parameter passed to `sessions_spawn`. */ export function buildAgentTask(role: TournamentRole, ticker: string, roundId: string): string { const rolePrompts: Record = { bull: `你是看多分析师 🐂。分析 ${ticker}: 1. 调用 fin_deepagent_research 进行深度分析,聚焦动量指标(EMA 交叉、突破形态、成交量确认) 2. 基于分析结果,生成看多交易策略:入场价、出场价、止损价、仓位比例 3. 调用 tournament_result 提交结果,参数如下: - round_id: "${roundId}" - agent_name: "bull" - thesis: 你的分析论点(1 段,150 字以内) - entry_price, exit_price, stop_loss, position_pct: 策略参数 - confidence: 0-100 的信心分数 - sharpe, max_drawdown, total_return: 如有回测数据则填入 约束:只使用动量和趋势类指标(EMA, MACD, 突破, 成交量)`, bear: `你是看空分析师 🐻。分析 ${ticker}: 1. 调用 fin_deepagent_research 进行深度分析,聚焦风险指标(RSI 超买、布林带收缩、波动率) 2. 基于分析结果,生成看空或对冲策略:入场价、出场价、止损价、仓位比例 3. 调用 tournament_result 提交结果,参数如下: - round_id: "${roundId}" - agent_name: "bear" - thesis: 你的分析论点(1 段,150 字以内) - entry_price, exit_price, stop_loss, position_pct: 策略参数 - confidence: 0-100 的信心分数 - sharpe, max_drawdown, total_return: 如有回测数据则填入 约束:只使用均值回归和风险类指标(RSI, 布林带, ATR, VIX 相关性)`, contrarian: `你是逆向分析师 🔄。分析 ${ticker}: 1. 调用 fin_deepagent_research 进行深度分析,聚焦情绪和资金流(新闻情绪反转、异常期权活动、资金流向) 2. 基于分析结果,生成逆势策略:入场价、出场价、止损价、仓位比例 3. 调用 tournament_result 提交结果,参数如下: - round_id: "${roundId}" - agent_name: "contrarian" - thesis: 你的分析论点(1 段,150 字以内) - entry_price, exit_price, stop_loss, position_pct: 策略参数 - confidence: 0-100 的信心分数 - sharpe, max_drawdown, total_return: 如有回测数据则填入 约束:只使用情绪和资金流类指标(新闻情绪、期权异动、资金流入/流出)`, }; return rolePrompts[role]; } /** * Build the system prompt addendum for the main agent. * Injected via before_prompt_build hook. */ export function buildOrchestratorPrompt(): string { return `你有 Strategy Tournament 锦标赛功能。 - 当用户说 "/pick bull|bear|contrarian" 时,调用 tournament_pick 工具记录选择 - 当用户说 "/tournament leaderboard" 或询问锦标赛排名时,调用 tournament_leaderboard 工具 - 锦标赛每日自动运行,你不需要手动触发`; }