Automated IB + Claude AI trading bot for EU/US markets
- Python 97.4%
- Shell 2.6%
Adds test_main, test_manual_trigger, test_market_data, and manual_trigger module; extends executor, risk, signal, monitor, backtest, and trade_log tests; refines main loop, dashboard, runtime config, and systemd service. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| dashboard | ||
| scripts | ||
| systemd | ||
| tests | ||
| trader | ||
| .env.example | ||
| .gitignore | ||
| README.md | ||
| requirements.txt | ||
| sync.sh | ||
trader
Automated trading bot for EU and US markets (ETFs + stocks) using Interactive Brokers Gateway and Claude AI for signal generation.
Stack
- IB Gateway — order execution via ib_insync
- Claude Haiku — AI signal generation
- Streamlit — web dashboard
- signal-cli-rest-api — Signal messenger alerts
Requirements
- Python 3.11+
- IB Gateway running (paper: port 4002, live: port 4001)
- signal-cli-rest-api container (optional, for alerts)
Setup
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your API keys and IB connection details
# Run bot
python -m trader.main
# Run dashboard (separate terminal)
streamlit run dashboard/app.py
Systemd (LXC deployment)
cp systemd/*.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now trader dashboard
Tests
pytest tests/ -v
Backtest
python scripts/run_backtest.py --symbols SPY QQQ VWCE --years 3
Markets
| Market | Schedule (CET) | Symbols |
|---|---|---|
| EU | 09:35 – 17:20 | VWCE, EXS1, XDWD (XETR) |
| US | 15:35 – 21:50 | SPY, QQQ, AAPL, … (NYSE/NASDAQ) |
Risk controls
- Daily loss limit: 2% equity
- Weekly loss limit: 5% equity
- Max open positions: 5
- VIX halt: ≥ 40 — circuit breaker: SPY −2.5% intraday