alpaca-trading
БесплатноБез исполняемых скриптовНе проверенExecute trades, analyze markets, and manage portfolios using apcacli command-line tool for Alpaca's Trading API. Use when the user wants to trade stocks…
от lxyeternal★ 68 звёзд на GitHubОб этом скилле
Alpaca Trading Skill
Execute trades and manage portfolios through the apcacli command-line tool for Alpaca's Trading API.
Installation
apcacli is a Rust CLI. Install it cross-platform:
macOS (Homebrew)
brew install rustup
rustup-init -y
source "$HOME/.cargo/env"
cargo install apcacli
Linux
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
cargo install apcacli
Windows
- Download and run rustup-init.exe
- Open a new terminal, then:
cargo install apcacli
Environment Variables
export APCA_API_KEY_ID='your-key-id'
export APCA_API_SECRET_KEY='your-secret-key'
# For live trading (default is paper):
# export APCA_API_BASE_URL='https://api.alpaca.markets'
Overview
You are an expert in using apcacli for command-line stock trading. Your goal is to help users trade stocks, ETFs, options, and crypto efficiently through Alpaca's API while emphasizing safety and best practices.
How to Use This Skill
When helping users with trading tasks:
- Safety First: Always recommend paper trading for new users or when testing
- Verify Commands: Show the exact command before executing trades
- Check Prerequisites: Confirm market hours, account balance, and valid symbols
- Explain Order Types: Help users choose the right order type for their needs
- Risk Management: Suggest stop losses and position sizing
What This Skill Does
apcacli is a Rust-based CLI for interacting with Alpaca's trading platform. It provides:
- Trading: Submit, modify, and cancel orders for stocks, ETFs, options, and crypto
- Portfolio Management: View positions, P/L, and account information
- Market Data: Access asset information and market clock status
- Account Activity: Track trading history and account changes
- Real-time Streaming: Monitor account and trade events
When to Use This Skill
Use this skill when the user wants to:
- Execute trades (buy/sell stocks, ETFs, options, crypto)
- Check portfolio positions and performance
- View or manage orders (open, filled, cancelled)
- Get account balance and buying power
- Access market data and asset information
- Monitor account activity and events
- Check if the market is open
- Set up stop losses or trailing stops
- Automate trading workflows with scripts
Common trigger phrases:
- "Buy 10 shares of AAPL"
- "Show my open positions"
- "What's my account balance?"
- "List all my orders"
- "Cancel order [ID]"
- "Is the market open?"
- "Show my portfolio performance"
- "Set a stop loss on my position"
- "Close all my positions"
When NOT to use this skill:
- User wants GUI-based trading (direct them to web interface)
- User asks for financial advice (you provide tools, not recommendations)
- User wants to trade instruments not supported by Alpaca
- User doesn't have apcacli installed (help them install it first)
Installation & Setup
Install apcacli
# Using Cargo (Rust package manager)
cargo install apcacli
# Verify installation
apcacli --help
Requirements:
- Rust 1.71 or newer
- Alpaca account (paper or live trading)
- Alpaca API credentials
Configure Environment Variables
For Paper Trading (Recommended for testing):
export APCA_API_KEY_ID='your_paper_key_id'
export APCA_API_SECRET_KEY='your_paper_secret_key'
# Paper trading is the default, no need to set APCA_API_BASE_URL
For Live Trading:
export APCA_API_BASE_URL='https://api.alpaca.markets'
export APCA_API_KEY_ID='your_live_key_id'
export APCA_API_SECRET_KEY='your_live_secret_key'
Get API Credentials:
- Sign up at https://alpaca.markets/
- Navigate to your dashboard
- Generate API keys (paper or live)
- Export the environment variables
Core Commands
Account Information
View account details:
apcacli account get
Shows account status, cash balance, buying power, equity, and margin information.
View account activity:
apcacli account activity
Displays recent account activity including trades, dividends, and transfers.
Update account configuration:
apcacli account config <options>
Modify account settings (use --help for available options).
Order Management
Submit a market order:
# Buy with dollar amount
apcacli order submit buy AAPL --value 1000
# Buy specific quantity
apcacli order submit buy AAPL --quantity 10
# Sell shares
apcacli order submit sell TSLA --quantity 5
Submit a limit order:
# Buy at specific price
apcacli order submit buy MSFT --quantity 10 --limit-price 420
# Sell at specific price
apcacli order submit sell NVDA --quantity 20 --limit-price 850
Submit advanced orders:
# Stop order
apcacli order submit sell AAPL --quantity 10 --stop-price 180
# Stop-limit order
apcacli order submit sell TSLA --quantity 5 --stop-price 800 --limit-price 795
# Tra
Установить alpaca-trading в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл alpaca-trading?
Execute trades, analyze markets, and manage portfolios using apcacli command-line tool for Alpaca's Trading API. Use when the user wants to trade stocks, ETFs, options, crypto, check market data, view positions, manage orders, or analyze their portfolio. Also use when they mention "buy," "sell," "trade," "market data," "stock price," "portfolio," "account balance," or "alpaca trading."
Как установить скилл alpaca-trading?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл alpaca-trading запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic