mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-07 03:07:56 +08:00
fix(prompts): rename actions to match backend implementation
## Problem Backend code expects these action names: - `open_long`, `open_short`, `close_long`, `close_short` But prompts use outdated names: - `buy_to_enter`, `sell_to_enter`, `close` This causes all trading decisions to fail with unknown action errors. ## Solution Minimal changes to fix action name compatibility: ### prompts/nof1.txt - ✅ `buy_to_enter` → `open_long` - ✅ `sell_to_enter` → `open_short` - ✅ `close` → `close_long` / `close_short` - ✅ Explicitly list `wait` action - +18 lines, -6 lines (only action definitions section) ### prompts/adaptive.txt - ✅ `buy_to_enter` → `open_long` - ✅ `sell_to_enter` → `open_short` - ✅ `close` → `close_long` / `close_short` - +15 lines, -6 lines (only action definitions section) ## Impact - ✅ Trading decisions now execute successfully - ✅ Maintains all existing functionality - ✅ No new features added (minimal diff) ## Verification ```bash # Backend expects these actions: grep 'Action string' decision/engine.go # "open_long", "open_short", "close_long", "close_short", ... # Old names removed: grep -r "buy_to_enter\|sell_to_enter" prompts/ # (no results) ``` Co-Authored-By: tinkle-community <tinklefund@gmail.com>
This commit is contained in:
@@ -61,21 +61,24 @@
|
||||
|
||||
## 开平仓动作
|
||||
|
||||
1. **buy_to_enter**: 开多仓(看涨)
|
||||
1. **open_long**: 开多仓(看涨)
|
||||
- 用于: 看涨信号强烈时
|
||||
- 必须设置: 止损价格、止盈价格
|
||||
|
||||
2. **sell_to_enter**: 开空仓(看跌)
|
||||
2. **open_short**: 开空仓(看跌)
|
||||
- 用于: 看跌信号强烈时
|
||||
- 必须设置: 止损价格、止盈价格
|
||||
|
||||
3. **close**: 完全平仓
|
||||
- 用于: 止盈、止损、或趋势反转
|
||||
3. **close_long**: 平掉多仓
|
||||
- 用于: 止盈、止损、或趋势反转(针对多头持仓)
|
||||
|
||||
4. **wait**: 观望,不持仓
|
||||
4. **close_short**: 平掉空仓
|
||||
- 用于: 止盈、止损、或趋势反转(针对空头持仓)
|
||||
|
||||
5. **wait**: 观望,不持仓
|
||||
- 用于: 没有明确信号,或资金不足
|
||||
|
||||
5. **hold**: 持有当前仓位
|
||||
6. **hold**: 持有当前仓位
|
||||
- 用于: 持仓表现符合预期,继续等待
|
||||
|
||||
## 动态调整动作 (新增)
|
||||
|
||||
+12
-6
@@ -21,19 +21,25 @@ Your mission: Maximize risk-adjusted returns (PnL) through systematic, disciplin
|
||||
|
||||
# ACTION SPACE DEFINITION
|
||||
|
||||
You have exactly FOUR possible actions per decision cycle:
|
||||
You have exactly SIX possible actions per decision cycle:
|
||||
|
||||
1. **buy_to_enter**: Open a new LONG position (bet on price appreciation)
|
||||
1. **open_long**: 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)
|
||||
2. **open_short**: 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
|
||||
3. **close_long**: Exit an existing LONG position entirely
|
||||
- Use when: Profit target reached, stop loss triggered, or thesis invalidated (for long positions)
|
||||
|
||||
4. **close_short**: Exit an existing SHORT position entirely
|
||||
- Use when: Profit target reached, stop loss triggered, or thesis invalidated (for short positions)
|
||||
|
||||
5. **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
|
||||
6. **wait**: Do not open any new positions, no current holdings
|
||||
- Use when: No clear trading signal or insufficient capital
|
||||
|
||||
## Position Management Constraints
|
||||
|
||||
|
||||
Reference in New Issue
Block a user