Alpaca connector
@qtrader/alpaca-connector
Talk to Alpaca from Claude Code: account, positions, orders (list, place, cancel), latest quote, and historical bars to CSV, using Node's built-in fetch. Paper trading by default. Live orders need ALPACA_LIVE=1 plus your yes in chat for each order. Not financial advice.
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1{
- 2 "name": "alpaca-connector",
- 3 "owner": "qtrader",
- 4 "version": "1.0.0",
- 5 "type": "skill",
- 6 "description": "Talk to Alpaca from Claude Code: account, positions, orders (list, place, cancel), latest quote, and historical bars to CSV, using Node's built-in fetch. Paper trading by default. Live orders need ALPACA_LIVE=1 plus your yes in chat for each order. Not financial advice.",
- 7 "category": "trading",
- 8 "license": "MIT",
- 9 "compat": ["claude-code"],
- 10 "permissions": {
- 11 "shell": ["node scripts/alpaca.mjs", "node scripts/selftest.mjs"],
- 12 "network": ["paper-api.alpaca.markets", "api.alpaca.markets", "data.alpaca.markets"],
- 13 "files": { "read": ["./data/**"], "write": ["./data/**", "./out/**"] },
- 14 "env": ["ALPACA_API_KEY_ID", "ALPACA_API_SECRET_KEY", "ALPACA_LIVE"]
- 15 },
- 16 "tests": {
- 17 "cases": [
- 18 {
- 19 "name": "parsing, request building, live gating, and bars paging work offline",
- 20 "inputs": {},
- 21 "checks": [{ "type": "command_exits_zero", "command": "node scripts/selftest.mjs" }]
- 22 },
- 23 {
- 24 "name": "dry run prints a paper order without any secret",
- 25 "inputs": {},
- 26 "checks": [
- 27 {
- 28 "type": "command_exits_zero",
- 29 "command": "node scripts/alpaca.mjs place --symbol aapl --side buy --qty 5 --type limit --limit-price 190.25 --dry-run --out out/request.json"
- 30 },
- 31 {
- 32 "type": "output_matches_schema",
- 33 "path": "out/request.json",
- 34 "schema": {
- 35 "type": "object",
- 36 "required": ["dry_run", "mode", "method", "url", "headers", "body"],
- 37 "properties": {
- 38 "dry_run": { "const": true },
- 39 "mode": { "const": "paper" },
- 40 "method": { "const": "POST" },
- 41 "url": { "const": "https://paper-api.alpaca.markets/v2/orders" },
- 42 "body": {
- 43 "type": "object",
- 44 "required": ["symbol", "side", "type", "time_in_force", "qty", "limit_price"],
- 45 "properties": { "symbol": { "const": "AAPL" }, "qty": { "const": "5" }, "limit_price": { "const": "190.25" } }
- 46 }
- 47 }
- 48 }
- 49 },
- 50 { "type": "file_contains", "path": "out/request.json", "text": "<missing ALPACA_API_SECRET_KEY>" }
- 51 ]
- 52 },
- 53 {
- 54 "name": "dry run builds a paged daily bars request on the data host",
- 55 "inputs": {},
- 56 "checks": [
- 57 {
- 58 "type": "command_exits_zero",
- 59 "command": "node scripts/alpaca.mjs bars --symbol SPY --timeframe 1Day --start 2025-01-01 --end 2025-12-31 --dry-run --out out/bars-request.json"
- 60 },
- 61 {
- 62 "type": "file_contains",
- 63 "path": "out/bars-request.json",
- 64 "text": "https://data.alpaca.markets/v2/stocks/SPY/bars?timeframe=1Day&start=2025-01-01&end=2025-12-31&adjustment=all&feed=iex&limit=10000&sort=asc"
- 65 }
- 66 ]
- 67 }
- 68 ]
- 69 }
- 70}
