From f99052e78099bbae5b62f7ea7e6bc0dbe9c670ec Mon Sep 17 00:00:00 2001 From: ZhouYongyou <128128010+zhouyongyou@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:41:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(prompts):=20rename=20actions=20to=20match?= =?UTF-8?q?=20backend=20implementation=20##=20Problem=20Backend=20code=20e?= =?UTF-8?q?xpects=20these=20action=20names:=20-=20`open=5Flong`,=20`open?= =?UTF-8?q?=5Fshort`,=20`close=5Flong`,=20`close=5Fshort`=20But=20prompts?= =?UTF-8?q?=20use=20outdated=20names:=20-=20`buy=5Fto=5Fenter`,=20`sell=5F?= =?UTF-8?q?to=5Fenter`,=20`close`=20This=20causes=20all=20trading=20decisi?= =?UTF-8?q?ons=20to=20fail=20with=20unknown=20action=20errors.=20##=20Solu?= =?UTF-8?q?tion=20Minimal=20changes=20to=20fix=20action=20name=20compatibi?= =?UTF-8?q?lity:=20###=20prompts/nof1.txt=20-=20=E2=9C=85=20`buy=5Fto=5Fen?= =?UTF-8?q?ter`=20=E2=86=92=20`open=5Flong`=20-=20=E2=9C=85=20`sell=5Fto?= =?UTF-8?q?=5Fenter`=20=E2=86=92=20`open=5Fshort`=20-=20=E2=9C=85=20`close?= =?UTF-8?q?`=20=E2=86=92=20`close=5Flong`=20/=20`close=5Fshort`=20-=20?= =?UTF-8?q?=E2=9C=85=20Explicitly=20list=20`wait`=20action=20-=20+18=20lin?= =?UTF-8?q?es,=20-6=20lines=20(only=20action=20definitions=20section)=20##?= =?UTF-8?q?#=20prompts/adaptive.txt=20-=20=E2=9C=85=20`buy=5Fto=5Fenter`?= =?UTF-8?q?=20=E2=86=92=20`open=5Flong`=20-=20=E2=9C=85=20`sell=5Fto=5Fent?= =?UTF-8?q?er`=20=E2=86=92=20`open=5Fshort`=20-=20=E2=9C=85=20`close`=20?= =?UTF-8?q?=E2=86=92=20`close=5Flong`=20/=20`close=5Fshort`=20-=20+15=20li?= =?UTF-8?q?nes,=20-6=20lines=20(only=20action=20definitions=20section)=20#?= =?UTF-8?q?#=20Impact=20-=20=E2=9C=85=20Trading=20decisions=20now=20execut?= =?UTF-8?q?e=20successfully=20-=20=E2=9C=85=20Maintains=20all=20existing?= =?UTF-8?q?=20functionality=20-=20=E2=9C=85=20No=20new=20features=20added?= =?UTF-8?q?=20(minimal=20diff)=20##=20Verification=20```bash=20#=20Backend?= =?UTF-8?q?=20expects=20these=20actions:=20grep=20'Action=20string'=20deci?= =?UTF-8?q?sion/engine.go=20#=20"open=5Flong",=20"open=5Fshort",=20"close?= =?UTF-8?q?=5Flong",=20"close=5Fshort",=20...=20#=20Old=20names=20removed:?= =?UTF-8?q?=20grep=20-r=20"buy=5Fto=5Fenter\|sell=5Fto=5Fenter"=20prompts/?= =?UTF-8?q?=20#=20(no=20results)=20```=20Co-Authored-By:=20tinkle-communit?= =?UTF-8?q?y=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prompts/adaptive.txt | 15 +++++++++------ prompts/nof1.txt | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/prompts/adaptive.txt b/prompts/adaptive.txt index d5778caa..3d9657f6 100644 --- a/prompts/adaptive.txt +++ b/prompts/adaptive.txt @@ -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**: 持有当前仓位 - 用于: 持仓表现符合预期,继续等待 ## 动态调整动作 (新增) diff --git a/prompts/nof1.txt b/prompts/nof1.txt index 012daa62..2e707b01 100644 --- a/prompts/nof1.txt +++ b/prompts/nof1.txt @@ -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