Dashboard: a stage's own daily loss limit shows its stop, its personal DLL and its min days

Since a withdrawal stage can carry its own daily loss limit, the engine
places that stop, but the dashboard and report still asked the type's base
limit whether the bot stops at all: with a base of 0 and no obfuscation
options the row showed no "stop $X", and a stopped-out red day read "Flat"
(and counted as a loss, not a personal DLL, in the report). botStopsActive
now takes the stage-resolved config. The state also carries the stage's
daily loss limit and min trading days, which the account page and the Days
column show instead of the type's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-10-27 14:15:02 -05:00
co-authored by Claude Opus 5.5
parent 952e4412c4
commit 4add379c68
7 changed files with 42 additions and 12 deletions
+9 -4
View File
@@ -1536,10 +1536,15 @@ export function stopTicks(o: {
}
/** Whether the bot places its own stops for this account type — the
* obfuscation options or a hard daily loss limit. A red day on such an
* account is the bot's own stop (the personal DLL), not a firm lockout. */
export function botStopsActive(cfg: { firstDayStop: boolean; minDayStop: boolean; dailyLossLimit?: number }): boolean {
return cfg.firstDayStop || cfg.minDayStop || (cfg.dailyLossLimit ?? 0) > 0;
* obfuscation options or a hard daily loss limit: the current stage's
* (resolveEffectiveConfig) when given, which a stage may set on a type with
* none. A red day on such an account is the bot's own stop (the personal
* DLL), not a firm lockout. */
export function botStopsActive(
cfg: { firstDayStop: boolean; minDayStop: boolean; dailyLossLimit?: number },
effective?: { dailyLossLimit: number },
): boolean {
return cfg.firstDayStop || cfg.minDayStop || (effective ? effective.dailyLossLimit : cfg.dailyLossLimit ?? 0) > 0;
}
/**