jmobrien2018

Trading Agent — Development skill for Claude Code

Development community

Python trading agent that uses Claude to propose day and swing trades, executed in Alpaca paper trading.

How to install Trading Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open jmobrien2018/trading-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Trading Agent does

Python trading agent that uses Claude to propose day and swing trades, executed in Alpaca paper trading. Built with real-money safeguards: a code-enforced risk engine, kill switch, keychain-stored API keys, and full audit logging. Includes backtesting, strategy research, and a go-live gate. Explorational only. Day trading is a terrible idea.

Alternatives in Development

  • Validate Plan — You are tasked with validating that an implementation plan was correctly executed, verifying all success crite 10k ★
  • Candidates — Fetch and analyse top pool candidates with OKX smart money signals 722 ★
  • Crypto Market Rank — Query crypto market rankings including trending tokens, smart money inflows, meme rankings, and top trader PnL 483 ★

README

Trading Agent

A Claude-powered agent that paper trades US stocks to test day- and swing-trading strategies. It is built to real-money standards, but runs on paper only until the go-live gate is passed.

The project plan, decisions log and go-live gate live in the "Trading Agent — Project Plan" doc.

Status

  • Phase 0 (foundations): done. Settings, secrets handling, local storage, logging and a CLI.
  • Phase 1 (broker and data): built. Read-only Alpaca client, bar storage, data-quality report.
  • Phase 2 (data pipeline): built. Backfill, incremental refresh, live quotes, quality warnings, and a script to run the refresh on a schedule.

No orders can be placed; that waits for the risk engine (Phase 4).

Setup (Windows, PowerShell)

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.lock   # exact pinned versions
python -m pip install -e ".[dev]"
pytest
trading-agent check

Secrets

API keys never go in code, Git, config files or chat. They live in the OS keychain (Windows Credential Manager), under the service name `trading-agent`:

trading-agent secrets set ALPACA_PAPER_API_KEY      # prompts with hidden input
trading-agent secrets set ALPACA_PAPER_SECRET_KEY
trading-agent secrets status                        # shows set / MISSING, never values

Environment variables override the keychain. A git-ignored `.env` file (copy `.env.example`) also works as a fallback, but the keychain is preferred.

Broker keys should be paper-only, with 2FA on the Alpaca account.

Keeping data up to date (Phase 2)

trading-agent data refresh     # backfill new symbols, fetch new bars, save quotes, check quality
trading-agent data status      # what is stored per symbol and how fresh (no API calls)
trading-agent data latest      # latest quote and trade per symbol

`data refresh` is safe to run any time:

  • The first time it sees a symbol it backfills [history]: 90 days of 1-minute