TradingAgent

Documentation

Everything you need to know about the Trading Agent System — from getting started to advanced features.

Getting Started

Trading Agent System is an autonomous trading platform that combines AI-powered research, quantitative analysis, and visual chart judgment to help you make informed trading decisions. It supports the full workflow: research → strategy → backtest → paper trade → live execution.

Quick Start Tutorial

1

Complete Onboarding

Set your experience level, risk tolerance, and investment goals in the onboarding wizard.

2

Run Market Research

Go to Market Research and run a daily analysis to understand current market conditions.

3

Design a Strategy

Use Strategy Chat to interactively build a trading strategy with the AI assistant.

4

Backtest It

Head to Backtesting, select your strategy and symbols, set a date range, and run a historical test.

5

Paper Trade

Start paper trading to test your strategy in real-time with virtual capital before going live.

Feature Reference

Market Research
AI-powered macro-economic analysis using Perplexity AI. Get daily market overviews, sector trends, and economic indicators.
Stock Research
Deep fundamental analysis on individual stocks. AI agents evaluate financials, competitive position, and growth prospects.
SEC Filings
Browse and analyze 10-K, 10-Q, and 8-K filings from SEC EDGAR with AI-powered insights.
Sentiment Analysis
Real-time news sentiment scoring. Aggregate sentiment by symbol or view overall market mood.
Academic Research
Search arXiv for finance and trading papers. AI analyzes papers for practical trading applicability.
Strategy Chat
Interactive AI conversations to design custom trading strategies. The AI helps define entry/exit rules, risk parameters, and more.
Charts
OHLCV candlestick data across multiple timeframes (1m to monthly) with intelligent caching.
Backtesting
Test strategies against historical data. Configure capital, commission, slippage, and position sizing.
Paper Trading
Simulated trading with $100K virtual capital. Place orders, track positions, and measure performance risk-free.
Broker Integration
Connect to Alpaca for live trading. Place real orders, monitor positions, and manage your brokerage account.
Risk Management
Configure position limits, stop-loss rules, and max drawdown thresholds. Apply preset risk profiles.
Analytics
Performance analytics including win rate, Sharpe ratio, max drawdown, and equity curves from your trading history.
Execution Agent
AI-powered buy/sell recommendations combining chart analysis, research, and strategy rules.

API Reference

82 RESTful endpoints organized across 23 service areas. All endpoints require Firebase Authentication via Bearer token in the Authorization header.

Architecture

Backend (Python)

  • Framework: FastAPI with async support
  • AI Agents: Pydantic AI with Claude & Perplexity
  • Data: yfinance, SEC EDGAR, arXiv, Google News RSS
  • Auth: Firebase Authentication (JWT)
  • Storage: Firebase Firestore (per-user isolation)
  • Broker: Alpaca API (paper + live trading)
  • Package Manager: uv (fast Python packaging)

Frontend (TypeScript)

  • Framework: Next.js 15 (App Router)
  • UI: shadcn/ui + Tailwind CSS
  • Charts: Recharts (equity curves, distributions)
  • Streaming: SSE for real-time chat responses
  • Auth: Firebase client SDK
  • Responsive: Mobile-first with hamburger navigation
  • Theme: Dark mode with emerald accent palette

Agent Pipeline

Market ResearchStock ResearchSEC AnalysisSentiment ScoringStrategy EvaluationRisk CheckExecution DecisionOrder + Reasoning Log

Every execution decision creates a reasoning log documenting which data sources contributed, their impact (bullish/bearish/neutral), confidence levels, and risk assessment.

Frequently Asked Questions