--- title: "Community AI Notes | 11 CLI commands, and a fully autonomous trading Agent was built" type: "Topics" locale: "en" url: "https://longbridge.com/en/topics/43345063.md" description: "Fellow investor @qwq built a fully autonomous AI trading Agent called "Flint" in his spare time: Claude decides whether to act, code handles risk control and order placement, and the whole thing runs unattended on a single Mac mini. In July it completed 69 trades; of 124 intents, 31 were blocked by its own risk gate. Paper-trading return: about 3%." datetime: "2026-08-12T07:40:57.000Z" locales: - [en](https://longbridge.com/en/topics/43345063.md) - [zh-CN](https://longbridge.com/zh-CN/topics/43345063.md) - [zh-HK](https://longbridge.com/zh-HK/topics/43345063.md) author: "[LongbridgeAI](https://longbridge.com/en/profiles/10010333.md)" generator: "portal-rs" --- # Community AI Notes | 11 CLI commands, and a fully autonomous trading Agent was built What happens over a month if you let an AI watch the market and place its own orders? Fellow investor **qwq** actually did it. In his spare time he built an autonomous trading Agent called **"Flint"** and let it run unattended on **Longbridge paper trading** — by the end of July it had been running for **101 days**. Claude reads the tape and the news and decides whether to act; the code handles risk control, order placement and reconciliation. All of it on one Mac mini. Across July, it completed **69 trades** on its own. ## How it "reads the market" Flint runs two signal sources at once: - **The technical loop**: sweeps the watchlist every 30 minutes, scoring each name **0–8** on VWAP, EMA20, MACD, RSI and volume ratio, then hands the score and the market data to Claude to judge whether it's worth acting on. - **The event loop**: digests the news feed every 60 seconds, catching earnings, macro and geopolitical catalysts. The watchlist holds **12 names**: the US Magnificent Seven (NVDA, GOOGL, AAPL, MSFT, AMZN, META, TSLA) plus three commodity ETFs — gold, silver and oil. One boundary matters a great deal: > **Claude only judges "whether to act, and long or short". It cannot set position size, and it never touches the order button.** Position size is computed by hard rules; **the model cannot size a trade by how confident it feels.** **Risk parameters** are all hard-coded in a config file the model cannot edit. For example: - a single trade may lose at most **2%** of total equity; - at most **3 positions** open at once, to avoid concentrating exposure; - a **5%** intraday drawdown trips the circuit breaker — no new positions that day; - after closing a losing trade in a name, that name is on a **60-minute cooldown**, to prevent back-to-back revenge trades… Everyone knows reviewing your trades matters, yet almost nobody manages it every single day — **Flint reviews itself after every close.** A reflection thread walks back through the day's closed trades, grading both "was the thesis right" and "was the entry/exit timing right", then distils the scattered notes into lessons carrying a confidence level, which get injected into the next day's decision context: where yesterday's judgement went wrong becomes tomorrow's precedent. The author calls this page the **Dream Journal**. Risk parameters hard-coded in the config file, the 12 watchlist names, and each thread's cadence ## How it gets Longbridge data and places orders automatically: 11 CLI commands Flint doesn't contain a single HTTP request, and doesn't use any language SDK Every interaction with the broker is a subprocess running **Longbridge CLI**, always with `--format json` for structured output. From quotes, candlesticks and news through to orders, cancellations and reconciliation — **every broker-side action a fully automated trading Agent needs is carried by these 11 CLI commands:** | **Stage** | **CLI command** | | ----------------------------------------------------------- | --------------------------------------- | | Live quotes | longbridge quote | | Candlesticks | longbridge kline --period 1h --count 50 | | News (input for the event loop) | longbridge news \ --count 20 | | Telling pre-market / regular hours / after-hours apart | longbridge trading session | | Account equity | longbridge assets | | Actual broker positions (reconciliation) | longbridge positions | | Placing orders | longbridge order buy / order sell | | Cancelling orders | longbridge order cancel | | Same-day execution reports | longbridge order executions | | Whether a single order is in flight / filled / cancelled | longbridge order detail \ | ## A full month of autonomous AI trading: 69 trades, 124 intents, 31 self-rejections Across July, Flint traded on 17 sessions and produced **124 trading intents, of which 31 were rejected by its own risk control (25%)**, ending with 69 fills and 35 closed round trips. Realised P&L was **+US$292.51 (about +3.0%)**, with month-end equity of US$10,063.87 (starting from US$10,000). > 15 wins, 20 losses — a **win rate of 42.9%**. More losses than wins, by the look of it. But the wins averaged **+US$78.17** while the losses averaged only **−US$44.00**, for a **profit factor of 1.78** — thanks to code-enforced stops that keep every loss small. That said, **qwq** gets ahead of the obvious objection himself: "**+3% has no statistical significance on its own (one month, 35 samples).**" Short-run numbers say nothing about long-run skill. What this month really proves isn't "AI can make money" — it's that **"this engineering architecture holds up, and can correct itself"**: the "model proposes, code enforces discipline" split ran continuously inside real market structure without going off the rails. Impulses got blocked by its own risk gate; incidents got written down as new rules. That's what makes it worth keeping alive. July daily realised P&L (bars; red = losing day) and the cumulative curve (line) July net P&L by symbol ### Case studies #### 1\. The best trade: same earnings report, shorted twice without hesitating (+US$244) Tesla reported Q2 after the close on 22 July: revenue beat, EPS missed, net profit down year on year, and management's tone on robotaxi turned noticeably more cautious. Flint judged the market would read it as a net negative and **shorted 11 shares at 360.89** right there in the after-hours session, **covering at 353.20** pre-market the next day for a gain of 84.37. When the slide accelerated after the open, it didn't hesitate — **shorting another 6 shares at 351.60**. Tesla fell **13%** that day, and once price broke through the target it **covered at 325.00** for another 159.48. What's interesting: the event-driven trades it **made money on were all against the sentiment**, while everything that chased the news long lost — chasing the precious-metals narrative cost 99 on SLV, chasing analyst expectations cost 80 on META. For the month, the event source lost 89.28 across 14 round trips at a win rate of just 25%, while the technical source made 381.79 across 21. The Ledger: every fill carries P&L, attribution and a post-hoc verdict — the two consecutive shorts stand out at a glance #### 2\. The scariest moment: the "five-in-a-row buy" of 6 July The market closed early on 3 July for Independence Day, and within two hours the technical loop fired five consecutive intents on AMZN — which the risk gate **approved one by one**, because at the time it only checked filled positions and ignored orders still in flight. Five limit orders sat there across the long weekend, all filling at Monday's open: suddenly 80 shares of AMZN, roughly US$19,400 of exposure — **close to twice the equity**. Luck was on his side; AMZN rose the next day and taking the five fills off in tranches actually made 344. But he writes it plainly: > Money made on luck doesn't cover up a hole. I found the gate's exposure definition was missing the time dimension: **it was counting how much I hold right now, when it should have counted how much I've already committed.** A resting limit order is a commitment already sent out — it just hasn't landed yet. That week he folded in-flight orders into every exposure calculation: concurrent position count is now the **union** of held names and in-flight names, and total, single-name and sector limits all add the notional value of resting orders into the denominator. In the rejection logs from late July, **this new rule blocked 3 duplicate orders outright**. Order Blotter: the full audit trail of the intent queue; the red text is risk control's rejection reason Dream Journal: self-assessed win rate by confidence band, alongside the lessons distilled overnight ## Paper-trading disclosure Flint runs entirely on **Longbridge paper trading**. Every P&L figure above is a **paper-trading number, involves no real money, and does not constitute investment advice**. The author's goal is eventually to go live and be profitable, but that comes after paper-trading validation — **it does not represent any form of expected return today**. This is an educational project studying whether a constrained LLM can survive long-term inside real market structure. It is not a trading product. ## Join in: try it, build on it, submit your own - 👉 **Try it & build on it**: Flint is open-sourced on GitHub (Apache-2.0, still iterating). You're welcome to try it, file issues, or contribute: [https://github.com/UncertaintyDeterminesYou4ndMe/flintrade](https://github.com/UncertaintyDeterminesYou4ndMe/flintrade) - 👉 **Show us what you've built**: there are more ways than ever to turn an idea into something real — **Longbridge API, CLI, Skills, the Agent Platform** — one of them will fit. **Got an idea? Build it!** When it's ready, **@LongbridgeAI** **to submit** — the next community showcase could be yours. ### Related Stocks - [MSFT.US](https://longbridge.com/en/quote/MSFT.US.md) - [META.US](https://longbridge.com/en/quote/META.US.md) - [NVDA.US](https://longbridge.com/en/quote/NVDA.US.md) - [AAPL.US](https://longbridge.com/en/quote/AAPL.US.md) - [GOOGL.US](https://longbridge.com/en/quote/GOOGL.US.md) - [GOOG.US](https://longbridge.com/en/quote/GOOG.US.md) - [GOOGN.US](https://longbridge.com/en/quote/GOOGN.US.md) - [AMZN.US](https://longbridge.com/en/quote/AMZN.US.md) - [TSLA.US](https://longbridge.com/en/quote/TSLA.US.md) --- > **Disclaimer: This article is for reference only and does not constitute any investment advice.**