Drain and extra-day legs always trade MNQ

They traded the micro of whatever the firm listed: MNQ with NQ, but MGC
for a firm listing only GC and CL. Now every futures firm's tiny legs go on
MNQ, the one micro the bot has always drained on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-27 18:54:41 -05:00
co-authored by Claude Opus 5.5
parent 5696f2b036
commit ed62788480
4 changed files with 15 additions and 20 deletions
+7 -12
View File
@@ -227,21 +227,16 @@ export function pickByChance(chances: { symbol: string; chance: number }[], rand
return chances.length > 0 ? chances[chances.length - 1].symbol : null;
}
/** What every futures firm's drain and extra-day legs trade. */
export const HOUSEKEEPING_ROOT = 'MNQ';
/**
* What a firm's drain and extra-day legs trade — tiny, so a micro: MNQ when
* NQ or MNQ is listed (as always), else the micro of a listed full-size
* contract, else a listed micro, else the listed root with the smallest tick
* value. null for an empty list.
* What a firm's drain and extra-day legs trade: always MNQ — tiny targets
* belong on a micro, whatever the firm lists for its full-size legs. null
* for an empty list: that firm trades nothing.
*/
export function housekeepingRoot(listed: readonly string[]): string | null {
const roots = listed.filter((r) => CME_SPECS[r]);
if (roots.length === 0) return null;
if (roots.includes('NQ') || roots.includes('MNQ')) return 'MNQ';
const twin = roots.find((r) => MICRO_OF[r]);
if (twin) return MICRO_OF[twin];
const micro = roots.find((r) => CME_SPECS[r].micro);
if (micro) return micro;
return [...roots].sort((a, b) => tickValue(a) - tickValue(b))[0];
return listed.some((r) => CME_SPECS[r]) ? HOUSEKEEPING_ROOT : null;
}
const DXTRADE_SYMBOL = /^[A-Za-z0-9./_:-]{1,32}$/;