Skip to main content

TradeAgent

English | 简体中文

Your own AI trading agent, with a public track record.

CI PyPI License

TradeAgent is an open-source AI agent that runs on your computer. Every trading morning it reads the news, picks one US stock or ETF (or stays in cash) and explains why. Turn on automatic trading and it buys that pick on Robinhood with a small amount you choose and sells it an hour later, while a deterministic engine enforces your limits.

Every pick is frozen before the market moves and scored against SPY and a random pick from the same shortlist, so you can see whether the AI actually helps. See the public track record →

  • It trades for you, within hard limits. Your symbols, $1–$5 a trade, one trade a day, sold after an hour. The AI only picks; the engine places and checks every order.
  • It shows its work. Each pick comes with its reasoning and news sources, and the record includes the losing days.
  • Pick its brain: GPT or Claude. The agent runs on Codex (GPT) by default. Add Claude to answer the same question on the same stocks, compare them, and choose whose pick to trade.
  • No API keys. It uses the ChatGPT and Claude subscriptions you already have, and Robinhood's official browser login.
  • See everything. A local dashboard shows your account, every trade and every pick.

A trading day

New York time What happens
10:30 The AI looks at three of the day's most unusual movers, reads the news and picks one, or none.
about 10:36 If the pick is on your list, TradeAgent buys your amount.
one hour later It sells automatically.
any time Open the dashboard to see the pick, the reasoning and the result.

No eligible pick, a missed start or a failed check means no trade that day.

flowchart LR
    A[Market data & news] --> B[AI analysis<br/>Codex or Claude]
    B --> C{Trade decision}
    C -->|Eligible pick| D[Your risk limits]
    C -->|No trade| E[Wait for next session]
    D --> F[Robinhood order]
    F --> G[Automatic exit after 1 hour]

Get started

You need Linux or WSL2, Python 3.12+, a ChatGPT account with Codex access and an eligible Robinhood agentic account. Claude is optional and needs a Claude Pro, Max, Team or Enterprise plan. Run everything as the same Linux user, on the local Linux filesystem.

1. Install

git clone https://github.com/danielye0010/TradeAgent.git
cd TradeAgent
python3 -m venv .venv
source .venv/bin/activate
pip install .
curl -fsSL https://chatgpt.com/codex/install.sh | sh

Just want to try the command and the dashboard? pipx install tradeagent installs the same tradeagent command from PyPI. Automatic trading below uses the checkout's research installer, so clone the repository for that.

2. Connect your accounts. Open a new terminal, return to the checkout and activate .venv:

codex login              # ChatGPT browser sign-in
tradeagent login         # Robinhood browser sign-in; creates your configuration
tradeagent doctor        # checks your setup and tells you what is missing
tradeagent live-check    # checks account access and quotes; places no orders

3. Open the dashboard

tradeagent dashboard

Nothing trades yet. Installing, signing in and opening the dashboard never place an order. See the setup guide if a step fails.

Turn on automatic trading

1. Set your limits in ~/.config/tradeagent/tradeagent.toml (created by tradeagent login). Keep the other generated settings:

[live]
enabled = true
symbols = ["QQQ", "IWM"]   # only these symbols may be bought
max_notional = "25"        # per-entry ceiling in dollars

[entry]
order_type = "market"
dollar_amount = "5"        # $1–$5 per trade

[exit]
order_type = "market"
hold_seconds = 3600        # sell after one hour

2. Start the daily AI research. It makes and records the pick each morning; it never trades.

python scripts/install_shadow.py --daily --protocol daily-news-v2 \
  --python "$PWD/.venv/bin/python" \
  --state-dir "$HOME/.local/state/tradeagent/daily-decisions"

3. Start trading the pick

tradeagent autotrade install --enable
systemctl --user list-timers tradeagent-daily-news.timer tradeagent-autotrade.timer

Your computer, with Linux or WSL running, needs to be awake from 10:30 until the sale about an hour later. The timers look for codex (and claude) in ~/.local/bin, /usr/local/bin, /usr/bin or /bin, where the installers put them. To stop: tradeagent autotrade uninstall. More in automatic trading.

Add Claude (optional)

Claude gets the same three stocks, the same market data and the same question as Codex at the same minute, and its pick is scored over the same hour with the same costs. The dashboard's GPT vs Claude page shows who is ahead, how often they agree and each model's reasoning, session by session. It runs on your Claude subscription, not an API key.

curl -fsSL https://claude.ai/install.sh | bash
claude                              # sign in once with your Claude plan
tradeagent claude doctor --probe    # checks the sign-in and asks Claude once
tradeagent claude install --enable  # runs next to the daily research

Claude only does research until you choose to trade its pick:

tradeagent autotrade install --model claude --enable   # trade Claude's pick
tradeagent autotrade install --enable                  # back to Codex (default)

A few days of results are mostly luck; the page gives a verdict after 20 trading days. See GPT vs Claude.

The dashboard

tradeagent dashboard opens a local page in your browser. It only reads; it never trades.

Page What you see
Account Account value and profit, a chart you can scrub, today's trade and recent trades.
Decisions Today's schedule, each frozen AI pick and why it was made.
GPT vs Claude Who is ahead, how often they agree, every day's picks and both models' reasoning.
Research Each strategy's results against SPY and a random pick.
Trades Every trade with prices, times and total profit.

Want others to follow along? tradeagent publish install puts the paper results (never your account) on a public track-record page like ours after every close. See publishing.

Ask the agent yourself

Run codex from the checkout and ask for an analysis:

$trade-opportunity-analyst Analyze today's market and generate a TradePlan.

It explains the candidates and the trade it would make, without placing an order. To place one trade from your settings yourself, use tradeagent run-once --live. See manual trading and recovery.

Safety

  • The AI only picks. The execution engine enforces your settings: fresh quotes, an allowed symbol, regular market hours, and enough cash within your position, exposure and loss limits.
  • No leverage and no short selling. Orders are recorded before they are sent and are never blindly retried.
  • Emergency stop: create a KILL file in the live state directory. It blocks new buys and lets the open position exit.
  • If the computer sleeps or the connection drops during a trade, check with tradeagent status and finish the exit with tradeagent recover.

AI picks can lose money. Start small.

Documentation

Setup · Automatic trading · Dashboard · GPT vs Claude · Public results page · Manual trading · Architecture · Contributing · Changelog

License

Apache 2.0, with some vendored MIT components (details).

Metadata

Release files for tradeagent 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tradeagent 1.6.0
File Size Uploaded Provenance Actions
tradeagent-1.6.0.tar.gz 680.2 kB With provenance Details for tradeagent-1.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tradeagent 1.6.0
File Interpreter ABI Platform Actions
tradeagent-1.6.0-py3-none-any.whl Python 3 none any Details for tradeagent-1.6.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / tradeagent-1.6.0.tar.gz

Download URL tradeagent-1.6.0.tar.gz
Size 680.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5036ae41c87685a5ebbc73931da967bc7bf121851fd5b4fc79563908e9f5b086
BLAKE2b-256 checksum
How to use checksums
2abc765eeadf8f6e1e3efa4b84b90db8f25cbc53237a70ab1c1460c991496c2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / tradeagent-1.6.0-py3-none-any.whl

Download URL tradeagent-1.6.0-py3-none-any.whl
Size 454.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23ece978752261c884ca34cf2df65d602d057829a12bec09ff64131436d64b98
BLAKE2b-256 checksum
How to use checksums
190ef78825c1289700ad6d476987a4cbe581f994056e82ffcafef428cc79ab9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for tradeagent 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tradeagent-1.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page