About storyclaw-alpaca-trading
A trading skill that uses Alpaca API for US stocks and crypto, with paper or real trading based on credentials. It supports account and market-data queries as well as orders, while requiring a proposed plan and explicit confirmation before any trade.
Key features
- 01Paper and real trading via credentials
- 02Account, position, and order-history queries
- 03Quotes, price history, and RSI data
- 04Market buy and sell orders
- 05RSI strategy command
Use cases
- 01Checking account balance and holdings
- 02Reviewing quotes and price history
- 03Preparing a stock or crypto trade plan
- 04Executing a trade after explicit confirmation
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ storyclaw-official/ talenthub --skill storyclaw-alpaca-tradingAfter installing, type/storyclaw-alpaca-tradingin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
.gitignoreconfig.example.jsoncredentials/example.jsonscripts/aggressive-strategy.jsconfig-loader.jsmomentum-strategy.jstrading.jsDetails
From the project READMEAlpaca Trading - US Stock & Crypto Trading
Trade US stocks and crypto via Alpaca API. Supports both paper trading (simulated, free) and real trading.
Critical Rules
- NEVER execute a trade without showing a plan and getting explicit confirmation
- NEVER set up cron jobs without proposing them first
- NEVER make up prices or data — always query real data
- NEVER assume what the user wants to trade — ask first
Multi-User Support
Each user has their own credentials/{USER_ID}.json:
{
"apiKey": "YOUR_KEY",
"apiSecret": "YOUR_SECRET",
"baseUrl": "https://paper-api.alpaca.markets",
"dataUrl": "https://data.alpaca.markets"
}
To switch to real trading, change baseUrl to https://api.alpaca.markets.
Or set ALPACA_API_KEY and ALPACA_API_SECRET env vars.
First-Time User Flow
- Check credentials:
USER_ID=$TELEGRAM_USER_ID node {baseDir}/scripts/trading.js check - Ask what they want to trade (stocks vs crypto, symbols, amount, risk)
- Propose a concrete plan — WAIT FOR CONFIRMATION
- Execute only after user confirms
Commands
Account & Positions
node {baseDir}/scripts/trading.js check # Check config
node {baseDir}/scripts/trading.js account # Balance
node {baseDir}/scripts/trading.js positions # Current holdings
node {baseDir}/scripts/trading.js history # Order history
node {baseDir}/scripts/trading.js portfolio-history # Equity curve (1W default)
node {baseDir}/scripts/trading.js portfolio-history 1M # 1D/1W/1M/3M/1A
Market Data
node {baseDir}/scripts/trading.js quote AAPL # Real-time quote
node {baseDir}/scripts/trading.js bars AAPL 30 # Price history
node {baseDir}/scripts/trading.js rsi AAPL 14 # RSI indicator
Trading
node {baseDir}/scripts/trading.js buy AAPL 10 # Buy (market order)
node {baseDir}/scripts/trading.js sell AAPL 10 # Sell
Strategy
node {baseDir}/scripts/trading.js strategy-rsi AAPL # RSI mean reversion
# RSI < 30 + no position → BUY; RSI > 70 + has position → SELL
Features
- US Stocks & Crypto (AAPL, TSLA, BTC, ETH, and more)
- Paper OR real trading (depends on credentials)
- Real-time quotes (15-min delayed on free tier)
- Market orders, technical indicators (RSI)
- Market hours: Stocks 9:30-16:00 ET Mon-Fri; Crypto 24/7
Setup
- Sign up at https://app.alpaca.markets/brokerage/new-account
- Generate API key + secret (Paper Trading section)
- Create
credentials/{USER_ID}.jsonor set env vars
API Limits
| Tier | Calls/min | Data delay |
|---|---|---|
| Free | 200 | 15 min |
| Unlimited | Unlimited | Real-time |
Comments
Markdown supported