feat(hub): align trend pullback display with instance in fullscreen

Position cards show trend plan source, risk%, program TP price and RR; trend section uses plan grid; hub API enriches floating PnL and planned_rr.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-04 10:09:04 +08:00
parent 02bc3c14bc
commit 98c904c2d1
6 changed files with 263 additions and 52 deletions
+10 -3
View File
@@ -890,7 +890,10 @@
if (elPosSl) elPosSl.textContent = ctx.stop_loss != null ? fmtPrice(ctx.stop_loss) : "—";
if (elPosTp) {
if (ctx.tp_monitored) {
elPosTp.textContent = "程序监控";
elPosTp.textContent =
ctx.take_profit != null
? "程序监控 · " + fmtPrice(ctx.take_profit)
: "程序监控";
elPosTp.classList.add("market-pos-tp-monitored");
} else {
elPosTp.textContent = ctx.take_profit != null ? fmtPrice(ctx.take_profit) : "—";
@@ -944,8 +947,12 @@
{ price: posContext.entry, color: "#5b9cf5", title: "入场" },
{ price: posContext.stop_loss, color: "#ff4d6d", title: "止损" },
];
if (!posContext.tp_monitored && posContext.take_profit != null) {
specs.push({ price: posContext.take_profit, color: "#00ff9d", title: "止盈" });
if (posContext.take_profit != null) {
specs.push({
price: posContext.take_profit,
color: "#00ff9d",
title: posContext.tp_monitored ? "止盈(程序)" : "止盈",
});
}
specs.forEach(function (s) {
if (s.price == null || !Number.isFinite(Number(s.price))) return;