Running

How it works

An experiment in whether an AI agent running on our own hardware, woken by the news and the market as they move, can finish every trading day green.

1. Up to 90 min before the open

Premarket plan
The agent wakes to plan the day: it reads the overnight news, looks things up and leaves itself watches and notes. No orders before the open.

2. From 10 min after the open

During the session
Code watches every minute's bars and wakes the agent for setups: a break above the opening range or, an hour in, a new session high, each on at least twice the stock's usual volume. Breaking news, a held stock moving 3%, a stop or target filling and its own watches wake it too, and after 2 h of quiet it reviews the book anyway. It trades stocks and options.

3. 25 min before the bell

Closing window
If it holds anything, the agent reviews the book for the close; new buys now must be meant to last overnight, with conviction 8 or more. In the last 7 minutes, code sells the intraday stock trades and carries only profitable, high-conviction positions with no event risk.

4. 10 min after the bell

After the close
The agent reviews the day's decisions and its book, and leaves itself notes and watches for tomorrow.

Each wake-up is an episode, and you can watch it

The agent runs on an open-weight model (local/qwen3.6-35b-a3b-q2) on two graphics cards in the server that runs the bot: no AI service and no per-call cost. One episode runs at a time, and bad news on a holding interrupts anything else. Every step streams to the Agent page as it happens.

  1. The brief: why it woke, its book, the session and the limits in force, the benchmarks, and the latest news on each stock it woke for, with the notes and watches it left itself.
  2. Lookups, one step at a time from 11 read-only tools: its book, quotes, technicals from Alpaca's daily and 5-minute bars, option chains, news, a stock's news dossier, past decisions, the calendar, and years of prices and past news from our history store. It can't search the web or place an order from here.
  3. The answer: its decisions in one fixed JSON structure (buy, sell, adjust exits or hold a stock; buy, close or hold an option), plus watches and notes for later. Sales go first, then the risk engine checks every decision in code and every check is shown.

Urgent wake-ups get 4 steps and 60 s; the review after the close gets up to 12 steps and 10 min, with time to think.

Rules enforced in code

  • Starts with $10,000 of fake money (an Alpaca paper account). Stocks are long only, with no margin.
  • The long-term book holds for months: SPY at 15% and QQQ at 10% of equity with no stop, and 5 leaders at 5% each (the strongest over 12 months, above their 200-day average) with a stop trailing 20% below. Each is sold only after a week closing below its 200-day average (a leader also on its stop or when it drops out of the top at the month's refresh).
  • The trend core trades by rules, not the AI: while SPY is above its 200-day average, it holds up to 5 of the strongest stocks in an uptrend (above a 50-day average that is above the 200-day, up over 6 months, near their 52-week high), ranked among the 500 most traded. Each risks 1% of equity at a stop 2 daily ATRs below, with no target; it sells when the stop is hit or the stock closes below its 50-day average, and the agent can sell one of its positions only on news.
  • Each buy risks 1% of equity at its stop (a little more or less by conviction), at most 25% of equity per stock, and 8 stock positions at once. 2% is always kept in cash.
  • Every stock buy is a bracket order with a stop-loss and a take-profit held by the broker, so exits fire even if the engine is down. Minimum reward:risk is 1.2.
  • Day P&L of −4% blocks new buys. At −7% everything is liquidated. Both lift the next session.
  • Never adds to a position or averages down, and a position's stop only ever moves up. No re-buying a stock within 15 minutes of selling it, including when a stop-loss fired. Price must be at least $5.
  • In the last 7 minutes of the session, intraday stock trades are sold; swing positions stay, protected by stops resting at the broker. Once a position is up by its stop distance, its stop trails the price at that distance.
  • Options are defined risk only (long calls, long puts, debit spreads): at most 4% of equity per position and 25% in total, 6 positions at once, closed 1 day before expiration. An options trade must use a contract from a chain the agent loaded in the same episode.
  • The agent has limits of its own: 8 new entries a day and 3 an hour, 4 open positions it opened, at most 3 new entries per wake-up, no entry in a stock it acted on in the last 30 minutes, and no re-entry within 6 h of a stop-out or 2 h of a sale. Its buys are sized by the rules above, a little more or less by its conviction.
  • Circuit breakers are for extreme cases: the account 20% below its peak since the agent took over (or was last resumed) pauses new entries for 24 h, when they resume by themselves (the owner can resume them sooner). A slow model, or most of its answers in an hour invalid, pauses the agent's entries only while it lasts. Exits carry on either way, and a rule refusing an order trips nothing.
  • Every episode (each step, with the exact data each lookup returned, and its answer), decision (including rejected ones, with every rule that was checked), order and fill is stored.

How it runs

A trading engine runs around the clock in Docker on a dedicated server. It holds the only Alpaca keys, streams prices and fills from Alpaca over WebSockets, watches the news and the market, wakes the agent on the AI model running on the same server's graphics cards, places orders, and writes everything to MongoDB. This website reads MongoDB and opens a WebSocket to the engine for the live feed. It never trades; the owner's controls (pause, kill switch, settings) go through MongoDB as audited commands.

Sister projects

  • CryptoMarketBot runs the same idea on crypto, trading a Kraken paper wallet 24/7.
  • PredictionMarketBot runs it on prediction markets, trading Kalshi's Yes/No contracts with a $10,000 Alpaca paper account.