Commit Graph

3 Commits

Author SHA1 Message Date
ZhouYongyou
82660b12c5 feat: 添加部分平仓和动态止盈止损功能
新增功能:
- update_stop_loss: 调整止损价格(追踪止损)
- update_take_profit: 调整止盈价格(技术位优化)
- partial_close: 部分平仓(分批止盈)

实现细节:
- Decision struct 新增字段:NewStopLoss, NewTakeProfit, ClosePercentage
- 新增执行函数:executeUpdateStopLossWithRecord, executeUpdateTakeProfitWithRecord, executePartialCloseWithRecord
- 修复持仓字段获取 bug(使用 "side" 并转大写)
- 更新 adaptive.txt 文档,包含详细使用示例和策略建议
- 优先级排序:平仓 > 调整止盈止损 > 开仓

命名统一:
- 与社区 PR #197 保持一致,使用 update_* 而非 adjust_*
- 独有功能:partial_close(部分平仓)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 05:32:23 +08:00
ZhouYongyou
b908fac92f feat: 創建 adaptive.txt 自適應雙策略模板
新增 prompts/adaptive.txt 模板,包含:

## 核心特性
- 市場狀態判斷(震盪/趨勢,多指標交叉驗證)
- 雙策略系統:
  * 策略 A: 震盪交易(高勝率低盈虧比)
  * 策略 B: 趨勢跟隨(中等勝率高盈虧比)
- 技術位優先止盈機制(EMA20、前高前低、整數關口)
- 動態追踪止損(鎖定利潤,避免回撤)
- 夏普比率自我進化(交易質量 > 交易頻率)

## 使用方式
用戶可在 Web UI 選擇此模板,或繼續使用 default/nof1

## 技術實現
- 259 行完整策略指導
- 與現有模板系統兼容
- engine.go 保留硬編碼作為 fallback

相關文檔:TEMPLATE_MIGRATION_PLAN.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 01:06:11 +08:00
SkywalkerJi
4250c11ddf Supports custom system prompts and custom models. 2025-11-01 19:45:54 +08:00