Chapter 7: Build It Yourself
Some readers won't want a product. They'll want the workbench: the APIs, data feeds, and backtesting engines for building their own AI trading systems. This chapter is for them. It's also a reality check, because the workbench is where the gap between "I built a trading AI" and "I built a trading AI that makes money" becomes impossible to ignore.
The plumbing: broker and data APIs
Alpaca is the friendliest on-ramp, a developer-first REST and WebSocket API for US stocks, ETFs, options, and crypto, with commission-free API trading for eligible retail accounts and, critically, free paper trading. You can build a strategy, run it against live market data with fake money, and watch it succeed or fail without paying tuition to the market.
Interactive Brokers is the professional choice: APIs spanning 170+ global markets, built-in algorithmic order types (TWAP, VWAP, Adaptive), and tiered commissions for high volume. The tradeoff is complexity. IBKR's onboarding and API surface assume you know what you're doing, because its core clientele does.
QuantConnect sits between research and execution: an open-source backtesting engine (LEAN) with deep historical data, free for research, with paid tiers (roughly $8–80 a month) for live deployment. TradingView's Pine Script is the lightest-weight path. Script a strategy on a chart, get alerts, bridge them to execution. Free to start, paid tiers from around $15 a month.
Understand what the API actually is: plumbing. The "AI" is whatever model you build on top, say a sentiment classifier whose scores trigger orders. The API doesn't give you intelligence. It gives you a faucet. What flows through it is your responsibility.
The discipline stack
If you build, build like a professional, because the market will treat you like one. It will take your money professionally. The realistic stack, in order:
- Research in QuantConnect or local Python, on survivorship-free data, with the overfitting paranoia of Chapter 10 as your constant companion.
- Paper trade for months, not days, on Alpaca or IBKR's simulator. Paper trading doesn't prove a strategy works. It proves the plumbing works and surfaces bugs. Most strategies die here, which is the point: better in simulation than in your IRA.
- Go live small, with three non-negotiable guardrails: a kill switch (one command that flattens everything and stops all trading), a daily loss limit (the system halts itself at, say, −2% of capital), and position caps (no single position can endanger the account).
Knight Capital lost $440 million in 45 minutes because a deployment went wrong and there was no kill switch, and that was a firm of professionals. Your kill switch is not optional equipment. It is the equipment.
The real cost of DIY
The DIY path costs months of learning, data subscriptions, compute, and the near-certainty that your first several strategies will fail. Practitioner post-mortems suggest the majority of machine-learning strategies don't survive six months in production, killed by overfitting, regime change, or costs the backtest undercounted.
I'm not telling you this to discourage you. Some of the best systematic traders started exactly this way, and the education alone, learning how markets actually work at the microstructure level, is worth more than most finance courses. I'm telling you so you budget for it like tuition, not like an investment. Money you can afford to lose, time you can afford to spend, expectations set to "education" rather than "income."
And one more planner's note: keep the mad-science account separate from the retirement plan. Different account, different mental ledger, hard cap on funding. The day your experimental trading bot shares an account with your kid's college fund is the day you've stopped doing research and started gambling with extra steps.
Why this chapter matters even if you never code
You may never write a line of Python. But understanding the DIY stack makes you immune to an entire category of sales pitch. When someone sells you a "proprietary AI trading system," you now know what the system would have to contain: data pipelines, a researched and honestly backtested model, execution logic, risk guardrails, monitoring. You can ask which parts they've actually built and which parts are marketing. Chapter 13 gives you the exact questions. This chapter gave you the knowledge to understand the answers.