Drain-day randomness in $0.50 steps (MNQ tick value), $5.00–$15.00

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-12 18:12:12 -05:00
co-authored by Claude Fable 5
parent 9b2d823210
commit c493796602
+5 -4
View File
@@ -133,9 +133,10 @@ export function currentTradeDateCT(now: Date = new Date()): string {
/** /**
* Drain-day target: the stage's min-day amount plus a deterministic bump of * Drain-day target: the stage's min-day amount plus a deterministic bump of
* $0/$5/$10 — so a $5 min day trades as $5, $10 or $15 depending on the * $0–$10 in $0.50 steps — MNQ's per-contract tick value, so every possible
* (account, trade date) pair. Seeded like dailyBump so every consumer of the * target lands on a realizable exit ($5 min day → $5.00, $5.50, … $15.00
* plan computes the same number. * depending on the (account, trade date) pair). Seeded like dailyBump so
* every consumer of the plan computes the same number.
*/ */
export function drainDayAmount(accountId: number, tradeDate: string, minDay: number): number { export function drainDayAmount(accountId: number, tradeDate: string, minDay: number): number {
const key = `${accountId}|drain|${tradeDate}`; const key = `${accountId}|drain|${tradeDate}`;
@@ -144,7 +145,7 @@ export function drainDayAmount(accountId: number, tradeDate: string, minDay: num
hash ^= key.charCodeAt(i); hash ^= key.charCodeAt(i);
hash = Math.imul(hash, 0x01000193) >>> 0; hash = Math.imul(hash, 0x01000193) >>> 0;
} }
return minDay + (hash % 3) * 5; return round2(minDay + (hash % 21) * 0.5);
} }
/** /**