📈
trader
Open Source
FinanceAnalytics
Alpaca Trading API plugin for OpenCode - stock trading, portfolio management, and market data
trading alpaca stocks market-data
Quick Install
npm install @openpets/trader pnpm add @openpets/trader Required Environment Variables
-
ALPACA_API_KEYAlpaca API key from https://app.alpaca.markets/
-
ALPACA_SECRET_KEYAlpaca secret key from https://app.alpaca.markets/
Available Tools (3)
These tools are available when you install the trader plugin in your AI assistant.
get-account-status
Get Alpaca account status including buying power, cash, portfolio value, and positions
search-stock
Search for stock information including latest price, bars, and asset details
create-trade
Create a buy or sell order for a stock
Example Queries
get account status search for AAPL stock buy 100 shares of TSLA get current positions Usage Scenarios
account management
- 1
get account status - 2
get current positions - 3
get recent orders
trading
- 1
search for GOOGL stock - 2
buy 50 shares of AAPL - 3
sell 10 shares of TSLA
Optional Configuration
| Variable | Description |
|---|---|
ALPACA_PAPER_TRADE | Use paper trading (true) or live trading (false). Default: true |
Use trader with Your AI Assistant
This open source plugin works with OpenCode-compatible AI assistants including ChatGPT, Claude, Perplexity, and other LLM-powered coding tools. Install the plugin and start using natural language to interact with trader.
Works with ChatGPT
Works with Claude
Works with Perplexity
MCP Compatible