OpenClaw Install

Building a Trading Bot with OpenClaw

Key Takeaways:
  • OpenClaw is suited for trading monitoring and alerts — price notifications, portfolio P&L reports, and news sentiment analysis — not for automated trade execution
  • Always create read-only API keys on your exchange; never grant trading or withdrawal permissions to any automation tool
  • The news-monitor and csv-analysis skills handle financial news summarization and broker CSV parsing, delivering structured reports via Telegram
  • A daily morning market digest can be scheduled with cron inside Docker Compose, running automatically on weekdays at 8am without any manual intervention
  • Auto-trading with LLMs is inadvisable due to hallucination risk, latency, regulatory exposure, and the absence of a human kill switch — keep humans in the decision loop
  • Total running cost is $8–14 per month (Anthropic API + VPS), making this far cheaper than any commercial trading information service
  • The complete setup — alerts, digest, portfolio report, and on-demand analysis — takes roughly 2–3 hours to configure and requires minimal ongoing maintenance

OpenClaw can monitor crypto and stock markets in real-time, analyze price movements using AI, and send instant Telegram alerts when your conditions are met — all running 24/7 on your own server with no subscription fees beyond the AI model API costs ($3–15/month).

Disclaimer

This guide is for educational and informational purposes only. OpenClaw is not a licensed financial advisor, and nothing in this article constitutes financial advice. The workflows described here are for monitoring, alerting, and data analysis — not automated trading execution. You are solely responsible for any financial decisions you make. Always consult a qualified professional before making investment decisions.

With that said: building a personal market monitoring assistant with OpenClaw is a genuinely useful project that can save hours of manual work every week.

---

What OpenClaw Can Actually Do for Trading

Let's be clear about what is realistic and what is not.

OpenClaw CAN:
  • Monitor price movements and send you alerts when thresholds are crossed
  • Pull your portfolio data and generate P&L reports
  • Summarize financial news and estimate market sentiment
  • Create daily or weekly digest emails/Telegram messages
  • Analyze CSV exports from your broker and identify patterns
  • Answer questions like "which of my positions is down more than 10% this week?"
OpenClaw CANNOT (and should not):
  • Place trades on your behalf automatically
  • Guarantee any prediction accuracy
  • Replace professional financial analysis
  • Safely manage real money without human oversight
The sweet spot for OpenClaw in a trading context is as a personal research assistant and alert system — not as a trading engine.

---

Required Skills

Before building your trading assistant, make sure you have these OpenClaw skills configured:

trading-bot — Core skill for interacting with price data APIs and exchange endpoints. Handles authentication, rate limiting, and data formatting. news-monitor — Fetches and filters financial news from RSS feeds, Reddit, and news APIs. Can apply keyword filters and summarize multiple articles in one pass. csv-analysis — Parses broker CSV exports and generates structured reports. Handles different date formats, currency symbols, and column mappings from popular brokers.

Optional but useful:

  • telegram-notify — Sends formatted messages and alerts to your Telegram chat
  • scheduler — Runs tasks on cron schedules (daily digest, weekly report)
  • web-search — Looks up real-time data when the primary APIs do not have it
Install them from the OpenClaw skills registry before proceeding.

---

Setting Up Exchange API Access (Read-Only Keys!)

This step is critical: always use read-only API keys. Most exchanges let you create API keys with granular permissions. Choose only:

  • Read account balance
  • Read order history
  • Read market data
  • Read positions
Never enable withdrawal or trading permissions on keys used with any automation tool.

Example: Binance

  • Log in to Binance and go to API Management
  • Create a new API key, label it "openclaw-monitor"
  • Disable all trading and withdrawal permissions
  • Enable only "Enable Reading"
  • Save the key and secret — you will only see the secret once
  • Adding to OpenClaw .env

    env
    # Exchange credentials (READ-ONLY)
    BINANCE_API_KEY=your_read_only_key
    BINANCE_API_SECRET=your_read_only_secret
    

    Or for Coinbase Advanced

    COINBASE_API_KEY=your_key COINBASE_API_SECRET=your_secret

    Alpha Vantage for stocks (free tier available)

    ALPHA_VANTAGE_KEY=your_key

    Store these in your .env file and never commit it to git. Add .env to .gitignore immediately.

    ---

    Configuring Price Alerts via Telegram

    Price alerts are the most immediately useful feature. Here is how to set them up:

    1. Create a Telegram bot

  • Open Telegram and message @BotFather
  • Send /newbot and follow the prompts
  • Copy the bot token
  • Start a chat with your new bot, then get your chat ID by visiting: https://api.telegram.org/bot/getUpdates
  • 2. Add credentials to .env

    env
    TELEGRAM_BOT_TOKEN=1234567890:AAxxxxxxxxxxxxxxxxxxxxxx
    TELEGRAM_CHAT_ID=987654321

    3. Configure an alert rule in OpenClaw

    Create a file config/alerts.json:

    json
    {
      "alerts": [
        {
          "id": "btc-drop",
          "asset": "BTC/USDT",
          "condition": "price_below",
          "threshold": 60000,
          "notify": "telegram",
          "cooldown_minutes": 60
        },
        {
          "id": "eth-spike",
          "asset": "ETH/USDT",
          "condition": "price_above",
          "threshold": 4000,
          "notify": "telegram",
          "cooldown_minutes": 120
        },
        {
          "id": "aapl-daily-move",
          "asset": "AAPL",
          "condition": "daily_change_pct_above",
          "threshold": 3,
          "notify": "telegram",
          "cooldown_minutes": 480
        }
      ]
    }

    The cooldown_minutes field prevents alert spam — once triggered, the same alert will not fire again for that period.

    ---

    Building a Daily Market Digest with Cron

    A daily digest saves you from spending 30 minutes every morning skimming financial news. OpenClaw can compile and send it automatically.

    Digest prompt (save as config/digest-prompt.txt)

    You are a financial news analyst assistant. Compile a concise morning market digest:
    
  • Major index moves overnight (S&P 500, NASDAQ, crypto top-5)
  • Top 3 most significant financial news stories
  • Any major earnings reports today
  • Sentiment summary: bullish / neutral / bearish and why
  • Keep the total under 400 words. Use plain language, no jargon. Format for Telegram (use bold with ** and bullet points with -).

    Cron schedule (in docker-compose.yml)

    yaml
    digest-scheduler:
        image: openclaw/agent:latest
        container_name: openclaw_digest
        restart: unless-stopped
        env_file: .env
        environment:
          OCL_TASK: daily-digest
          OCL_SCHEDULE: "0 8   1-5"  # 8am, weekdays
          OCL_PROMPT_FILE: /app/config/digest-prompt.txt
        volumes:
          - ./config:/app/config
          - ./logs/digest:/app/logs

    The digest runs every weekday at 8am and sends the summary to your Telegram chat.

    ---

    Portfolio Tracking and P&L Reports

    Most brokers let you export your transaction history as CSV. OpenClaw's csv-analysis skill can parse these and generate meaningful reports.

    Example workflow

  • Export your broker's transaction CSV (usually under Account > History > Export)
  • Drop the file into data/portfolio/transactions.csv
  • Ask OpenClaw via the web UI or scheduled task:
  • Analyze my portfolio CSV at data/portfolio/transactions.csv.
    Report:
    
    • Current positions and quantities
    • Total cost basis vs current value
    • P&L by asset (realized and unrealized)
    • Best and worst performers this month
    • Any positions down more than 15%
    OpenClaw reads the CSV, fetches current prices via the exchange API or Alpha Vantage, and returns a formatted report. You can send this to Telegram on a weekly schedule.

    Sample output format

    Weekly Portfolio Report — Week 14, 2025
    Positions:
    
    • BTC: 0.45 units | Cost: $22,500 | Now: $27,000 | +$4,500 (+20%)
    • ETH: 2.0 units | Cost: $6,000 | Now: $6,400 | +$400 (+6.7%)
    • AAPL: 10 shares | Cost: $1,750 | Now: $1,920 | +$170 (+9.7%)
    Total Portfolio: $35,320 | Cost Basis: $30,250 | P&L: +$5,070 (+16.8%) Attention: No positions down more than 15%.

    ---

    News Sentiment Analysis Workflow

    Sentiment analysis is where large language models genuinely shine. OpenClaw can read 20 news articles and give you a calibrated summary in seconds — something that would take a human analyst an hour.

    Setup

    Configure news sources in config/news-sources.json:

    json
    {
      "sources": [
        {"type": "rss", "url": "https://feeds.reuters.com/reuters/businessNews"},
        {"type": "rss", "url": "https://feeds.bloomberg.com/markets/news.rss"},
        {"type": "reddit", "subreddit": "investing", "limit": 10},
        {"type": "reddit", "subreddit": "wallstreetbets", "limit": 5}
      ],
      "keywords": ["bitcoin", "federal reserve", "inflation", "earnings"],
      "max_articles": 20
    }

    Sentiment prompt

    Read the following news articles and financial discussions.
    For each asset in my watchlist (BTC, ETH, AAPL, TSLA), rate market sentiment:
    
    • Score: -2 (very bearish) to +2 (very bullish)
    • Key driver: one sentence explaining the dominant narrative
    • Confidence: low / medium / high
    End with an overall market mood assessment.

    This runs as part of the daily digest or on-demand when you want a quick market read.

    ---

    Risk Management: Why NOT to Auto-Trade

    It might be tempting to close the loop — let OpenClaw not just alert you but actually place the trade. Here is why that is a bad idea, even technically:

    Latency. An LLM-based agent adds hundreds of milliseconds of latency. High-frequency strategies are impossible; even moderate-frequency strategies suffer. Hallucination risk. LLMs can misread data or misunderstand context. A hallucination in a monitoring tool means a wrong alert. A hallucination in an auto-trading tool means a real financial loss. No kill switch. Automated trading without a human in the loop can compound losses faster than you can intervene — especially in volatile markets. Regulatory and legal risk. Depending on your jurisdiction, fully automated trading systems may have compliance requirements. The right architecture is: OpenClaw identifies an opportunity and sends you an alert with analysis. You review it, decide, and place the trade manually. The human stays in the loop for the decision that costs money.

    ---

    Cost Breakdown

    One of the best things about this setup is how affordable it is.

    ComponentCost/Month
    Anthropic API (claude-haiku-4-5 for most tasks)$3–8
    Alpha Vantage free tier (stocks)$0
    Exchange API (Binance, Coinbase)$0
    VPS for hosting OpenClaw$5–6
    Telegram bot$0
    Total$8–14/month
    For lighter usage (alerts only, no daily digest), you can stay under $5/month on API costs by using Haiku for everything. Reserve Sonnet for complex analysis tasks only.

    Compare that to Bloomberg Terminal at $2,000/month or even basic trading software subscriptions at $30–100/month.

    ---

    Example Setup Walkthrough

    Here is the full picture of a minimal but complete trading assistant:

    What you will have after setup:
    • BTC and ETH price alerts in Telegram (fires within 5 minutes of threshold breach)
    • Daily weekday digest at 8am with market overview and sentiment
    • Weekly portfolio P&L report every Monday morning
    • On-demand portfolio analysis via web UI
    Files you need:
    openclaw-trading/
    ├── docker-compose.yml
    ├── .env                      # API keys (never commit)
    ├── config/
    │   ├── alerts.json           # Price alert rules
    │   ├── news-sources.json     # RSS and Reddit feeds
    │   └── digest-prompt.txt     # Morning digest instructions
    └── data/
        └── portfolio/
            └── transactions.csv  # Your broker export
    Time to set up: About 2–3 hours for someone comfortable with Docker and APIs. Ongoing maintenance: Minimal. Update the transactions CSV once a week, adjust alert thresholds occasionally. OpenClaw handles the rest.

    This is a legitimate productivity win — you stay informed without screen time, and you make decisions with better context than you would have by scanning headlines manually.

    Alex Werner

    Founder of OpenClaw Install. 5+ years in DevOps and AI infrastructure. Helped 50+ clients deploy AI agents.

    About the author

    Read Also