← Coil home
GUIDE

How to automate SOXL/SOXS trading with an AI agent

A practical, honest walkthrough of what it actually takes to run a hands-off semiconductor-ETF strategy through your own AI agent and broker.

Guide · 9 min read · updated July 2026

Automating a SOXL/SOXS strategy with an AI agent is genuinely possible — and most naive attempts lose money. The difference between the two outcomes is almost never the model. It's whether you've done the unglamorous work: a narrow instrument set, entries and exits written as explicit rules, hard risk circuit-breakers, and a backtest harness that proves the logic cold before a single real dollar is at stake. This guide walks through that work conceptually, names the components, and is candid about the parts that are real labor. Coil is offered at the end as the pre-built option that bakes all of it in — but you can build your own from these same pieces.

Nothing here is investment advice or a recommendation to buy or sell anything. SOXL and SOXS are 3x leveraged ETFs: a ~10% move in the semis index is roughly ~30% in the ETF before gaps and slippage. They decay on multi-day holds and can lose rapidly, including total loss of the capital you commit. No agent, rule, or stop removes that — the best they can do is try to reduce single-day damage.

Coil has evolved. Automating a single SOXL/SOXS pair is what Coil used to be. Coil today is long-only and hunts the market's leaders across the whole tape — every name in the S&P 500 and the Nasdaq-100, plus a Macro book (bonds, income, gold and metals, commodities) — and buys the ones scored ready at real entries. That includes semiconductors when they lead: when semis are in favor it will accelerate a semis leader with a leveraged vehicle (SOXL is one such accelerator) rather than trade a fixed long/inverse pair around the clock. The DIY walkthrough below still teaches an honest semis-automation build; the pre-built product it points to is now the market-wide engine. Jump to Coil, the pre-built option to see what shipped.

The components you need

A hands-off agentic strategy is not one program; it's a small stack of cooperating parts. Skip any of them and the whole thing gets fragile fast.

  • An AI agent on a schedule. A model like Claude, run as a scheduled session, not an always-on chat. At set times it wakes, gathers data, evaluates rules, and either acts or stands down. The agent operates the strategy; it should not improvise it.
  • A broker connector. A tool interface — commonly an MCP — that lets the agent read positions and place orders through your brokerage. Robinhood works via a broker MCP, and any equivalent broker MCP fits the same slot.
  • A market-data key. Prices and history to decide on, and to backtest against. A free Alpaca data key covers both.
  • A defined rules engine. The actual strategy — entries, exits, sizing — written as deterministic logic the model executes, not as a vibe in a prompt.
  • Risk circuit-breakers. Account-level guardrails that cut size or halt trading when losses mount, independent of whatever the strategy “wants” to do.
  • A backtest harness. A way to replay the rules across past market regimes — honestly, in a fresh process each time — so you can see the logic's behavior before risking money.

The steps, conceptually

1. Pick a narrow instrument set

Resist the urge to trade everything. A tight universe means you can actually understand the behavior, backtest it deeply, and tune it without overfitting noise across dozens of tickers. A focused semis build like the one this guide describes might trade exactly one pair — SOXL (3x long semis) and SOXS (3x inverse) — and nothing else. If you're choosing between the long and inverse side, the mechanics in SOXL vs SOXS are worth reading first; the leverage-decay primer explains why these are short-hold instruments, not buy-and-hold.

2. Define entries and exits as explicit rules

This is where most agent-trading quietly fails. “Buy when it looks strong” is not a rule a model can execute consistently — it's a prompt that drifts. You want explicit conditions. As a concrete shape: a disciplined semis build buys weakness inside a confirmed uptrend — an oversold flush, a pullback to trend, a momentum reclaim — and, if it trades the inverse side at all, only when trend structure has genuinely broken (a death-cross gate). Its exits are equally explicit: every position carries an ATR-scaled protective stop, and size is clamped by a hard risk cap. The point isn't the specific dials; it's that every decision the agent makes maps to a written rule you can read and test.

3. Validate cold, across regimes

A backtest that only looks good in one market is a coin that landed heads once. You want to replay the rules separately through a bull, a chop, and a bear — each in a fresh process so cross-run cache warmth can't quietly flatter the numbers. “Cold” validation is the honesty layer. It's also where look-ahead bugs hide — which is why Coil ships the same research-backtest harness the developer uses, plus a safety self-test suite (account whitelist, hard caps, drawdown ladder, kill switch) you can run before a dollar is at stake. If your harness has never embarrassed you, be suspicious of it.

4. Connect the broker — credentials stay local

Wire the broker MCP with your own credentials, on your own machine. The non-negotiable rule: your keys never leave your computer and your capital stays in your own account. No pooled money, no custody transfer, no platform server holding trade-enabled keys. For the practical mechanics of pairing a scheduled agent to a brokerage, the Claude + Robinhood agentic trading guide walks through the setup end to end, and can Claude trade stocks? covers what the model can and cannot do on its own.

5. Run on a schedule, with a kill switch

Schedule the sessions yourself and start small while you learn the behavior. Critically, keep a way to stop it instantly — you can pause, change, or kill the schedule anytime. And remember that standing down is a position: on no-setup days the rules can simply hold cash, where any uncommitted balance earns whatever your broker's variable sweep pays (for example, Robinhood Gold quoted ~3.35% APY as of early 2026 — that's the broker's yield, variable, not paid by Coil, and not risk-free). A human watching overnight is always the strongest safety layer; deterministic per-session exits and circuit-breakers are a backstop, not a substitute.

Why DIY is real work — and why most naive loops lose

The components above are simple to list and hard to get right together. The common failure modes are predictable: an over-broad universe you can't backtest; entries that are prompts, not rules; a backtest with look-ahead that promises returns it can't deliver; no circuit-breaker, so one bad open on a 3x ETF undoes months; or an agent given enough latitude to improvise in exactly the moments discipline matters most. An engine that retunes its sizing to your own fills within hard bounds is far more robust than a static script — the trade-offs are laid out in self-tuning vs static trading bots. Budget about an hour from setup to a scheduled dry-run with a pre-built engine, and considerably more to build, validate, and harden your own from scratch.

Build vs. buy

If you want to assemble your own, the table maps what each path actually asks of you. Neither path can promise a profit — the leveraged-ETF risk is yours in both.

What it takesBuild it yourselfUse Coil
Instrument selectionYou research and narrow it downEvery S&P 500 + Nasdaq-100 name plus a Macro book, scored and ranked for you
Entry / exit rulesYou design, code, and tune themLong-only: buys READY/SETUP leaders at real entries, refuses falling knives and chasing; structural stops + ladder exits with trailing stops — included
Risk circuit-breakersYou build the ladder and test itAn immutable safety spine — account whitelist, position caps, a drawdown ladder, a kill switch — built in; ships disarmed
Backtest harnessYou write it — and debug its own bugsResearch-backtest harness (point-in-time, survivorship-free) + a safety self-test suite ship with it
Broker + data wiringYou integrate the MCP and data keyBuilt for Claude + Robinhood; free Alpaca key; Mac or Windows, Python 3.9+
Who holds keys / capital / riskYouYou — credentials never leave your machine

What the validation actually shows

These are research-backtest figures — not typical, not a prediction, and not client or live returns. The market-wide leadership-rotation backbone the v4 engine is built on was replayed point-in-time and survivorship-free (delisted names included), 2017 through 2026 H1, with next-open fills and costs modeled. Each figure rides next to its same-window SPY benchmark. Treat it as a hypothesis to test yourself.

YearCoil (research)SPY
2017+17%+20%
2018−1%−7%
2019+7%+30%
2020+22%+19%
2021+6%+28%
2022+13%−16%
2023+10%+23%
2024+12%+27%
2025+51%+17%
2026 H1+86%+10%
Cumulative+638%+282%
Max drawdown−23%−32%

In that research backtest the backbone compounded +638% versus SPY's +282%, with a shallower worst drawdown (−23% vs −32%) and a positive result in 9 of 10 years (worst −1%, in 2018). Read the honest rider with it: through the end of 2025 it ran roughly even with SPY at about one-third less drawdown — the outperformance concentrates in leadership regimes (2025 +51%, 2026 H1 +86%). The engine is newly live; these are research figures, not a live track record, and live, forward results matter more than any replay — just as true of anything you build yourself.

Coil — the pre-built option

If the steps above sound like more than you want to maintain, Coil packages them — and it now reaches well past a single semis pair. Coil is a rules-based, long-only engine that scores every name across the S&P 500, the Nasdaq-100, and a Macro book, buys the leaders scored READY or SETUP at real entries, and accelerates the strongest with a leveraged vehicle at reduced size (SOXL among them when semiconductors lead). It's built for a scheduled Claude agent and a Robinhood-style broker MCP, with the research-backtest harness, the safety self-test suite, and the immutable safety spine — account whitelist, caps, a drawdown ladder, a kill switch — included; it ships disarmed. It's $29 once (regular $49) to own the full engine, yours forever: no subscription, no tiers, no recurring charge. Checkout runs through Gumroad as merchant of record (checkout, receipts, license keys). Because Coil is an instant download you keep, all sales are final — the only thing corrected is a genuine billing error, such as a duplicate charge. See exactly how the engine is put together in how it works before you decide.

Skip the assembly — or use it as your blueprint

Coil bakes market-wide leader selection, explicit long-only rules, the research harness, and the safety spine into one engine you run on your own machine. You hold the keys, the capital, and the risk.

See pricing — $29

Coil is software you install and run yourself, with your own brokerage credentials and capital. It is long-only and not investment advice, not a managed account, and not a signal service. Leveraged ETFs, where the engine uses them, can lose value rapidly, including total loss. All performance figures are research backtests — point-in-time and survivorship-free, not live or client returns; past performance does not predict future results.