Financial Trading with AI Agents - A Practical Guide from Theory to Deployment A 16-chapter book teaching developers with no finance background how to build autonomous AI agents that scan markets, detect opportunities, and execute trades. Written from real production code running on a $30/month Azure VM. Part I - Financial Foundations (Ch 1-5) Covers market mechanics (exchanges, order books, bid-ask spreads), candlestick/volume analysis, trading strategies (momentum, mean-reversion, Wyckoff accumulation, channel breakouts), penny stock specifics (volatility, manipulation, accumulation detection), and macro forces - particularly the yen carry trade mechanism where USD/JPY crossing 160 triggers Japan intervention, causing small-cap liquidation cascades. Part II - Data, APIs, and Integration (Ch 6-9) Maps the data landscape (real-time vs delayed, survivorship bias, caching strategies). Deep-dives into Yahoo Finance, Finnhub, DuckDuckGo, SEC EDGAR with working Python code. Compares trading platform APIs: Revolut X (crypto only), Trade Republic (no API), T3 OPEN (our choice - HTTP localhost + TCP push for Italian markets), and Interactive Brokers. Introduces MCP (Model Context Protocol) as the broker-agnostic bridge. Builds a Telegram bot for delivery with HTML formatting, URL shortening via CleanURI, command handling, and chunking. Part III - Building the Agents (Ch 10-15) Designs the multi-persona pipeline architecture (LLM + tools + loop). Three specialized agents: Marcus "Viper" (news scanner, 7-source strategy, 0-10 scoring rubric), Dr. Tanaka (accumulation detector - Donchian channel width as primary signal, 9-phase scoring model), and Hiro Mashimura (yen carry trade macro overlay, position sizing multipliers). Covers LLM client engineering: the tool-calling loop from scratch (no frameworks), DeepSeek's parallel_tool_calls bug, cost tracking ($0.50/month with DeepSeek V3), and prompt engineering patterns. Deployment: cron scheduling, systemd services, SCP deployment, and production failure catalog. Part IV - The Last Mile (Ch 16) Closes the loop from signal to execution. Compares EU broker APIs (comparison table). Implements the full execution pipeline: detection → macro check → position sizing (budget multiplier) → 6 safety gates (max position, daily loss limit, simulation mode, human-in-the-loop via Telegram, market hours, duplicate protection) → T3 MCP server (Go binary) → order on Borsa Italiana. Includes TikZ architecture diagrams and the $100-to-5-shares worked example. Appendix: LLM Operational Risks Covers model deprecation, API outages during market hours, hallucinated parameters, cost spikes from reasoning loops, and rate-limit cascades. Full cost comparison table (DeepSeek V3 at $0.14/M vs GPT-4o at $2.50/M). Monthly infrastructure: $30.62 total with DeepSeek. 10-point mitigation checklist.
ThriftBooks sells millions of used books at the lowest everyday prices. We personally assess every book's quality and offer rare, out-of-print treasures. We deliver the joy of reading in recyclable packaging with free standard shipping on US orders over $20. ThriftBooks.com. Read more. Spend less.