A (Paper) Trading Agent
Wire data → reasoning → a decision — in a simulator, with rails. This is for learning, not for your real money.
You want to feel an agent do real work end to end: pull live-ish market data, reason about it, and output a decision. A trading agent is a vivid way to learn the loop — but real money is exactly where naive AI agents cause real harm. So we build it as a paper-trading simulator with hard rails, and treat its output as a learning exercise, never advice.
First, the rails (this is not financial advice)
Everything here is paper/simulated only. Nothing in this lesson is financial advice, and you should never wire an LLM agent to place real trades with your money. AI agents hallucinate, misread data, and can loop — in markets that means real losses. The point is the engineering pattern, practiced in a sandbox: fake portfolio, simulated fills, hard limits. Treat the agent’s “decision” as an exercise output, not a recommendation.
The pattern: data → reasoning → decision
An applied agent composes pieces you already know. Tools fetch inputs (a price feed, recent news). The model reasons over them against an explicit policy (“only consider the given data; if uncertain, hold”). It outputs a structured decision — action + reason + confidence — that your code can log, check against rails (position limits, max loss), and simulate. Same plan→act→observe shape as any agent, wrapped in guardrails because the domain is high-stakes.
Sim step: tool returns {price: 100, trend: "down 3%"}. Policy: “risk-averse; hold unless a strong, data-backed signal.” Agent outputs {action: "hold", reason: "short-term dip, no strong signal", confidence: 0.4}. Your simulator records it — no real order, ever.A flight simulator for pilots. You practice the full procedure — instruments, decisions, emergencies — with zero risk, precisely because the real thing is dangerous. A paper-trading agent is the same: learn the loop where a mistake costs nothing, never confusing the simulator for the real cockpit.
A safe agent decision cycle:
1. Tool fetches simulated price + a news snippet.
2. Model reasons under a written risk policy (only the given data; bias to hold).
3. Outputs {action, reason, confidence} as JSON.
4. Rails check: within position limits? max-loss respected? If not → force “hold.”
5. Simulator applies it to a fake portfolio. Nothing real moves — you studied the pattern safely.This is the reading. The interactive version — active-recall quiz, a hands-on experiment you run in your own AI, and an earned mastery check — is free in the app.
Start this lesson free →