BetterTradingAgents

A local multi-agent research desk that turns market, news and sentiment data into a risk-checked BUY/HOLD/SELL call, then places paper orders.

Stars
★ 37
Last updated
9d ago
FARS reviewed
Nov 06, 2026
License
MIT
Primary language
Python

At a glance

Works with
Universal · cross-platformOpenAI API
You'll need
Python 3.12+uvOpenAI-compatible LLM API key (optional; mock mode without one)Alpaca paper account (optional)Shell / CLINetwork accessLocal filesystem
Typical use
An individual investor who wants a second opinion, a bull/bear argument and explicit risk checks on a ticker before committing, and is happy to rehearse in a paper account first.
Main limitation
No crash-resume — an interrupted run must be restarted; the upstream TradingAgents project does support it.
Maintenance
Commits in the last 30 dayslast commit 2026-11-14

What does this agent do, and when should you use it?

BetterTradingAgents is a locally run stock research and paper-trading application built around the OpenAI Agents SDK. A FastAPI backend serves a vanilla HTML/CSS/JS frontend and orchestrates parallel researchers covering market regime, technicals, fundamentals, news, social sentiment and forecasting; Pro and Max depth add a bull-vs-bear debate, with a judge at Max, before a Portfolio Manager issues a BUY / HOLD / SELL call with reasoning. Market data comes from yfinance by default, with optional Finnhub (fundamentals, news), Olostep (search and social sentiment) and Bako TimesFM forecasts that fall back to a local ridge model. Output passes a risk gate that scales position size by volatility and enforces per-ticker, invested and cash limits before anything reaches an Alpaca paper account, where the client hardcodes paper=True. Runs are stored in SQLite and reopenable via ?run=<id> URLs, followed up through a manager chat, graded against SPY for return and alpha, and replayed historically with a walk-forward backtest CLI. A guarded Autopilot can schedule sessions with a deployment budget and bear-market brake, and the whole service binds to 127.0.0.1 only. It is MIT-licensed and inspired by the TradingAgents framework.

A user picks up to five tickers, an outlook and a depth on the Home screen, and the frontend starts a run via POST /api/analyze. Researchers then work concurrently: yfinance market data plus optional Finnhub, Olostep and Bako TimesFM calls (a local ridge model covers forecasts when Bako is absent), while a market-regime analyst reads the S&P 500, Nasdaq, VIX and the 10-year yield. Depth controls agent count — Fast runs 3 agents (price plus forecast), Pro adds news and a bull/bear debate (7), Max adds sentiment and a debate judge (10). The Portfolio Manager consolidates the views and a risk gate applies volatility-scaled sizing plus per-ticker, invested and cash caps against paper equity before emitting BUY / HOLD / SELL with reasoning. Progress streams to the browser over GET /api/runs/{run_id}/events (SSE), results persist in SQLite and reopen through a ?run=<id> link, and POST /api/runs/{run_id}/chat lets the manager answer follow-ups from that run's research. Trading is exposed through GET /api/broker/account, POST /api/broker/orders (requires an explicit confirm), GET /api/broker/sync for reconciliation drift, and POST /api/automation/run to fire one scheduled Autopilot session. uv run python -m app.backtest replays past dates with point-in-time data and grades results against SPY after costs, and completed calls are scored on return and alpha, with lessons feeding later runs.

  1. An individual investor who wants a second opinion, a bull/bear argument and explicit risk checks on a ticker before committing, and is happy to rehearse in a paper account first.
  2. A team that already runs its own OpenAI-compatible endpoint (vLLM, Ollama, DeepSeek, OpenRouter) and wants a financial research workbench with per-role model routing.
  3. A researcher comparing agent depth Fast vs Pro vs Max across historical windows against a momentum baseline, using the reproducible mock replay and manifests.
  4. Someone testing a scheduled screening strategy: Autopilot sets candidates, a confidence bar, a deployment budget and an optional webhook for each finished session.
  5. A privacy-conscious user who does not want research history in a vendor cloud — the service listens on loopback only, keys go to the OS keychain where available and history stays in local SQLite.
  6. A demo or teaching setting where no API keys exist: mock mode still runs the full flow on live market data at zero cost.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Environment variables
LLM_BASE_URL LLM_API_KEY LLM_MODEL FINNHUB_API_KEY OLOSTEP_API_KEY BAKO_API_KEY
Config files
.env
Runtime
Python 3.12+
Install notes cover
Windows · Linux

How do you install or deploy this agent?

The shortest path is the portable binary from Releases, which bundles Python — keep the _internal folder next to the app:

# Windows x64: extract bettertradingagents-desktop-windows-x64.zip, then double-click
bettertradingagents.exe

# Linux x64
tar -xzf bettertradingagents-desktop-linux-x64.tar.gz
./bettertradingagents

Running from source requires Python 3.12+ and uv:

git clone https://github.com/kingabzpro/BetterTradingAgents.git
cd BetterTradingAgents
uv sync
uv run setup
uv run app

uv run setup is an arrow-key wizard that live-tests the LLM and paper account and format-checks the other keys. Alternatively configure through .env or the process environment (priority: .env → process environment → saved Settings → defaults); fields set in .env or the environment are locked in Settings and require editing at the source plus a restart:

LLM_BASE_URL=https://api.openai.com/v1
LLM_API_KEY=
LLM_MODEL=gpt-6-luna
FINNHUB_API_KEY=
OLOSTEP_API_KEY=
BAKO_API_KEY=
ALPACA_API_KEY_ID=
ALPACA_TRADING_ENABLED=0
TERMINAL_LOGGING=0
APP_PORT=8000

Only LLM_API_KEY matters for getting real agents — without it everything runs in labeled mock mode. The Finnhub, Olostep, Bako and Alpaca keys are optional and degrade to yfinance or disabled order submission when absent.

How do you use this agent?

Open http://127.0.0.1:8000 after startup (a busy port rolls to the next free one). On Home, enter up to five tickers with an outlook and depth; Incognito runs market-only analysis, skips portfolio access and saves nothing, so download the report before leaving. History keeps regular runs with a direct ?run=<id> link, and Trades shows the paper account's equity curve, positions, order lifecycle, return versus SPY and a reconciliation drift banner. Backtests run from the terminal:

uv run python -m app.backtest --tickers NVDA,AMD --start 2026-03-01 --end 2026-06-30

That is a free, deterministic mock replay; add --llm for real agents with a cost confirmation, and no paper account is needed. Tests:

uv run test
uv run test all

Programmatic use goes through /api/analyze, /api/runs/{run_id}, /api/runs/{run_id}/events (SSE), /api/runs/{run_id}/chat, /api/settings, /api/broker/account, /api/broker/orders, /api/broker/sync, /api/automation/run and /api/health. Order submission requires an explicit confirm in the request, and ALPACA_TRADING_ENABLED=0 is the kill switch.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • Paper trading is wrapped in a real risk gate — volatility-scaled sizing plus per-ticker, invested and cash caps — and the Alpaca client hardcodes paper=True, so no live-trading path exists.
  • Measured cost and latency beat the upstream project on the same model and endpoint: about $0.011 versus $0.069 per decision, about 9 seconds versus about 3 minutes, 7 versus ~16 LLM calls.
  • No provider lock-in at the model layer: any OpenAI-compatible endpoint (OpenAI, DeepSeek, OpenRouter, Z.AI, vLLM, Ollama) can be assigned per role or per agent, with fallback when a provider rejects an output format.
  • Walk-forward backtesting with holdout sets and baselines ships in the box, and the mock replay is free and reproducible — including the project's own unfavorable result that Max cost -2.08% per matched decision versus Fast.
  • Small attack surface by design: binds to 127.0.0.1, rejects non-loopback Host and cross-site Origin headers, prefers OS-keychain storage for keys, keeps history in local SQLite.
  • Vanilla HTML/CSS/JS served by FastAPI means no frontend build step, and mock mode keeps the full flow usable on live data with zero keys.
Limitations
  • No crash-resume — an interrupted run must be restarted; the upstream TradingAgents project does support it.
  • Narrower native provider coverage than upstream: only OpenAI-compatible protocols, with no native Anthropic, Google, Azure or Bedrock adapters.
  • Full functionality depends on several optional third-party keys (Finnhub, Olostep, Bako, Alpaca); with only an LLM key, news, sentiment and forecasting fall back to weaker defaults.
  • Evidence is thin: the head-to-head rests on six shared decisions, and the authors themselves note that more agents buy context and risk control, not alpha.
  • Single-user local scope — loopback-only binding with no authentication, multi-tenancy or remote deployment story.
  • Real agent runs cost money; the README's own benchmark puts a ticker at roughly $0.02–$0.07 depending on depth, model and news volume.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
BetterTradingAgents This agent 56 · Major gaps — ★ 37 9d ago Python OpenAI API
QuantDinger AI Trading OS 64 · Some gaps Self-hosted serviceFree + model costs ★ 14k 1d ago Python Codex · Claude Code · OpenAI API
Vibe-Trading 68 · Some gaps CLIFree + model costs ★ 39k today Python OpenAI API · Claude API
AI Stock Analysis System 65 · Some gaps CLIFree + model costs ★ 74k today Python —

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
56/ 100 5-point scale 2.8 / 5
Trust 18/29
Reliability 6/14
Adaptability 10/18
Convention 9/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust18 / 29 · 3.1/5

Evidence shows keys stored in the OS keychain, server bound to 127.0.0.1 with Host/Origin checks, Alpaca client hardcoded paper=True, order endpoint requiring explicit confirm, ALPACA_TRADING_ENABLED kill switch, and CI with gitleaks plus pip-audit. Deductions: rollback/recovery is limited to the kill switch and paper-only design with no stated recovery for submitted orders or SQLite history; dependency security relies on CI audit only, with no pinned versions or documented vulnerability remediation, so 2 rather than 3.

Reliability6 / 14 · 2.1/5

Evidence shows README and pyproject agree on Python 3.12+, uv workflow, and script entry points (setup/app/test), and CI runs offline checks on 3.12/3.13. Deductions: dependencies use lower-bound (>=) constraints rather than pins; wiki pages and backtests reports referenced by README are not in this evidence and cannot be checked; failure messages and error handling are not visible in source, only README mentions mock mode and port fallback, hence 1-2.

Adaptability10 / 18 · 2.8/5

Evidence shows a clear self-hosted research/paper-trading scenario, Fast/Pro/Max depths, multiple OpenAI-compatible endpoints, mock mode and incognito, and explicit capability boundaries (paper only, not investment advice, no live path). Deduction: trigger precision for autopilot scheduling, confidence bar, and webhook lives in .env.example and the wiki, which are not in this evidence, so trigger_precision is 1.

Convention9 / 18 · 2.5/5

Evidence shows a well-structured README (highlights, quick start, configuration, API, backtesting, disclaimer), concrete install steps, proactive disclosure of known limitations (Max may underperform, results not significant, baselines can win), and a full MIT LICENSE. Deductions: version only 0.4.0 in pyproject with no CHANGELOG; naming stability cannot be judged from one snapshot; examples/FAQ mostly link out to the wiki; maintenance responsibility is unclear with an unverified publisher and no CONTRIBUTING, hence 1s.

Effectiveness9 / 13 · 3.5/5

Evidence shows outputs include BUY/HOLD/SELL, sizing, full reasoning trail, grading vs SPY, and durable history, giving good output usability; incremental value over upstream TradingAgents via cost/latency comparison, risk gate, backtests, and web UI; cost of ~$0.011-0.07 per decision plus free mock mode is reasonable. Deduction: comparison and backtest figures are self-reported and the underlying reports are not in this evidence, so not full marks.

Verifiability4 / 8 · 2.5/5

Evidence shows README separates measured numbers, mock replay, and statistical intervals, and proactively notes Max may underperform and baselines can win, so fact/inference separation is good. Deduction: most key claims (32 test groups, +60.73% backtest, comparison table) point to the wiki and backtests/ directory not included in this evidence, so claim_traceability and cross_source_corroboration are only 1.

Risks and how to mitigate them
  • Publisher identity is unverified; maintenance responsibility and update path are unclear, so review the code before adoption.
  • Dependencies use lower-bound constraints rather than pins; supply-chain safety relies on CI audit, so pin and audit dependencies yourself.
  • Backtest and comparison figures are self-reported and the underlying reports are not in this evidence; do not infer real returns from them.
  • Autopilot and webhook make outbound requests; verify trigger conditions and endpoint trust before enabling.
  • Paper trading and educational use only; not investment advice.
Evidence confidence: Low Reviewed Nov 06, 2026 Reviewed revision 25e09895e10c
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/bettertradingagents.svg)](https://followagents.com/en/agents/bettertradingagents)
<a href="https://followagents.com/en/agents/bettertradingagents"><img src="https://followagents.com/badge/bettertradingagents.svg" alt="FARS review"></a>

FAQ

Is BetterTradingAgents open source?
Yes. The source code is on GitHub (kingabzpro/BetterTradingAgents) under the MIT licence.
Is BetterTradingAgents safe to use?
FollowAgents' FARS review (Nov 06, 2026) scored BetterTradingAgents 18/29 on trust and safety. None of the eight safety controls the review checks for was missing outright.
Is BetterTradingAgents still maintained?
Yes. The latest commit on GitHub is from 2026-11-14, within the last 30 days.
Who makes BetterTradingAgents?
BetterTradingAgents is published on GitHub by the account kingabzpro. FollowAgents has not verified which person or company is behind that account.
Was this page helpful?
View on GitHub ↗ Install ↓

Related concepts