diff --git a/decision/engine.go b/decision/engine.go index 6672f339..2f96a15e 100644 --- a/decision/engine.go +++ b/decision/engine.go @@ -404,15 +404,15 @@ func buildSystemPrompt(accountEquity float64, btcEthLeverage, altcoinLeverage in sb.WriteString("\n") sb.WriteString("第二步: JSON决策数组\n\n") sb.WriteString("```json\n[\n") - sb.WriteString(fmt.Sprintf(" {\"symbol\": \"BTCUSDT\", \"action\": \"open_short\", \"leverage\": %d, \"position_size_usd\": %.0f, \"stop_loss\": 97000, \"take_profit\": 91000, \"confidence\": 85, \"risk_usd\": 300, \"reasoning\": \"下跌趋势+MACD死叉\"},\n", btcEthLeverage, accountEquity*5)) - sb.WriteString(" {\"symbol\": \"SOLUSDT\", \"action\": \"update_stop_loss\", \"new_stop_loss\": 155, \"reasoning\": \"移动止损至保本位\"},\n") - sb.WriteString(" {\"symbol\": \"ETHUSDT\", \"action\": \"close_long\", \"reasoning\": \"止盈离场\"}\n") + sb.WriteString(fmt.Sprintf(" {\"symbol\": \"BTCUSDT\", \"action\": \"open_short\", \"leverage\": %d, \"position_size_usd\": %.0f, \"stop_loss\": 97000, \"take_profit\": 91000, \"confidence\": 85, \"risk_usd\": 300},\n", btcEthLeverage, accountEquity*5)) + sb.WriteString(" {\"symbol\": \"SOLUSDT\", \"action\": \"update_stop_loss\", \"new_stop_loss\": 155},\n") + sb.WriteString(" {\"symbol\": \"ETHUSDT\", \"action\": \"close_long\"}\n") sb.WriteString("]\n```\n") sb.WriteString("\n\n") sb.WriteString("## 字段说明\n\n") sb.WriteString("- `action`: open_long | open_short | close_long | close_short | update_stop_loss | update_take_profit | partial_close | hold | wait\n") sb.WriteString("- `confidence`: 0-100(开仓建议≥75)\n") - sb.WriteString("- 开仓时必填: leverage, position_size_usd, stop_loss, take_profit, confidence, risk_usd, reasoning\n") + sb.WriteString("- 开仓时必填: leverage, position_size_usd, stop_loss, take_profit, confidence, risk_usd\n") sb.WriteString("- update_stop_loss 时必填: new_stop_loss (注意是 new_stop_loss,不是 stop_loss)\n") sb.WriteString("- update_take_profit 时必填: new_take_profit (注意是 new_take_profit,不是 take_profit)\n") sb.WriteString("- partial_close 时必填: close_percentage (0-100)\n\n") diff --git a/docs/prompt-guide.md b/docs/prompt-guide.md index fb232070..71c7b34b 100644 --- a/docs/prompt-guide.md +++ b/docs/prompt-guide.md @@ -153,8 +153,7 @@ BTC broke support, MACD death cross, volume increased... "position_size_usd": 5000, "stop_loss": 97000, "take_profit": 91000, - "confidence": 85, - "reasoning": "Bearish technical turn" + "confidence": 85 } ] ``` @@ -462,8 +461,7 @@ Your analysis... "stop_loss": 97000, "take_profit": 91000, "confidence": 85, - "risk_usd": 300, - "reasoning": "Bearish technical" + "risk_usd": 300 } ] ``` @@ -500,14 +498,14 @@ Your analysis... { "symbol": "BTCUSDT", "action": "open_long", // Open long - "reasoning": "This is a great long opportunity because..." // Too long + "confidence": 80 // Only necessary fields } // Correct { "symbol": "BTCUSDT", "action": "open_long", - "reasoning": "MACD golden cross + volume surge" + "confidence": 85 } ``` diff --git a/docs/prompt-guide.zh-CN.md b/docs/prompt-guide.zh-CN.md index a853a92f..f9f22328 100644 --- a/docs/prompt-guide.zh-CN.md +++ b/docs/prompt-guide.zh-CN.md @@ -153,8 +153,7 @@ BTC 跌破支撑位,MACD 死叉,成交量放大... "position_size_usd": 5000, "stop_loss": 97000, "take_profit": 91000, - "confidence": 85, - "reasoning": "技术面转空" + "confidence": 85 } ] ``` @@ -462,8 +461,7 @@ AI 必须按照以下格式输出决策: "stop_loss": 97000, "take_profit": 91000, "confidence": 85, - "risk_usd": 300, - "reasoning": "技术面转空" + "risk_usd": 300 } ] ``` @@ -500,14 +498,14 @@ AI 必须按照以下格式输出决策: { "symbol": "BTCUSDT", "action": "open_long", // 开多仓 - "reasoning": "这是一个很好的做多机会,因为..." // 太长 + "confidence": 80 // 只需要必要字段 } // 正确 { "symbol": "BTCUSDT", "action": "open_long", - "reasoning": "MACD金叉+成交量放大" + "confidence": 85 } ``` diff --git a/mcp/deepseek_client.go b/mcp/deepseek_client.go index 62e28490..2a124c8b 100644 --- a/mcp/deepseek_client.go +++ b/mcp/deepseek_client.go @@ -6,7 +6,7 @@ import ( const ( ProviderDeepSeek = "deepseek" - DefaultDeepSeekBaseURL = "https://api.deepseek.com/v1" + DefaultDeepSeekBaseURL = "https://api.deepseek.com" DefaultDeepSeekModel = "deepseek-chat" )