Add bot orchestrator, wire up index.ts, remove old runDay

Bot validates strategy capital allocations, waits for market open,
runs all strategies concurrently, and passes signals to the executor.
The main loop in index.ts now delegates to Bot.runDay().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jon
2026-01-30 14:09:30 -07:00
parent d0d3d7254a
commit ecdffab950
5 changed files with 179 additions and 73 deletions

View File

@@ -24,23 +24,3 @@ export async function waitForNextOpen(alpaca: Alpaca) {
return wait(new Date(clock.next_open).valueOf() - new Date().valueOf());
}
export async function runDay(alpaca: Alpaca) {
console.log('waiting for open');
await waitForNextOpen(alpaca);
await wait(60000); //wait a minute
const q = await alpaca.getLatestQuote('TQQQ');
await wait(1000);
const q2 = await alpaca.getLatestQuote('TQQQ');
if (q2.ap - q.ap > 0) {
//up day
console.log('up day: ', new Date())
}
else {
//down day
console.log('down day', new Date());
}
}