Show stage-aware + consistency-adjusted profit target on dashboards

State API now returns effectiveProfitTarget = max(stage profit target,
maxDay/consistency). When a big day forces the consistency rule, this
reflects the actual amount needed to complete the stage — not just the
base profit target.

Main dashboard and account detail page now display this instead of the
raw cfg.profitTarget.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-04-24 02:20:11 -05:00
co-authored by Claude Opus 4.6
parent 9928f1cabd
commit 8204cd138b
4 changed files with 16 additions and 3 deletions
+2 -2
View File
@@ -247,7 +247,7 @@ export default function AccountPage() {
? Math.round((account.amount - cfg.accountSize) * 100) / 100
: Math.round(fifoTotal * 100) / 100;
const profitPct = cfg?.accountSize ? (totalProfit / cfg.accountSize) * 100 : null;
const profitPassed = cfg != null && totalProfit >= cfg.profitTarget;
const profitPassed = cfg != null && totalProfit >= (account.effectiveProfitTarget ?? cfg.profitTarget);
// dailyTarget is computed server-side in the state API — single source of truth.
const dailyTarget = account.dailyTarget ?? null;
const lossPassed = !hasLossLimit || (cfg != null && totalProfit >= cfg.minDayPnL);
@@ -379,7 +379,7 @@ export default function AccountPage() {
<ObjRow
passed={profitPassed}
label="Profit Target"
value={cfg ? `$${fmt(totalProfit)} of $${fmt(cfg.profitTarget)}` : '—'}
value={cfg ? `$${fmt(totalProfit)} of $${fmt(account.effectiveProfitTarget ?? cfg.profitTarget)}` : '—'}
/>
<ObjRow
passed={daysPassed}