We built a trading bot in two hours. Now my wife and I trade together. · Shai Magzimof
Shai Magzimof
We built a trading bot in two hours. Now my wife and I trade together.
June 21, 2026
My wife and I used to trade from separate Robinhood accounts. One of us would buy something, tell the other about it later, and hope we hadn't done the same thing twice. We were running two portfolios in parallel with no shared language.
Robinhood is fine for one person. It doesn't do anything with two.
So I built something that did. It took roughly two hours.
Why we built this
We had the accounts. We had the positions. What we couldn't do was look at both at once. No API to query, no shared history, no way to ask what the combined picture looked like without manually reconciling two apps on two phones. One of us would research something; the other would make a separate call the same day.
We needed an account that spoke HTTP.
Most retail traders don't know that Charles Schwab has a free, fully documented developer API. You register on their developer portal, wait a day or two for approval, and you have OAuth2 access to your own brokerage account: quotes, positions, order placement, transaction history, all of it. We transferred both our Robinhood accounts to Schwab. The whole migration took a week, including the ACATS transfer.
What we built
The trading core is about 1,500 lines of Python with zero pip dependencies. The Telegram bot that wraps it is another 1,400. Getting to a working first trade took roughly two hours.
A trading CLI: about twenty commands (quote, research, theme, buy, sell, pnl, audit, and more), talking directly to Schwab's REST API with no third-party trading library in the way.
A risk reviewer that runs before every order. Hard limits live here in Python, not in a prompt: 2× maximum leverage, $250k maximum notional per order, a 10% daily-loss kill switch, a 20% drawdown kill switch. These cannot be overridden, regardless of what the AI says.
A Telegram bot that wraps the CLI and serves as the shared UI. Both of us are in the same group, both can ask questions and see the same answers. Claude Sonnet does the reasoning, with a hard daily AI spend cap of $5.
OAuth tokens live in Cloudflare KV. Every order is written to a local JSONL file first, then to Cloudflare D1. The ledger never loses data, even if the database is temporarily unreachable.
The one decision worth stealing
The Reviewer is code, not a prompt.
The dangerous failure mode in any agent system is the AI doing something irreversible because nobody put a real checkpoint between "recommend" and "execute." A language model confident enough to say "buy 200 shares of NVDA" should not be the one asking "but is this within our risk limits?"
Judgment and risk enforcement need to be separate.
So the Reviewer runs in Python before any call to Schwab's order API. It fetches the current portfolio snapshot, estimates the post-trade leverage, checks every hard limit, logs its verdict to the database, and either lets the order through or kills it with a reason. The LLM can propose. The code decides if it is safe to proceed.
Propose → Review → Confirm → Execute. The AI proposes. The code reviews. The human confirms. Schwab executes.
Order flow from Telegram through Claude and the code Reviewer to Schwab
Telegram<br>Claude<br>Reviewer<br>Schwab
you + wife<br>proposes trade<br>code, not AI<br>executes
blocked<br>limits exceeded
you confirm<br>The Reviewer runs before the Confirm button appears. Limits exceeded means no button, no order.
Four entities, one direction. The Reviewer is the only node that can send the flow downward instead of right.
How we use it
We have a shared Telegram group: me, my wife, and the bot.
The bot breaks down position size, flags concentration risk, and shows its reasoning before asking to confirm. The first NBIS attempt was blocked by the Reviewer and resubmitted. The META brief at the bottom came back from the bot's training knowledge; the Schwab token had expired and live data wasn't available. Numbers are illustrative; this is a sandbox environment.
She'll message the group asking about a stock. The bot fetches a brief: price, analyst targets, thematic context, risk flags. Both of us read the same answer in the same thread. We talk about it. If we want to do something, she proposes a trade. The bot sizes it, runs the Reviewer, and shows the verdict before anything is sent to Schwab.
After confirmation, the bot shows what went in and checks back on open orders. Here, four orders are queued for Monday's open because the market was closed. Both of us see the same status. Numbers are illustrative; this is a sandbox environment.
She taps Confirm. The order goes to Schwab. Both of us see the fill confirmation in the group. Both of us can check P&L and see the same picture.
It is not a black box anymore.
What changed
Not the returns. I want to be honest about that. I have no idea whether this makes us better investors....