Tradeify247: each person sizes a little apart from everyone else

Every machine sized a like account in a like state to the same position as
every other person's, so two people's positions could match to the unit.
Each person now draws a size factor in [0.85, 1.15] per trade date, seeded
by the master's uuid for them; all of one person's accounts share it.

The factor moves the hold a DXtrade leg is sized for (hold / factor², since
size goes as 1/√hold), so the instrument pick, the dashboard's next leg and
the Firms page's reach test all see the hold the size was made for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-10-19 20:00:33 -05:00
co-authored by Claude Opus 5.5
parent ed56e306d1
commit 6dd2528fe2
8 changed files with 126 additions and 15 deletions
+6 -3
View File
@@ -11,9 +11,10 @@ import type { PlatformContract } from './platform-client';
import type { SymbolStats } from './master-protocol';
import {
combineCmeSessions, computeDayPlan, resolveEffectiveConfig, obfuscationStopDollars, dllRoom as computeDllRoom,
planLegSize, rankForTarget, maxLossRoom, lastStand, dllStopDollars, DEFAULT_TARGET_HOLD_HOURS,
planLegSize, rankForTarget, maxLossRoom, lastStand, dllStopDollars,
FALLBACK_COMMISSION_PER_CONTRACT,
} from './trading-logic';
import { sizingHoldHours } from './person-size';
export type CandidateLeg = SymbolStats['symbols'][number] & {
swapReserve: number;
@@ -39,10 +40,12 @@ export function rankNextLeg(o: {
dllRoom: number | null;
obfuscationDollars: number;
cash: { amount: number; availableFunds?: number };
/** The trade date the hold is drawn for (sizingHoldHours); default today. */
tradeDate?: string;
}): CandidateLeg[] {
const candidates: PlatformContract[] = o.client.lastCandidates ?? [];
if (!(o.leg > 0) || candidates.length === 0) return [];
const target = o.firm.targetHoldHours || DEFAULT_TARGET_HOLD_HOURS;
const target = sizingHoldHours(o.firm, o.tradeDate);
const floorRoom = maxLossRoom({
balance: o.cash.amount, accountSize: o.cfg.accountSize, maxLoss: o.cfg.maxLoss ?? 0,
autoLiqThreshold: o.client.autoLiqThresholds?.[o.accountId],
@@ -145,7 +148,7 @@ export function accountNextLeg(
lastStand: p.room !== null && lastStand({ dllRoom: p.room, dailyLossLimit: p.dll, maxLossRoom: floorRoom }),
candidates: rankNextLeg({
client, accountId: acc.id, cfg: p.cfg, firm, leg: p.plan.remainingToday, dllRoom: p.room,
obfuscationDollars: p.obfuscation, cash: p.cash,
obfuscationDollars: p.obfuscation, cash: p.cash, tradeDate,
}),
};
}