MCPInstall

algo-trading

Implements algorithmic trading strategies using quantitative models and financial APIs for automated trading.

Installs
202
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/alphaonedev/openclaw-graph --skill algo-trading
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads algo-trading automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

algo-trading

Purpose

This skill automates algorithmic trading by integrating quantitative models with financial APIs to execute buy/sell orders based on predefined strategies. It processes market data, runs backtests, and handles live trading to minimize human intervention in financial markets.

When to Use

Use this skill for high-frequency trading, portfolio optimization, or strategy backtesting in volatile markets. Apply it when you need to automate trades based on indicators like moving averages or RSI, especially for stocks, forex, or crypto, to reduce emotional decisions and improve efficiency.

Key Capabilities

  • Fetch real-time or historical data from APIs like Alpha Vantage or Yahoo Finance using endpoints such as /query?function=TIME_SERIES_DAILY.
  • Implement strategies like moving average crossover or mean reversion with built-in functions, e.g., strategy.run('MA_Crossover', params).
  • Backtest models on historical data with metrics like Sharpe ratio, using commands like backtest --data CSV_FILE --strategy STRATEGY_NAME.
  • Execute trades via broker APIs, supporting integration with Alpaca (e.g., POST /v2/orders) or Robinhood, with risk controls like stop-loss.
  • Handle data analysis with libraries like NumPy for calculations, e.g., computing RSI in 2 lines: rsi = talib.RSI(close, timeperiod=14); signals = np.where(rsi > 70, 'sell', 'buy').

Usage Patterns

To use this skill, first set environment variables for authentication, e.g., export ALPHA_VANTAGE_API_KEY=$SERVICE_API_KEY. Initialize the skill in your code with import openclaw; oc = openclaw.Skill('algo-trading'). For CLI, run openclaw algo-trading init --config config.json to load a strategy file. In scripts, call strategies like oc.execute_strategy('MA_Crossover', symbols=['AAPL'], timeframe='1d'). Always wrap calls in try-except blocks for error resilience. For live trading, enable with a flag: oc.run_live('--broker alpaca --key $ALPACA_KEY').

Common Commands/API

  • CLI Command: openclaw algo-trading run --strategy MA_Crossover --symbols AAPL,GOOG --timeframe 1h to execute a strategy on specified stocks.
  • API Endpoint: GET https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=IBM&apikey=$SERVICE_API_KEY for fetching intraday data.
  • Code Snippet:
    import openclaw
    oc = openclaw.Skill('algo-trading')
    data = oc.fetch_data('AAPL', '1d')  # Fetches daily data
    signals = oc.analyze_strategy('MA_Crossover', data)
    
  • Config Format: Use JSON for strategies, e.g., {"strategy": "MA_Crossover", "params": {"short_window": 50, "long_window": 200}, "symbols": ["AAPL"]}. Load via openclaw algo-trading load-config path/to/config.json.
  • Another Command: openclaw algo-trading backtest --file historical.csv --strategy RSI_Overbought --iterations 100 to run simulations.
  • API Call Example: POST https://api.alpaca.markets/v2/orders with body {"symbol": "AAPL", "qty": 10, "side": "buy", "type": "market"} for placing orders, authenticated via $ALPACA_KEY header.

Integration Notes

Integrate by adding the skill to your OpenClaw agent via openclaw add-skill algo-trading. For external APIs, set auth in env vars like export BROKER_API_KEY=$SERVICE_API_KEY and use in code: oc.set_auth('alpaca', os.environ['BROKER_API_KEY']). Ensure data pipelines match, e.g., parse API responses into Pandas DataFrames for analysis. For webhooks, configure callbacks like oc.register_webhook('/triggers', lambda event: oc.execute_strategy('event_strategy')). Test integrations in a sandbox environment first, using flags like --sandbox true to simulate trades without real execution.

Error Handling

Always check for API errors by wrapping calls in try-except, e.g.:

try:
    response = oc.fetch_data('AAPL', '1d')
except APIError as e:
    print(f"API Error: {e.code} - {e.message}")  # Handles 429 for rate limits

Handle common issues like rate limits by implementing retries: use oc.retry_on_error(call_func, max_retries=3). For invalid configs, validate with openclaw algo-trading validate-config config.json, which returns errors like "Missing param: short_window". Log all errors with timestamps for auditing, e.g., via oc.log_error('Trade failed: insufficient funds'). If authentication fails, prompt for env var checks, e.g., ensure $SERVICE_API_KEY is set.

Concrete Usage Examples

  1. Backtesting a Moving Average Strategy: Load historical data and run a backtest. Command: openclaw algo-trading backtest --file aapl_historical.csv --strategy MA_Crossover. In code:

    oc = openclaw.Skill('algo-trading')
    data = oc.load_data('aapl_historical.csv')
    results = oc.backtest_strategy('MA_Crossover', data)
    print(results['sharpe_ratio'])  # Outputs e.g., 1.2
    

    This analyzes past performance to refine the strategy before live use.

  2. Executing a Live Trade on RSI Signal: Fetch real-time data, generate signals, and place an order. Command: openclaw algo-trading run --strategy RSI_Overbought --symbols TSLA --broker alpaca. In code:

    oc = openclaw.Skill('algo-trading')
    rsi_data = oc.fetch_data('TSLA', '1m')
    signal = oc.analyze_strategy('RSI_Overbought', rsi_data)
    if signal == 'sell':
        oc.execute_trade('TSLA', 'sell', 5)  # Sells 5 shares
    

    This automates selling when RSI exceeds 70, using live API calls.

Graph Relationships

  • Depends on: financial-data-fetcher (for market data retrieval)
  • Related to: risk-analysis (for evaluating trade risks)
  • Conflicts with: manual-trading (due to automation focus)
  • Enhances: portfolio-management (by adding automated strategies)

FAQ

What does the algo-trading skill do?

Implements algorithmic trading strategies using quantitative models and financial APIs for automated trading.

How do I install algo-trading?

Run npx skills add https://github.com/alphaonedev/openclaw-graph --skill algo-trading in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/algo-trading/ (personal) or .claude/skills/algo-trading/ (project).

Which AI agents can use algo-trading?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is algo-trading safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains algo-trading?

It is published by alphaonedev in alphaonedev/openclaw-graph. It has 202 recorded installs.

More from alphaonedev/openclaw-graph

View all →

playwright-scraper

alphaonedev/openclaw-graph

Playwright web scraping: dynamic content, auth flows, pagination, data extraction, screenshots

Testing & QA1.6K installs

humanize-ai-text

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

463 installs

gcp-iam

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

DevOps & Cloud431 installs

macos-automation

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

food-order

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

249 installs

tavily-web-search

alphaonedev/openclaw-graph

Open the skill to read its SKILL.md instructions.

Popular business & finance skills

View category →

sales-enablement

coreyhaines31/marketingskills

When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),

Business & Finance119.5K installs

revops

coreyhaines31/marketingskills

When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.

Business & Finance114.1K installs

sales-funnel-blueprint

autonnel/autonnel-skills

Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.

Business & Finance104.5K installs

pricing

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.

Business & Finance80K installs

cross-border-ecommerce

nexscope-ai/ecommerce-skills

Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.

Business & Finance62.9K installs

pricing-strategy

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' or 'should I offer a free plan.' Use this whenever someone is figuring out what to charge or how to structure their plans. For in-app upgrade screens, see paywall-upgrade-cro.

Business & Finance61.2K installs