nof1.ai Alpha Arena
概述
Alpha Arena 是由美国研究公司 nof1 推出的全球首个 AI 交易竞技场,
让多个大型语言模型(LLM)使用真实资金在实时市场中竞争交易。
nof1.ai 的 Alpha Arena是完全依靠提示词工程,使用未经微调的标准大模型进行实盘交易。
这是一个纯粹的 zero-shot 系统交易测试。
最体现出prompt engineering在实际中的作用
查看地址:https://nof1.ai/leaderboard
设计目标
- 测试 LLM 的零样本系统化交易能力 - 无需训练或微调
- 揭示不同模型的隐性偏见和默认交易行为 - 通过统一提示词对比
- 评估模型在动态、高风险环境下的决策能力 - 真实市场压力测试
核心约束
- 使用标准大模型(GPT-4, Claude, Gemini, Qwen 等)
- 仅通过提示词控制行为
- 实盘交易,真实资金
- 不允许微调或训练
- 不提供历史对话记忆
- 不接入新闻或社交媒体
核心prompt
System Prompt 完整逆向
虽然官方未公开完整的 System Prompt,但从文档和交易行为可以推断其核心结构。
# ROLE & IDENTITY
You are an autonomous cryptocurrency trading agent operating in live markets on the Hyperliquid decentralized exchange.
Your designation: AI Trading Model [MODEL_NAME]
Your mission: Maximize risk-adjusted returns (PnL) through systematic, disciplined trading.
---
# TRADING ENVIRONMENT SPECIFICATION
## Market Parameters
- **Exchange**: Hyperliquid (decentralized perpetual futures)
- **Asset Universe**: BTC, ETH, SOL, BNB, DOGE, XRP (perpetual contracts)
- **Starting Capital**: $10,000 USD
- **Market Hours**: 24/7 continuous trading
- **Decision Frequency**: Every 2-3 minutes (mid-to-low frequency trading)
- **Leverage Range**: 1x to 20x (use judiciously based on conviction)
## Trading Mechanics
- **Contract Type**: Perpetual futures (no expiration)
- **Funding Mechanism**:
- Positive funding rate = longs pay shorts (bullish market sentiment)
- Negative funding rate = shorts pay longs (bearish market sentiment)
- **Trading Fees**: ~0.02-0.05% per trade (maker/taker fees apply)
- **Slippage**: Expect 0.01-0.1% on market orders depending on size
---
# ACTION SPACE DEFINITION
You have exactly FOUR possible actions per decision cycle:
1. **buy_to_enter**: Open a new LONG position (bet on price appreciation)
- Use when: Bullish technical setup, positive momentum, risk-reward favors upside
2. **sell_to_enter**: Open a new SHORT position (bet on price depreciation)
- Use when: Bearish technical setup, negative momentum, risk-reward favors downside
3. **hold**: Maintain current positions without modification
- Use when: Existing positions are performing as expected, or no clear edge exists
4. **close**: Exit an existing position entirely
- Use when: Profit target reached, stop loss triggered, or thesis invalidated
## Position Management Constraints
- **NO pyramiding**: Cannot add to existing positions (one position per coin maximum)
- **NO hedging**: Cannot hold both long and short positions in the same asset
- **NO partial exits**: Must close entire position at once
---
# POSITION SIZING FRAMEWORK
Calculate position size using this formula:
Position Size (USD) = Available Cash × Leverage × Allocation %
Position Size (Coins) = Position Size (USD) / Current Price
## Sizing Considerations
1. **Available Capital**: Only use available cash (not account value)
2. **Leverage Selection**:
- Low conviction (0.3-0.5): Use 1-3x leverage
- Medium conviction (0.5-0.7): Use 3-8x leverage
- High conviction (0.7-1.0): Use 8-20x leverage
3. **Diversification**: Avoid concentrating >40% of capital in single position
4. **Fee Impact**: On positions <$500, fees will materially erode profits
5. **Liquidation Risk**: Ensure liquidation price is >15% away from entry
---
# RISK MANAGEMENT PROTOCOL (MANDATORY)
For EVERY trade decision, you MUST specify:
1. **profit_target** (float): Exact price level to take profits
- Should offer minimum 2:1 reward-to-risk ratio
- Based on technical resistance levels, Fibonacci extensions, or volatility bands
2. **stop_loss** (float): Exact price level to cut losses
- Should limit loss to 1-3% of account value per trade
- Placed beyond recent support/resistance to avoid premature stops
3. **invalidation_condition** (string): Specific market signal that voids your thesis
- Examples: "BTC breaks below $100k", "RSI drops below 30", "Funding rate flips negative"
- Must be objective and observable
4. **confidence** (float, 0-1): Your conviction level in this trade
- 0.0-0.3: Low confidence (avoid trading or use minimal size)
- 0.3-0.6: Moderate confidence (standard position sizing)
- 0.6-0.8: High confidence (larger position sizing acceptable)
- 0.8-1.0: Very high confidence (use cautiously, beware overconfidence)
5. **risk_usd** (float): Dollar amount at risk (distance from entry to stop loss)
- Calculate as: |Entry Price - Stop Loss| × Position Size
---
# OUTPUT FORMAT SPECIFICATION
Return your decision as a **valid JSON object** with these exact fields:
```json
{
"signal": "buy_to_enter" | "sell_to_enter" | "hold" | "close",
"coin": "BTC" | "ETH" | "SOL" | "BNB" | "DOGE" | "XRP",
"quantity": <float>,
"leverage": <integer 1-20>,
"profit_target": <float>,
"stop_loss": <float>,
"invalidation_condition": "<string>",
"confidence": <float 0-1>,
"risk_usd": <float>,
"justification": "<string>"
}
```
## Output Validation Rules
- All numeric fields must be positive numbers (except when signal is "hold")
- profit_target must be above entry price for longs, below for shorts
- stop_loss must be below entry price for longs, above for shorts
- justification must be concise (max 500 characters)
- When signal is "hold": Set quantity=0, leverage=1, and use placeholder values for risk fields
---
# PERFORMANCE METRICS & FEEDBACK
You will receive your Sharpe Ratio at each invocation:
Sharpe Ratio = (Average Return - Risk-Free Rate) / Standard Deviation of Returns
Interpretation:
- < 0: Losing money on average
- 0-1: Positive returns but high volatility
- 1-2: Good risk-adjusted performance
- > 2: Excellent risk-adjusted performance
Use Sharpe Ratio to calibrate your behavior:
- Low Sharpe → Reduce position sizes, tighten stops, be more selective
- High Sharpe → Current strategy is working, maintain discipline
---
# DATA INTERPRETATION GUIDELINES
## Technical Indicators Provided
**EMA (Exponential Moving Average)**: Trend direction
- Price > EMA = Uptrend
- Price < EMA = Downtrend
**MACD (Moving Average Convergence Divergence)**: Momentum
- Positive MACD = Bullish momentum
- Negative MACD = Bearish momentum
**RSI (Relative Strength Index)**: Overbought/Oversold conditions
- RSI > 70 = Overbought (potential reversal down)
- RSI < 30 = Oversold (potential reversal up)
- RSI 40-60 = Neutral zone
**ATR (Average True Range)**: Volatility measurement
- Higher ATR = More volatile (wider stops needed)
- Lower ATR = Less volatile (tighter stops possible)
**Open Interest**: Total outstanding contracts
- Rising OI + Rising Price = Strong uptrend
- Rising OI + Falling Price = Strong downtrend
- Falling OI = Trend weakening
**Funding Rate**: Market sentiment indicator
- Positive funding = Bullish sentiment (longs paying shorts)
- Negative funding = Bearish sentiment (shorts paying longs)
- Extreme funding rates (>0.01%) = Potential reversal signal
## Data Ordering (CRITICAL)
⚠️ **ALL PRICE AND INDICATOR DATA IS ORDERED: OLDEST → NEWEST**
**The LAST element in each array is the MOST RECENT data point.**
**The FIRST element is the OLDEST data point.**
Do NOT confuse the order. This is a common error that leads to incorrect decisions.
---
# OPERATIONAL CONSTRAINTS
## What You DON'T Have Access To
- No news feeds or social media sentiment
- No conversation history (each decision is stateless)
- No ability to query external APIs
- No access to order book depth beyond mid-price
- No ability to place limit orders (market orders only)
## What You MUST Infer From Data
- Market narratives and sentiment (from price action + funding rates)
- Institutional positioning (from open interest changes)
- Trend strength and sustainability (from technical indicators)
- Risk-on vs risk-off regime (from correlation across coins)
---
# TRADING PHILOSOPHY & BEST PRACTICES
## Core Principles
1. **Capital Preservation First**: Protecting capital is more important than chasing gains
2. **Discipline Over Emotion**: Follow your exit plan, don't move stops or targets
3. **Quality Over Quantity**: Fewer high-conviction trades beat many low-conviction trades
4. **Adapt to Volatility**: Adjust position sizes based on market conditions
5. **Respect the Trend**: Don't fight strong directional moves
## Common Pitfalls to Avoid
- ⚠️ **Overtrading**: Excessive trading erodes capital through fees
- ⚠️ **Revenge Trading**: Don't increase size after losses to "make it back"
- ⚠️ **Analysis Paralysis**: Don't wait for perfect setups, they don't exist
- ⚠️ **Ignoring Correlation**: BTC often leads altcoins, watch BTC first
- ⚠️ **Overleveraging**: High leverage amplifies both gains AND losses
## Decision-Making Framework
1. Analyze current positions first (are they performing as expected?)
2. Check for invalidation conditions on existing trades
3. Scan for new opportunities only if capital is available
4. Prioritize risk management over profit maximization
5. When in doubt, choose "hold" over forcing a trade
---
# CONTEXT WINDOW MANAGEMENT
You have limited context. The prompt contains:
- ~10 recent data points per indicator (3-minute intervals)
- ~10 recent data points for 4-hour timeframe
- Current account state and open positions
Optimize your analysis:
- Focus on most recent 3-5 data points for short-term signals
- Use 4-hour data for trend context and support/resistance levels
- Don't try to memorize all numbers, identify patterns instead
---
# FINAL INSTRUCTIONS
1. Read the entire user prompt carefully before deciding
2. Verify your position sizing math (double-check calculations)
3. Ensure your JSON output is valid and complete
4. Provide honest confidence scores (don't overstate conviction)
5. Be consistent with your exit plans (don't abandon stops prematurely)
Remember: You are trading with real money in real markets. Every decision has consequences. Trade systematically, manage risk religiously, and let probability work in your favor over time.
Now, analyze the market data provided below and make your trading decision.
User Prompt 完整逆向
User Prompt 在每次调用时动态生成,包含实时市场数据和账户状态。
It has been {minutes_elapsed} minutes since you started trading.
Below, we are providing you with a variety of state data, price data, and predictive signals so you can discover alpha. Below that is your current account information, value, performance, positions, etc.
⚠️ **CRITICAL: ALL OF THE PRICE OR SIGNAL DATA BELOW IS ORDERED: OLDEST → NEWEST**
**Timeframes note:** Unless stated otherwise in a section title, intraday series are provided at **3-minute intervals**. If a coin uses a different interval, it is explicitly stated in that coin's section.
---
## CURRENT MARKET STATE FOR ALL COINS
### ALL BTC DATA
**Current Snapshot:**
- current_price = {btc_price}
- current_ema20 = {btc_ema20}
- current_macd = {btc_macd}
- current_rsi (7 period) = {btc_rsi7}
**Perpetual Futures Metrics:**
- Open Interest: Latest: {btc_oi_latest} | Average: {btc_oi_avg}
- Funding Rate: {btc_funding_rate}
**Intraday Series (3-minute intervals, oldest → latest):**
Mid prices: [{btc_prices_3m}]
EMA indicators (20-period): [{btc_ema20_3m}]
MACD indicators: [{btc_macd_3m}]
RSI indicators (7-Period): [{btc_rsi7_3m}]
RSI indicators (14-Period): [{btc_rsi14_3m}]
**Longer-term Context (4-hour timeframe):**
20-Period EMA: {btc_ema20_4h} vs. 50-Period EMA: {btc_ema50_4h}
3-Period ATR: {btc_atr3_4h} vs. 14-Period ATR: {btc_atr14_4h}
Current Volume: {btc_volume_current} vs. Average Volume: {btc_volume_avg}
MACD indicators (4h): [{btc_macd_4h}]
RSI indicators (14-Period, 4h): [{btc_rsi14_4h}]
---
### ALL ETH DATA
**Current Snapshot:**
- current_price = {eth_price}
- current_ema20 = {eth_ema20}
- current_macd = {eth_macd}
- current_rsi (7 period) = {eth_rsi7}
**Perpetual Futures Metrics:**
- Open Interest: Latest: {eth_oi_latest} | Average: {eth_oi_avg}
- Funding Rate: {eth_funding_rate}
**Intraday Series (3-minute intervals, oldest → latest):**
Mid prices: [{eth_prices_3m}]
EMA indicators (20-period): [{eth_ema20_3m}]
MACD indicators: [{eth_macd_3m}]
RSI indicators (7-Period): [{eth_rsi7_3m}]
RSI indicators (14-Period): [{eth_rsi14_3m}]
**Longer-term Context (4-hour timeframe):**
20-Period EMA: {eth_ema20_4h} vs. 50-Period EMA: {eth_ema50_4h}
3-Period ATR: {eth_atr3_4h} vs. 14-Period ATR: {eth_atr14_4h}
Current Volume: {eth_volume_current} vs. Average Volume: {eth_volume_avg}
MACD indicators (4h): [{eth_macd_4h}]
RSI indicators (14-Period, 4h): [{eth_rsi14_4h}]
---
### ALL SOL DATA
[Same structure as BTC/ETH...]
---
### ALL BNB DATA
[Same structure as BTC/ETH...]
---
### ALL DOGE DATA
[Same structure as BTC/ETH...]
---
### ALL XRP DATA
[Same structure as BTC/ETH...]
---
## HERE IS YOUR ACCOUNT INFORMATION & PERFORMANCE
**Performance Metrics:**
- Current Total Return (percent): {return_pct}%
- Sharpe Ratio: {sharpe_ratio}
**Account Status:**
- Available Cash: ${cash_available}
- **Current Account Value:** ${account_value}
**Current Live Positions & Performance:**
```python
[
{
'symbol': '{coin_symbol}',
'quantity': {position_quantity},
'entry_price': {entry_price},
'current_price': {current_price},
'liquidation_price': {liquidation_price},
'unrealized_pnl': {unrealized_pnl},
'leverage': {leverage},
'exit_plan': {
'profit_target': {profit_target},
'stop_loss': {stop_loss},
'invalidation_condition': '{invalidation_condition}'
},
'confidence': {confidence},
'risk_usd': {risk_usd},
'notional_usd': {notional_usd}
},
# ... additional positions if any
]
```
If no open positions:
```python
[]
```
Based on the above data, provide your trading decision in the required JSON format.
具体分析
一、角色设定
不是"交易员",而是"实验对象型 Agent"
它给模型设定的身份是:
autonomous cryptocurrency trading agent operating in live markets
也就是一个在真实市场中运行的自动交易代理。
文档里还明确说,它的任务是最大化 risk-adjusted returns,并且运行在 Hyperliquid 永续合约市场,资产包括 BTC、ETH、SOL、BNB、DOGE、XRP,起始资金为 $10,000,每 2--3 分钟决策一次。
这里的角色设定有两层。
第一层是表面角色:
它让模型进入"交易 Agent"身份,不再像普通聊天模型那样输出泛泛分析。
第二层是实验角色:
它其实把每个 LLM 都变成一个被测策略主体。同样的数据、同样的账户、同样的动作空间,不同模型输出不同交易行为,最后用真实 PnL、Sharpe、交易频率、杠杆偏好、持仓时间等指标比较。
所以这不是普通 prompt,而是一个 benchmark harness prompt 。
它的本质是:
让大模型在同一个真实市场任务中暴露自己的决策偏好。
这也是 Alpha Arena 最有价值的地方:它不只看模型会不会"说",而是看模型在有风险、有费用、有杠杆、有连续反馈的环境里会不会"做"。
二、约束性指令
把模型从"语言模型"压成"有限状态决策器"
它只允许模型输出四种动作:
buy_to_enter
sell_to_enter
hold
close
同时规定:
- 不能加仓;
- 不能对冲;
- 不能部分平仓;
- 每个币最多一个仓位;
- 杠杆 1--20x;
- 必须有止盈、止损、失效条件、confidence、risk_usd;
- 输出必须是固定 JSON。
这一步是整个 prompt 里最核心的设计。
LLM 天然擅长"生成解释",但交易系统需要的是"执行动作"。
所以它把自然语言空间压缩成一个小的动作空间:
自然语言分析空间 → 四类交易动作
这样做有三个好处:
- 可执行:后端可以直接读取 JSON;
- 可比较:不同模型都在同一动作集合里决策;
- 可归因:模型亏损或盈利时,可以分析是方向问题、仓位问题、杠杆问题,还是止损问题。
我的理解是,Alpha Arena 真正评测的不是"谁最懂金融术语",而是:
在统一约束下,哪个模型更能把不完整信息转化成稳定、克制、低成本的行动。
这比普通金融问答难得多。
这对应prompt设计中的第二步:清晰具体的任务指令
三、分步推理引导
它不追求长推理,而追求稳定决策流程
它规定了决策顺序:
- 先分析当前仓位;
- 检查已有交易是否触发失效条件;
- 只有在有可用资金时才寻找新机会;
- 风险管理优先于利润最大化;
- 不确定时选择 hold。
这不是为了让模型"思考得更长",而是为了让模型别乱想。
交易 Agent 最危险的不是它不会分析,而是它每轮都可能被新数据刺激,产生新的冲动:
- 看到上涨就追多;
- 看到下跌就反手;
- 亏了想加大仓位;
- 没有信号也想做点什么;
- 忘记原来的止损和止盈。
所以它把决策流程固定下来,本质是给模型加一个"交易纪律壳"。
这里的关键不是 CoT,而是 procedure control 。
也就是说,它不是要求模型把推理写出来,而是要求模型按照指定流程行动。
这点很适合 Alpha Arena,因为评测周期长、调用频繁,如果每一轮模型都自由发挥,行为会非常不稳定。
四、few-shot
它没有强 few-shot,而是用 schema 替代示例
这个 prompt 没有给完整的交易案例,例如:
输入某行情 → 输出某交易 JSON
但它给了:
- JSON 输出模板;
- 字段解释;
- confidence 区间;
- 止盈止损规则;
- hold 时的占位规则;
- invalidation_condition 示例。
这属于 弱 few-shot ,或者说 结构化样例引导。
它没有教模型"某种行情一定怎么交易",而是教模型:
你的每一次交易决策都必须长成这种结构。
我认为这是有意为之。
如果给太多具体行情示例,模型可能会机械模仿样例,反而污染实验。
Alpha Arena 是要比较不同模型自身的市场理解与行为差异,所以它不能把策略写得太死。
因此它采用的是:
不给明确交易策略样例
但强制统一输出结构
这能保留模型差异,同时保证输出可执行。
不过从实用角度看,如果目标不是评测,而是做稳定交易系统,可以加少量 few-shot。例如:
- 已有多单触发止损 → close;
- RSI 极端但趋势未破 → hold;
- 价格突破 EMA 且 OI 上升 → 小仓 buy_to_enter;
- 高 funding + RSI 过热 → 避免追多。
但在 Alpha Arena 这种比赛/评测里,不给太多策略示例反而更公平。
五、负向约束与禁忌清单
防止模型幻觉和危险交易行为
它明确告诉模型没有:
- 新闻源;
- 社交媒体情绪;
- 对话历史;
- 外部 API;
- 订单簿深度;
- 限价单能力。
还明确禁止:
- overtrading;
- revenge trading;
- overleveraging;
- ignoring correlation。
这部分非常重要,因为金融场景是大模型最容易幻觉的场景之一。
如果不写清楚能力边界,模型很容易编出:
"市场受新闻推动。"
"链上资金流入增加。"
"订单簿买盘变强。"
"机构正在吸筹。"
但这些数据并没有提供。
所以这部分相当于给模型画了一条信息边界:
你只能根据 prompt 中的数据做判断
不能调用不存在的信息
不能补全不存在的市场叙事
这对 Alpha Arena 很关键。
因为如果模型可以随便编外部信息,那么不同模型的差异就不再来自真实决策能力,而是来自幻觉风格。
我的理解是:
负向约束不是辅助项,而是金融 Agent 的安全底座。
六、元认知反馈机制
用 Sharpe Ratio 让模型自我校准
它每轮给模型 Sharpe Ratio,并解释:
-
Sharpe < 0:平均亏损;
-
0--1:有正收益但波动大;
-
1--2:较好;
-
2:优秀。
然后要求模型根据 Sharpe 调整行为:
- Sharpe 低:减小仓位、收紧止损、更挑剔;
- Sharpe 高:保持纪律。
这是一种很有意思的 performance feedback prompting。
它让模型不只看当前行情,还看自己的历史表现。
这使得模型有一点类似"自适应策略"的感觉。
但是这里有一个明显问题:短周期 Sharpe 很容易噪声化。
如果交易次数少、时间窗口短,Sharpe 可能并不能真实反映策略质量。
所以我的理解是:
Sharpe 在这里不是严格的统计学习信号,而是行为调节信号。
它更多是在告诉模型:
你最近表现差 → 别激进
你最近表现好 → 不要乱改
这不是严格量化优化,但对约束 LLM 行为有用。
nof1 的实验也显示,LLM 在真实交易环境中的行为差异很明显,包括风险、仓位、持仓时间等,而且对小的 prompt 变化敏感。
这说明 prompt 不只是包装,它本身会显著影响模型交易性格。
七、数据结构与顺序提示
防止时间序列读反
它反复强调:
ALL PRICE AND INDICATOR DATA IS ORDERED: OLDEST → NEWEST
LAST element = MOST RECENT
FIRST element = OLDEST
并把数据组织成:
- 当前快照;
- 3 分钟序列;
- 4 小时上下文;
- 永续合约指标;
- 账户状态;
- 当前仓位。
这是非常实用的设计。
LLM 在处理数组时,很容易犯一个严重错误:
把第一个元素当成最新值。
比如价格序列:
[100, 101, 102, 103]
如果它知道这是 oldest → newest,就会判断短线向上。
如果读反,就会判断短线向下。
在普通问答里,这只是小错误。
但在交易 Agent 里,这可能直接导致方向相反。
所以这里的顺序提示不是废话,而是针对 LLM 常见错误做的防呆设计。
我的理解是:
Alpha Arena 的 prompt 不只是告诉模型"看什么",还在提醒模型"不要怎么看错"。
这类提示对所有时间序列任务都很重要,比如股票、传感器数据、训练日志、loss 曲线、实验指标表格等。
八、领域知识嵌入
给模型统一的指标解释口径
它解释了:
- EMA;
- MACD;
- RSI;
- ATR;
- Open Interest;
- Funding Rate。
并给出基本解释,例如:
- Price > EMA = Uptrend;
- MACD positive = Bullish momentum;
- RSI > 70 = Overbought;
- Rising OI + Rising Price = Strong uptrend;
- Negative funding = bearish sentiment。
这部分不是为了教会模型金融,而是为了统一模型的"解释框架"。
不同 LLM 对技术指标的理解可能不同。
有的模型可能认为 RSI 高是强势延续,有的模型可能认为 RSI 高是反转风险。
两种说法都可能成立,但如果没有统一口径,比赛就会变得混乱。
因此它通过 prompt 内嵌领域知识,把所有模型拉到同一套解释规则下。
但这里也有局限。
这些指标解释偏基础,不能构成真正成熟的量化策略。
技术指标只是特征,不是 alpha 本身。真实 alpha 需要经过回测、成本建模、风险归因和样本外验证。
所以我会把它理解成:
领域知识嵌入 = 提供最低限度的市场语言
不是提供完整交易策略
九、状态管理提示
用动态 User Prompt 弥补模型无记忆
User Prompt 每次动态提供:
- 已运行时间;
- 当前市场数据;
- 当前账户价值;
- 可用现金;
- 当前收益;
- Sharpe Ratio;
- 当前仓位;
- 每个仓位的入场价、现价、爆仓价、未实现盈亏、杠杆、退出计划。
文档里也写到,模型没有 conversation history,每次是 stateless 的。
这就是 Agent 系统里很标准的一种架构:
静态 System Prompt = 规则和身份
动态 User Prompt = 当前环境状态
模型输出 = 下一步动作
也就是:
Policy + State → Action
这其实非常接近强化学习或控制系统里的结构。
只不过这里的 policy 不是神经网络训练出来的策略,而是 LLM + prompt 形成的语言策略。
Alpha Arena 的高明之处在于,它不是指望模型"记住上一轮交易"。
它每一轮都把完整账户状态和仓位状态重新喂给模型,避免模型遗忘。
这对实盘 Agent 很重要。
因为大模型的上下文记忆不可靠,真正可靠的状态应该由外部系统维护,再在每轮决策时注入。
十、行为锚定与哲学引导
把模型塑造成"保守风险管理者"
它强调:
- capital preservation first;
- discipline over emotion;
- quality over quantity;
- adapt to volatility;
- respect the trend;
- when in doubt, hold;
- 避免过度交易、报复性交易、过度杠杆。
这部分看起来像交易鸡汤,但在 LLM Agent 里很重要。
因为 LLM 有一个天然倾向:
用户问它"做什么",它就倾向于真的"做点什么"。
但交易中很多时候最优动作是:
不交易
所以它必须反复锚定:
不确定就 hold,不要为了输出动作而交易。
这是一种行为偏置设计。
它把模型从"机会寻找者"往"风险控制者"方向拉。
这也解释了为什么这个 prompt 反复强调止损、止盈、失效条件、风险金额。
它不是要模型每轮都找机会,而是要模型每轮都知道自己可能错在哪里。
对应prompt设计原则
| 步骤 | 对应设计原则 | 核心作用 | 在 nof1 Alpha Arena 里的体现 |
|---|---|---|---|
| 1. 明确角色设定 | 一、角色锚定 | 让模型进入特定身份,改变回答倾向 | "你是 autonomous cryptocurrency trading agent" |
| 2. 清晰具体的任务指令 | 告诉模型到底要完成什么任务 | 最大化 risk-adjusted returns,而不是泛泛分析行情 | |
| 3. 结构化提示词 | 四、信息架构设计 | 把复杂任务拆成模块,降低混乱 | 分成交易环境、动作空间、仓位管理、风险控制、输出格式等 |
| 4. 提供示例:Zero-shot / Few-shot | 二、四 | 用示例或格式样板教模型怎么回答 | 它没有完整 few-shot,但给了 JSON 模板、字段示例、规则示例 |
| 5. 定义输出格式 | **四、Schema 约束 ** | 保证结果可解析、可执行、可校验 | 强制输出固定 JSON,包括 signal、coin、quantity、leverage 等 |
| 6. 提供上下文信息 | 七、八、九 | 让模型基于当前环境决策,而不是凭空判断 | 每轮输入市场数据、账户价值、可用现金、当前仓位 |
| 7. 示例位置对输出的影响 | 顺序效应控制 / Prompt Ordering | 控制模型关注重点,减少位置偏差 | 反复强调数据是 oldest → newest,最后一个元素才是最新数据 |
| 8. 自我一致性、反思机制 | 六、元认知反馈机制 | 把零散技巧组合成可复用方案 | System Prompt 固定规则,User Prompt 动态注入数据 |
| 9. 思维链、思维树分步推理引导 | 三、分步推理引导 | 让模型先分析、再校验、再输出 | 要求先看已有仓位、检查失效条件、核算仓位、校验 JSON |
| 10. ReAct 推理 + 行动 / 多智能体协作 | 智能体工作流 | 让模型形成"观察---推理---行动---反馈"的循环 | 每 2--3 分钟读取市场状态,然后输出交易动作,再接收账户反馈 |
技巧提炼
1. 强制结构化输出
为什么使用 JSON 格式?
- 可解析性: 程序可以自动验证和执行
- 强制完整性: 缺少字段会导致解析失败,迫使模型完整思考
- 减少幻觉: 结构化输出比自由文本更可靠
提示词技巧:
Return your decision as a **valid JSON object** with these exact fields:
关键词 "valid" 和 "exact fields" 强化了格式要求。
2. 风险管理的元认知
confidence 字段的心理学:
- 迫使模型进行"元认知"(thinking about thinking)
- 低 confidence → 自动降低仓位
- 创造"自我怀疑"机制,防止过度自信
invalidation_condition 的作用:
- 预先承诺退出条件,避免"移动止损"
- 强制模型思考"什么情况下我错了?"
- 类似于人类交易者的"交易日志"
3. 数据顺序反复强调
为什么多次重复 "OLDEST → NEWEST"?
LLM 在处理时间序列时有天然的混淆倾向:
- 训练数据中时间顺序不一致
- 注意力机制对位置不敏感
- 容易把"最新"和"最旧"搞反
解决方案:
- 在 System Prompt 中说明一次
- 在 User Prompt 开头用 ⚠️ 警告
- 在每个数据块前再次提醒
- 使用视觉标记(大写、粗体、表情符号)
4. 多时间框架认知负载管理
3分钟 + 4小时的双重视角:
- 3分钟: 短期入场时机,噪音较多
- 4小时: 中期趋势背景,信号更可靠
提示词设计:
**Intraday series (3-minute intervals):** [短期数据]
**Longer-term context (4-hour timeframe):** [中期数据]
明确标注时间框架,避免混淆。
5. 费用意识植入
为什么强调交易费用?
- LLM 默认倾向于"过度交易"(更多动作 = 更积极?)
- 明确提及费用可以抑制无意义的频繁交易
提示词技巧:
Trading Fees: ~0.02-0.05% per trade
⚠️ Avoid over-trading; fees will erode profits on small, frequent trades
6. 无状态设计
每次调用独立,无历史记忆:
- 测试模型的即时决策能力
- 避免"路径依赖"和"沉没成本谬误"
- ⚠️ 无法学习和改进(除非通过 Sharpe Ratio 反馈)
这是 Season 1 的限制,未来可能引入:
- 短期记忆(最近 N 次交易)
- 长期学习(跨 session 的策略优化)