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:
co-authored by
Claude Fable 5
parent
c58e981b1e
commit
6685a75864
+12
-3
@@ -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,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user