Skip to main content

Module position_row

Module position_row 

Source
Expand description

Single-position row — the reusable primitive behind the Positions pane and any future verdict overlay that embeds an open-position snapshot.

§Layout

Columns, left to right, with a one-space gutter between each:

 BTC     long  size=0.4200  entry=64120.50  mark=64480.00  pnl=+151.13 (+0.82R)  stop=63500  tgt=66000

Column widths are fixed so the eye can scan down a column without jitter. Missing optional fields (mark, pnl, stop, target) render as so the row still occupies its slot and columns don’t shift.

§Color rules (operator-safety)

  • Symbol / side → theme.primary (bright, first-glance anchor).
  • Numeric fill (size, entry, mark) → theme.metadata (low-contrast; ops read these after verifying the symbol).
  • pnl is the one column whose color changes with value:
    • >= 0theme.primary (positive).
    • < 0theme.alert (negative).
    • Nonetheme.metadata (not yet observed).
  • stop / targettheme.caution only if the mark has crossed the level (stop hit while position open, target hit while position open); otherwise theme.metadata. This is a cheap early-warning cue; full guardrail-proximity coloring lands with the risk-overlay pass.

The widget does not flag stale data — freshness is the job of the parent pane’s Stat<Positions> badge. Coloring a single row as stale would hide the fact that the whole feed is behind.

Structs§

PositionRow