AI-powered copy trading that tracks smart money and trades automatically. Built from Samin Yasar's "Claude's New Trading Agent Is Insane!" tutorial.
- Overview
- Quick Start
- Installation
- Desktop Shortcuts
- Web Dashboard
- API Keys & Data Sources
- Trading Modes
- Copy Trading Strategies
- CLI Commands
- Configuration
- Troubleshooting
- Security & Best Practices
The Copy Trading Bot has three levels of operation:
| Level | Name | Description |
|---|---|---|
| 1 | 📡 Data Sources | Connect to real market data, insider trades, web signals |
| 2 | 📋 Copy Trading | Automatically copy trades from insiders, politicians, top traders |
| 3 | 🌐 Any Source | Monitor Discord, newsletters, or any web page for trade signals |
┌─────────────────────────────────────────────────────┐
│ Web Dashboard (port 8420) │
│ FastAPI + Alpine.js + Chart.js + SSE real-time │
├─────────────────────────────────────────────────────┤
│ Sources │ Execution │
│ ├─ Market Data (Binance) │ ├─ Paper Trading │
│ ├─ Quiver Quant (insider) │ └─ Live Trading │
│ ├─ FireCrawl (web scrape) │ │
│ └─ TraderDev (backtest) │ Portfolio + Approval │
└─────────────────────────────────────────────────────┘
# 1. Start the dashboard
cd ~/copy-trading-bot
./scripts/start-web.sh
# 2. Open your browser to http://localhost:8420
# 3. Click "🧪 Demo" to see simulated trades
# 4. Click "▶ Start Bot" to begin monitoringWhat happens: The bot checks every 30 minutes for new insider trades, scrapes monitored web pages for signals, and copies trades into your paper trading portfolio (no real money at risk).
- Python 3.11+ and
pip - Git (optional, for updates)
# Clone the repository
git clone https://github.com/xcode4tux/copy-trading-bot.git
cd copy-trading-bot
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install
pip install -e .
pip install -r web/requirements.txt
# Configure API keys (optional but recommended)
cp config.example.yaml config.yaml
nano .env # Add your API keys (see API Keys section)source .venv/bin/activate
ctb demo # Run demo with simulated trades
ctb status # Show portfolio statusThree shortcuts are available on your Desktop:
| Shortcut | Icon | Action |
|---|---|---|
| Start Copy Trading Bot | 🟢 Green play button | Launches web server + bot engine + opens dashboard |
| Dashboard | 🔵 Blue grid icon | Starts server (or reuses existing) + opens dashboard |
| Stop Copy Trading Bot | 🔴 Red stop button | Gracefully shuts down bot + web server |
Tip: Double-clicking Start when already running just opens the dashboard — no duplicates.
Open http://localhost:8420 in your browser.
- Status indicator: Green pulsing dot = bot is running. Gray = idle.
- ▶ Start Bot: Launches the monitoring loop (checks every 30 min)
- ⏹ Stop Bot: Gracefully stops the bot
- ↻ Check Now: Runs one immediate check cycle
- 🧪 Demo: Injects 3 simulated insider trades for instant results
A scrolling bar across the top shows real-time prices for all watched assets with 24-hour percentage changes — green for up, red for down. Auto-refreshes every 30 seconds.
Shows your current portfolio holdings with entry price, current price, P&L, and unrealized P&L percentage. Empty state shows when no positions are open.
When approval mode is on (default), every trade requires your sign-off before execution. Each pending trade shows:
- Ticker and direction (BUY/SELL)
- Notional value
- Who it's copied from (trader name or signal source)
- Approve/Reject buttons
- Market Overview: Global crypto market cap, BTC dominance, 24h volume
- Live Price Grid: Real-time prices with 24h changes for all watched assets
- 🔥 Trending: Top 8 trending coins on CoinGecko
Live feed of trading signals detected from monitored sources (FireCrawl web scraping, Quiver Quant insider data). Each signal shows the ticker, action, source, and raw text context.
Configure the bot at runtime:
- Check Interval: How often to scan for new trades (5-240 minutes)
- Trading Mode: Paper Trading (safe) or Live Trading (real money)
- Approval Required: Yes (review every trade) or No (auto-execute)
- Tracked Traders: Comma-separated list of trader names to copy
- Monitored URLs: Web pages to scrape for trading signals (one per line)
Interactive line chart showing portfolio value over time. Updates in real-time via SSE. Shows the full history of your portfolio's performance.
| Source | What It Provides | Status |
|---|---|---|
| Binance Public API | Live crypto prices, 24h stats | ✅ Active |
| CoinGecko API | Global market cap, trending coins | ✅ Active |
| Paper Trading | Simulated stock prices with realistic drift | ✅ Active |
# Get key: https://firecrawl.link/samin-yasar (free tier available)
echo 'FIRECRAWL_API_KEY=fc-your-key-here' >> .envEnables monitoring any web page for trading signals — Discord channels, newsletters, TradingView ideas.
Already configured via MCP. Use the login URL to authenticate:
https://mcp-api.trader.dev/login
Provides: strategy search, backtesting, parameter optimization, live alerts.
# Get key: https://api.quiverquant.com/mcp-server (starts at $30/month)
echo 'QUIVER_API_KEY=your-key-here' >> .envTracks: congressional trades, corporate insider filings, SEC Form 4 data, government contracts.
Sign up at https://coinvest.liquid.trade and add as a Claude Code connector to execute real trades from the bot.
- No real money is ever at risk
- Prices simulated with Ornstein-Uhlenbeck mean-reverting drift
- Realistic slippage and commission simulation
- Perfect for testing strategies before going live
- Requires Co-Invest / Liquid Trade connector
- Real order execution on stocks, crypto, forex, commodities
- Always start with small position sizes when going live
⚠️ WARNING: Only trade with money you can afford to lose. Past performance of tracked traders does not guarantee future results. Always do your own research.
- Track: The bot monitors specific traders (e.g., "Nancy Pelosi", "Ron Baron") via Quiver Quant
- Detect: When a tracked trader makes a new buy, the bot detects it
- Filter: Deduplication prevents copying the same trade twice
- Size: Position size calculated as % of portfolio (capped at max_position_pct, default 10%)
- Approve: If approval mode is on, you review and approve/reject each trade
- Execute: Approved trades are executed at market price with simulated slippage
The bot can monitor any web page for trading signals:
- Discord trading channels
- Email newsletters (via web archive)
- TradingView ideas pages
- Blog posts with trade alerts
How it works: FireCrawl scrapes the page every N minutes, compares with the previous version, and parses new text for buy/sell patterns like:
- "Buy AAPL at market open"
- "Going long on TSLA"
- "Sell all BTC"
- "Closing our NVDA position"
ctb run # Start continuous mode (runs until stopped)
ctb check # Single check cycle (fetch → generate → execute)
ctb status # Show portfolio and bot status
ctb demo # Demo with simulated insider trades
ctb markets # Show watched markets with prices| Flag | Description | Default |
|---|---|---|
--track NAME |
Track a trader (repeatable) | none |
--monitor URL |
Monitor a URL (repeatable) | none |
--interval MIN |
Check interval in minutes | 30 |
--capital AMT |
Initial capital | $10,000 |
--dry-run |
Paper trading only | true |
--approval / --no-approval |
Require human approval | true |
# Track Nancy Pelosi and Ron Baron, check every 15 min
ctb run --track "Nancy Pelosi" --track "Ron Baron" --interval 15 --dry-run
# Monitor a Discord trading channel
ctb run --monitor "https://discord.com/channels/..." --dry-run
# Check once with auto-execution
ctb check --track "Tim Moore" --no-approval --dry-runFIRECRAWL_API_KEY=fc-your-key
QUIVER_API_KEY=your-key
COINVEST_API_KEY=your-keyportfolio:
initial_capital: 10000.0
max_position_pct: 10.0 # Max % per position
max_positions: 10 # Max concurrent positions
require_approval: true # Human-in-the-loop
scheduler:
check_interval_minutes: 30
trading_hours_only: true # Only US market hours (9:30-4:00 ET)
tracked_traders:
- "Nancy Pelosi"
- "Ron Baron"
- "Tim Moore"
monitored_sources:
- "https://tradingview.com/ideas/"All settings can be changed live from the ⚙ Settings tab — no restart required.
# Check if port is in use
fuser 8420/tcp
# Kill the old process and restart
pkill -f "web.server"
~/copy-trading-bot/scripts/start-web.sh- Make sure your API keys are set (at minimum, none are required for basic operation)
- Open browser DevTools (F12 → Console) and check for red error messages
- Verify the server is running:
curl http://localhost:8420/health - Try clicking "🧪 Demo" first — if that works, the bot is functional
- Add tracked traders in Settings or via
--trackCLI flag - Add monitored URLs in Settings or via
--monitorCLI flag - Run a manual check: click "↻ Check Now" in the dashboard
- Market data auto-refreshes every 30 seconds
- Click "↻ Refresh" in the Markets tab to force an update
- Binance and CoinGecko APIs may be rate-limited — wait 30 seconds
pkill -f "web.server"
rm -f ~/copy-trading-bot/.bot.pid ~/copy-trading-bot/.web.pid
~/copy-trading-bot/scripts/start-web.sh- Never commit
.envto git (it's in.gitignore) - Store API keys only in
.envor environment variables - Rotate keys regularly
- Use read-only API keys when possible
- Always start with paper trading — test for at least 2-4 weeks
- Start small — when going live, use 1-5% of portfolio per trade
- Keep approval on — human review catches bad signals
- Diversify sources — don't copy just one trader
- Set stop-losses — the paper trading engine simulates them, live trading relies on the exchange
- The dashboard binds to
127.0.0.1(localhost only) — not accessible from other machines - All API calls are local — no data leaves your machine except to data source APIs
- SSE stream uses local EventSource — no external push services
- TraderDev MCP: Backtesting and strategy optimization at
https://mcp.trader.dev - Quiver Quant: Insider trading data at
https://api.quiverquant.com - FireCrawl: Web scraping at
https://firecrawl.dev - Liquid Trade: Multi-market trading at
https://liquid.trade
- Issues: File a bug report on the GitHub repo
- API questions: Refer to the respective service's documentation
- Strategy help: Use the TraderDev MCP to search leaderboard strategies for inspiration
Built with ❤️ using FastAPI, Alpine.js, Chart.js, and real market data APIs.