diff --git a/lib/db.ts b/lib/db.ts index d81f318..3fbfbef 100644 --- a/lib/db.ts +++ b/lib/db.ts @@ -199,11 +199,15 @@ export function setSetting(key: string, value: string): void { const SYMBOLS = ['NQ','MNQ','ES','MES','YM','MYM','RTY','M2K','GC','MGC','SI','CL','MCL','NG','ZB','ZN','ZF','6E','6J','6B']; +// Enabled on a fresh install. The rest still seed, so they can be switched on +// from the Instruments page, they just start off. +const DEFAULT_ENABLED = new Set(['NQ', 'GC', 'CL']); + // Seed instruments table if empty const instrCount = (db.prepare('SELECT COUNT(*) as count FROM instruments').get() as { count: number }).count; if (instrCount === 0) { - const ins = db.prepare('INSERT INTO instruments (symbol, enabled) VALUES (?, 1)'); - for (const s of SYMBOLS) ins.run(s); + const ins = db.prepare('INSERT INTO instruments (symbol, enabled) VALUES (?, ?)'); + for (const s of SYMBOLS) ins.run(s, DEFAULT_ENABLED.has(s) ? 1 : 0); } export interface InstrumentRow {