/merrymen-trader:trader-risk [path to orders.json]from Merrymen Day Trader
Validates trade orders against configurable risk limits before they become proposals. Checks stop-loss, max loss per trade, reward:risk ratio, daily loss limit, trade count, entry window, blocked tickers, position caps, and Merrymen agent constraints. Prints PASS or BLOCK with reason.
Ships in Merrymen Day Trader. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Risk Manager is the gate between a proposal and Merrymen. Every order written by trader-budget or trader-broker's flatten passes through it. A BLOCK is final for that order: it does not go to the user for a yes, and it never becomes a Merrymen proposal. Merrymen checks its own signed limits again when the proposal is made, when the owner approves it and when the agent executes it; this check says no first, with the reason, before anyone is asked. Most people who day trade lose money. These limits keep each loss and each day's losses small. They do not make a trade win.
${CLAUDE_SKILL_DIR} below is this skill's folder (where this SKILL.md lives).
python3 "${CLAUDE_SKILL_DIR}/check.py" # trader/ files; writes trader/state/risk.json
python3 "${CLAUDE_SKILL_DIR}/check.py" --json
python3 "${CLAUDE_SKILL_DIR}/check.py" --no-write # look without recording
python3 "${CLAUDE_SKILL_DIR}/check.py" --now "2026-10-19 10:15" # pin the clock (New York time)
| file | what |
|---|---|
trader/orders.json | the proposed orders (trader-budget, or trader-broker's flatten) |
trader/config.json | the limits (trader-budget ships config.example.json) |
trader/portfolio.json | cash and holdings; if missing, a fresh account funded with the budget |
trader/prices.json | a fresh price raises the entry it measures risk from; also values holdings |
trader/merrymen/tokens.json | Merrymen's stock tokens: the registry address for each symbol, paused or not |
trader/merrymen/agent.json | the agent's status, mode, permission expiry, signed limits and 24-hour budget |
trader/merrymen/quotes.json | the quote_trade result for this exact order |
trader/state/broker.json | what was proposed or filled today: duplicates, trades per day, daily loss |
trader/state/risk.json | the verdicts it writes, with a fingerprint of each exact order |
An entry opens or adds to a position: a buy, or a sell that would go short. An exit only reduces what you already hold. Getting out must always be possible, so an exit is checked for format, asset and short sales only. Every other rule (day limits, entry window, loss, reward:risk, blocked list, size, duplicates) turns into a warning for an exit, never a BLOCK.
Orders are checked in file order, as if each passed order had filled, so a batch that is fine order by order but breaks a limit together is caught.
| check | blocks when |
|---|---|
| format | no symbol, side not buy or sell, both or neither of qty and notional, a limit order with no limit price; with "broker": "merrymen", anything but a Merrymen order (a USDG amount of one token address for one agent, market only, no bracket fields) |
| asset | an option symbol while allow_options is false; crypto or anything that is not a US stock or ETF ticker |
| short | a sell of more than you hold (allow_short false) |
| blocked | (entries) the ticker is on the blocked list |
| size | (entries) under min_order_usd or over max_order_usd |
| position | (entries) the stock would be over max_position_pct of the account |
| cash | (entries) the buy would leave less than the cash buffer, or need margin |
| stop | (entries) no stop while require_stop is true (the order's plan stop); a stop on the wrong side of the entry |
| loss | (entries) the loss at the stop over max_loss_per_trade_usd: the amount x (entry minus stop) / entry, or, when bigger, measured from the token's quoted price with fees and gas both ways |
| reward:risk | (entries) (target minus entry) / (entry minus stop) under min_reward_risk |
| daily loss | (entries) the max losses at the stops of today's entries, plus this one, over max_daily_loss_usd |
| trades | (entries) max_trades_per_day entries already placed today |
| window | (entries) before no_entries_before or after no_entries_after, or the market is closed |
| pdt | (entries, only with pdt_guard true) 3 day trades already in the last 5 business days |
| duplicate | (entries) the same symbol and side twice in one batch, or already placed today |
| daily limit | (entries) max_orders_per_day orders already placed today |
Merrymen's checks ("broker": "merrymen"). Some block any order, even a sell:
| check | blocks when |
|---|---|
| token | the symbol is not exactly one token in Merrymen's stock-token registry, or the order's address is not that token's |
| agent | no merrymen_agent in the config; agent.json is missing, older than 10 minutes, mixes two agents or is for another agent |
| running | the agent is killed, expired or in error; (entries) not armed or active |
| book | "paper": true and the agent is not in paper mode; the agent is idle or its mode is unknown |
| permission | no signed permission, or it has expired; (entries) it expires before today's flat-by time, so the agent could not sell |
| signed limits | over the signed per-trade limit or the owner-order cap; (entries) within exit_headroom_pct (5%) of either, so the closing sell might not fit under it; the 24-hour budget left cannot cover the buy AND the sell (reserve_exit_budget), or fewer than 2 operations are left |
| paused | (entries) the token is paused in the registry |
| holding | a flatten ticket made for a holding that trader/portfolio.json no longer shows (one part filled since): run flatten again |
| quote | (entries) no quote_trade for this exact side, token and amount, one older than 120 seconds, one Merrymen could not route, or one whose price impact the agent would refuse |
| gap | (entries) the token's quoted price is more than max_quote_gap_pct (1%) from the stock price the plan uses: the token is not tracking the chart, or it is not one share |
A Merrymen sell of a token the agent holds is always an exit: Merrymen sells at most what the agent holds, so it can never go short.
How the numbers work:
trader/prices.json (under 15 minutes old). A plan written at 10:15 cannot
understate the risk at 10:55 after the price ran up. An older price is not
used, and it says so.propose_trade call that errored, until it is settled.no_entries_* to null to switch the window off.pdt_guard on if yours does.Warnings do not block, but say them to the user: a LIVE agent, a stop that lives only in the plan (always, on Merrymen: it holds no resting stop), a price too old to use, an early close today.
alerts.py quote TSLA --write). Refresh
trader/merrymen/agent.json (get_agent_status, get_agent_controls) and
quote_trade the exact order into trader/merrymen/quotes.json.check.py. Exit code 0 means every order passed, 1 means at least one
was blocked.The TSLA order from trader-budget (23.75 USDG) at 10:15 AM on Monday 2026-10-19, paper agent, with the token quoted at 364.90:
PASS #1 buy TSLA $23.75, entry
token price 364.9000 vs the stock's 364.18: +0.20%; impact 12 bps; fee $0.01
max loss with the token's price and costs: $0.48 ($0.43 at the stop + $0.04 fees and gas, both ways)
entry 364.18 (the plan's entry), stop 358.32, target 370.04: risk 5.86 a share
max loss $0.48 (limit $2), reward:risk 1.00 (min 1)
today before this: 0 of 3 trades, $0 of $6 daily loss
~ the stop 358.32 is in the plan only, not at the broker: set a stop alert (trader-alerts: alerts.py add --from-plan)
1 passed, 0 blocked at 2026-10-19 10:15 New York. Cash after the passed orders: $176.25 (paper account).
The same order against a live agent, with the token quoted at 370.00:
BLOCK #1 buy TSLA $23.75, entry
- merrymen: your config says paper ("paper": true) but the agent trades REAL funds (mode live). Switch the agent to practice in Merrymen, or decide to go live yourself
- merrymen: the token trades +1.60% from the stock price 364.18 the plan uses (limit 1%): the token is not tracking the chart, or is not one share
At 9:40 it is blocked by the window (no new entries before 9:45). The 3:55 PM sell that closes the position passes, even though it is after the 3:30 entry cutoff and has no quote yet: it is an exit (the missing quote is a warning).
It never proposes a trade, never edits an order to make it pass, never loosens a limit, never blocks a sell that only gets the user out on a day limit or the entry window, and never treats a PASS as the user's yes. A sell is blocked only where Merrymen would refuse it anyway (a stale or wrong agent snapshot, an expired permission, a stopped agent, the wrong book, the wrong token, over the signed per-trade limit): refresh the snapshot, or flatten in parts.
"paper": true): trader-risk blocks every order unless the Merrymen agent is in
practice (paper) mode. Going live is the owner's own decision, made in Merrymen and in their own config.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub merrymen-labs/merrymen --plugin merrymen-trader11 skills in this plugin
/trader-alertsPrice Alerts. Rings when a price, a stop or the opening bell hits. Turns the trade plan into three alerts in one go (the stop, the target and "flat by close" at your flat-by time), plus above / below / stop / target levels, percent moves from the previous close, any time of day, and the NYSE opening bell, each ringing once so you are not spammed. Knows NYSE hours with the 2026 and 2027 holidays and 1:00 p.m. early closes, works out New York time itself, fetches free delayed quotes (Yahoo chart JSON, Stooq CSV) one ticker at a time, and writes trader/prices.json for sizing and the risk check. Use when the user says "alert me when", "tell me if TSLA hits", "watch my stop", "watch my trade", "remind me to close by 3:55", "is the market open", "when does the market open", "get me a price", or right after /trader-exit writes a plan./trader-analystThe Earnings Analyst. Reads a company's reported numbers straight from SEC EDGAR (XBRL company facts from its 10-Qs and 10-Ks, plus the latest earnings 8-K and its press release) and sums up what changed: revenue, gross, operating and net margins, net income and diluted EPS, quarter by quarter, each against the same quarter a year earlier, with the trailing twelve months. Reads an earnings call transcript when you paste one. Use when the user says "how did Tesla's earnings look", "analyze the earnings", "what changed this quarter", "is revenue growing", "check the 10-Q", "compare margins", "sum up the call", "does it report this week", or before trading a stock around its earnings./trader-brokerOrder Executor for Merrymen. Turns an order that trader-risk passed into ONE Merrymen trade proposal for the user's own agent, never without their yes. Shows each order as a plain ticket (a USDG amount of one stock token, the plan's stop and target, the max loss with the token's price and costs) plus the exact propose_trade call, records the yes word for word, then Claude's own permission card asks again and the owner approves the proposal in Merrymen. Links the agent (list_agents, get_agent_status, get_agent_controls) and the stock-token list (discover_tokens), follows a proposal with get_proposal, records fills, and builds the sell that closes a day trade by the flat-by time. Paper (practice) by default. Use when the user says "place the order", "buy it", "execute", "send it to Merrymen", "trade it on my Merryman", "close my position", "flatten", "get me out", "connect Merrymen", "set up paper trading", or after /trader-risk passes./trader-budgetBudget Manager. Sizes every position to your budget, your max loss per trade and your Merrymen agent's own signed limits. Reads the trade plan from trader-exit (entry, stop, target), finds the USDG amount that fits inside every limit (max loss per trade, position cap, max order, cash after your buffer, the agent's per-trade limit, the owner-order cap and half of what is left of its 24-hour budget), says which limit decided it, and writes ONE Merrymen order (a USDG amount of one stock token, by address) to trader/orders.json. A stop too far away for your max loss is a plain refusal, not a smaller order. Nothing is sent. Use when the user says "how much should I buy", "size this trade", "I have $200 on my Merryman", "I only want to risk $2 a trade", "set my rules", "keep 10% in cash", or after /trader-exit writes a plan./trader-entryEntry Timer. Watches a setup bar by bar and tells you the moment to get in. Reads free Yahoo 1-minute or 5-minute bars, builds the opening range (the first 15 minutes by default) and calls the entry on the first completed bar that CLOSES above the range high, or above a level you give it (like a 20-day high from the scanner), with an optional volume check. Says waiting and how far, triggered with the time and the price, expired, or not open yet, and writes trader/entry.json for /trader-exit. Long side only. It never places an order. Use when the user says "tell me when to get in", "watch TSLA", "has it broken out", "did it break the opening range", "entry signal", "time my entry", "check my watchlist", or after /trader-scanner and /trader-news, before /trader-exit./trader-exitExit Planner. Sets your stop and your target before you enter, so you know when to get out. Reads the entry from trader-entry (or a price you give), puts the stop at the opening-range midpoint by default (or the range low, your price, a percent, or a multiple of the ATR), rounds it down to the cent, and sets the target at 2R (or 1R, or your price). Refuses a stop at or above the entry, a target at or below it, or a stop too tight to survive the spread, and says why. Writes trader/plan.json for the Time Machine, the Budget Manager and Price Alerts. Long side only. Use when the user says "where's my stop", "set my stop and target", "plan the exit", "when do I get out", "stop loss", "what's my R", "risk reward", or right after /trader-entry triggers, before /trader-timemachine.Other plugins' skills for the same job