AI Trading Agent with Risk Guardrails for Educational Investing

A developer has built an AI-powered trading assistant that connects Claude to a brokerage account with a risk engine positioned between the AI and the money. Every trade must pass through safety checks before execution.
Key Features and Implementation
The system includes multiple risk controls:
- Blocks trades attempting to allocate 50% of portfolio to a single stock
- Automatically shuts off trading when down 3% in a day
- Includes a kill switch that stops everything at 20% drawdown
- Uses fractional Kelly Criterion for position sizing ("don't bet more than the math says you should")
The setup begins with $100K in fake money using Alpaca paper trading (free to set up). Users can interact through multiple interfaces:
- Talking to Claude in terminal
- Web dashboard with charts and watchlist
- CLI commands
The AI can analyze positions and provide buy/sell/hold recommendations, with clear disclaimers that this is educational and not financial advice.
Technical Details
The project works as an MCP server, allowing integration with Claude Code. According to the developer: "If you use Claude Code, you can drop it into your setup in about 2 minutes and just start talking to it." Example commands include:
- "What's my portfolio look like?"
- "Buy 5 shares of AAPL."
- "Why did you block that trade?"
Transitioning from paper to live trading requires flipping one environment variable. The same guardrails apply with real stakes.
The project is available on GitHub under MIT license, includes 129 tests, and works on Mac/Linux/WSL. The developer is seeking feedback on whether the risk limits feel appropriate for learning and what additional features users would want.
📖 Read the full source: r/ClaudeAI
👀 See Also

Local LLM Performance Benchmarks on Mac Mini with OpenClaw and LM Studio
A Reddit user posted performance figures for running the Unsloth gpt-oss-20b-Q4_K_S.gguf model locally on a Mac Mini with 32GB RAM, achieving 34 tokens/second with a 0.7 second time to first token using OpenClaw 2026.3.8 and LM Studio 0.4.6+1.

Text Adventure Game Engine Skill for Claude Desktop
A text adventure game engine runs entirely inside Claude Desktop as a skill with no servers, apps, or code to run. It includes full RPG mechanics, 3D dice rendering, 19 expansion modules, and portable save files.
Give Your OpenClaw Agent a Phone: Open Source Plugin for Voice Calls
A developer open-sourced a plugin that lets OpenClaw make phone calls. Unlike $20/mo SaaS alternatives, this is free and self-hosted.

Pi Coding Agent with Qwen 35B Q2: Using Filesystem as External Memory and Enforcing Context Guards
A Reddit user built a stack around Pi coding agent with Qwen 35B Q2_K_XL quant that enforces guards — rejects edits over 100 lines, caps thinking blocks at 2000 chars, and monitors context at 65%/80% — treating the filesystem as the model's memory, not the context window.