Skip to content

trading-agent

trading-agent is an always-on AI trading agent that trades on its own, without asking anyone to approve its orders. It runs four desks side by side: general, intraday, scalper and positional. Each desk has its own persona, models, schedule and memory, and every order from every desk passes through one risk engine that enforces the hard limits you write in TradingRules.md. It trades through tradingmachine and the Unified Broker Interface (UBI), and thinks with Claude through the Max subscription, with DeepSeek when Claude is unavailable, and with Gemma and Qwen on this machine.

Four desks and one risk engine Each desk sends its orders through the same risk engine, which gives each stock to one desk at a time and enforces every limit. approved main Claude first; any product; the conversation so far intraday Claude first; mis; flat by 15:15 heartbeat 10 min; 09:05 15:05 15:35 scalper Qwen first; mis; bracket orders heartbeat 2 min; 09:10 15:05 positional Claude first; cnc, nrml 08:45 12:30 15:40; no heartbeat One risk engine one desk per stock at a time each desk's products only a desk at its own loss limit stops alone the account at 15% a day stops everyone getting out is never blocked Risk ledger who owns each stock now, and who owned it today, for desk P&L UBI tagged with the desk; dry runs until you go live Market watcher account and each desk's P&L Every message starts with the time, what woke the desk and the market line: next trading day Mon, holiday Tue (Dussehra) an order from a desk refused: the stock belongs to intraday
Orange dots are orders from the four desks; every one reaches the same risk engine, and only approved ones reach UBI. The blue dot is a refusal: the scalper may not trade a stock the intraday desk already holds.

Start here

The site is split into tabs along the top. If you are about to trade live, read the second card first.

  • Get started


    Install it, fill in trading_agent.toml and .env, run the doctor, and start the service.

    Installation

  • Going live


    The plan for the first trading day: the last dry-run checks, the switch to live orders, and every way to stop.

    Going live

  • Using it


    The web page, talking to a desk, answering its questions, steering and stopping a turn, Telegram, and every command.

    The web page

  • Desks and risk


    The four desks, the files that instruct them, the risk engine's limits, and how an order travels.

    The desks

  • The agent


    Models and fallback, the 49 tools, memory and compression, skills, subagents, scheduling and extensions.

    How a desk thinks

  • Architecture


    The gateway and its parts, the HTTP API, the security model and the reasons behind the design.

    How it fits together

What it does, in one table

The table below lists the pieces a newcomer usually asks about first, and where each is explained.

You want to know The short answer Read
Who approves the orders? Nobody. The risk engine's hard limits are the only gate. The risk engine
Does it ever ask me? Only when it chooses to ask a question or show a plan, and before any tool you list in [approvals], which is only flatten_desk on this machine. It never waits for the answer. Questions, plans and permissions
Which models does it use? Claude through your Max subscription, never the API; then DeepSeek V4 Pro, then Qwen and Gemma on Ollama when Claude is unavailable. Models
How do I talk to it? The web page at http://127.0.0.1:8120, the terminal program bin/trading-agent, Telegram, or bin/trading-agent -p from a script. Using it
How do I stop it? Stop a turn, pause a desk, flatten a desk, or fire the kill switch. Going live
What can it change? Its own notes, memory and skills. It only proposes changes to your files. Your files
Does it keep running? Yes. It is a systemd user service that restarts after a crash and resumes every conversation. The service

A first taste

The commands below check the setup, ask a desk a question from the terminal, and show the state of the service. The output of the second command is real, from Saturday 17 October 2026, when the market was closed.

$ bin/trading-agent doctor
$ bin/trading-agent send --desk scalper "What time is it in India? Use your get_time tool."
  [tool] get_time({})
It's 14:04 IST on Saturday 17 October 2026 in India.
$ systemctl --user status trading-agent