AI-Assisted Stock Trading Bots: Alpaca API, Congressional Copy Trading, and the Wheel Strategy
A critical analysis of three AI-automated trading strategies built with Claude and the Alpaca paper trading API: trailing stop loss with ladder buying (basic but functional), congressional copy trading via Capitol Trades (limited by disclosure delays and survivorship bias), and the options wheel strategy (legitimate income strategy with significant downside risk in crashes).
Building stock trading bots via conversational AI (e.g., Claude + Alpaca API) has become accessible to non-programmers. Three common strategies demonstrate both the power and the limitations of this approach. ## The Alpaca API Setup Alpaca offers free paper trading with real market data and a straightforward REST API. The typical setup: generate API keys, provide them to an AI assistant, describe the strategy in natural language, and the AI writes the code to connect, monitor, and execute trades. Scheduled tasks check positions at regular intervals. ## Strategy 1: Trailing Stop Loss with Ladder Buying Set a stop loss (e.g., -10%), which automatically ratchets up as the price rises (locks in gains). On the way down, ladder in additional purchases at predetermined levels (e.g., buy 10 more shares at -20%, 20 more at -30%). This is a structured version of dollar cost averaging with downside protection. Not novel — brokerages offer trailing stops natively — but the conversational setup makes it accessible. ## Strategy 2: Congressional Copy Trading US politicians are required by law to disclose stock trades (under the STOCK Act of 2012, though enforcement is weak). Services like Capitol Trades aggregate these disclosures. The idea: copy trades of politicians who sit on committees with access to non-public information. Claimed backtests show outperformance (one politician at 34.8% vs S&P 500 at 15% over one year), but this has significant limitations: **disclosure delays** mean you're always trading days to weeks late, **survivorship bias** skews results when you retroactively pick the best-performing politician, and the strategy is well-known enough that any edge has likely compressed as more participants copy it. ## Strategy 3: The Wheel Strategy (Options) A two-stage options income strategy: **Stage 1 — Sell cash-secured puts:** Pick a stock you want to own, sell a put at a strike below current price, and collect the premium. If the stock stays above the strike, keep the premium and repeat. If it drops below, you're assigned shares at the strike price minus the premium collected. **Stage 2 — Sell covered calls:** Now owning shares, sell a call above your cost basis and collect more premium. If the stock stays below the strike, keep shares and premium and repeat. If it goes above, shares are called away at a profit. Return to Stage 1. The wheel generates consistent income in sideways or slightly bullish markets. The critical risk: in a crash, you're assigned shares at a price that keeps falling — you're holding declining shares and can't sell calls above your cost basis without locking in a loss. The claim that it "pays you no matter which direction" is misleading; you can absolutely lose money if the underlying tanks. ## Honest Assessment The options explanations (particularly the insurance company analogy for selling options) are genuinely clear and valuable for beginners. The strategies themselves are all well-established — trailing stops, copy trading, and the wheel have existed for decades. AI makes them easier to set up conversationally but doesn't provide an inherent trading edge. Paper trading results don't account for real execution conditions (slippage, bid-ask spreads, liquidity).