Add options index target monitors that auto limit-close on hit.
Position and order forms can arm a target; right-side and hub panels show active monitors; expiry remains the stop with no separate SL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8772,6 +8772,38 @@ html[data-theme="light"] .hub-monitor-options .hub-monitor-block-label {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.hub-opt-target-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.hub-opt-target-item {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
color: var(--muted, #9aa8c7);
|
||||
}
|
||||
|
||||
.hub-opt-target-item code {
|
||||
font-size: 11px;
|
||||
color: #dbe6ff;
|
||||
}
|
||||
|
||||
.hub-opt-pos-card .opt-target-row--ro {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
margin-top: 8px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid rgba(67, 82, 118, 0.4);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.hub-options-summary {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -3614,8 +3614,18 @@
|
||||
html += `<div class="err">${esc(opt.msg || "期权数据不可用")}</div>`;
|
||||
} else {
|
||||
const pos = Array.isArray(opt.positions) ? opt.positions : [];
|
||||
const targets = Array.isArray(opt.target_monitors) ? opt.target_monitors : [];
|
||||
const bal = optionsBalanceFields(opt);
|
||||
html += renderStatRow(bal.funding, bal.trading, bal.upl);
|
||||
if (targets.length) {
|
||||
html += `<div class="section-title hub-options-title">目标监控 · ${targets.length}</div>`;
|
||||
html += '<div class="hub-opt-target-list">';
|
||||
targets.forEach((t) => {
|
||||
const side = String(t.opt_type || "").toUpperCase() === "P" ? "Put ≤" : "Call ≥";
|
||||
html += `<div class="hub-opt-target-item"><code title="${esc(t.inst_id || "")}">${esc(shortOptionsInst(t.inst_id))}</code> <span>${side} ${esc(fmt(t.target_index, 1))}</span></div>`;
|
||||
});
|
||||
html += "</div>";
|
||||
}
|
||||
html += `<div class="section-title hub-options-title">期权持仓 · ${pos.length} 仓</div>`;
|
||||
html += layout === "cards" ? renderOptionsPositionsCards(pos) : renderOptionsPositionsTable(pos);
|
||||
if (row.flask_url_browser || row.flask_url) {
|
||||
|
||||
Reference in New Issue
Block a user