← 返回
数据分析 Key 中文

Storyclaw Alpaca Trading

US stock and crypto trading via Alpaca API. Paper trading (simulated) and real trading supported. Real-time quotes, orders, positions, RSI strategy.
通过Alpaca API交易美股与加密货币,支持模拟/实盘模式,提供实时行情、订单、持仓管理及RSI策略。
patches429
数据分析 clawhub v0.1.0 1 版本 99835.3 Key: 需要
★ 0
Stars
📥 606
下载
💾 23
安装
1
版本
#latest

概述

Alpaca Trading - US Stock & Crypto Trading

Trade US stocks and crypto via Alpaca API. Supports both paper trading (simulated, free) and real trading.

Critical Rules

  1. NEVER execute a trade without showing a plan and getting explicit confirmation
  2. NEVER set up cron jobs without proposing them first
  3. NEVER make up prices or data — always query real data
  4. 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

  1. Check credentials: USER_ID=$TELEGRAM_USER_ID node {baseDir}/scripts/trading.js check
  2. Ask what they want to trade (stocks vs crypto, symbols, amount, risk)
  3. Propose a concrete plan — WAIT FOR CONFIRMATION
  4. 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

  1. Sign up at https://app.alpaca.markets/brokerage/new-account
  2. Generate API key + secret (Paper Trading section)
  3. Create credentials/{USER_ID}.json or set env vars

API Limits

TierCalls/minData delay
----------------------------
Free20015 min
UnlimitedUnlimitedReal-time

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-19 19:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 165 📥 60,016
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,464
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 65,120