Add trade move points; label option UPL price as bid not mark.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -645,7 +645,7 @@ export default function PlanPage() {
|
||||
<span className="pos-value mono">{fmt(pos?.option_entry_px)}</span>
|
||||
</div>
|
||||
<div className="pos-cell">
|
||||
<span className="pos-label">标记/买一</span>
|
||||
<span className="pos-label">买一</span>
|
||||
<span className="pos-value mono">{fmt(pos?.option_mark_px)}</span>
|
||||
</div>
|
||||
<div className="pos-cell">
|
||||
|
||||
@@ -44,6 +44,9 @@ type Group = {
|
||||
hold_basis?: string | null;
|
||||
strike?: number | null;
|
||||
settle_index_px?: number | null;
|
||||
entry_index_px?: number | null;
|
||||
close_index_px?: number | null;
|
||||
move_points?: number | null;
|
||||
exec_mode?: string | null;
|
||||
expiry_settle?: ExpirySettle | null;
|
||||
pnl_summary?: PnlSummary;
|
||||
@@ -102,6 +105,13 @@ function groupPnl(g: Group) {
|
||||
return g.net_pnl ?? g.pnl_summary?.net_pnl ?? g.realized_pnl;
|
||||
}
|
||||
|
||||
/** 开仓→平仓指数点数(带符号) */
|
||||
function fmtMovePoints(n: number | null | undefined) {
|
||||
if (n == null || Number.isNaN(n)) return "—";
|
||||
const s = n > 0 ? `+${n.toFixed(1)}` : n.toFixed(1);
|
||||
return s;
|
||||
}
|
||||
|
||||
export default function TradesPage() {
|
||||
const titleId = useId();
|
||||
const [groups, setGroups] = useState<Group[]>([]);
|
||||
@@ -196,6 +206,7 @@ export default function TradesPage() {
|
||||
<span className="trade-row-times">
|
||||
开 {fmtTime(openMs)} · 平 {fmtTime(closeMs)} · 周期{" "}
|
||||
{fmtHold(g.hold_ms)}
|
||||
{g.move_points != null ? ` · 波动 ${fmtMovePoints(g.move_points)}` : ""}
|
||||
</span>
|
||||
</div>
|
||||
<div className={`trade-row-pnl mono ${pnlClass(listPnl)}`}>
|
||||
@@ -244,6 +255,7 @@ export default function TradesPage() {
|
||||
<th>开仓时间</th>
|
||||
<th>平仓时间</th>
|
||||
<th>持仓时长</th>
|
||||
<th>波动点数</th>
|
||||
<th>盈亏金额</th>
|
||||
<th>平仓方式</th>
|
||||
</tr>
|
||||
@@ -269,6 +281,7 @@ export default function TradesPage() {
|
||||
<td className="mono">{fmtTime(openMs)}</td>
|
||||
<td className="mono">{fmtTime(closeMs)}</td>
|
||||
<td className="mono">{fmtHold(g.hold_ms)}</td>
|
||||
<td className="mono">{fmtMovePoints(g.move_points)}</td>
|
||||
<td className={`mono ${pnlClass(listPnl)}`}>
|
||||
{fmt(listPnl)}
|
||||
</td>
|
||||
@@ -389,6 +402,16 @@ export default function TradesPage() {
|
||||
{fmtHold(selectedGroup.hold_ms)}
|
||||
</span>
|
||||
</div>
|
||||
<div className="kv">
|
||||
<span>波动点数</span>
|
||||
<span className="mono">
|
||||
{fmtMovePoints(selectedGroup.move_points)}
|
||||
{selectedGroup.entry_index_px != null &&
|
||||
selectedGroup.close_index_px != null
|
||||
? `(${fmt(selectedGroup.entry_index_px, 1)}→${fmt(selectedGroup.close_index_px, 1)})`
|
||||
: ""}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="trade-detail-hint">
|
||||
|
||||
Reference in New Issue
Block a user