Commit Graph

13 Commits

Author SHA1 Message Date
Jon
075572a01c Remove executor, add buy/sell to Alpaca, move capital allocation to Bot
Replace the Executor logging placeholder with real buy/sell methods on
the Alpaca class that place market orders via createOrder and return the
fill price. Strategies now receive their capital amount directly and
place orders themselves. Bot accepts StrategyAllocation[] to decouple
capital allocation from strategy definition.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:05:21 -07:00
Jon
e32e30af47 update our alpaca calls to be separate bid and ask 2026-02-03 13:58:42 -07:00
Jon
8872803563 Add project README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:51:46 -07:00
Jon
bf345243fd Add momentum strategy with QQQ-based TQQQ/SQQQ trading
Implements MomentumIndicator (samples QQQ direction) and
MomentumStrategy (buys TQQQ on up, SQQQ on down, exits at
+1% target or 1hr timeout). Wired into Bot via index.ts.
Also fixes vitest config to exclude dist/ from test discovery.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:47:20 -07:00
Jon
6d63346f4c Clean up tracked artifacts and commit vitest config
Remove node_modules/ and tsconfig.tsbuildinfo from git tracking
(both already in .gitignore). Add vitest.config.js which was
missing from version control.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:17:42 -07:00
Jon
ecdffab950 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>
2026-01-30 14:09:30 -07:00
Jon
d0d3d7254a Add executor with logging placeholder and tests
The Executor receives strategy signals and calculates dollar amounts
from capital allocations. Currently logs intended trades rather than
placing real orders.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:06:46 -07:00
Jon
345ff933ec Add indicator and strategy interfaces
Introduce the typed interfaces that form the foundation of the
strategy framework: Indicator<T> for market analysis and Strategy
with Signal types for trading decisions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 14:05:41 -07:00
Jon
5e06c06987 Refactor for TDD workflow with Vitest and ESLint
- Move API keys from hardcoded values to .env via dotenv
- Extract business logic into src/trading.ts with dependency injection
- Add typed AlpacaClient interface, replace `any` on Alpaca class
- Add Vitest test suites for trading logic and Alpaca wrapper (14 tests)
- Set up ESLint with @typescript-eslint for linting
- Fix getAsset to pass symbol string directly to SDK
- Fix typo (alpacha -> alpaca), remove unused ws/node-fetch deps
- Update .gitignore for node_modules and .env

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 13:49:31 -07:00
Jon
892305e349 forgot to add it 2025-02-11 00:24:00 -07:00
Jon
3e582af8ff add dockerfile 2025-02-11 00:23:36 -07:00
Jon
fe60f014aa just print if the first minute is up or down 2025-02-11 00:00:04 -07:00
Jon
04d1202acb added files 2025-02-10 23:21:27 -07:00