{
  "schemaVersion": "1.0",
  "item": {
    "slug": "alpaca-trading",
    "name": "Alpaca Trading",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/lacymorrow/alpaca-trading",
    "canonicalUrl": "https://clawhub.ai/lacymorrow/alpaca-trading",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/alpaca-trading",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=alpaca-trading",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "AGENTS.md",
      "README.md",
      "SKILL.md",
      "_meta.json"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/alpaca-trading"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/alpaca-trading",
    "agentPageUrl": "https://openagent3.xyz/skills/alpaca-trading/agent",
    "manifestUrl": "https://openagent3.xyz/skills/alpaca-trading/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/alpaca-trading/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Alpaca Trading Skill",
        "body": "Execute trades and manage portfolios through the apcacli command-line tool for Alpaca's Trading API."
      },
      {
        "title": "Installation",
        "body": "apcacli is a Rust CLI. Install it cross-platform:"
      },
      {
        "title": "macOS (Homebrew)",
        "body": "brew install rustup\nrustup-init -y\nsource \"$HOME/.cargo/env\"\ncargo install apcacli"
      },
      {
        "title": "Linux",
        "body": "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\nsource \"$HOME/.cargo/env\"\ncargo install apcacli"
      },
      {
        "title": "Windows",
        "body": "Download and run rustup-init.exe\nOpen a new terminal, then: cargo install apcacli"
      },
      {
        "title": "Environment Variables",
        "body": "export APCA_API_KEY_ID='your-key-id'\nexport APCA_API_SECRET_KEY='your-secret-key'\n# For live trading (default is paper):\n# export APCA_API_BASE_URL='https://api.alpaca.markets'"
      },
      {
        "title": "Overview",
        "body": "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."
      },
      {
        "title": "How to Use This Skill",
        "body": "When helping users with trading tasks:\n\nSafety First: Always recommend paper trading for new users or when testing\nVerify Commands: Show the exact command before executing trades\nCheck Prerequisites: Confirm market hours, account balance, and valid symbols\nExplain Order Types: Help users choose the right order type for their needs\nRisk Management: Suggest stop losses and position sizing"
      },
      {
        "title": "What This Skill Does",
        "body": "apcacli is a Rust-based CLI for interacting with Alpaca's trading platform. It provides:\n\nTrading: Submit, modify, and cancel orders for stocks, ETFs, options, and crypto\nPortfolio Management: View positions, P/L, and account information\nMarket Data: Access asset information and market clock status\nAccount Activity: Track trading history and account changes\nReal-time Streaming: Monitor account and trade events"
      },
      {
        "title": "When to Use This Skill",
        "body": "Use this skill when the user wants to:\n\nExecute trades (buy/sell stocks, ETFs, options, crypto)\nCheck portfolio positions and performance\nView or manage orders (open, filled, cancelled)\nGet account balance and buying power\nAccess market data and asset information\nMonitor account activity and events\nCheck if the market is open\nSet up stop losses or trailing stops\nAutomate trading workflows with scripts\n\nCommon trigger phrases:\n\n\"Buy 10 shares of AAPL\"\n\"Show my open positions\"\n\"What's my account balance?\"\n\"List all my orders\"\n\"Cancel order [ID]\"\n\"Is the market open?\"\n\"Show my portfolio performance\"\n\"Set a stop loss on my position\"\n\"Close all my positions\"\n\nWhen NOT to use this skill:\n\nUser wants GUI-based trading (direct them to web interface)\nUser asks for financial advice (you provide tools, not recommendations)\nUser wants to trade instruments not supported by Alpaca\nUser doesn't have apcacli installed (help them install it first)"
      },
      {
        "title": "Install apcacli",
        "body": "# Using Cargo (Rust package manager)\ncargo install apcacli\n\n# Verify installation\napcacli --help\n\nRequirements:\n\nRust 1.71 or newer\nAlpaca account (paper or live trading)\nAlpaca API credentials"
      },
      {
        "title": "Configure Environment Variables",
        "body": "For Paper Trading (Recommended for testing):\n\nexport APCA_API_KEY_ID='your_paper_key_id'\nexport APCA_API_SECRET_KEY='your_paper_secret_key'\n# Paper trading is the default, no need to set APCA_API_BASE_URL\n\nFor Live Trading:\n\nexport APCA_API_BASE_URL='https://api.alpaca.markets'\nexport APCA_API_KEY_ID='your_live_key_id'\nexport APCA_API_SECRET_KEY='your_live_secret_key'\n\nGet API Credentials:\n\nSign up at https://alpaca.markets/\nNavigate to your dashboard\nGenerate API keys (paper or live)\nExport the environment variables"
      },
      {
        "title": "Account Information",
        "body": "View account details:\n\napcacli account get\n\nShows account status, cash balance, buying power, equity, and margin information.\n\nView account activity:\n\napcacli account activity\n\nDisplays recent account activity including trades, dividends, and transfers.\n\nUpdate account configuration:\n\napcacli account config <options>\n\nModify account settings (use --help for available options)."
      },
      {
        "title": "Order Management",
        "body": "Submit a market order:\n\n# Buy with dollar amount\napcacli order submit buy AAPL --value 1000\n\n# Buy specific quantity\napcacli order submit buy AAPL --quantity 10\n\n# Sell shares\napcacli order submit sell TSLA --quantity 5\n\nSubmit a limit order:\n\n# Buy at specific price\napcacli order submit buy MSFT --quantity 10 --limit-price 420\n\n# Sell at specific price\napcacli order submit sell NVDA --quantity 20 --limit-price 850\n\nSubmit advanced orders:\n\n# Stop order\napcacli order submit sell AAPL --quantity 10 --stop-price 180\n\n# Stop-limit order\napcacli order submit sell TSLA --quantity 5 --stop-price 800 --limit-price 795\n\n# Trailing stop order (percentage)\napcacli order submit sell NVDA --quantity 10 --trail-percent 5\n\nList all orders:\n\napcacli order list\n\nShows all orders with their status (open, filled, cancelled, etc.).\n\nGet specific order details:\n\napcacli order get <ORDER_ID>\n\nDisplays comprehensive order information including timestamps, pricing, and status.\n\nCancel an order:\n\napcacli order cancel <ORDER_ID>\n\nCancels a pending order by its ID.\n\nCancel all orders:\n\napcacli order cancel-all\n\nCancels all open orders."
      },
      {
        "title": "Position Management",
        "body": "List all open positions:\n\napcacli position list\n\nShows all open positions with:\n\nQuantity and entry price\nCurrent market value\nDaily P/L (with percentage)\nTotal P/L (with percentage)\nColor-coded profit/loss\n\nGet specific position:\n\napcacli position get <SYMBOL>\n\nDisplays detailed information for a specific position.\n\nClose a position:\n\n# Close entire position\napcacli position close <SYMBOL>\n\n# Close partial position\napcacli position close <SYMBOL> --quantity 5\n\nClose all positions:\n\napcacli position close-all\n\nCloses all open positions."
      },
      {
        "title": "Asset Information",
        "body": "List available assets:\n\napcacli asset list\n\nShows all tradeable assets.\n\nGet asset details:\n\napcacli asset get <SYMBOL>\n\nDisplays asset information including exchange, class, and tradability status.\n\nSearch for assets:\n\napcacli asset search <QUERY>\n\nSearches for assets matching the query."
      },
      {
        "title": "Market Data",
        "body": "Check market clock:\n\napcacli market clock\n\nShows current market status (open/closed), next open time, and next close time."
      },
      {
        "title": "Streaming (Real-time Events)",
        "body": "Stream account updates:\n\napcacli stream account\n\nMonitors real-time account events including order updates and fills.\n\nStream trade updates:\n\napcacli stream trades\n\nMonitors real-time trade events for your positions."
      },
      {
        "title": "Safety & Risk Management",
        "body": "Start with Paper Trading - Always test strategies with paper trading first\nUse Limit Orders - Avoid market orders in volatile conditions for better price control\nVerify Symbols - Double-check ticker symbols before executing trades\nReview Before Executing - Use apcacli order get to verify order details\nSet Stop Losses - Protect positions with stop orders\nCheck Account Balance - Ensure sufficient buying power before trading\nMonitor Positions - Regularly review P/L with apcacli position list"
      },
      {
        "title": "Effective Usage",
        "body": "Check help for any command - Use apcacli <command> --help for detailed options\nSave order IDs - Store returned order IDs to track and manage orders later\nUse environment variables - Keep credentials secure in environment variables, never hardcode\nVerify market hours - Check apcacli market clock before placing orders\nReview activity regularly - Monitor account activity for unexpected changes"
      },
      {
        "title": "Common Workflows",
        "body": "Simple stock purchase:\n\n# 1. Check account balance\napcacli account get\n\n# 2. Verify asset is tradeable\napcacli asset get AAPL\n\n# 3. Check market is open\napcacli market clock\n\n# 4. Submit market order\napcacli order submit buy AAPL --value 1000\n\n# 5. Verify position\napcacli position list\n\nLimit order with monitoring:\n\n# 1. Submit limit order\napcacli order submit buy MSFT --quantity 10 --limit-price 420\n\n# 2. Save the returned ORDER_ID\n# 3. Check order status\napcacli order get <ORDER_ID>\n\n# 4. If needed, cancel\napcacli order cancel <ORDER_ID>\n\nPortfolio review:\n\n# 1. View all positions\napcacli position list\n\n# 2. Check account summary\napcacli account get\n\n# 3. Review recent activity\napcacli account activity\n\nClose position with stop loss:\n\n# 1. Check current position\napcacli position get AAPL\n\n# 2. Set trailing stop to protect profits\napcacli order submit sell AAPL --quantity 10 --trail-percent 5\n\n# 3. Monitor the order\napcacli order list"
      },
      {
        "title": "Command Reference Quick Guide",
        "body": "TaskCommandView accountapcacli account getAccount activityapcacli account activityBuy stock (market)apcacli order submit buy SYMBOL --value AMOUNTBuy stock (limit)apcacli order submit buy SYMBOL --quantity N --limit-price PRICESell stockapcacli order submit sell SYMBOL --quantity NList all ordersapcacli order listGet order detailsapcacli order get ORDER_IDCancel orderapcacli order cancel ORDER_IDCancel all ordersapcacli order cancel-allList positionsapcacli position listGet positionapcacli position get SYMBOLClose positionapcacli position close SYMBOLClose all positionsapcacli position close-allList assetsapcacli asset listGet asset infoapcacli asset get SYMBOLCheck market statusapcacli market clockStream account eventsapcacli stream accountStream tradesapcacli stream trades"
      },
      {
        "title": "Basic Order Parameters",
        "body": "--quantity N - Number of shares to trade\n--value AMOUNT - Dollar amount to invest (for market orders)\n--limit-price PRICE - Limit price for limit orders\n--stop-price PRICE - Stop price for stop orders\n--trail-percent N - Trailing stop percentage\n--trail-amount AMOUNT - Trailing stop dollar amount"
      },
      {
        "title": "Order Types",
        "body": "Market Order - Executes immediately at current market price\n\napcacli order submit buy AAPL --quantity 10\n\nLimit Order - Executes only at specified price or better\n\napcacli order submit buy AAPL --quantity 10 --limit-price 185\n\nStop Order - Converts to market order when stop price is reached\n\napcacli order submit sell AAPL --quantity 10 --stop-price 180\n\nStop-Limit Order - Converts to limit order when stop price is reached\n\napcacli order submit sell AAPL --quantity 10 --stop-price 180 --limit-price 179\n\nTrailing Stop - Stop price follows market by specified percentage or amount\n\n# Percentage-based\napcacli order submit sell AAPL --quantity 10 --trail-percent 5\n\n# Dollar-based\napcacli order submit sell AAPL --quantity 10 --trail-amount 10"
      },
      {
        "title": "Requirements",
        "body": "apcacli binary must be installed - Install via cargo install apcacli\nEnvironment variables must be set - APCA_API_KEY_ID and APCA_API_SECRET_KEY are required\nAlpaca account - Active paper or live trading account\nRust 1.71+ - Required for installation from source"
      },
      {
        "title": "Trading Limitations",
        "body": "Paper vs Live: Default is paper trading; set APCA_API_BASE_URL for live trading\nMarket hours: Most trades only execute during market hours (9:30 AM - 4:00 PM ET)\nPattern Day Trading (PDT): Accounts under $25k have PDT restrictions\nBuying power: Limited by account equity and margin requirements\nOrder restrictions: Some order types may not be available for all securities\nCrypto trading: May have different rules and trading hours"
      },
      {
        "title": "Data & Performance",
        "body": "API rate limits: Alpaca has request limits to prevent abuse\nReal-time data: May require active data subscription\nCommand output: Results formatted with color coding for easy reading\nOrder IDs: Save returned order IDs for tracking and management\nNetwork dependency: Requires internet connection to Alpaca's API"
      },
      {
        "title": "Environment Variables Not Set",
        "body": "# Error: \"Missing APCA_API_KEY_ID\"\n# Solution: Export required environment variables\nexport APCA_API_KEY_ID='your_key'\nexport APCA_API_SECRET_KEY='your_secret'"
      },
      {
        "title": "Command Not Found",
        "body": "# Error: \"apcacli: command not found\"\n# Solution: Install apcacli\ncargo install apcacli\n\n# Verify installation\nwhich apcacli"
      },
      {
        "title": "API Authentication Failed",
        "body": "Verify API credentials are correct\nCheck if using correct endpoint (paper vs live)\nEnsure API keys haven't been revoked\nConfirm account status is active"
      },
      {
        "title": "Order Rejected",
        "body": "Verify market is open (for stocks)\nCheck sufficient buying power\nConfirm symbol is valid and tradeable\nReview order parameters (price, quantity)\nCheck for any account restrictions"
      },
      {
        "title": "Position Not Found",
        "body": "Verify symbol is correct\nEnsure position is actually open\nCheck if position was closed previously\nConfirm you're using the right account (paper vs live)"
      },
      {
        "title": "Shell Completion",
        "body": "Generate shell completion for faster command entry:\n\n# Install completion script\ncargo run --bin=shell-complete > apcacli.bash\nsource apcacli.bash\n\n# Now you can use tab completion\napcacli order <TAB>"
      },
      {
        "title": "Streaming for Monitoring",
        "body": "Use streaming commands to monitor account activity in real-time:\n\n# Terminal 1: Monitor account events\napcacli stream account\n\n# Terminal 2: Execute trades\napcacli order submit buy AAPL --value 1000\n# Watch the fill notification appear in Terminal 1"
      },
      {
        "title": "Scripting & Automation",
        "body": "Combine apcacli with shell scripts for automated strategies:\n\n#!/bin/bash\n# Example: Daily portfolio check script\n\necho \"=== Daily Portfolio Report ===\"\necho \"\"\necho \"Account Status:\"\napcacli account get\necho \"\"\necho \"Open Positions:\"\napcacli position list\necho \"\"\necho \"Recent Activity:\"\napcacli account activity"
      },
      {
        "title": "Additional Resources",
        "body": "apcacli Repository: https://github.com/d-e-s-o/apcacli\nAlpaca Documentation: https://docs.alpaca.markets/\nAlpaca API Reference: https://docs.alpaca.markets/reference/\nPaper Trading Dashboard: https://app.alpaca.markets/paper/dashboard/overview\napca Crate (Underlying Library): https://github.com/d-e-s-o/apca"
      },
      {
        "title": "Safety Reminders",
        "body": "⚠️ IMPORTANT:\n\nAlways start with PAPER TRADING to test without risk\nReview all order details before execution\nNever share your API credentials\nUse limit orders for better price control\nSet stop losses to manage risk\nVerify environment variables are set correctly (paper vs live)\nDouble-check symbols and quantities\nMonitor positions regularly"
      },
      {
        "title": "Credits",
        "body": "apcacli created by d-e-s-o\n\nBuilt on the apca Rust crate for Alpaca API interactions."
      }
    ],
    "body": "Alpaca Trading Skill\n\nExecute trades and manage portfolios through the apcacli command-line tool for Alpaca's Trading API.\n\nInstallation\n\napcacli is a Rust CLI. Install it cross-platform:\n\nmacOS (Homebrew)\nbrew install rustup\nrustup-init -y\nsource \"$HOME/.cargo/env\"\ncargo install apcacli\n\nLinux\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\nsource \"$HOME/.cargo/env\"\ncargo install apcacli\n\nWindows\nDownload and run rustup-init.exe\nOpen a new terminal, then: cargo install apcacli\nEnvironment Variables\nexport APCA_API_KEY_ID='your-key-id'\nexport APCA_API_SECRET_KEY='your-secret-key'\n# For live trading (default is paper):\n# export APCA_API_BASE_URL='https://api.alpaca.markets'\n\nOverview\n\nYou 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.\n\nHow to Use This Skill\n\nWhen helping users with trading tasks:\n\nSafety First: Always recommend paper trading for new users or when testing\nVerify Commands: Show the exact command before executing trades\nCheck Prerequisites: Confirm market hours, account balance, and valid symbols\nExplain Order Types: Help users choose the right order type for their needs\nRisk Management: Suggest stop losses and position sizing\nWhat This Skill Does\n\napcacli is a Rust-based CLI for interacting with Alpaca's trading platform. It provides:\n\nTrading: Submit, modify, and cancel orders for stocks, ETFs, options, and crypto\nPortfolio Management: View positions, P/L, and account information\nMarket Data: Access asset information and market clock status\nAccount Activity: Track trading history and account changes\nReal-time Streaming: Monitor account and trade events\nWhen to Use This Skill\n\nUse this skill when the user wants to:\n\nExecute trades (buy/sell stocks, ETFs, options, crypto)\nCheck portfolio positions and performance\nView or manage orders (open, filled, cancelled)\nGet account balance and buying power\nAccess market data and asset information\nMonitor account activity and events\nCheck if the market is open\nSet up stop losses or trailing stops\nAutomate trading workflows with scripts\n\nCommon trigger phrases:\n\n\"Buy 10 shares of AAPL\"\n\"Show my open positions\"\n\"What's my account balance?\"\n\"List all my orders\"\n\"Cancel order [ID]\"\n\"Is the market open?\"\n\"Show my portfolio performance\"\n\"Set a stop loss on my position\"\n\"Close all my positions\"\n\nWhen NOT to use this skill:\n\nUser wants GUI-based trading (direct them to web interface)\nUser asks for financial advice (you provide tools, not recommendations)\nUser wants to trade instruments not supported by Alpaca\nUser doesn't have apcacli installed (help them install it first)\nInstallation & Setup\nInstall apcacli\n# Using Cargo (Rust package manager)\ncargo install apcacli\n\n# Verify installation\napcacli --help\n\n\nRequirements:\n\nRust 1.71 or newer\nAlpaca account (paper or live trading)\nAlpaca API credentials\nConfigure Environment Variables\n\nFor Paper Trading (Recommended for testing):\n\nexport APCA_API_KEY_ID='your_paper_key_id'\nexport APCA_API_SECRET_KEY='your_paper_secret_key'\n# Paper trading is the default, no need to set APCA_API_BASE_URL\n\n\nFor Live Trading:\n\nexport APCA_API_BASE_URL='https://api.alpaca.markets'\nexport APCA_API_KEY_ID='your_live_key_id'\nexport APCA_API_SECRET_KEY='your_live_secret_key'\n\n\nGet API Credentials:\n\nSign up at https://alpaca.markets/\nNavigate to your dashboard\nGenerate API keys (paper or live)\nExport the environment variables\nCore Commands\nAccount Information\n\nView account details:\n\napcacli account get\n\n\nShows account status, cash balance, buying power, equity, and margin information.\n\nView account activity:\n\napcacli account activity\n\n\nDisplays recent account activity including trades, dividends, and transfers.\n\nUpdate account configuration:\n\napcacli account config <options>\n\n\nModify account settings (use --help for available options).\n\nOrder Management\n\nSubmit a market order:\n\n# Buy with dollar amount\napcacli order submit buy AAPL --value 1000\n\n# Buy specific quantity\napcacli order submit buy AAPL --quantity 10\n\n# Sell shares\napcacli order submit sell TSLA --quantity 5\n\n\nSubmit a limit order:\n\n# Buy at specific price\napcacli order submit buy MSFT --quantity 10 --limit-price 420\n\n# Sell at specific price\napcacli order submit sell NVDA --quantity 20 --limit-price 850\n\n\nSubmit advanced orders:\n\n# Stop order\napcacli order submit sell AAPL --quantity 10 --stop-price 180\n\n# Stop-limit order\napcacli order submit sell TSLA --quantity 5 --stop-price 800 --limit-price 795\n\n# Trailing stop order (percentage)\napcacli order submit sell NVDA --quantity 10 --trail-percent 5\n\n\nList all orders:\n\napcacli order list\n\n\nShows all orders with their status (open, filled, cancelled, etc.).\n\nGet specific order details:\n\napcacli order get <ORDER_ID>\n\n\nDisplays comprehensive order information including timestamps, pricing, and status.\n\nCancel an order:\n\napcacli order cancel <ORDER_ID>\n\n\nCancels a pending order by its ID.\n\nCancel all orders:\n\napcacli order cancel-all\n\n\nCancels all open orders.\n\nPosition Management\n\nList all open positions:\n\napcacli position list\n\n\nShows all open positions with:\n\nQuantity and entry price\nCurrent market value\nDaily P/L (with percentage)\nTotal P/L (with percentage)\nColor-coded profit/loss\n\nGet specific position:\n\napcacli position get <SYMBOL>\n\n\nDisplays detailed information for a specific position.\n\nClose a position:\n\n# Close entire position\napcacli position close <SYMBOL>\n\n# Close partial position\napcacli position close <SYMBOL> --quantity 5\n\n\nClose all positions:\n\napcacli position close-all\n\n\nCloses all open positions.\n\nAsset Information\n\nList available assets:\n\napcacli asset list\n\n\nShows all tradeable assets.\n\nGet asset details:\n\napcacli asset get <SYMBOL>\n\n\nDisplays asset information including exchange, class, and tradability status.\n\nSearch for assets:\n\napcacli asset search <QUERY>\n\n\nSearches for assets matching the query.\n\nMarket Data\n\nCheck market clock:\n\napcacli market clock\n\n\nShows current market status (open/closed), next open time, and next close time.\n\nStreaming (Real-time Events)\n\nStream account updates:\n\napcacli stream account\n\n\nMonitors real-time account events including order updates and fills.\n\nStream trade updates:\n\napcacli stream trades\n\n\nMonitors real-time trade events for your positions.\n\nBest Practices\nSafety & Risk Management\nStart with Paper Trading - Always test strategies with paper trading first\nUse Limit Orders - Avoid market orders in volatile conditions for better price control\nVerify Symbols - Double-check ticker symbols before executing trades\nReview Before Executing - Use apcacli order get to verify order details\nSet Stop Losses - Protect positions with stop orders\nCheck Account Balance - Ensure sufficient buying power before trading\nMonitor Positions - Regularly review P/L with apcacli position list\nEffective Usage\nCheck help for any command - Use apcacli <command> --help for detailed options\nSave order IDs - Store returned order IDs to track and manage orders later\nUse environment variables - Keep credentials secure in environment variables, never hardcode\nVerify market hours - Check apcacli market clock before placing orders\nReview activity regularly - Monitor account activity for unexpected changes\nCommon Workflows\n\nSimple stock purchase:\n\n# 1. Check account balance\napcacli account get\n\n# 2. Verify asset is tradeable\napcacli asset get AAPL\n\n# 3. Check market is open\napcacli market clock\n\n# 4. Submit market order\napcacli order submit buy AAPL --value 1000\n\n# 5. Verify position\napcacli position list\n\n\nLimit order with monitoring:\n\n# 1. Submit limit order\napcacli order submit buy MSFT --quantity 10 --limit-price 420\n\n# 2. Save the returned ORDER_ID\n# 3. Check order status\napcacli order get <ORDER_ID>\n\n# 4. If needed, cancel\napcacli order cancel <ORDER_ID>\n\n\nPortfolio review:\n\n# 1. View all positions\napcacli position list\n\n# 2. Check account summary\napcacli account get\n\n# 3. Review recent activity\napcacli account activity\n\n\nClose position with stop loss:\n\n# 1. Check current position\napcacli position get AAPL\n\n# 2. Set trailing stop to protect profits\napcacli order submit sell AAPL --quantity 10 --trail-percent 5\n\n# 3. Monitor the order\napcacli order list\n\nCommand Reference Quick Guide\nTask\tCommand\nView account\tapcacli account get\nAccount activity\tapcacli account activity\nBuy stock (market)\tapcacli order submit buy SYMBOL --value AMOUNT\nBuy stock (limit)\tapcacli order submit buy SYMBOL --quantity N --limit-price PRICE\nSell stock\tapcacli order submit sell SYMBOL --quantity N\nList all orders\tapcacli order list\nGet order details\tapcacli order get ORDER_ID\nCancel order\tapcacli order cancel ORDER_ID\nCancel all orders\tapcacli order cancel-all\nList positions\tapcacli position list\nGet position\tapcacli position get SYMBOL\nClose position\tapcacli position close SYMBOL\nClose all positions\tapcacli position close-all\nList assets\tapcacli asset list\nGet asset info\tapcacli asset get SYMBOL\nCheck market status\tapcacli market clock\nStream account events\tapcacli stream account\nStream trades\tapcacli stream trades\nOrder Types & Parameters\nBasic Order Parameters\n--quantity N - Number of shares to trade\n--value AMOUNT - Dollar amount to invest (for market orders)\n--limit-price PRICE - Limit price for limit orders\n--stop-price PRICE - Stop price for stop orders\n--trail-percent N - Trailing stop percentage\n--trail-amount AMOUNT - Trailing stop dollar amount\nOrder Types\n\nMarket Order - Executes immediately at current market price\n\napcacli order submit buy AAPL --quantity 10\n\n\nLimit Order - Executes only at specified price or better\n\napcacli order submit buy AAPL --quantity 10 --limit-price 185\n\n\nStop Order - Converts to market order when stop price is reached\n\napcacli order submit sell AAPL --quantity 10 --stop-price 180\n\n\nStop-Limit Order - Converts to limit order when stop price is reached\n\napcacli order submit sell AAPL --quantity 10 --stop-price 180 --limit-price 179\n\n\nTrailing Stop - Stop price follows market by specified percentage or amount\n\n# Percentage-based\napcacli order submit sell AAPL --quantity 10 --trail-percent 5\n\n# Dollar-based\napcacli order submit sell AAPL --quantity 10 --trail-amount 10\n\nImportant Notes\nRequirements\napcacli binary must be installed - Install via cargo install apcacli\nEnvironment variables must be set - APCA_API_KEY_ID and APCA_API_SECRET_KEY are required\nAlpaca account - Active paper or live trading account\nRust 1.71+ - Required for installation from source\nTrading Limitations\nPaper vs Live: Default is paper trading; set APCA_API_BASE_URL for live trading\nMarket hours: Most trades only execute during market hours (9:30 AM - 4:00 PM ET)\nPattern Day Trading (PDT): Accounts under $25k have PDT restrictions\nBuying power: Limited by account equity and margin requirements\nOrder restrictions: Some order types may not be available for all securities\nCrypto trading: May have different rules and trading hours\nData & Performance\nAPI rate limits: Alpaca has request limits to prevent abuse\nReal-time data: May require active data subscription\nCommand output: Results formatted with color coding for easy reading\nOrder IDs: Save returned order IDs for tracking and management\nNetwork dependency: Requires internet connection to Alpaca's API\nTroubleshooting\nEnvironment Variables Not Set\n# Error: \"Missing APCA_API_KEY_ID\"\n# Solution: Export required environment variables\nexport APCA_API_KEY_ID='your_key'\nexport APCA_API_SECRET_KEY='your_secret'\n\nCommand Not Found\n# Error: \"apcacli: command not found\"\n# Solution: Install apcacli\ncargo install apcacli\n\n# Verify installation\nwhich apcacli\n\nAPI Authentication Failed\nVerify API credentials are correct\nCheck if using correct endpoint (paper vs live)\nEnsure API keys haven't been revoked\nConfirm account status is active\nOrder Rejected\nVerify market is open (for stocks)\nCheck sufficient buying power\nConfirm symbol is valid and tradeable\nReview order parameters (price, quantity)\nCheck for any account restrictions\nPosition Not Found\nVerify symbol is correct\nEnsure position is actually open\nCheck if position was closed previously\nConfirm you're using the right account (paper vs live)\nAdvanced Features\nShell Completion\n\nGenerate shell completion for faster command entry:\n\n# Install completion script\ncargo run --bin=shell-complete > apcacli.bash\nsource apcacli.bash\n\n# Now you can use tab completion\napcacli order <TAB>\n\nStreaming for Monitoring\n\nUse streaming commands to monitor account activity in real-time:\n\n# Terminal 1: Monitor account events\napcacli stream account\n\n# Terminal 2: Execute trades\napcacli order submit buy AAPL --value 1000\n# Watch the fill notification appear in Terminal 1\n\nScripting & Automation\n\nCombine apcacli with shell scripts for automated strategies:\n\n#!/bin/bash\n# Example: Daily portfolio check script\n\necho \"=== Daily Portfolio Report ===\"\necho \"\"\necho \"Account Status:\"\napcacli account get\necho \"\"\necho \"Open Positions:\"\napcacli position list\necho \"\"\necho \"Recent Activity:\"\napcacli account activity\n\nAdditional Resources\napcacli Repository: https://github.com/d-e-s-o/apcacli\nAlpaca Documentation: https://docs.alpaca.markets/\nAlpaca API Reference: https://docs.alpaca.markets/reference/\nPaper Trading Dashboard: https://app.alpaca.markets/paper/dashboard/overview\napca Crate (Underlying Library): https://github.com/d-e-s-o/apca\nSafety Reminders\n\n⚠️ IMPORTANT:\n\nAlways start with PAPER TRADING to test without risk\nReview all order details before execution\nNever share your API credentials\nUse limit orders for better price control\nSet stop losses to manage risk\nVerify environment variables are set correctly (paper vs live)\nDouble-check symbols and quantities\nMonitor positions regularly\nCredits\n\napcacli created by d-e-s-o\n\nBuilt on the apca Rust crate for Alpaca API interactions."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/lacymorrow/alpaca-trading",
    "publisherUrl": "https://clawhub.ai/lacymorrow/alpaca-trading",
    "owner": "lacymorrow",
    "version": "1.2.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/alpaca-trading",
    "downloadUrl": "https://openagent3.xyz/downloads/alpaca-trading",
    "agentUrl": "https://openagent3.xyz/skills/alpaca-trading/agent",
    "manifestUrl": "https://openagent3.xyz/skills/alpaca-trading/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/alpaca-trading/agent.md"
  }
}