Published: 2026-04-17

I Turned Claude Opus 4.7 Into a 24/7 Trading Agent Using Routines

Nate Herk upgrades his stock-trading agent from Opus 4.6 to 4.7 and wires it to Claude Code's new routines feature — a cron-style scheduler that lets the agent run market research, place trades via Alpaca, journal its decisions, and push an end-of-day summary to ClickUp, all without any human intervention. His first 30-day run with the same setup (on 4.6) beat the S&P 500 by 8%.

Source video

"I Turned Claude Opus 4.7 Into a 24/7 Trader" by Nate HerkWatch on YouTube →

Key Takeaways

  • Claude Code routines are the unlock: a built-in cron scheduler that fires the agent on a defined schedule (pre-market, market open, midday, close). The agent doesn't need to be manually triggered — it wakes up, does its work, and goes back to sleep.
  • Opus 4.7 is specifically designed for this use case. Anthropic describes it as built for "full throttle agentic work, judgment over ambiguity, and self-verifying outputs" — the exact properties you need for autonomous, unsupervised financial decisions.
  • The agent loop: pre-market research → place trades via Alpaca API → journal decisions into a file (persistent context for future sessions) → end-of-day summary pushed to ClickUp. The journaling step is what makes the agent get better over time rather than starting cold every day.
  • Tech stack is deliberately minimal: Claude Code (runtime + scheduler), Opus 4.7 (model), Alpaca API (trade execution), ClickUp (reporting). No separate orchestration framework required.
  • Custom skills define the agent's behaviors: how it does market research, how it makes decisions, how it places trades, how it writes logs. These are plain files — not magic — that you build and refine over time.
  • First 30-day result (Opus 4.6): $10,000 deployed, beat the S&P 500 by ~8%. The upgrade to 4.7's improved reasoning is expected to widen that gap.

The Routine Architecture

A "routine" in Claude Code is a scheduled trigger that fires the agent at specific times. Nate configures four daily firing times: pre-market (research window), market open (initial positioning), midday (rebalance check), and market close (end-of-day summary). Each firing loads the agent's skills and journaling context so it has memory of previous sessions.

The Alpaca API handles the actual brokerage integration: placing orders, checking positions, pulling account balance. The agent uses this as its "hands" — it can't just decide to trade, it has to call the Alpaca API correctly. This creates a useful guardrail: the agent is limited to what the API allows.

The journaling skill is what separates this from a one-shot agent. After every session the agent writes structured notes about what it researched, what it bought, why, and what it plans to monitor. This file is loaded at every subsequent session, so the agent builds on prior reasoning rather than starting from scratch.

Related on OpenClawDatabase

← Back to News digest · See also: OpenClaw guide

📬 Weekly Digest — In Your Inbox

One email a week: top news, releases, and our deepest new guide. No spam. Same content via RSS if you prefer.