# Trader Broker

Order Executor.

- Repository: https://github.com/Jakeschincariol/day-trader-skill (4279 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-20
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add Jakeschincariol/day-trader-skill --skill trader-broker -g -a claude-code -y`
Codex: `npx skills add Jakeschincariol/day-trader-skill --skill trader-broker -g -a codex -y`
Cursor: `npx skills add Jakeschincariol/day-trader-skill --skill trader-broker -g -a cursor -y`
Gemini CLI: `npx skills add Jakeschincariol/day-trader-skill --skill trader-broker -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Jakeschincariol/day-trader-skill`

## Description

Order Executor. Sends approved orders to your broker, paper trading by default, never without your yes. Shows each order as a plain ticket (a bracket shows its stop-loss, take-profit and the max loss at the stop) plus the exact JSON for Alpaca's place_stock_order, records your yes word for word, then Claude's own Allow once / Deny card asks again. Builds the sell ticket that closes a day trade by your flat-by time, records fills, and logs each trade's max loss so trader-risk can hold the daily limit. Covers setting up Alpaca's official MCP server in Claude Desktop (paper by default, keys in env vars, never in chat), the Interactive Brokers connector, and setting order tools to "Needs approval". Use when the user says "place the order", "buy it", "execute", "send it to my broker", "close my position", "flatten", "get me out", "connect Alpaca", "set up paper trading", or after /trader-risk passes.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# trader-broker

The Order Executor is the only skill in this pack that can lead to a real
order, so it is the strictest. An order reaches the market only after three
separate gates, every time, for every order:

1. **trader-risk passed this exact order today** (matched by fingerprint).
2. **The user typed an explicit yes for this one order** in the chat.
3. **The user clicked Allow once** on Claude's own permission card, which
   appears because the order tool is set to "Needs approval".

Two yeses from the user, one PASS from the rules. No yes, no order.

`${CLAUDE_SKILL_DIR}` below is this skill's folder (where this SKILL.md lives).

```bash
python3 "${CLAUDE_SKILL_DIR}/ticket.py" show                     # every ticket, READY or not
python3 "${CLAUDE_SKILL_DIR}/ticket.py" approve --index 1 --reply "yes"
python3 "${CLAUDE_SKILL_DIR}/ticket.py" result --index 1 --status placed --broker-id ID --filled-qty 8 --filled-price 364.20
python3 "${CLAUDE_SKILL_DIR}/ticket.py" fill --symbol TSLA --side sell --qty 8 --price 370.04
python3 "${CLAUDE_SKILL_DIR}/ticket.py" flatten --symbol TSLA --qty 8
python3 "${CLAUDE_SKILL_DIR}/ticket.py" log
```

`ticket.py` never talks to a broker. It renders tickets, checks that a reply
is a real yes for that order, builds the flatten ticket, and keeps the log in
`trader/state/broker.json`. `--now "2026-10-19 10:15"` pins the clock (New York time).

## What it reads and writes

| file | what |
| --- | --- |
| `trader/orders.json` | the proposed orders (trader-budget writes it; `flatten` replaces it) |
| `trader/state/risk.json` | trader-risk's verdicts; only a PASS from today is READY |
| `trader/state/broker.json` | every yes, no, placed, failed and filled, with each entry's max loss |
| `trader/portfolio.json` | cash and shares, updated by `fill` and by `result --filled-qty` |
| `trader/plan.json` | the flat-by time for `flatten` |

## Setup A: Alpaca (official MCP server, Claude Desktop)

The rest: https://github.com/Jakeschincariol/day-trader-skill/blob/HEAD/trader-broker/SKILL.md
