claudeers.

🔓 unclaimed — this page was auto-generated from GitHub. Are you the creator?

Claim this page →
// Finance & Trading

ai-trading-agent

Multi-symbol AI trading agent — Claude AI + FastAPI + Next.js + MetaTrader 5

Slowing down
82/100
last commit 2 months ago
last release none
releases 0
open issues 0
// install
git clone https://github.com/flukelaster/ai-trading-agent
AI Trading Agent

AI Trading Agent

Multi-symbol autonomous trading platform powered by Claude AI agents

Trades GOLD · OILCash · BTCUSD · USDJPY through MetaTrader 5

Features · Screenshots · Architecture · Quick Start · Pages


✨ Highlights

Eight specialist Claude agents collaborating on a virtual trading floor — Orchestrator, Technical, Fundamental, Risk, Reflector, Sentiment, Strategy Optimizer, and Single-Agent fallback. Hard guardrails prevent runaway trades. Real-time UI streams every decision, position, and P&L tick.

Trading Dashboard

📑 Table of Contents


🚀 Features

DomainCapability
🧠 Multi-Agent AI8 specialist Claude agents (Sonnet + Haiku) — Orchestrator + Technical + Fundamental + Risk + Reflector + Sentiment + Optimizer
🛡️ GuardrailsNon-bypassable limits at MCP tool layer (lot size, daily loss, trade frequency, cooldowns)
🎯 Strategy Engine5 strategies + ensemble (EMA, RSI, Breakout, Mean Reversion, ML Signal) with regime-adaptive switching
🤖 ML ModelsPer-symbol LightGBM with 40+ features, drift detection, auto-retrain, calibration analysis
📊 Real-time DashboardLive ticks, positions, P&L, equity chart, AI insights, multi-symbol tabs
🪙 Token Cost TrackingPer-agent token + cost monitoring with daily breakdown and 90-day retention
🔐 Secrets VaultAES-256-GCM encrypted credential storage, OAuth token health monitor
📰 News & SentimentRSS + macro feeds, Claude sentiment analyzer with bullish/bearish/neutral scoring
⚖️ Quantitative AnalysisVaR, Sharpe, Sortino, drawdown, Monte Carlo, walk-forward, cointegration
🚦 Gradual RolloutShadow → Paper → Micro-Live → Live deployment modes
🔁 Self-ReflectionReflector agent reviews past trades and writes lessons to session memory
📡 Live WebSocketReal-time price, position, sentiment, and bot event streaming
🔑 Passkey AuthWebAuthn-ready (currently JWT/password active on Railway)
📨 Telegram AlertsTrade open/close, signal, AI analysis, system health (Thai language)

📸 Screenshots

Drop PNGs into docs/screenshots/ with the filenames below.

🏠 Dashboard — Live Trading View

Dashboard

📈 Backtest Studio

Backtest

📜 Trade History & Performance

History

🧠 AI Insights

AI Insights

⚡ AI Activity Timeline

AI Activity

💰 AI Usage & Cost Monitor

AI Usage

🤖 ML Model Monitoring

ML Model

🌐 Macro Data

Macro Data

🛡️ Quant Risk Dashboard

Quant

🏢 AI Trading Floor — Agent Prompts

Agent Prompts

🔌 Integration Status

Integration

🔔 Notifications Center

Notifications

⚙️ Settings

Settings

🏗 Architecture

┌──────────────────────────────────────────────────────────────────────┐
│  Frontend (Next.js 16, Vercel/Railway)                               │
│  Dashboard · Backtest · History · AI Insights · AI Usage · ML        │
└──────────────────────┬───────────────────────────────────────────────┘
                       │  HTTPS + WebSocket
                       ▼
┌──────────────────────────────────────────────────────────────────────┐
│  Backend (FastAPI, Railway)                                          │
│  ├── Auth Layer (JWT cookie · Passkey WebAuthn ready)                │
│  ├── Secrets Vault (AES-256-GCM · HKDF key derivation)               │
│  ├── Runner Manager (process / Docker sandbox)                       │
│  │   ├── Job Queue (Redis + DB-persisted)                            │
│  │   ├── Heartbeat Monitor (auto-restart)                            │
│  │   └── Agent Entrypoint (asyncio loop)                             │
│  │       ├── MCP Tool Server (14 modules · 40+ tools)                │
│  │       ├── Guardrails (non-bypassable trading limits)              │
│  │       └── Multi-Agent Pipeline                                    │
│  │           ├── Reflector (Haiku)        — past trade review        │
│  │           ├── Technical Analyst (Haiku) — indicators              │
│  │           ├── Fundamental Analyst (Haiku) — sentiment             │
│  │           ├── Risk Analyst (Haiku)     — portfolio risk           │
│  │           ├── Sentiment Analyzer (Haiku) — news scoring           │
│  │           ├── Strategy Optimizer (Haiku) — param tuning           │
│  │           └── Orchestrator (Sonnet)    — final decision           │
│  ├── Strategy Engine (5 strategies + ensemble + MTF + regime)        │
│  ├── ML Models (LightGBM per-symbol · drift detection)               │
│  ├── AI Usage Logger (token + cost per call · 90d retention)         │
│  ├── PostgreSQL 15 + Redis 7 (AOF persistence)                       │
│  └─── HTTP ────► Windows VPS                                         │
│                  └── MT5 Bridge + MetaTrader 5 (XM Global)           │
└──────────────────────────────────────────────────────────────────────┘

🛠 Tech Stack

LayerTechnology
BackendFastAPI 0.115 · SQLAlchemy 2.0 (async) · asyncpg · APScheduler
FrontendNext.js 16 · React 19 · Tailwind 4 · Zustand · lightweight-charts · recharts
AIClaude Code SDK (Max subscription) + Anthropic SDK fallback · Sonnet 4 + Haiku 4.5
MLLightGBM · scikit-learn · pandas · 40+ features per symbol
AuthJWT Bearer (active) · WebAuthn Passkey (ready)
TradingMetaTrader 5 via custom HTTP Bridge (Windows VPS)
CI/CDGitHub Actions (ruff · pytest · tsc · build) · Railway auto-deploy
DBPostgreSQL 15 (14 Alembic migrations) · Redis 7 (AOF)
NotificationsTelegram bot (trade signals · AI analysis · system alerts)
Testingpytest (444 tests · 27 files) · SQLite in-memory · fakeredis · MT5 mock

📄 Pages Overview

RoutePagePurpose
/dashboardTrading DashboardLive ticks, positions, P&L, equity chart, AI insights, multi-symbol tabs
/backtestBacktest StudioRun backtests, optimizer, walk-forward, Monte Carlo, overfitting score
/historyTrade HistoryPast trades + performance breakdown (P&L, equity curve, archive demo)
/insightsAI InsightsNews sentiment + Claude optimization reports
/activityAI ActivityUnified timeline of agent decisions, sentiment runs, errors
/ai-usageAI UsagePer-agent token consumption + equivalent USD cost (90-day window)
/mlML ModelLightGBM training, drift detection, calibration, predictions
/macroMacro DataFRED indicators, economic calendar, correlations
/quantQuant RiskVaR, regime, correlation matrix, volatility, portfolio, stress test
/agent-promptsTrading FloorCustomize per-agent system prompts (chibi character avatars)
/integrationIntegrationService connectivity status (DB, Redis, MT5, Vault, OAuth)
/notificationsNotificationsEvent history with filters
/settingsSettingsPer-symbol risk, AI filter toggle, paper trade switch
/loginLoginPasskey or password authentication
/setupSetupFirst-time passkey registration wizard

⚡ Quick Start

Prerequisites

  • Python 3.12+
  • Node.js 22+
  • Docker (for local PostgreSQL + Redis)
  • Windows VPS with MetaTrader 5 (production trading only)

1. Start databases

docker-compose up -d

2. Backend

cd backend
python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
alembic upgrade head
uvicorn app.main:app --reload --port 8000

3. MT5 Bridge (Windows VPS only)

cd mt5_bridge
pip install -r requirements.txt
cp .env.example .env                # add MT5 credentials
uvicorn main:app --host 0.0.0.0 --port 8001

4. Frontend

cd frontend
npm install
cp .env.example .env.local
npm run dev

5. Run tests

cd backend
python -m pytest tests/ -v --no-cov   # 444 tests

📁 Project Structure

gold-trading-bot/
├── backend/
│   ├── app/
│   │   ├── api/routes/         # 80+ REST endpoints
│   │   ├── ai/                 # Claude client, pricing, usage logger
│   │   ├── bot/                # Trading engine, scheduler, health monitor
│   │   ├── strategy/           # 5 strategies + ensemble + regime
│   │   ├── risk/               # Risk manager, circuit breaker, correlation
│   │   ├── ml/                 # LightGBM trainer, features, drift
│   │   ├── runner/             # Docker sandbox runner system
│   │   ├── db/                 # SQLAlchemy models + 15 migrations
│   │   └── ...
│   ├── alembic/versions/       # DB migrations
│   ├── mcp_server/
│   │   ├── server.py           # FastMCP tool server
│   │   ├── guardrails.py       # Non-bypassable trading limits
│   │   ├── agents/             # 6 specialist agents + orchestrator
│   │   └── tools/              # 14 tool modules
│   └── tests/                  # 444 tests (27 files)
├── frontend/
│   ├── app/                    # Next.js App Router (15 pages, no runners)
│   ├── components/             # UI primitives + layout
│   ├── lib/                    # API client + WebSocket
│   └── public/agent-characters/ # Chibi agent portraits
├── mt5_bridge/                 # MetaTrader 5 HTTP bridge (Windows VPS)
├── agent-character/            # Source character art (PNG)
├── docs/
│   ├── logo/                   # Logo assets
│   └── screenshots/            # README screenshots
├── scripts/backup_db.sh        # Daily pg_dump
└── docker-compose.yml

🔧 Environment Variables

See backend/.env.example and mt5_bridge/.env.example.

VariablePurpose
DATABASE_URL / DATABASE_URL_SYNCPostgreSQL connection (asyncpg + sync for Alembic)
REDIS_URLRedis connection
SECRET_KEYJWT signing key
VAULT_MASTER_KEYAES-256-GCM root key for Secrets Vault
CLAUDE_CODE_OAUTH_TOKENClaude Max subscription token
MT5_BRIDGE_URL / MT5_BRIDGE_API_KEYWindows VPS bridge endpoint
AGENT_MODEsingle (Phase C) or multi (Phase D)
ROLLOUT_MODEshadow · paper · micro · live
MAX_RISK_PER_TRADE / MAX_DAILY_LOSS / MAX_LOTHard risk limits
TELEGRAM_BOT_TOKEN / TELEGRAM_CHAT_IDTelegram alerts

📜 License

Private — internal use only.


Built with Claude Code · Deployed on Railway · Trading on MT5

// compatibility

Platformsapi, web
Operating systems
AI compatibilityclaude
License
Pricingopen-source
LanguagePython

// faq

What is ai-trading-agent?

Multi-symbol AI trading agent — Claude AI + FastAPI + Next.js + MetaTrader 5. It is open-source on GitHub.

Is ai-trading-agent free to use?

ai-trading-agent is open-source, so it is free to use.

What category does ai-trading-agent belong to?

ai-trading-agent is listed under automation in the Claudeers registry of Claude-compatible tools.

5 views
67 stars
unclaimed
updated 15 days ago

// embed badge

ai-trading-agent on Claudeers
[![Claudeers](https://claudeers.com/api/badge/ai-trading-agent.svg)](https://claudeers.com/ai-trading-agent)

// retro hit counter

ai-trading-agent hit counter
[![Hits](https://claudeers.com/api/counter/ai-trading-agent.svg)](https://claudeers.com/ai-trading-agent)

// reviews

// guestbook

0/500

// related in Finance & Trading

🔓

An AI SKILL that provide design intelligence for building professional UI/UX multiple platforms

// financenextlevelbuilder/Python100,423MIT[ claude ]
🔓

TradingAgents: Multi-Agents LLM Financial Trading Framework

// financeTauricResearch/Python90,619Apache-2.0[ claude ]
🔓

"AI-Trader: 100% Fully-Automated Agent-Native Trading"

// financeHKUDS/Python20,389[ claude ]
🔓

"Vibe-Trading: Your Personal Trading Agent"

// financeHKUDS/Python17,979MIT[ claude ]
→ see how ai-trading-agent connects across the ecosystem