Add backtesting entry point for offline strategy testing
Introduces a BacktestClient that replays historical 1-min bars against the existing strategy code, plus a CLI entry point (npm run backtest) that fetches bars from Alpaca and runs the bot over a date range. Makes wait() pluggable so the backtest resolves delays instantly while advancing simulated time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
"dev": "nodemon --exec ts-node src/index.ts",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"lint": "eslint src/"
|
||||
"lint": "eslint src/",
|
||||
"backtest": "ts-node src/backtest.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alpacahq/alpaca-trade-api": "^3.1.3",
|
||||
|
||||
Reference in New Issue
Block a user