Report and badge Personal DLL days

A stop-enabled account whose day booked red via its own stop shows an
amber "Personal DLL" badge on the dashboard (the firm's lockout keeps
its red "Hit DLL") and reports as personalDll in the day outcomes
instead of loss, per account type and per firm.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-11 18:51:03 -05:00
co-authored by Claude Fable 5
parent c58e981b1e
commit 6685a75864
5 changed files with 30 additions and 6 deletions
+4
View File
@@ -22,6 +22,9 @@ export interface AccountTypeStats {
targetHit?: number;
partial?: number;
loss?: number;
/** Of the finished accounts, how many booked the day via their own
* obfuscation stop (personal DLL) rather than a genuine loss. */
personalDll?: number;
/** Live accounts by trading days completed toward the current target:
* {daysTraded: accountCount}. Feeds the master's payout calendar, so
* accounts that are dead, DLL-locked, or in the red are left out — the
@@ -56,6 +59,7 @@ export interface FirmStats {
targetHit?: number;
partial?: number;
loss?: number;
personalDll?: number;
/** Per account type, summing to the firm's own totals. Optional so a master
* on an older build simply ignores it. */
accountTypes?: AccountTypeStats[];
+12 -3
View File
@@ -32,7 +32,7 @@ function collectFirmStats() {
if (!client || client.accountList.length === 0) {
return {
firm: f.name, totalAccounts: 0, accountsTraded: 0, inTrade: 0,
targetHit: 0, partial: 0, loss: 0, accountTypes: [],
targetHit: 0, partial: 0, loss: 0, personalDll: 0, accountTypes: [],
};
}
@@ -42,6 +42,7 @@ function collectFirmStats() {
let targetHitCount = 0;
let partialCount = 0;
let lossCount = 0;
let personalDllCount = 0;
// Per account type, so the master can say what the accounts still to
// trade actually are. Keyed by account type id; unassigned accounts
@@ -172,7 +173,14 @@ function collectFirmStats() {
slice.accountsTraded++;
// A grind-day fill (dayTarget 0) can flag targetHit on a
// negative day — a loss is still a loss, so red wins.
if (combined.realizedPnL < 0) {
// A red day on a stop-enabled account is its own personal
// DLL, booked on purpose — not a genuine loss. (A firm DLL
// lockout took the !acc.active branch above and stays a
// loss.)
if ((cfg.firstDayStop || cfg.minDayStop) && combined.realizedPnL <= -25) {
personalDllCount++;
slice.personalDll = (slice.personalDll ?? 0) + 1;
} else if (combined.realizedPnL < 0) {
lossCount++;
slice.loss = (slice.loss ?? 0) + 1;
} else if (targetHit) {
@@ -195,7 +203,8 @@ function collectFirmStats() {
return {
firm: f.name, totalAccounts, accountsTraded, inTrade,
targetHit: targetHitCount, partial: partialCount, loss: lossCount, accountTypes,
targetHit: targetHitCount, partial: partialCount, loss: lossCount,
personalDll: personalDllCount, accountTypes,
};
});
}