Add per-account-type splitEnabled flag from the catalog
When the master marks an account type splitEnabled=false, big days trade as one unsplit leg (the legacy one-and-done behavior); min-day bumps are unaffected. Missing field — older master or pre-toggle cached catalog — defaults to enabled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
3ef9486977
commit
a36e227e74
@@ -242,7 +242,8 @@ export interface DayPlan {
|
||||
/** dayTarget minus what's already realized today; what's left to trade. */
|
||||
remainingToday: number;
|
||||
path: 'first_day' | 'normal_day' | 'reduced_day';
|
||||
/** False for strict-consistency accounts past their first trade ever — single unsplit trade. */
|
||||
/** False when the account type disables splitting, or for strict-consistency
|
||||
* accounts past their first trade ever — single unsplit trade. */
|
||||
splitAllowed: boolean;
|
||||
}
|
||||
|
||||
@@ -264,7 +265,8 @@ export function computeDayPlan(
|
||||
minDayPnL: number,
|
||||
minTradingDays: number,
|
||||
equityProfit: number | null | undefined,
|
||||
realizedPnL: number
|
||||
realizedPnL: number,
|
||||
splitEnabled: boolean = true
|
||||
): DayPlan | null {
|
||||
if (typeof equityProfit !== 'number' || !Number.isFinite(equityProfit)) return null;
|
||||
|
||||
@@ -277,7 +279,7 @@ export function computeDayPlan(
|
||||
if (!target) return null;
|
||||
|
||||
const qualifyingDays = minDayPnL === 0 ? priorDays : priorDays.filter((d) => d.pnl >= minDayPnL);
|
||||
const splitAllowed = consistency === 0 || consistency >= 1 || qualifyingDays.length === 0;
|
||||
const splitAllowed = splitEnabled && (consistency === 0 || consistency >= 1 || qualifyingDays.length === 0);
|
||||
|
||||
return {
|
||||
dayTarget: target.amount,
|
||||
|
||||
Reference in New Issue
Block a user