market-analyst avatar

market-analyst

Cryptocurrency and stock market analysis with real-time data and technical indicators

financecryptocurrencystockstradinganalysismarket-datatechnical-analysiscoingeckoalphavantage
by openhatchβ€’about 2 months ago

Quick Start

# Install and run
openhatch run @openhatch/market-analyst

Template Contents

Browse files before installing this template.

Loading template files…

About

Market Analyst Agent

Comprehensive cryptocurrency and stock market analysis powered by Claude Sonnet

A sophisticated AI agent that provides real-time market data, technical analysis, and investment insights. Combines data from CoinGecko (crypto) and Alpha Vantage (stocks) with Claude's analytical capabilities to deliver professional-grade market intelligence.

What It Does

The Market Analyst agent is your personal financial data scientist:

  • Real-time price data for cryptocurrencies and stocks
  • Technical analysis with indicators (RSI, MACD, moving averages, Bollinger Bands)
  • Market comparisons across assets and timeframes
  • Trend analysis with visual markdown charts
  • Portfolio insights (performance tracking, allocation analysis)
  • Market summaries on demand or scheduled
  • News context via web research integration

Key Features

πŸ“Š Multi-Asset Support

  • Cryptocurrencies via CoinGecko API (Bitcoin, Ethereum, 10,000+ coins)
  • Stocks via Alpha Vantage API (US equities, global markets)
  • Market cap rankings and volume analysis
  • Historical data (1 day to 1 year lookback)

πŸ” Technical Analysis

  • RSI (Relative Strength Index) β€” overbought/oversold signals
  • MACD (Moving Average Convergence Divergence)
  • SMA/EMA (Simple/Exponential Moving Averages)
  • Bollinger Bands and volatility metrics
  • Support/resistance level detection

πŸ’‘ Intelligent Insights

  • Pattern recognition (breakouts, reversals, trends)
  • Correlation analysis between assets
  • Risk assessment and volatility scoring
  • Market sentiment interpretation
  • Plain-English explanations of technical concepts

πŸ›‘οΈ Safety & Disclaimers

  • Always includes investment disclaimer
  • Never provides financial advice (informational only)
  • Cites data sources and timestamps
  • Transparent about data limitations

Quick Start

Prerequisites

  1. OpenClaw runtime installed (docs)
  2. API keys (see Configuration below)
  3. Messaging platform (Telegram, Discord, Slack, or direct chat)

Installation

# Install from Hatchery
hatchery run @openclaw/market-analyst

# The CLI will prompt you for required API keys

Configuration

Create a .env file with your API credentials:

# CoinGecko API (required for crypto)
# Free tier: 10-50 calls/minute
# Get your key at: https://www.coingecko.com/en/api/pricing
COINGECKO_API_KEY=your_key_here

# Alpha Vantage API (required for stocks)
# Free tier: 25 calls/day, 5 calls/minute
# Get your key at: https://www.alphavantage.co/support/#api-key
ALPHA_VANTAGE_API_KEY=your_key_here

# Optional: Your timezone for time-aware features
USER_TIMEZONE=America/New_York

First Run

# Start the agent
hatchery run @openclaw/market-analyst

# In your chat interface:
You: "What's the current Bitcoin price?"
Agent: "Bitcoin (BTC) is currently trading at $45,234.56..."

You: "Analyze AAPL stock with technical indicators"
Agent: "Let me fetch the latest data for Apple (AAPL)..."

Usage Examples

Cryptocurrency Analysis

You: "Bitcoin price and 24h change"
Agent: Fetches current BTC price, 24h volume, market cap, % change

You: "Compare ETH and SOL performance this week"
Agent: 7-day chart comparison with % gains/losses

You: "Is BTC overbought? Show RSI"
Agent: Calculates RSI, explains overbought/oversold levels (>70/<30)

You: "Top 10 cryptos by market cap"
Agent: Ranked list with prices and 24h changes

Stock Market Analysis

You: "AAPL technical analysis"
Agent: Full analysis with RSI, MACD, moving averages, trend assessment

You: "Is TSLA in an uptrend?"
Agent: Checks 50/200 day moving averages, price action, momentum

You: "Compare MSFT and GOOGL"
Agent: Side-by-side performance, valuation metrics, trends

You: "SPY weekly summary"
Agent: S&P 500 ETF performance, key levels, market sentiment

Advanced Queries

You: "Which cryptos are down >20% this week?"
Agent: Scans top 100, filters by % change, sorted list

You: "Correlation between BTC and tech stocks"
Agent: Fetches data, calculates correlation coefficient, explains

You: "Bollinger Bands for ETH"
Agent: Calculates bands, shows where price is relative to upper/lower

You: "What's driving BTC price today?"
Agent: Uses web_fetch to check crypto news, summarizes key events

How It Works

Architecture

User Query β†’ Agent (Claude Sonnet) β†’ Skills β†’ External APIs β†’ Analysis β†’ Response
                ↓
             MEMORY.md (learns preferences, watchlists)
  1. Query Understanding β€” Agent parses your request (asset, timeframe, indicators)
  2. Data Fetching β€” Invokes appropriate skill (CoinGecko or Alpha Vantage)
  3. Technical Analysis β€” Calculates indicators using historical data
  4. Insight Generation β€” Claude analyzes patterns, trends, risk factors
  5. Response Formatting β€” Markdown tables, charts, plain-English summary
  6. Memory Update β€” Saves frequently requested assets to watchlist

Skills Included

coingecko β€” Cryptocurrency Data

  • fetch-price.sh β€” Current price, volume, market cap
  • fetch-history.sh β€” Historical OHLCV data (1d to 1y)
  • Rate limit handling (50 calls/min free, 500/min pro)

alphavantage β€” Stock Market Data

  • fetch-quote.sh β€” Real-time stock quote
  • fetch-daily.sh β€” Daily time series (100 days)
  • fetch-intraday.sh β€” Intraday prices (5/15/30/60 min intervals)

Session Security

  • Main session (operator): Full access, can write to MEMORY.md, update watchlists
  • DM sessions: Read-only market data, no memory writes (privacy)
  • Group sessions: Not recommended (financial data should be private)

Configuration Options

Customize Behavior

Edit MEMORY.md to set preferences:

## My Watchlist
- Bitcoin (BTC)
- Ethereum (ETH)
- Apple (AAPL)
- S&P 500 (SPY)

## Default Settings
- Preferred timeframe: 7 days
- Always include: RSI, MACD
- Alert threshold: Β±10% daily move

API Tier Considerations

CoinGecko Free vs Pro:

  • Free: 10-50 calls/min, 10,000/month β€” fine for personal use
  • Pro ($4.99/mo): 500 calls/min, 500,000/month β€” for heavy users

Alpha Vantage Free vs Premium:

  • Free: 25 calls/day β€” limited to ~5 stocks per day
  • Premium ($50/mo): 75 calls/min β€” unlimited usage

Recommendation: Start with free tiers, upgrade if you hit limits.

Troubleshooting

"Rate limit exceeded"

CoinGecko:

  • Free tier is 10-50 calls/min
  • Agent caches results for 60 seconds
  • Wait 1 minute and retry, or upgrade to Pro

Alpha Vantage:

  • Free tier is 25 calls/day (very limited)
  • Agent warns when approaching limit
  • Consider premium tier for active use

"Invalid API key"

  • Verify keys in .env file (no quotes, no spaces)
  • CoinGecko: Check at https://www.coingecko.com/en/api/dashboard
  • Alpha Vantage: Check at https://www.alphavantage.co/

"Asset not found"

  • Crypto: Use CoinGecko IDs ("bitcoin" not "BTC") β€” search at coingecko.com
  • Stocks: Use ticker symbols ("AAPL" not "Apple")
  • Agent can help: "What's the CoinGecko ID for Solana?" β†’ "solana"

Stale data

  • CoinGecko free tier updates every 60 seconds
  • Alpha Vantage free tier has 15+ min delay
  • Premium tiers offer real-time data

Advanced Usage

Memory-Assisted Watchlists

The agent learns your interests:

You: "Add NVDA to my watchlist"
Agent: Updates MEMORY.md, will include NVDA in daily summaries

You: "What's on my watchlist?"
Agent: Reads MEMORY.md, shows all tracked assets with current prices

Custom Alerts (via HEARTBEAT)

You can enable proactive monitoring by uncommenting the heartbeat section in hatchery.yaml and editing HEARTBEAT.md:

## Price Alert Check (every 30 min)
1. Load watchlist from MEMORY.md
2. Fetch current prices
3. Compare to last known values
4. If any asset moved >5%: alert operator
5. Otherwise: HEARTBEAT_OK

(Heartbeat disabled by default to avoid unexpected notifications)

Model & Performance

  • Model: Claude Sonnet 4.5 (balanced speed + capability)
  • Thinking: Medium (5,000 tokens) β€” enables multi-step analysis
  • Response time: 2-5 seconds for simple queries, 10-15s for complex analysis
  • Cost: ~$0.01-0.05 per query (depends on complexity)

Disclaimer

This agent provides informational analysis only. It is NOT financial advice.

  • Always do your own research (DYOR)
  • Consult a licensed financial advisor for investment decisions
  • Past performance does not guarantee future results
  • Cryptocurrency and stock trading carry significant risk
  • The agent cites data sources but cannot guarantee accuracy

Contributing

Found a bug? Want to add a feature?

  • Report issues: GitHub Issues
  • Submit skills: Add new data sources or indicators
  • Improve analysis: Enhance technical analysis logic

License

MIT License β€” free to use, modify, and distribute.


Built with OpenClaw β€’ Published on Hatchery

Deploy to Hosted

Stats

Downloads0
Deployments0
Latest Version1.0.0
Runtime SupportAny
Size24.8 KB

Versions

1.0.0about 2 months ago