StackTrading Docs

SRS: UC_4.7.5 — Daily Loss Limit Bar (Persistent Global Header)

FieldValue
BA in ChargeTrang Nguyen
Date Created2026-08-08
Versionv1
Document ReferencesRFQ_ Stack Trading Prop Tech V7.pdf §S4.A (WSRULE_TRACKING, DAILY_LIMIT_BREACH) · STAGE2-003/004/007/031/032/033 (References/QnA from clients/03_STAGE2_DASHBOARD_EVALUATION/QnA_STAGE2_DASHBOARD_EVALUATION.md) · docs/BA/UC_4.1-4.17/dashboard_sim/UC_4.7.5/QnA_init_docs.md (QN-4.7.5-01..06)

UC_4.7.5 — Daily Loss Limit Bar (Persistent Global Header)

1. Overview

FieldContent
IDUC_4.7.5
Use CaseDaily Loss Limit Bar (Persistent Global Header)
DescriptionA progress bar in the persistent header (Ref:UC_4.1.1 §2) showing how much of the trader's Daily Loss Limit budget remains for the day. SIM only, flat 7.5% of notional across all tiers. Scope is UI-component only — this UC owns bar rendering and real-time update; it does not own the Daily_Loss_Limit calculation formula or the breach consequence logic (Read-Only lock, force-close positions, unfreeze timing). When the Daily Loss Limit is reached (Soft Breach), refer to UC_4.10.1 — Soft Breach: Daily Loss Limit Hit, which owns all breach logic and the "Daily Limit Reached" overlay — not covered by this UC. (Source: QN-4.7.5-02, QN-4.7.5-05)
Zapier Flow
Zapier TableTable C —Daily_Loss_Ratio (consumed by UC_4.10.1's calculation, not by this UC directly)
3rd Party

References/Wireframe/Stage 2/Dashboard/Dashboard.png Persistent header, Daily Loss Limit Bar in its normal in-session state (0%–100% fill per BR_4.7.5.1). Soft breach modal.png Daily Loss Limit Bar at its max-fill/motion-warning state, rendered underneath the Soft Breach overlay — this UC owns only the bar itself; the overlay content is owned by UC_4.10.1 §9.1 row 3. (No dedicated wireframe crop exists for the bar alone — these 2 files are the confirmed source per BA fallback QN-4.7.5-06, superseding the earlier text-only placeholder: "a persistent visual progress bar tracking Daily loss limit", dashboard_v7_full.txt L569-571.)

2. Trigger

  • The Dashboard header (Ref: UC_4.1.1) renders — frontend subscribes to the RULE_TRACKING WebSocket event.
  • A RULE_TRACKING event arrives with updated current_daily_pnl/daily_loss_limit values (dist_daily_loss is streamed in the same payload but is not used by this UC's fill calculation — Ref: BR_4.7.5.1).

3. Pre-conditions

  • User is on the Dashboard, account type SIM.

4. Post-conditions

  • The bar's fill level and visual state reflect the most recently received RULE_TRACKING values (Ref: BR_4.7.5.1).

5. Basic Flow

  1. On Dashboard load, frontend subscribes to the RULE_TRACKING WebSocket event (no separate polling call — Ref: BR_4.7.5.2).
  2. Each RULE_TRACKING event delivers dist_daily_loss, daily_loss_limit, current_daily_pnl for the current session.
  3. Frontend computes the bar's fill percentage from current_daily_pnl (Net_P&L for the session) checked against daily_loss_limit (Ref: BR_4.7.5.1).
  4. [If the trader has no loss this session — including a brand-new account that has never placed a trade] → bar renders at 0% fill, the default/empty state (Ref: BR_4.7.5.5).
  5. [If current_daily_pnl <= -daily_loss_limit] → bar renders at max/full fill with the motion-warning visual state (Ref: BR_4.7.5.1; graduated blink rate below max-fill per BR_4.7.5.7).
  6. [If the trader was in the max-fill/motion-warning state from a prior Soft Breach, and the account's trading session has since opened] → bar drops back to 0% fill, now reflecting the trader's actual (reset-to-0) loss for the new session (Ref: BR_4.7.5.6).

6. Alternative Flow

  • [If the Daily Loss Limit is reached (Soft Breach) while the user is on the Dashboard] → the bar transitions to the max/motion-warning state per step 5 above. This UC does not cover Soft Breach logic — the breach detection, consequence (Read-Only lock, position flattening, unfreeze timing), and the "Daily Limit Reached" overlay (which renders the bar in its max-fill state underneath it, per UC_4.10.1 §9.1 row 3) are handled entirely by UC_4.10.1 — Soft Breach: Daily Loss Limit Hit.
  • [If the account enters Hard Breach, Soft Breach, or Frosted Glass cooling-off] → per the persistent-header permission rule (Ref: UC_4.1.1 §2 Screen Description, row 1), this bar freezes on the state/value it held right before the breach and does not update further while the account remains in any of those 3 statuses (Source: BA/client direct instruction, 2026-08-17).

7. Exceptional Flow

  • WebSocket disconnects: bar holds its last-known-good fill/state; no error banner from this component. Reconnect behavior follows the same shared pattern noted in UC_4.7.1 §7.

8. Business Rules

BR_4.7.5.1: Bar Fill Is Computed from Net_P&L vs. daily_loss_limit

The bar's fill percentage is computed by the frontend from two RULE_TRACKING-streamed values — current_daily_pnl (the session's Net_P&L, per the UC_4.10.1 §2 Trigger definition: Net_P&L = Realized P&L + Unrealized P&L) and daily_loss_limit — rather than consumed directly from the dist_daily_loss field:

fill_% = min(100%, max(0%, (-current_daily_pnl / daily_loss_limit) × 100%))
  • daily_loss_limit is the positive threshold value calculated by UC_4.10.1 §2 Trigger: Daily_Loss_Limit = Absolute_Stop_Loss × Daily_Loss_Ratio, where Absolute_Stop_Loss = Notional × 7.5% (flat, all SIM tiers) and Daily_Loss_Ratio = 1/3.
  • Soft Breach condition, per the same UC: Net_P&L ≤ −Daily_Loss_Limit (i.e. current_daily_pnl <= -daily_loss_limit) → fill clamps at 100%, with the blink rate at max-fill per BR_4.7.5.7.
  • When current_daily_pnl >= 0 (no realized loss this session) → fill clamps at 0% (Ref: BR_4.7.5.5).

BR_4.7.5.2: Real-Time Update via WebSocket Push Only

The bar updates exclusively from the RULE_TRACKING WebSocket event — there is no separate polling API call for this component. (Source: QN-4.7.5-04)

BR_4.7.5.3: No-Loss / First-Day Display — Always 0% Fill

The bar shows 0% fill in both of these cases, and the UI cannot distinguish between them (both simply mean "no realized loss to display yet"):

  • Trader has not lost money this sessioncurrent_daily_pnl >= 0 (i.e. Net_P&L is zero or positive, so the fill formula in BR_4.7.5.1 clamps at 0%), regardless of whether the trader is flat, in a winning position, or has an open unrealized loss that hasn't reduced Net_P&L below 0 yet.
  • Trader's very first day — brand-new account that has never placed a trade. There is no separate "no data yet" visual state; a first-day account with current_daily_pnl = 0 renders identically to any other day with zero loss: 0% fill.

This UC does not compute or infer "first day" as a distinct condition — it only reads whatever current_daily_pnl/daily_loss_limit values RULE_TRACKING streams and applies the BR_4.7.5.1 formula, and a fresh account naturally streams current_daily_pnl = 0, which produces 0% fill. (Source: BA correction per user request, 2026-08-09; formula source updated per BA correction, 2026-08-19)

BR_4.7.5.4: Bar Resets to 0% Only on Soft Breach → New Session Open

The bar's fill level (and the underlying current_daily_pnl it reflects) resets back to 0 — i.e. back to showing the trader's actual loss as 0 — in exactly one scenario: the trader reached the Daily Loss Limit (Soft Breach) and the account's trading session has since opened (reset_time reached). Outside of that scenario, the bar simply tracks whatever dist_daily_loss the trader's ongoing session P&L produces; there is no other periodic or manual reset of this component.

  • Daily P&L counter reset and Soft Lock lifted always move together, at reset_time — never independently (Ref: UC_4.10.1).
  • reset_time varies by asset class — the reset logic itself (Soft Lock lifting, session-open detection) is owned entirely by UC_4.10.1, not covered by this UC:
    • Forex: resets at 17:00 EST (16:00 CST).
    • Futures: resets at 18:00 EST (17:00 CST).
  • This UC's only responsibility at reset time is passive: once RULE_TRACKING streams the post-reset values (current_daily_pnl back to 0), the BR_4.7.5.1 formula naturally re-computes 0% fill per BR_4.7.5.5 — no separate reset-specific rendering logic exists in this UC. (Source: BA correction per user request, 2026-08-09; formula source updated per BA correction, 2026-08-19)

Once fill_% (Ref: BR_4.7.5.1) reaches the 70% threshold, the bar's motion-warning blink animation activates and steps up in exactly 2 stages as fill increases further — a step function, not a continuous ramp:

fill_% rangeBlink rate
< 70%No blink — bar shows static fill only (0%–100% perBR_4.7.5.1), no animation.
70% ≤fill_% < 85%Blinks at50% slower than the motion file's reference blink rate (i.e. half the frequency — one blink cycle takes 2× as long as the motion file's cycle).
fill_% ≥ 85% (including max-fill/100% on Soft Breach, Ref: BR_4.7.5.1)Blinks at thesame rate as the motion file — full reference frequency, no slowdown.
  • The rate change at each threshold is an immediate step (jump to the new rate the instant fill_% crosses 70% or 85%), not an animated transition between rates.
  • Crossing back below 70% (e.g. after the BR_4.7.5.6 reset-to-0% on new session open) stops the blink entirely, returning to the static <70% state.
  • The "motion file" is the client-supplied Figma motion/animation asset for this component (Ref: dashboard_v7_full.txt, FE build input) — its authored blink frequency is the 100% reference rate this rule scales against. (Source: client instruction relayed by BA, 2026-08-20)

9. Screen Description

No.Field NameField TypeDisplaying rule / Behaviour rule
1Daily Loss Limit Progress BarLabelDisplaying rule:- Fill % computed as (-current_daily_pnl / daily_loss_limit) × 100%, clamped to [0%, 100%] — i.e. checked against Net_P&L (current_daily_pnl), not the pre-computed dist_daily_loss field (Ref: BR_4.7.5.1).- 0% fill whenever current_daily_pnl >= 0 (no realized loss this session) — including a brand-new / first-day account that has never traded (Ref: BR_4.7.5.5).- Blink animation activates at fill_% ≥ 70%, stepping through 2 rate stages: 70%–84% blinks at 50% slower than the motion file's reference rate, 85%–100% blinks at the motion file's exact reference rate; below 70% no blink (Ref: BR_4.7.5.7).- Max-fill + motion-warning visual state when current_daily_pnl <= -daily_loss_limit (Ref: BR_4.7.5.1).- Drops back to 0% fill only after a Soft Breach's session reset fires — Forex: 17:00 EST (16:00 CST); Futures: 18:00 EST (17:00 CST); reset logic owned by UC_4.10.1, not covered by this UC (Ref: BR_4.7.5.6).Behaviour rule:- Passive display only — no click/interaction defined for this component. Updates on every RULE_TRACKING WS push (Ref: BR_4.7.5.2).

Changelog

DateVersionUpdated itemBeforeAfterNotes
2026-08-08v1Initial creationFull SRS with 6 BRs, Basic Flow, Alternative Flow, Exceptional Flow, Screen Description + Field ClassificationSynthesized from QnA_init_docs.md (6 BA-confirmed items), STAGE2-003/004/007/031/032/033,v7_full.txt WS schema.
2026-08-19v1§2 Trigger, §5 Basic Flow Steps 3/5, BR_4.7.5.1, BR_4.7.5.3, BR_4.7.5.5, BR_4.7.5.6, §9 Screen DescriptionFill % consumed directly from the backend-computeddist_daily_loss field (no formula in this UC — per QN-4.7.5-01/02, UC_4.7.5 explicitly did not compute or check anything)Fill % is now computed by the frontend by checkingNet_P&L (current_daily_pnl) against daily_loss_limitfill_% = min(100%, max(0%, (-current_daily_pnl / daily_loss_limit) × 100%)) — reusing UC_4.10.1's Net_P&L/Daily_Loss_Limit formulas; dist_daily_loss is no longer used by this UC's fill logicBA correction per user request: display % must check against Net_P&L using the Soft Breach (UC_4.10.1) formulas, not the pre-computeddist_daily_loss field. ⚠️ Open follow-up: this narrows/reverses the scope confirmed in QnA_init_docs.md (QN-4.7.5-01/02) — recommend re-confirming with BA/client whether dist_daily_loss should be deprecated from this UC's payload consumption, or whether backend should instead be asked to compute dist_daily_loss using the same Net_P&L-based formula so both stay consistent.
2026-08-19v1.1§1 Overview (wireframe), §6 Alternative Flow, BR_4.7.5.4 (removed)No wireframe mapped —[BLOCKED — pending design] text placeholder. §6 referenced the now-removed BR_4.7.5.4. BR_4.7.5.4 duplicated the "overlay is not covered by this UC" statement already made in §1 Overview and §6.Wireframe mapping added:Dashboard.png (normal state) + Soft breach modal.png (max-fill/motion-warning state, bar as rendered under UC_4.10.1's overlay). §6 reworded to point straight at UC_4.10.1 §9.1 row 3 and added a new bullet restating the Hard/Soft Breach/Frosted Glass "bar freezes" rule from UC_4.1.1 §2, which this UC had never restated. BR_4.7.5.4 removed entirely (its content was redundant with §1/§6, not a distinct rule; no external file referenced its anchor).User request — wireframe/UC-reference remap + remove BR_4.7.5.4. Removing BR_4.7.5.4 does not change scope: this UC still does not own the overlay or Soft Breach logic.
2026-08-20v1.2§5 Basic Flow Step 5, BR_4.7.5.7 (new), §9 Screen DescriptionBlink behavior only described as a binary "motion-warning visual state" at 100% max-fill (Ref: BR_4.7.5.3) — no graduated blink rate below 100%.Added BR_4.7.5.7: graduated blink-rate step function — <70% no blink; 70%–84% blinks at 50% slower than the motion file's reference rate; ≥85% blinks at the motion file's exact reference rate. §5 Step 5 cross-referencesBR_4.7.5.7 without restating the rate detail (kept out of Basic Flow per BA request — detail belongs in Business Rules only).Client instruction relayed by BA, 2026-08-20: blink rate must ramp up in 2 stages (70% = 50% slower than motion file; 85% = matches motion file) ahead of the existing 100%/Soft-Breach max-fill state. Applied identically to LIVE siblingUC_4.12.5.
2026-08-20v1.3BR_4.7.5.3 (removed), §5 Basic Flow Step 5, BR_4.7.5.1, BR_4.7.5.7, §9 Screen DescriptionBR_4.7.5.3 existed as its own rule stating the max-fill/motion-warning state on Soft Breach; the other sections cross-referenced it.BR_4.7.5.3 removed. Its content is preserved inline where needed: the Soft Breach clamp-to-100% statement now lives directly in BR_4.7.5.1 (which already owns the fill formula), and the max-fill blink rate is already fully covered by BR_4.7.5.7's ≥85% row. All former BR_4.7.5.3 cross-references now point to BR_4.7.5.1 instead.User request to remove BR_4.7.5.3 as a standalone rule -- no scope change, the behavior it described is unchanged, just no longer a separate rule number.

On this page