Skip to content

feat(web): 最近决策 open_long/open_short 显示止损止盈 #107

Description

@xqliu

当前状态

❌ 未实现

当前 "最近决策" 卡片在显示 open_long / open_short 时,只显示:

  • 币种、action、杠杆、价格、成功/失败状态

缺少止损止盈信息。

数据已有

后端 DecisionAction 结构已包含 stop_loss 和 take_profit 字段:

  • logger/decision_logger.go:84-85

前端类型定义有 new_stop_loss / new_take_profit(用于 update 操作),
但缺少开仓时的 stop_loss / take_profit 字段。

建议实现

  1. 前端 DecisionAction 类型添加 stop_loss / take_profit 字段

    • web/src/types.ts:54
  2. TraderDashboard.tsx:940-950 区域,当 action.action.includes('open') 时,
    显示止损止盈:

    {action.stop_loss > 0 && <span>🛑 {action.stop_loss}</span>}
    {action.take_profit > 0 && <span>🎯 {action.take_profit}</span>}

验收标准

  • open_long / open_short 决策显示止损价格(🛑)
  • open_long / open_short 决策显示止盈价格(🎯)
  • 样式与现有 update_stop_loss 显示保持一致

相关文件

  • web/src/pages/TraderDashboard.tsx:912-950 - 决策卡片渲染
  • web/src/types.ts:44-58 - DecisionAction 类型
  • web/src/components/DecisionCard.tsx:143-151 - 参考:update 操作的止损止盈显示
  • logger/decision_logger.go:84-85 - 后端已有字段

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions