How jason8745/llm-agent-trader works
LLM Agent Trader is a stock-backtesting dashboard: users configure and stream an LLM-driven backtest, then review its results and daily trading decisions and feedback. The documented runtime spans a Next.js interface, FastAPI endpoints, market-data and analysis services, a strategy and backtesting engine, and log-backed review APIs. Edges are limited to relationships shown in excerpts, SOURCE INDEX references, or the README; several frontend/API and unsampled implementation details are therefore not connected.
Main entry points: llm_strategy.py LLM Trading Strategy · router.py API Router · llm_stream.py Streaming Backtest API · backtest_logger.py Backtest Log Store
Components 23
Dashboard
- Web Dashboard
frontend/src/app/page.tsx - Streaming Runner
frontend/src/components/llm/StreamingLLMRunner.tsx - Backtest Results
frontend/src/components/analysis/BacktestResultsWithAnalysis.tsx - Daily Analysis
frontend/src/components/analysis/DayAnalysis.tsx - Backtest Charts
frontend/src/components/charts/BacktestChart.tsx
API
- FastAPI App
backend/app/main.py - API Router
backend/app/api/v1/router.py - Streaming Backtest API
backend/app/api/v1/endpoints/llm_stream.py - Backtest Analysis API
backend/app/api/v1/endpoints/backtest_analysis.py - Daily Feedback API
backend/app/api/v1/endpoints/daily_feedback.py
Backtesting
- Stock Data Service
backend/app/utils/stock_data.py - Market Data Fetcher
backend/app/utils/fetcher.py - Backtest Engine
backend/app/backtesting/engine.py - LLM Trading Strategy
backend/app/llm/strategies/llm_strategy.py - Strategy Interface
backend/app/llm/strategies/base.py
Market Analysis
- Technical Indicators
backend/app/utils/indicators.py - Technical Context
backend/app/llm/analysis/enhanced_technical_analyzer.py - Trend Analysis
backend/app/llm/analysis/trend_analyzer.py - LLM Client
backend/app/llm/client.py
Review and Logs
- Backtest Log Store
backend/app/utils/backtest_logger.py - SQLite Logs
Other components
- Trader
- LLM Provider
Connections 24
- Trader → Web Dashboard: uses
README.md - Web Dashboard → FastAPI App: accesses
README.md - FastAPI App → API Router: mounts
backend/app/main.py - API Router → Streaming Backtest API: routes
backend/app/api/v1/router.py - API Router → Backtest Analysis API: routes
backend/app/api/v1/router.py - API Router → Daily Feedback API: routes
backend/app/api/v1/router.py - Streaming Backtest API → Stock Data Service: loads data
backend/app/api/v1/endpoints/llm_stream.py - Streaming Backtest API → LLM Trading Strategy: initializes
backend/app/api/v1/endpoints/llm_stream.py - Streaming Backtest API → Backtest Engine: runs
backend/app/api/v1/endpoints/llm_stream.py - Backtest Engine → Market Data Fetcher: fetches data
backend/app/backtesting/engine.py - Backtest Engine → Technical Indicators: uses
backend/app/backtesting/engine.py - LLM Trading Strategy → Strategy Interface: implements
backend/app/llm/strategies/base.py - LLM Trading Strategy → Technical Indicators: uses
backend/app/llm/strategies/llm_strategy.py - LLM Trading Strategy → Technical Context: analyzes context
backend/app/llm/strategies/llm_strategy.py - LLM Trading Strategy → Trend Analysis: analyzes trends
backend/app/llm/strategies/llm_strategy.py - LLM Trading Strategy → LLM Client: requests decisions
backend/app/llm/strategies/llm_strategy.py - LLM Client → LLM Provider: calls
- Backtest Analysis API → Backtest Log Store: queries logs
backend/app/api/v1/endpoints/backtest_analysis.py - Daily Feedback API → Backtest Log Store: queries logs
backend/app/api/v1/endpoints/daily_feedback.py - LLM Trading Strategy → Backtest Log Store: records decisions
backend/app/llm/strategies/llm_strategy.py - Backtest Log Store → SQLite Logs: persists
README.md - Backtest Results → Daily Analysis: renders
frontend/src/components/analysis/BacktestResultsWithAnalysis.tsx - Streaming Runner → Backtest Results: displays results
- Backtest Results → Backtest Charts: presents charts