Jump to content

IdiotProof/CLI COMMANDS/part 2

From MindAttic Docs
Part 2 of 2: 1 · 2
Buy option contracts to open (level 2+). Sandbox by default; live needs a confirmation code.

Usage: idiotproof options buy <occ> <contracts> [--limit <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <occ>                            OCC contract symbol, e.g. AAPL261219C00150000. (required)
  <contracts>                      Whole contracts (each is usually 100 shares). (required)
  -l, --limit <decimal>            Limit price per share (premium). Without it the order is a market order.
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof options buy AAPL261219C00150000 2 --limit 3.20 --mode paper
      Paper limit buy of 2 calls.
  idiotproof options buy SPY261120P00560000 1 --mode live
      Live market buy; prints a confirmation code first.

options chain

An underlying's option chain for one expiration: calls and puts by strike with bid/ask, IV, delta and open interest.

Usage: idiotproof options chain <symbol> [--expiry <date>] [--horizon <int>] [--strikes <int>] [--feed <indicative|opra>]
Risk: read

Parameters:
  <symbol>                      Underlying ticker, e.g. AAPL. (required)
      --expiry <date>           Expiration date (yyyy-MM-dd) to show; default the nearest one.
      --horizon <int>           Days ahead to list expirations for (default 1098, about 3 years, so LEAPS show; Alpaca's own default is 1 week). (default: 1098)
      --strikes <int>           Strikes to show on each side of the spot price (default 10; 0 shows every strike). (default: 10)
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options chain AAPL
  idiotproof options chain SPY --expiry 2026-12-18 --strikes 5

options close

Close a whole options position (sells a long, buys back a short) through the gateway.

Usage: idiotproof options close <occ> [--limit <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <occ>                            OCC contract symbol of the position to close. (required)
  -l, --limit <decimal>            Limit price per share. Without it the close is a market order.
  -m, --mode <sandbox|paper|live>  Which account holds it: sandbox (default), paper or live (needs confirmation). (default: sandbox)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof options close AAPL261219C00150000 --mode paper
  idiotproof options close SPY261120P00560000 --limit 2.40 --mode live
      Live close; prints a confirmation code first.

options conditions

Options trade or quote condition codes and what they mean.

Usage: idiotproof options conditions [--tick <trade|quote>]
Risk: read

Parameters:
      --tick <trade|quote>  trade (default) or quote condition codes. (default: trade)

Examples:
  idiotproof options conditions
  idiotproof options conditions --tick quote

options contract

Full catalog details of one option contract by OCC symbol or Alpaca id.

Usage: idiotproof options contract <contract>
Risk: read

Parameters:
  <contract>  OCC symbol (e.g. AAPL261120C00250000) or Alpaca contract id. (required)

Examples:
  idiotproof options contract AAPL261120C00250000

options contracts

Search listed option contracts for an underlying by expiry, type, strike range and status.

Usage: idiotproof options contracts <underlying> [--expiry <date>] [--type <call|put>] [--strike-min <decimal>] [--strike-max <decimal>] [--status <active|inactive>] [--horizon <int>] [--limit <int>]
Risk: read

Parameters:
  <underlying>                    Underlying ticker(s), comma separated, e.g. AAPL or AAPL,MSFT. (required)
      --expiry <date>             Only this expiration date (yyyy-MM-dd).
      --type <call|put>           Only calls or only puts.
      --strike-min <decimal>      Lowest strike to include.
      --strike-max <decimal>      Highest strike to include.
      --status <active|inactive>  active (default) or inactive. (default: active)
      --horizon <int>             Without --expiry: days ahead to include (default 1098; Alpaca's own default is only 1 week). (default: 1098)
      --limit <int>               Most contracts to return (default 200, max 10000). (default: 200)

Examples:
  idiotproof options contracts AAPL --expiry 2026-11-20 --type call
  idiotproof options contracts SPY --strike-min 600 --strike-max 650 --limit 50

options do-not-exercise

Opt a held contract out of automatic exercise at expiry (paper or live; live needs a code).

Usage: idiotproof options do-not-exercise <occ> [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <occ>                            OCC contract symbol (or Alpaca contract id) of a long position you hold. (required)
  -m, --mode <sandbox|paper|live>  Which Alpaca account: paper (default) or live (needs confirmation). Sandbox can't exercise. (default: paper)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof options do-not-exercise AAPL261219C00150000 --mode paper

options exchanges

Options exchange codes and their names, as they appear in quotes and trades.

Usage: idiotproof options exchanges
Risk: read

Examples:
  idiotproof options exchanges

options exercise

Exercise a long option you hold (Alpaca paper or live; live needs a confirmation code).

Usage: idiotproof options exercise <occ> [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <occ>                            OCC contract symbol (or Alpaca contract id) of a long position you hold. (required)
  -m, --mode <sandbox|paper|live>  Which Alpaca account: paper (default) or live (needs confirmation). Sandbox can't exercise. (default: paper)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof options exercise AAPL261219C00150000
      Paper: exercise now.
  idiotproof options exercise AAPL261219C00150000 --mode live
      Prints a confirmation code first.

options glossary

Plain-English options jargon (hype, breakeven, IV, sell to close, ...): every term, or one in full.

Usage: idiotproof options glossary [<term>]
Risk: read

Parameters:
  <term>  A glossary key or title word (hype, breakeven, iv, sell-to-close, ...); omit to list every term.

Examples:
  idiotproof options glossary
  idiotproof options glossary hype
      The full explanation of one term.

options greeks

Delta, gamma, theta, vega and rho for one option contract; badged Model when computed locally.

Usage: idiotproof options greeks <occ> [--spot <decimal>] [--rate <decimal>] [--feed <indicative|opra>]
Risk: read

Parameters:
  <occ>                         OCC option symbol: ROOT + YYMMDD + C|P + strike x 1000 (8 digits), e.g. AAPL261120C00250000. (required)
      --spot <decimal>          Underlying price to use instead of Alpaca's last trade.
      --rate <decimal>          Risk-free rate in percent, e.g. 4.25 (default: the Options page setting, else 4).
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options greeks AAPL261120C00250000
  idiotproof options greeks SPY261218P00600000 --spot 640 --rate 4.25

options iv

Implied volatility for one option contract: Alpaca's, plus IV solved locally at bid, mid, ask and last.

Usage: idiotproof options iv <occ> [--spot <decimal>] [--rate <decimal>] [--feed <indicative|opra>]
Risk: read

Parameters:
  <occ>                         OCC option symbol: ROOT + YYMMDD + C|P + strike x 1000 (8 digits), e.g. AAPL261120C00250000. (required)
      --spot <decimal>          Underlying price to use instead of Alpaca's last trade.
      --rate <decimal>          Risk-free rate in percent, e.g. 4.25 (default: the Options page setting, else 4).
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options iv AAPL261120C00250000
  idiotproof options iv AAPL261120C00250000 --spot 255

options latest

Latest NBBO quote and latest trade for one option contract, with exchanges and sizes.

Usage: idiotproof options latest <occ> [--feed <indicative|opra>]
Risk: read

Parameters:
  <occ>                         OCC option symbol: ROOT + YYMMDD + C|P + strike x 1000 (8 digits), e.g. AAPL261120C00250000. (required)
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options latest AAPL261120C00250000

options level

Options trading level (effective and approved) and options buying power for your Alpaca accounts.

Usage: idiotproof options level [--mode <all|paper|live>]
Risk: read

Parameters:
      --mode <all|paper|live>  paper, live or all (default all). (default: all)

Examples:
  idiotproof options level
  idiotproof options level --mode paper

options positions

Open option contracts in your Alpaca accounts: strike, expiry, DTE, cost, value and unrealized P&L.

Usage: idiotproof options positions [--mode <all|paper|live>]
Risk: read

Parameters:
      --mode <all|paper|live>  paper, live or all (default all). (default: all)

Examples:
  idiotproof options positions
  idiotproof options positions --mode live

options quote

Latest bid/ask, mid, spread and last trade for one option contract (OCC symbol).

Usage: idiotproof options quote <occ> [--feed <indicative|opra>]
Risk: read

Parameters:
  <occ>                         OCC option symbol: ROOT + YYMMDD + C|P + strike x 1000 (8 digits), e.g. AAPL261120C00250000. (required)
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options quote AAPL261120C00250000
  idiotproof options quote SPY261218P00600000 --feed opra

options sell

Sell option contracts you hold (sell to close), or write them with --open (level 1+).

Usage: idiotproof options sell <occ> <contracts> [--limit <decimal>] [--mode <sandbox|paper|live>] [--open] [--note <string>]
Risk: money

Parameters:
  <occ>                            OCC contract symbol, e.g. AAPL261219C00150000. (required)
  <contracts>                      Whole contracts (each is usually 100 shares). (required)
  -l, --limit <decimal>            Limit price per share (premium). Without it the order is a market order.
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --open                       Write (sell to open, level 1+: covered call / cash-secured put) instead of selling contracts you hold. (default: false)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof options sell AAPL261219C00150000 2 --limit 4.10 --mode paper
      Take profit on 2 calls you hold.
  idiotproof options sell AAPL261219C00170000 1 --open --limit 1.05 --mode paper
      Write a covered call.

options signals

Sell-the-hype nudges on your open long options: hype near its session high plus bullish news (never places anything).

Usage: idiotproof options signals [--mode <all|paper|live>]
Risk: read

Parameters:
      --mode <all|paper|live>  paper, live or all (default all). (default: all)

Examples:
  idiotproof options signals
  idiotproof options signals --mode paper

options snapshot

Alpaca's full snapshot of one option contract: latest quote and trade, daily bars, IV and Greeks.

Usage: idiotproof options snapshot <occ> [--feed <indicative|opra>]
Risk: read

Parameters:
  <occ>                         OCC option symbol: ROOT + YYMMDD + C|P + strike x 1000 (8 digits), e.g. AAPL261120C00250000. (required)
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options snapshot AAPL261120C00250000

options spread

Place a 2-4 leg options order (verticals, straddles, ratios...) as one Alpaca multi-leg order; level 3, max-loss preview, live needs a code.

Usage: idiotproof options spread <legs>... [--qty <int>] [--limit <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <legs>                           2 to 4 legs, each side:OCC[:ratio][:close], e.g. buy:AAPL261219C00150000 sell:AAPL261219C00160000. Legs open unless :close. (required)
  -q, --qty <int>                  How many spreads (each leg trades ratio x qty contracts). Default 1. (default: 1)
  -l, --limit <decimal>            Net price per spread per share: positive = debit you pay, negative = credit you take. Without it the order is a market order.
  -m, --mode <sandbox|paper|live>  paper (default) or live (needs confirmation). The Sandbox simulator does not fill multi-leg orders. (default: paper)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof options spread buy:AAPL261219C00150000 sell:AAPL261219C00160000 --limit 3.10
      Paper bull call spread for a $3.10 debit.
  idiotproof options spread sell:SPY261120P00560000 buy:SPY261120P00550000 --limit -1.25 --qty 2 --mode live
      Live put credit spread; prints a confirmation code first.

options trades

Historical trades (prints) for one option contract, newest first.

Usage: idiotproof options trades <occ> [--start <date>] [--end <date>] [--limit <int>]
Risk: read

Parameters:
  <occ>               OCC option symbol, e.g. AAPL261120C00250000. (required)
      --start <date>  First ET date (yyyy-MM-dd); default 7 days back.
      --end <date>    Last ET date (yyyy-MM-dd); default today.
      --limit <int>   Most trades to return, newest first (default 50). (default: 50)

Examples:
  idiotproof options trades AAPL261120C00250000
  idiotproof options trades AAPL261120C00250000 --start 2026-10-29 --limit 200

options value

Intrinsic and extrinsic value, breakeven, DTE and Black-Scholes price for one option contract.

Usage: idiotproof options value <occ> [--spot <decimal>] [--premium <decimal>] [--iv <decimal>] [--rate <decimal>] [--feed <indicative|opra>]
Risk: read

Parameters:
  <occ>                         OCC option symbol: ROOT + YYMMDD + C|P + strike x 1000 (8 digits), e.g. AAPL261120C00250000. (required)
      --spot <decimal>          Underlying price to value at (what-if) instead of Alpaca's last trade.
      --premium <decimal>       Premium per share to value instead of the current mid, e.g. what you paid.
      --iv <decimal>            Implied volatility in percent for the Black-Scholes price, e.g. 35 (default Alpaca's IV).
      --rate <decimal>          Risk-free rate in percent, e.g. 4.25 (default: the Options page setting, else 4).
      --feed <indicative|opra>  Options data feed: indicative (default, free) or opra (paid). (default: indicative)

Examples:
  idiotproof options value AAPL261120C00250000
  idiotproof options value AAPL261120C00250000 --spot 260 --premium 4.10

orders

orders bracket

Entry plus a take-profit and a stop-loss that cancel each other (Alpaca bracket). The stop-loss is the Risk Guardian's stop.

Usage: idiotproof orders bracket <symbol> <side> <qty> [--limit <decimal>] [--take-profit <decimal>] [--stop-loss <decimal>] [--stop-loss-limit <decimal>] [--tif <string>] [--client-id <string>] [--stop <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <side>                           buy or sell (the parent's side; an OCO's side closes the position: sell exits a long). (required)
  <qty>                            Whole shares. (required)
  -l, --limit <decimal>            Entry limit price (bracket/OTO). Without it the entry is a market order.
      --take-profit <decimal>      Take-profit child's limit price.
      --stop-loss <decimal>        Stop-loss child's stop price.
      --stop-loss-limit <decimal>  Make the stop-loss a stop-limit with this limit price.
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --client-id <string>         Your own id for the parent order (Alpaca client_order_id).
  -s, --stop <decimal>             Planned protective stop for the Risk Guardian when the order has no stop-loss child (OTO with only a take-profit).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof orders bracket NVDA buy 10 --limit 131 --take-profit 140 --stop-loss 127 --tif gtc --mode paper
  idiotproof orders bracket AAPL buy 5 --take-profit 240 --stop-loss 220 --stop-loss-limit 219.5
      Market entry; the stop-loss is a stop-limit.

orders cancel

Cancel one working order through the gateway (audited; live needs a confirmation code).

Usage: idiotproof orders cancel <id> [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <id>                             The order id (from `orders list`). (required)
  -m, --mode <sandbox|paper|live>  The account the order is in: paper (default), live (needs confirmation) or sandbox. (default: paper)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof orders cancel 61e69015-8549-4bfd-b9c3-01e75843f47d
  idiotproof orders cancel 61e69015-8549-4bfd-b9c3-01e75843f47d --mode live

orders cancel-all

Cancel every open order in an account, or only one symbol's, through the gateway (live needs a confirmation code).

Usage: idiotproof orders cancel-all [--symbol <string>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
      --symbol <string>            Only this symbol's open orders. Without it, every open order in the account.
  -m, --mode <sandbox|paper|live>  The account: paper (default), live (needs confirmation) or sandbox. (default: paper)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof orders cancel-all --mode paper
  idiotproof orders cancel-all --symbol NVDA --mode live

orders history

Closed Alpaca orders (filled, cancelled, expired, rejected) over the last N days, newest first, with fill prices and totals.

Usage: idiotproof orders history [--days <int>] [--symbol <string>] [--mode <all|paper|live>]
Risk: read

Parameters:
      --days <int>             How far back, in days (default 7, up to 365). (default: 7)
      --symbol <string>        Only orders for these symbols (comma-separated).
      --mode <all|paper|live>  paper, live or all (default all). (default: all)

Examples:
  idiotproof orders history
  idiotproof orders history --days 30 --symbol NVDA --mode paper

orders list

Your Alpaca orders (open by default) in the paper and live accounts, newest first, with bracket/OCO legs.

Usage: idiotproof orders list [--status <open|closed|all>] [--symbol <string>] [--side <string>] [--limit <int>] [--mode <all|paper|live>]
Risk: read

Parameters:
      --status <open|closed|all>  open (default: working orders), closed (filled/cancelled/expired) or all. (default: open)
      --symbol <string>           Only orders for these symbols (comma-separated).
      --side <string>             Only buy or sell orders.
      --limit <int>               Most orders per account (default 50, Alpaca's max 500). (default: 50)
      --mode <all|paper|live>     paper, live or all (default all). (default: all)

Examples:
  idiotproof orders list
  idiotproof orders list --status closed --symbol NVDA --mode paper

orders oco

Exit a held position with a take-profit limit and a stop-loss; whichever fills cancels the other (Alpaca OCO).

Usage: idiotproof orders oco <symbol> <side> <qty> [--limit <decimal>] [--take-profit <decimal>] [--stop-loss <decimal>] [--stop-loss-limit <decimal>] [--tif <string>] [--client-id <string>] [--stop <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <side>                           buy or sell (the parent's side; an OCO's side closes the position: sell exits a long). (required)
  <qty>                            Whole shares. (required)
  -l, --limit <decimal>            Entry limit price (bracket/OTO). Without it the entry is a market order.
      --take-profit <decimal>      Take-profit child's limit price.
      --stop-loss <decimal>        Stop-loss child's stop price.
      --stop-loss-limit <decimal>  Make the stop-loss a stop-limit with this limit price.
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --client-id <string>         Your own id for the parent order (Alpaca client_order_id).
  -s, --stop <decimal>             Planned protective stop for the Risk Guardian when the order has no stop-loss child (OTO with only a take-profit).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof orders oco NVDA sell 10 --take-profit 140 --stop-loss 127 --tif gtc --mode paper

orders oto

Entry that, once filled, triggers ONE child: a take-profit or a stop-loss (Alpaca OTO).

Usage: idiotproof orders oto <symbol> <side> <qty> [--limit <decimal>] [--take-profit <decimal>] [--stop-loss <decimal>] [--stop-loss-limit <decimal>] [--tif <string>] [--client-id <string>] [--stop <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <side>                           buy or sell (the parent's side; an OCO's side closes the position: sell exits a long). (required)
  <qty>                            Whole shares. (required)
  -l, --limit <decimal>            Entry limit price (bracket/OTO). Without it the entry is a market order.
      --take-profit <decimal>      Take-profit child's limit price.
      --stop-loss <decimal>        Stop-loss child's stop price.
      --stop-loss-limit <decimal>  Make the stop-loss a stop-limit with this limit price.
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --client-id <string>         Your own id for the parent order (Alpaca client_order_id).
  -s, --stop <decimal>             Planned protective stop for the Risk Guardian when the order has no stop-loss child (OTO with only a take-profit).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof orders oto NVDA buy 10 --limit 131 --stop-loss 127 --mode paper
  idiotproof orders oto NVDA buy 10 --limit 131 --take-profit 140 --stop 127
      Take-profit child; --stop is the planned stop for the Risk Guardian.

orders place

Place any single Alpaca order: market/limit/stop/stop-limit/trailing, every TIF, fractional or notional, client id, position intent. Through the gateway; live needs a code.

Usage: idiotproof orders place <symbol> <side> [<qty>] [--notional <decimal>] [--type <market|limit|stop|stop-limit|trailing-stop>] [--limit <decimal>] [--stop-price <decimal>] [--trail-percent <decimal>] [--trail-price <decimal>] [--tif <string>] [--ext] [--client-id <string>] [--intent <string>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <symbol>                                                 Ticker, e.g. NVDA. (required)
  <side>                                                   buy or sell. (required)
  <qty>                                                    Shares; fractions allowed (0.25, DAY only). Leave out and pass --notional to size by dollars.
      --notional <decimal>                                 Size by dollar amount instead of shares (DAY only).
      --type <market|limit|stop|stop-limit|trailing-stop>  market, limit, stop, stop-limit or trailing-stop. Default: worked out from the prices given (none = market).
  -l, --limit <decimal>                                    Limit price (limit and stop-limit orders).
      --stop-price <decimal>                               Stop trigger price (stop and stop-limit orders).
      --trail-percent <decimal>                            Trailing stop distance in percent.
      --trail-price <decimal>                              Trailing stop distance in dollars.
      --tif <string>                                       Time in force: day (default), gtc, opg (at the open), cls (at the close), ioc or fok. (default: day)
      --ext                                                Extended hours (premarket/after-hours); limit + day only. (default: false)
      --client-id <string>                                 Your own order id (Alpaca client_order_id, up to 128 characters).
      --intent <string>                                    Position intent: buy-to-open, buy-to-close, sell-to-open or sell-to-close.
  -s, --stop <decimal>                                     Planned protective stop for an entry (the Risk Guardian refuses entries without one).
  -t, --target <decimal>                                   Planned take-profit (for the reward:risk check).
  -m, --mode <sandbox|paper|live>                          Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --note <string>                                      Why — kept in the audit trail.

Examples:
  idiotproof orders place NVDA buy 10 --limit 131.20 --stop 127.50 --tif gtc --mode paper
  idiotproof orders place AAPL buy 0.5 --stop 220 --mode paper
      Fractional market buy (DAY only).
  idiotproof orders place TSLA sell 5 --type trailing-stop --trail-percent 3 --tif gtc --mode paper
      Trailing stop exit.
  idiotproof orders place NVDA sell 10 --type stop-limit --stop-price 120 --limit 119.5 --client-id exit-nvda-1 --mode live

orders replace

Change a working order's quantity, limit/stop/trail, TIF or client id (Alpaca PATCH; it gets a new id). Through the gateway; live needs a code.

Usage: idiotproof orders replace <id> [--qty <decimal>] [--limit <decimal>] [--stop-price <decimal>] [--trail <decimal>] [--tif <string>] [--client-id <string>] [--stop <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <id>                             The working order to change (from `orders list`). (required)
      --qty <decimal>              New share count (fractions allowed).
  -l, --limit <decimal>            New limit price.
      --stop-price <decimal>       New stop trigger price.
      --trail <decimal>            New trailing distance, in the order's own unit (percent or dollars).
      --tif <string>               New time in force: day, gtc, opg, cls, ioc or fok.
      --client-id <string>         New client order id for the replacement order.
      --stop <decimal>             Protective stop for the position, needed when --qty raises an entry's size (the Risk Guardian checks the whole new size).
  -m, --mode <sandbox|paper|live>  The account the order is in: paper (default) or live (needs confirmation). (default: paper)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof orders replace 61e69015-8549-4bfd-b9c3-01e75843f47d --limit 131.50
  idiotproof orders replace 61e69015-8549-4bfd-b9c3-01e75843f47d --qty 5 --tif gtc --mode live

orders show

One Alpaca order in full, by id or client id: prices, fills, timestamps (ET) and its nested bracket/OCO/OTO/multi-leg legs.

Usage: idiotproof orders show [<id>] [--client-id <string>] [--mode <all|paper|live>]
Risk: read

Parameters:
  <id>                         The Alpaca order id (from `orders list`). Leave out and pass --client-id to look up by your own id.
      --client-id <string>     Look the order up by its client order id instead.
      --mode <all|paper|live>  paper, live or all (default all: whichever account has it). (default: all)

Examples:
  idiotproof orders show 61e69015-8549-4bfd-b9c3-01e75843f47d
  idiotproof orders show --client-id exit-nvda-1 --mode paper

orders stream

Live order events from Alpaca (new, fill, partial fill, canceled, replaced, rejected, expired); the Hub records every fill in the trade diary and audit log.

Starts (or joins) the Hub's trade_updates listener for each account; once started it keeps recording fills until the Hub stops. A terminal streams events until Ctrl+C; MCP and --json get the events of a bounded window (--seconds, default 15) plus the last few seen.

Usage: idiotproof orders stream [--mode <all|paper|live>] [--fills-only] [--seconds <int>] [--max <int>]
Risk: read

Parameters:
      --mode <all|paper|live>  paper, live or all (default all: every account with keys). (default: all)
      --fills-only             Show only fills and partial fills. (default: false)
      --seconds <int>          Stop after this many seconds (a terminal streams until Ctrl+C; MCP/--json default 15, at most 300).
      --max <int>              Stop after this many events.

Examples:
  idiotproof orders stream
  idiotproof orders stream --mode paper --fills-only

positions

positions close

Close (or trim) one Alpaca position as a market exit through the TransactionGateway. Live needs a confirmation code.

Usage: idiotproof positions close <symbol> [--qty <decimal>] [--percentage <decimal>] [--mode <sandbox|paper|live>] [--preview]
Risk: money

Parameters:
  <symbol>                         Ticker or OCC option symbol of the position to close, e.g. NVDA. (required)
      --qty <decimal>              Close only this many shares/contracts (default: all of it).
      --percentage <decimal>       Close this percent of the position (0-100) instead of all of it.
  -m, --mode <sandbox|paper|live>  Which Alpaca account: paper (default) or live (needs a confirmation code). (default: paper)
      --preview                    Run every gate and show the exit without sending it. (default: false)

Examples:
  idiotproof positions close HIHO --mode paper
  idiotproof positions close NVDA --percentage 50 --mode paper
      Sell half.
  idiotproof positions close TSLA --qty 5 --mode live
      Prints a confirmation code first.

positions close-all

Close every Alpaca position in one account with market exits through the TransactionGateway; optionally cancel open orders first. Live needs a confirmation code.

Usage: idiotproof positions close-all [--cancel-orders] [--mode <sandbox|paper|live>] [--preview]
Risk: money

Parameters:
      --cancel-orders              Cancel every open order first (frees shares held by working sells/stops). (default: false)
  -m, --mode <sandbox|paper|live>  Which Alpaca account: paper (default) or live (one confirmation code covers the whole set). (default: paper)
      --preview                    Run every gate and list everything that would close, without sending anything. (default: false)

Examples:
  idiotproof positions close-all --preview
      List what would close in paper; send nothing.
  idiotproof positions close-all --cancel-orders --mode paper
  idiotproof positions close-all --cancel-orders --mode live
      Prints the full list and one confirmation code.

positions list

Every open position in your Alpaca paper and live accounts: price, today's move, unrealized P&L.

Usage: idiotproof positions list [--mode <all|paper|live>]
Risk: read

Parameters:
      --mode <all|paper|live>  paper, live or all (default all). (default: all)

Examples:
  idiotproof positions list
  idiotproof positions list --mode paper

positions reconcile

What Alpaca actually holds vs what your strategies book (PositionQty), per account. --apply clears phantom rows (booked, broker flat) from the strategies' own filled exits; it never places an order.

Usage: idiotproof positions reconcile [--mode <all|paper|live>] [--problems] [--apply] [--rebook]
Risk: write

Parameters:
      --mode <all|paper|live>  paper, live or all (default all). (default: all)
      --problems               Only the rows where the broker and the strategies disagree. (default: false)
      --apply                  Clear phantom rows (booked but the broker is flat): book each strategy's own filled exit orders from the broker, else flat as reconciled. Never places an order. (default: false)
      --rebook                 Re-book strategies an earlier --apply closed flat as reconciled (P&L 0) at their own filled exit orders. Reads orders, never places one. (default: false)

Examples:
  idiotproof positions reconcile
  idiotproof positions reconcile --mode paper --problems
  idiotproof positions reconcile --mode paper --apply
      Book each phantom as the exit its own filled sell order made, else flat as reconciled.

positions show

One position in your Alpaca paper/live accounts, the IdiotProof strategy that owns it, and its latest trade-diary row.

Usage: idiotproof positions show <symbol> [--mode <all|paper|live>]
Risk: read

Parameters:
  <symbol>                     Ticker, OCC option symbol or crypto pair, e.g. NVDA. (required)
      --mode <all|paper|live>  paper, live or all (default all). (default: all)

Examples:
  idiotproof positions show NVDA
  idiotproof positions show HIHO --mode paper

prefs

prefs get

Show your preferences: theme, account pill and Risk Guardian limits.

Usage: idiotproof prefs get [<field>]
Risk: read

Parameters:
  <field>  One preference (theme, account-type, risk.max-loss-per-trade, ...); omit for all.

Examples:
  idiotproof prefs get
  idiotproof prefs get risk.max-loss-per-day

prefs set

Change one of your preferences (risk limits keep the Settings page's sanity rules).

Usage: idiotproof prefs set <field> <value>
Risk: write

Parameters:
  <field>  theme, account-type or a risk.* limit (see `prefs get`). (required)
  <value>  The new value. (required)

Examples:
  idiotproof prefs set risk.max-loss-per-day 250
  idiotproof prefs set account-type paper

replay

replay all

Replay every strategy family on one ticker/day and rank them by realized P&L (best fit first).

Usage: idiotproof replay all <symbol> [<date>] [--pages] [--out <string>]
Risk: write

Parameters:
  <symbol>            The ticker to try every family on. (required)
  <date>              The ET trading day (yyyy-MM-dd); default the last completed trading day.
      --pages         Render each run's page and the archive indexes (HTML only). (default: true)
      --out <string>  Archive folder for the pages (default the mindattic.com replays folder).

Examples:
  idiotproof replay all NVDA 2026-10-29
  idiotproof replay all ABCD --no-pages

replay compare

Two replay runs side by side: strategy, day, fires, round-trips, win rate, hold time and P&L, with the difference.

Usage: idiotproof replay compare <run-a> <run-b>
Risk: read

Parameters:
  <run-a>  First run id or prefix. (required)
  <run-b>  Second run id or prefix. (required)

Examples:
  idiotproof replay compare 0190a3f2 0190b7c1

replay families

The built-in strategy families `replay run --family` and `replay all` use, with what each trades.

Usage: idiotproof replay families
Risk: read

Examples:
  idiotproof replay families

replay list

The replay archive, newest first: ticker, day, strategy, sim or live, fired and P&L.

Usage: idiotproof replay list [--symbol <string>] [--since <date>] [--kind <string>] [--fired] [--limit <int>]
Risk: read

Parameters:
      --symbol <string>  Only this ticker.
      --since <date>     Only runs of ET trading days on or after this date (yyyy-MM-dd).
      --kind <string>    Only sim (hypothetical replays) or live (the Monitor's real trades).
      --fired            Only runs that fired. (default: false)
      --limit <int>      At most this many runs, newest first (default 50). (default: 50)

Examples:
  idiotproof replay list
  idiotproof replay list --symbol NVDA --since 2026-10-01 --fired

replay live

Render the Monitor's real trades for a day (from the trade diary) on that day's bars as LIVE runs in the archive.

Usage: idiotproof replay live [<symbol>] [--date <date>] [--pages] [--out <string>]
Risk: write

Parameters:
  <symbol>            Only this ticker (default every ticker the Monitor traded that day).
  -d, --date <date>   The ET day whose real trades to render (default today ET).
      --pages         Render the run pages and archive indexes (HTML only; publishing stays manual). (default: true)
      --out <string>  Archive folder for the pages (default the mindattic.com replays folder).

Examples:
  idiotproof replay live
  idiotproof replay live NVDA --date 2026-10-29

replay regen

Regenerate the replay archive's HTML (every run page and index) from SQL; never uploads or deploys.

Usage: idiotproof replay regen [--out <string>]
Risk: write

Parameters:
      --out <string>  Archive folder to (re)write (default the mindattic.com replays folder).

Examples:
  idiotproof replay regen
  idiotproof replay regen --out C:\temp\replays

replay run

Replay a strategy, gapper profile or built-in family over one past day with the Monitor's own evaluator; saves the run and its page.

Usage: idiotproof replay run <symbol> [<date>] [--strategy <string>] [--profile <string>] [--family <string>] [--repeat] [--pages] [--out <string>]
Risk: write

Parameters:
  <symbol>                 The ticker to replay. (required)
  <date>                   The ET trading day (yyyy-MM-dd); default the last completed trading day.
  -s, --strategy <string>  Replay this saved strategy (id, id prefix, stamp id or symbol) instead of the symbol's own.
  -p, --profile <string>   Replay a gapper profile on the fly (e.g. classic-gapper, penny-runner).
  -f, --family <string>    Replay a built-in family (momentum, reversal, rsireversal, emabreak, rthdrive, shortfade, swingreversal).
  -r, --repeat             Re-arm after every exit to show each round-trip the day offered. (default: false)
      --pages              Render the run page and archive indexes (HTML only; publishing stays manual). (default: true)
      --out <string>       Archive folder for the pages (default the mindattic.com replays folder).

Examples:
  idiotproof replay run NVDA 2026-10-29
  idiotproof replay run ABCD 2026-10-29 --profile penny-runner
  idiotproof replay run TSLA --family rthdrive --repeat --no-pages

replay show

One replay run: its round-trips with entry features and its per-bar features (OHLCV, VWAP, volume ratio, conditions passed).

Usage: idiotproof replay show <run> [--bars <string>]
Risk: read

Parameters:
  <run>                Run id or its first 6+ characters (from `replay list`). (required)
      --bars <string>  Which per-bar rows to print: marked (entries/exits, default), session (in-session bars) or all. (default: marked)

Examples:
  idiotproof replay show 0190a3f2
  idiotproof replay show 0190a3f2 --bars session

research

research analyze

Extract catalysts and portents from a ticker's news, a URL or pasted text via the LLM (--save to keep them).

Uses your Claude key (else the host's). Without --save nothing is written; with --save the claims join the research feed like scanned ones.

Usage: idiotproof research analyze <target> [--ticker <string>] [--text <string>] [--source <string>] [--days <int>] [--max-articles <int>] [--save]
Risk: write

Parameters:
  <target>                  A ticker (analyzes its recent Alpaca news, or --text) or an http(s) URL of an article or filing. (required)
      --ticker <string>     The company a URL is about (required with a URL).
      --text <string>       Analyze this text instead of fetching anything.
      --source <string>     Source name to record (default: the URL's host, Alpaca's outlet, or "manual").
      --days <int>          News lookback for a ticker, 1-30 days (default 3). (default: 3)
      --max-articles <int>  Most news articles to analyze for a ticker, 1-20 (default 5). (default: 5)
      --save                Persist the extracted claims to the research feed (skips a URL already analyzed). (default: false)

Examples:
  idiotproof research analyze NVDA
  idiotproof research analyze https://www.sec.gov/Archives/edgar/data/1045810/x.htm --ticker NVDA --save
  idiotproof research analyze AMD --text "AMD signs a preliminary $4B supply deal, closing next quarter"

research backfill

Record what each old enough claim's stock actually did (Alpaca daily closes) and settle portents.

Usage: idiotproof research backfill [--min-wait-days <int>] [--window-days <int>] [--max <int>]
Risk: write

Parameters:
      --min-wait-days <int>  Only claims at least this many days old, 1-365 (default 5). (default: 5)
      --window-days <int>    Measure the price move this many days after the claim, 1-365 (default 7). (default: 7)
      --max <int>            Most claims to backfill this run, 1-5000 (default 200). (default: 200)

Examples:
  idiotproof research backfill
  idiotproof research backfill --min-wait-days 10 --window-days 10 --max 500

research claim

One research claim in full: source, trigger, outcome, insider lines and its score breakdown.

Usage: idiotproof research claim <claim>
Risk: read

Parameters:
  <claim>  Claim id, or the 8-character prefix `research claims` shows. (required)

Examples:
  idiotproof research claim 3f2a91c0

research claims

Ranked research feed: catalysts and portents by significance score, filterable by ticker, date, score and macro.

Usage: idiotproof research claims [--ticker <string>] [--since <date>] [--min-score <number>] [--macro] [--portents] [--limit <int>]
Risk: read

Parameters:
      --ticker <string>     Only claims about this symbol (and macro claims that name it).
      --since <date>        First ET date a claim was found, yyyy-MM-dd (default: 14 days ago).
      --min-score <number>  Only claims scored at least this (0-100); unscored claims are left out.
      --macro               Only macro/regulatory claims (no single ticker). (default: false)
      --portents            Only pending portents: announced, not yet happened. (default: false)
      --limit <int>         Most claims to show, 1-500 (default 50). (default: 50)

Examples:
  idiotproof research claims
  idiotproof research claims --ticker NVDA --since 2026-10-01
  idiotproof research claims --min-score 60 --portents
  idiotproof research claims --macro

research gappers build-universe

Gapper study T1/T6 + universe: every Alpaca us_equity asset's daily bars and splits, then U(D), exclusions, candidates, ADV deciles and price tiers per the frozen protocol, and sample.json.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Every number comes from docs/research/gapper-study-2026-11/params.json. Resumable: covered symbols are not re-pulled; universe rows for the range are rebuilt.

Usage: idiotproof research gappers build-universe --from <date> --to <date> [--smoke] [--symbols <string>] [--max-calls <int>]
Risk: read

Parameters:
      --from <date>       First trading day D of the universe (ET, yyyy-MM-dd). (required)
      --to <date>         Last trading day D (ET, yyyy-MM-dd). (required)
      --smoke             Smoke run: only --symbols, daily bars from 60 days before --from, rows tagged split 'smoke', sample.smoke.json. (default: false)
      --symbols <string>  Comma-separated symbols for a --smoke run.
      --max-calls <int>   Stop pulling after this many Alpaca requests (0 = no cap); the run stays resumable. (default: 0)

Examples:
  idiotproof research gappers build-universe --from 2021-11-01 --to 2026-10-30
  idiotproof research gappers build-universe --smoke --symbols GOGO,STAK,BE --from 2026-11-03 --to 2026-11-05

research gappers calibrate-spread

Gapper study cost model: the one-time premarket spread multiplier, median of (quoted relative spread at 08:00 ET from /v2/stocks/{s}/quotes) over (Corwin-Schultz on D-1..D-5) across the first 500 training Tier20 events, written to data/spread-multiplier.json.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Refuses to run twice unless --force, and a forced run leaves an audit line in the runs log.

Usage: idiotproof research gappers calibrate-spread [--split <string>] [--events <int>] [--force]
Risk: read

Parameters:
      --split <string>  Calibration split; must match params.json costModel.spread.calibration.split (train).
      --events <int>    Number of Tier20 events in (D, symbol) order; must match params.json (500).
      --force           Recalibrate although data/spread-multiplier.json exists; the forced run is written to runs/calibrate-spread-audit.log. (default: false)

Examples:
  idiotproof research gappers calibrate-spread --split train --events 500

research gappers casestudy

Recent-runner case studies on the window amendment 05 opened (2026-09-10 onward): per session the top runners with catalyst, prior profile, 1-minute path and whether the R4 alarm would have fired. Reads no market data before 2026-09-10.

Usage: idiotproof research gappers casestudy [--from <string>] [--to <string>] [--top <int>] [--extra <string>]
Risk: read

Parameters:
      --from <string>   First session (default 2026-09-10; nothing before it is read).
      --to <string>     Last session (default 2026-11-09).
      --top <int>       Runners per session (default 5). (default: 5)
      --extra <string>  Extra names per day, e.g. "2026-11-09:CKX,GFR;2026-11-06:NWGL".

Examples:
  idiotproof research gappers casestudy --from 2026-09-10 --to 2026-11-09 --top 5

research gappers catalysts

Re-run the frozen version 1 catalyst rules over every backfilled catalyst row (idempotent), write each row's catalyst type and non-binding-LOI flag, and spend an optional Haiku budget on rows never classified; each article/filing is classified at most once.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders.

Usage: idiotproof research gappers catalysts [--llm-budget <int>]
Risk: read

Parameters:
      --llm-budget <int>  At most this many never-classified backfilled rows get a Haiku classification (default 0). (default: 0)

Examples:
  idiotproof research gappers catalysts
  idiotproof research gappers catalysts --llm-budget 200

research gappers detector-export

Freeze the gapper study's validated H11p detector (logistic on the 08:00 snapshot, fit on train only) into the formation-detector.json catalog the live formation alert scores with, after checking it reproduces the validation AUC. Writes a file; places no orders.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. The holdout is never read; the validation AUC is recomputed with the frozen model as a reproduction check, not a new test.

Usage: idiotproof research gappers detector-export [--out <string>]
Risk: write

Parameters:
      --out <string>  Where to write formation-detector.json (default: IdiotProof.Core\Catalogs in the repo that holds the study folder).

Examples:
  idiotproof research gappers detector-export

research gappers explore

Gapper study exploratory round (IP-T453, explore-plan.md), train only: build the in-memory panel cache at any decision time, then score tracks on four rolling folds inside train, logging every configuration to runs/explore/ledger.jsonl.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Refuses any split but train, so no validation or holdout label reaches a search. Writes nothing to SQL.

Usage: idiotproof research gappers explore --command <string> [--split <string>] [--times <string>] [--force] [--from <date>] [--to <date>] [--parallelism <int>]
Risk: read

Parameters:
      --command <string>   build (cache the train panel at the decision times), visibility (how early a gapper is visible), models (learners and feature-block ablation), exits (when velocity runs out), news (news ride by catalyst type, age and direction), fade (extension from the open vs how the day ends) entries (buy now, VWAP pullback or premarket-high breakout after a detection, net of cost), corobs (look-alike neighbour counts x feature subsets), ssr (cache Rule 201 from daily bars for the short-sale block), float-import (shares outstanding from SEC companyfacts.zip for the float proxy), tradeflow-pull (SIP trades on train gapper mornings, 08:00-10:30, as minute flow), tradeflow (retail imbalance collapse vs the high, H17) regsho-pull (Nasdaq and NYSE Reg SHO threshold lists and FINRA daily short volume, 2021-10-01..2026-11-06, resumable), alarms (alarm-time scoring 06:00-09:10 of count-CUSUM and rank-k onset rules vs gainers + news: hit rate, lead to +20%, false alarms per 100 mornings, per fold) or exit-routes (clock exit routes 09:15/09:20, opg limit by 09:27 with a 09:30:05 fallback, 09:31, 09:44, 09:50 with or without the LULD 09:44 exit, alone and with the drift-change and giveback overlays, plus the $1k/$5k/$25k participation capacity curve; default --times 08:30), fade-short (short at 09:45 the names whose premarket high was +30/50/100% and that are still +20% but under 10/5/0% from the 09:30 open, cover by 15:55 or 11:00 with optional stop and VWAP reclaim, net of the frozen cost model, borrow, SSR and Reg SHO variants, against a random short), fade-short-deep (IP-T479: the top fade short and its +50% variant on train: deflated Sharpe vs the ledger, time-of-day profile and MAE timing, MAE-aware exits, shortability tiers, tail sizing, squeeze predictors), alarm-ride (IP-T483: long only, buy the R4 alarm alone, gated by the boosted top k or by fresh news, marketable or a passive -1% limit, sold by take-profit x stop x time-stop/velocity brackets or lottery trailing exits, net at the frozen cost and 0.5x/0.25x spread), watchlist (IP-T484: runner anatomy (+50/+100/+300% by the 04:00-16:00 high), a D-1 16:00 watchlist (boosted, logistic, point score, recall/precision@10/20/50/100, prerequisite and catalyst lifts), all-day ignition (k x trailing 30-min volume, 2% session-high break, gap caps) and the ride (stops, trails, half, cooling exits) net at the frozen cost and 0.5x/0.25x spread), split-days-pull (IP-T490: raw 04:00-20:00 minute bars for D-1..D+10 of every train reverse split, inferred ratio change and excluded unexplained > +200% move, resumable) or split-days (IP-T490: runs by day offset, ratio, announcement, float and promotion profile on those days, and a long calendar / ignition entry x ride grid net at the frozen cost and 0.5x/0.25x spread), auctions-pull (IP-T472: Alpaca opening/closing auction prints for train Tier20+ gapper days and their controls, one file per day, resumable, paused through premarket) or auctions (official crosses vs the 09:30 bar open and 15:59 bar close, cross size vs volume), quotes-pull (IP-T472: NBBO within 60 s of every simulated entry and exit of the 08:30 buy-now entries pool, resumable, paused through premarket), quotes-check (frozen cost model charge vs the quoted spread at those fills) late-runners (IP-T605, amendment 09: runners that start after 09:30, the move start m0, A09-H1/H2 and D1-D3 on train), late-runner-ride (IP-T617, amendment 10: H29, buy the next bar after the move start when the H27 model rates +20% more likely than not, frozen exit ladder and cost model, 4-config grid on train) or late-runner-ride-liquidity (IP-T619, amendment 11: H30, amendment 10's best configuration with an added $2,000,000 20-day-ADV floor, one config on train). (required)
      --split <string>     Must be train: the exploratory round never reads validation or holdout. (default: train)
      --times <string>     Decision times, comma-separated ("08:00,08:30"); default every frozen decision time (models and exits default to 08:00).
      --force              build: rebuild decision times already cached. (default: false)
      --from <date>        build: first train day (regsho-pull: first trading day) (ET, yyyy-MM-dd), for a partial build.
      --to <date>          build: last train day (regsho-pull: last trading day) (ET, yyyy-MM-dd), for a partial build.
      --parallelism <int>  build: trading days computed at once (default 4). (default: 4)

Examples:
  idiotproof research gappers explore --command build --times 08:00
  idiotproof research gappers explore --command visibility

research gappers label

Gapper study labels: next-bar-open entry and forward returns per horizon, reach-20 by 09:45, premarket/RTH/full-session high times and bucket, fade, extension from open, velocity death, death-to-HOD, halt proxy and VWAP-loss time, per the frozen definitions.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Same holdout lock as snapshot.

Usage: idiotproof research gappers label --split <string> [--smoke] [--from <date>] [--to <date>]
Risk: read

Parameters:
      --split <string>  train, validation or holdout (holdout needs holdout-unlock.txt and runs once). (required)
      --smoke           Label the smoke-tagged rows instead. (default: false)
      --from <date>     Restrict to days on or after this ET date.
      --to <date>       Restrict to days on or before this ET date.

Examples:
  idiotproof research gappers label --split train
  idiotproof research gappers label --split train --smoke

research gappers pull

Gapper study data tiers: minute bars for candidate/prior/control days into the file store (then gapper tiers and controls), Alpaca news, ticker-CIK map, EDGAR form index with acceptance times, splits. Resumable, rate-limited, --max-calls capped.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Minute bars go to D:\IdiotProofData\gapper-study\bars (setting gapperStudy.barRoot) as packed day blocks; a killed pull is rerun, not restarted.

Usage: idiotproof research gappers pull --tier <string> [--smoke] [--from <date>] [--to <date>] [--max-calls <int>]
Risk: read

Parameters:
      --tier <string>    bars (T2 minute bars + gapper classification + controls), news (T3), cik (T5), edgar (T4 form index + acceptance times), splits (T6), or all. Exploration only, never part of all (IP-T458): edgar-dilution (6-K, F-1/F-3, EFFECT, 424B1/2/7, S-1/A, SC 13G plus 424B5/S-3 rows into D:/IdiotProofData/edgar-dilution, with acceptance times in ET) and edgar-dilution-text (424B5/S-3/F-3 text through the ATM / baby-shelf detector). (required)
      --smoke            Operate on the smoke-tagged universe rows only. (default: false)
      --from <date>      Restrict to candidate days on or after this ET date.
      --to <date>        Restrict to candidate days on or before this ET date.
      --max-calls <int>  Stop after this many API requests per tier (0 = no cap); the pull resumes from its coverage marks next time. (default: 0)

Examples:
  idiotproof research gappers pull --tier bars
  idiotproof research gappers pull --tier all --smoke
  idiotproof research gappers pull --tier edgar --max-calls 5000
  idiotproof research gappers pull --tier edgar-dilution --max-calls 50000

research gappers report

Gapper study results document: docs/research/gapper-study-2026-11.md in the evidence sweep's shape (protocol link, sample, data tiers, one verdict table per family, the H11 gate, exit timing with the post-registration variant marked, kill criteria, promotion), plus events/snapshots/labels CSVs with a hashed manifest under data/.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Holdout numbers are withheld unless holdout-run.json exists; hypotheses edited after the unlock are marked post-hoc and void.

Usage: idiotproof research gappers report [--skip-export]
Risk: read

Parameters:
      --skip-export  Skip the events/snapshots/labels CSV export and manifest. (default: false)

Examples:
  idiotproof research gappers report
  idiotproof research gappers report --skip-export

research gappers snapshot

Gapper study feature snapshots: every candidate and control day at every frozen decision time through the shared GapperFormationFeatures.Compute, written as Source=backtest rows; fits and saves data/tod-profile.json on train control days first.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. The holdout split refuses to run unless holdout-unlock.txt holds the frozen commit hash, and refuses a second run.

Usage: idiotproof research gappers snapshot --split <string> [--smoke] [--from <date>] [--to <date>]
Risk: read

Parameters:
      --split <string>  train, validation or holdout (holdout needs holdout-unlock.txt and runs once). (required)
      --smoke           Snapshot the smoke-tagged rows instead (profile goes to data/tod-profile.smoke.json). (default: false)
      --from <date>     Restrict to days on or after this ET date.
      --to <date>       Restrict to days on or before this ET date.

Examples:
  idiotproof research gappers snapshot --split train
  idiotproof research gappers snapshot --split train --smoke

research gappers status

What the gapper study holds per split (universe days, candidates, gappers per tier, controls, minute-bar coverage, snapshots, labels), the data tiers' row counts, and the holdout lock state.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders.

Usage: idiotproof research gappers status
Risk: read

Examples:
  idiotproof research gappers status

research gappers test

Gapper study hypothesis tests: each pre-registered hypothesis with the primitive hypotheses.json names (bucket-lift, event-study-bmp, proportion-diff-clustered, wilson-ci, quantile-ci, group-diff, auc-delong, search-grid-spa), BH within family, Holm across primaries, one run file per hypothesis under runs/.

Research rows only, on the research database (the connection string must name a database containing '_Research_'); read-only market data; no orders. Every threshold comes from hypotheses.json and params.json. The holdout split goes through the same lock as snapshot and label and opens once.

Usage: idiotproof research gappers test --hypothesis <string[]> --split <string> [--smoke]
Risk: read

Parameters:
      --hypothesis <string[]>  Hypothesis ids to run, comma-separated (H1,H2) or all. (required)
      --split <string>         train, validation or holdout (holdout needs holdout-unlock.txt and runs the test stage once). (required)
      --smoke                  Run on the smoke-tagged rows instead (verdicts are void by construction; checks the plumbing). (default: false)

Examples:
  idiotproof research gappers test --hypothesis H1,H9 --split train
  idiotproof research gappers test --hypothesis all --split validation

research index-events

S&P 500 / S&P 100 additions and removals: announced and effective dates, pending or done.

Usage: idiotproof research index-events [--since <date>] [--ticker <string>] [--pending]
Risk: read

Parameters:
      --since <date>     First announcement date, yyyy-MM-dd (default: 180 days ago).
      --ticker <string>  Only this symbol.
      --pending          Only events whose effective date has not passed yet. (default: false)

Examples:
  idiotproof research index-events
  idiotproof research index-events --pending
  idiotproof research index-events --ticker DDOG --since 2026-01-01

research insiders

Form 4 insider transactions for a ticker: filer, role, buy/sell, shares, price, value.

Usage: idiotproof research insiders <symbol> [--days <int>] [--code <string[]>] [--limit <int>]
Risk: read

Parameters:
  <symbol>               Ticker symbol, e.g. NVDA. (required)
      --days <int>       Transactions dated within this many days, 1-3650 (default 180). (default: 180)
      --code <string[]>  SEC transaction codes, comma-separated: P purchase, S sale, A award, M exercise, F tax, G gift (default: all).
      --limit <int>      Most lines to show, 1-1000 (default 100). (default: 100)

Examples:
  idiotproof research insiders NVDA
  idiotproof research insiders TSLA --code P,S --days 365

research macro

Macro and regulatory claims (rule changes, listing standards) with the tickers each affects.

Usage: idiotproof research macro [--since <date>] [--affects <string>] [--limit <int>]
Risk: read

Parameters:
      --since <date>      First ET date a claim was found, yyyy-MM-dd (default: 30 days ago).
      --affects <string>  Only claims whose affected-ticker list names this symbol.
      --limit <int>       Most claims to show, 1-500 (default 50). (default: 50)

Examples:
  idiotproof research macro
  idiotproof research macro --since 2026-09-01 --affects SOUN

research scan

Run one research scan pass now in the Hub (news, SEC filings, regulatory, index events, backfill, scoring).

Targeted with --tickers; otherwise watchlist + the next rotating batch of the ticker universe. Writes claims and a ScanRun row; the Monitor's trading loop is untouched.

Usage: idiotproof research scan [--tickers <string[]>] [--batch <int>] [--days-back <int>] [--wake-database]
Risk: write

Parameters:
      --tickers <string[]>  Scan just these symbols, comma-separated (default: every watchlist symbol plus the next rotating batch of the universe).
      --batch <int>         Rotating-batch size beyond the watchlist, 1-5000 (default 300, or IDIOTPROOF_RESEARCHSCAN_BATCHSIZE).
      --days-back <int>     Lookback per source in days, 1-30 (default 2, or IDIOTPROOF_RESEARCHSCAN_DAYSBACK).
      --wake-database       Run even outside the database online window (trading days, 03:30-20:30 ET by default). Only matters when the history database is on Azure SQL Database, where this wakes the paused serverless database and it is billed until it pauses again. (default: false)

Examples:
  idiotproof research scan --tickers NVDA,AMD
  idiotproof research scan --batch 50 --days-back 3

research score

Explain a claim's 0-100 significance score term by term (magnitude, confidence, history, source, watchlist, recency).

Usage: idiotproof research score <claim>
Risk: read

Parameters:
  <claim>  Claim id, or the 8-character prefix `research claims` shows. (required)

Examples:
  idiotproof research score 3f2a91c0

research similar

Look-alike past claims (LSH neighbours) and what their stocks did afterwards.

Usage: idiotproof research similar <claim> [--max-distance <int>] [--limit <int>]
Risk: read

Parameters:
  <claim>                   Claim id, or the 8-character prefix `research claims` shows. (required)
      --max-distance <int>  Largest Hamming distance (of 64 signature bits) that counts as similar, 0-64 (default 20). (default: 20)
      --limit <int>         Most neighbours to list, 1-100 (default 20). (default: 20)

Examples:
  idiotproof research similar 3f2a91c0
  idiotproof research similar 3f2a91c0 --max-distance 12 --limit 10

research ticker

Everything research knows about one ticker: claims, portents, macro and index events, insiders, outcomes.

Usage: idiotproof research ticker <symbol> [--days <int>] [--limit <int>]
Risk: read

Parameters:
  <symbol>           Ticker symbol, e.g. NVDA. (required)
      --days <int>   Look back this many days, 1-3650 (default 90). (default: 90)
      --limit <int>  Most claims to list, 1-200 (default 15). (default: 15)

Examples:
  idiotproof research ticker NVDA
  idiotproof research ticker SMCI --days 365 --limit 30

research universe list

The tracked ticker universe the research scan sweeps: symbol, exchange, last price, freshness.

Usage: idiotproof research universe list [--exchange <string>] [--prefix <string>] [--min-price <decimal>] [--max-price <decimal>] [--limit <int>]
Risk: read

Parameters:
      --exchange <string>    Only NASDAQ or NYSE.
      --prefix <string>      Only symbols starting with this text.
      --min-price <decimal>  Only tickers whose last price is at least this.
      --max-price <decimal>  Only tickers whose last price is at most this.
      --limit <int>          Most rows to show, 1-10000 (default 100). (default: 100)

Examples:
  idiotproof research universe list
  idiotproof research universe list --exchange NASDAQ --max-price 5 --limit 50
  idiotproof research universe list --prefix NV

research universe refresh

Reload the tracked ticker universe (asset list and last prices) from Alpaca when stale, or --force.

Usage: idiotproof research universe refresh [--force] [--max-age-hours <int>]
Risk: write

Parameters:
      --force                Reload even when the cache is fresher than --max-age-hours. (default: false)
      --max-age-hours <int>  Only reload when the newest row is older than this, 1-720 (default 24). (default: 24)

Examples:
  idiotproof research universe refresh
  idiotproof research universe refresh --force

risk

risk check

Dry-run a setup through your Risk Guardian: approved or why not, worst case, and the largest size allowed. Places nothing.

Usage: idiotproof risk check <symbol> --entry <decimal> --stop <decimal> --qty <int> [--target <decimal>] [--short] [--mode <sandbox|paper|live>]
Risk: read

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
      --entry <decimal>            Planned entry price. (required)
      --stop <decimal>             Planned protective stop price. (required)
      --qty <int>                  Planned share count. (required)
      --target <decimal>           Planned take-profit price, for the reward:risk warning.
      --short                      A short entry (stop above entry) instead of a long. (default: false)
  -m, --mode <sandbox|paper|live>  Which account's daily loss to check against: sandbox, paper (default) or live. (default: paper)

Examples:
  idiotproof risk check NVDA --entry 100 --stop 98 --qty 20
  idiotproof risk check TSLA --entry 250 --stop 255 --qty 5 --target 240 --short

risk kill-switch

Halt every new entry now (on), or resume (off, which needs a confirmation code); exits always go through.

Usage: idiotproof risk kill-switch <state>
Risk: write

Parameters:
  <state>  on (halt every new entry now) or off (resume; needs a confirmation code). (required)

Examples:
  idiotproof risk kill-switch on
  idiotproof risk kill-switch off
      Returns a code; re-run with --confirm <code> to resume entries.

risk set

Change Risk Guardian limits; unnamed ones keep their value and today's loss counter is preserved.

Usage: idiotproof risk set [--max-loss-per-trade <decimal>] [--max-loss-per-day <decimal>] [--min-stop-percent <decimal>] [--max-stop-percent <decimal>] [--account-balance <decimal>] [--max-account-risk-percent <decimal>]
Risk: write

Parameters:
      --max-loss-per-trade <decimal>        Most a single trade may lose in the worst case, in dollars.
      --max-loss-per-day <decimal>          Daily loss that trips the circuit breaker, in dollars (at least the per-trade limit).
      --min-stop-percent <decimal>          Tightest allowed stop, percent of entry (0.01-50).
      --max-stop-percent <decimal>          Widest allowed stop, percent of entry (at least the minimum).
      --account-balance <decimal>           Balance the position size is measured against, in dollars.
      --max-account-risk-percent <decimal>  Most of the balance one trade may risk, percent (0-100).

Examples:
  idiotproof risk set --max-loss-per-trade 50 --max-loss-per-day 200
  idiotproof risk set --max-stop-percent 8 --account-balance 25000

risk show

Your six Risk Guardian limits (per-trade and daily loss, stop range, balance, account risk %) and the kill switch.

Usage: idiotproof risk show
Risk: read

Examples:
  idiotproof risk show

risk status

Today's realized P&L, losses counted against the daily breaker, remaining room, breaker and kill-switch state.

Usage: idiotproof risk status [--mode <sandbox|paper|live>]
Risk: read

Parameters:
  -m, --mode <sandbox|paper|live>  Which account: sandbox, paper (default) or live. Each has its own daily loss limit. (default: paper)

Examples:
  idiotproof risk status
  idiotproof risk status --mode live

scan

scan movers

Screen today's top gainers to the gapper band; --replay replays each survivor with a gapper profile and saves the runs.

Usage: idiotproof scan movers [--date <date>] [--replay] [--top <int>] [--min-gap <number>] [--min-price <number>] [--max-price <number>] [--profile <string>] [--pages] [--out <string>]
Risk: write

Parameters:
  -d, --date <date>         ET day to replay the survivors on (default today ET — movers are live).
  -r, --replay              Replay each survivor with the gapper profile and save the runs (and pages). (default: false)
      --top <int>           Keep at most this many gappers (default 10, max 25). (default: 10)
      --min-gap <number>    Minimum percent change (default 5). (default: 5)
      --min-price <number>  Lowest price (default 1). (default: 1)
      --max-price <number>  Highest price (default 50). (default: 50)
  -p, --profile <string>    Gapper profile or family to replay with (default classic-gapper). (default: classic-gapper)
      --pages               With --replay: render run pages and archive indexes (HTML only). (default: true)
      --out <string>        Archive folder for the pages (default the mindattic.com replays folder).

Examples:
  idiotproof scan movers
  idiotproof scan movers --min-gap 10 --max-price 20 --replay

settings

settings get

Show one runtime setting: value, default, range and meaning.

Usage: idiotproof settings get <key>
Risk: read

Parameters:
  <key>  The setting key, e.g. Options.RiskFreeRate. (required)

Examples:
  idiotproof settings get Options.RiskFreeRate

settings list

List the app's runtime settings with current value, default, range and meaning.

Usage: idiotproof settings list [--all]
Risk: read

Parameters:
      --all  Also show internal bookkeeping keys the app writes for itself. (default: false)

Examples:
  idiotproof settings list
  idiotproof settings list --all

settings set

Change one runtime setting (type- and range-checked; unknown and internal keys refused).

Usage: idiotproof settings set <key> <value>
Risk: write

Parameters:
  <key>    The setting key (see `settings list`). (required)
  <value>  The new value; checked against the key's type and range. (required)

Examples:
  idiotproof settings set Options.RiskFreeRate 0.045
  idiotproof settings set decay.be-bex.threshold 10

strategy

strategy activate

Hand a strategy to the Monitor. A Live strategy needs a confirmation code.

Usage: idiotproof strategy activate <strategy>
Risk: money

Parameters:
  <strategy>  Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol. (required)

Examples:
  idiotproof strategy activate NVDA

strategy bulk

Activate or deactivate many strategies at once (--all, --symbol, --mode, --kind). Live activations need one confirmation code for the batch.

Deactivation skips strategies holding a position (that would orphan the exit). Activation skips quarantined and soft-deleted strategies; when the batch would turn on any Live strategy, nothing happens until you re-run with the confirmation code, which is bound to exactly that batch.

Usage: idiotproof strategy bulk <action> [--all] [--symbol <string>] [--mode <sandbox|paper|live>] [--kind <string>]
Risk: money

Parameters:
  <action>                         activate or deactivate. (required)
      --all                        Every strategy you own (soft-deleted ones excluded). (default: false)
      --symbol <string>            Only strategies on this symbol.
      --mode <sandbox|paper|live>  Only strategies in this broker mode (sandbox, paper, live).
      --kind <string>              Only strategies of this kind (gapper, momentum, exhaustion, ...; `none` = no kind); case-insensitive.

Examples:
  idiotproof strategy bulk deactivate --all
  idiotproof strategy bulk activate --symbol NVDA --mode paper
  idiotproof strategy bulk deactivate --kind gapper --mode paper

strategy clone

Copy a strategy (optionally onto another symbol) as a new, inactive Sandbox strategy.

The copy gets the same canon (re-validated), never the original's position, history or Live routing. Cloning onto another symbol warns about fixed prices that belonged to the original's chart.

Usage: idiotproof strategy clone <strategy> [--symbol <string>] [--title <string>] [--mode <sandbox|paper|live>] [--kind <string>]
Risk: write

Parameters:
  <strategy>                       Id, id prefix, stamp id or symbol of the strategy to copy. (required)
      --symbol <string>            Trade a different symbol with the same rules.
      --title <string>             Title for the copy (default: "<title> (copy)").
  -m, --mode <sandbox|paper|live>  Broker mode for the copy: sandbox (default) or paper. (default: sandbox)
      --kind <string>              Kind for the copy (e.g. gapper, momentum), at most 24 characters (default: the original's kind).

Examples:
  idiotproof strategy clone NVDA
  idiotproof strategy clone NVDA --symbol AMD --title "AMD VWAP reclaim"
  idiotproof strategy clone NVDA --kind momentum
      The copy's kind; without --kind it keeps the original's.

strategy create

Create a strategy from IdiotScript or canonical JSON after validating it. It starts inactive in Sandbox.

Exactly one of --script or --canon. A strategy with no size buys 1 share. Errors (no stop, stop on the wrong side of the target, a broken canon) stop the save; warnings are shown.

Usage: idiotproof strategy create [--script <string>] [--canon <string>] [--title <string>] [--ticker <string>] [--description <string>] [--mode <sandbox|paper|live>] [--kind <string>] [--dry-run]
Risk: write

Parameters:
  -s, --script <string>            The strategy as IdiotScript text (`-` reads stdin).
      --canon <string>             The strategy as canonical JSON (what `strategy export --format json` prints) (`-` reads stdin).
      --title <string>             Title (default: the strategy's own name, else "SYM strategy").
      --ticker <string>            Symbol to use when the script doesn't name one.
      --description <string>       Free-form description stored with the strategy.
  -m, --mode <sandbox|paper|live>  Broker mode: sandbox (default) or paper. Live is a separate, confirmed step. (default: sandbox)
      --kind <string>              What kind of strategy this is (e.g. gapper, momentum), stored lower-case, at most 24 characters; tools select by it (`strategy list --kind`). Default: none.
      --dry-run                    Validate and show the stamp without saving anything. (default: false)

Examples:
  idiotproof strategy create --script "Stock.Ticker(\"NVDA\").IsAboveVwap().Long().StopLoss(170).TakeProfit(190).Build()"
  idiotproof strategy create --canon - --mode paper
      Reads canonical JSON from stdin.
  idiotproof strategy create --script - --mode paper --kind gapper
      Tags the strategy as a gapper so `strategy list --kind gapper` (and the daily retirement job) finds it.

strategy deactivate

Stop the Monitor evaluating a strategy (refused while it holds a position).

Usage: idiotproof strategy deactivate <strategy>
Risk: write

Parameters:
  <strategy>  Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol. (required)

Examples:
  idiotproof strategy deactivate NVDA

strategy delete

Soft-delete a strategy: deactivate it and mark it [deleted] (reversible with --restore). Refused while it holds a position.

Deleting is a reversible disable (HOUSE-LAW-2): the row, canon and history stay, and `strategy list` hides it unless --deleted. --hard permanently removes a strategy that is already deleted — a separate, explicit second step.

Usage: idiotproof strategy delete <strategy> [--restore] [--hard]
Risk: destructive

Parameters:
  <strategy>     Id, id prefix, stamp id or symbol. (required)
      --restore  Undo a delete: take the [deleted] marker off (it stays inactive). (default: false)
      --hard     Permanently remove an ALREADY deleted strategy and its progress row. Cannot be undone. (default: false)

Examples:
  idiotproof strategy delete NVDA
  idiotproof strategy delete 0193ab12 --restore
  idiotproof strategy delete 0193ab12 --hard

strategy diff

Compare two strategies field by field at the canon level (what the Monitor actually runs), plus title, mode and state.

Usage: idiotproof strategy diff <a> <b>
Risk: read

Parameters:
  <a>  First strategy: id, id prefix, stamp id or symbol. (required)
  <b>  Second strategy: id, id prefix, stamp id or symbol. (required)

Examples:
  idiotproof strategy diff NVDA AMD
  idiotproof strategy diff IP-P4AY-UXZU IP-Q7RB-K2MD

strategy explain

Explain a strategy in plain English, phase by phase — generated from its canon, no LLM, the same words every time.

Usage: idiotproof strategy explain <strategy>
Risk: read

Parameters:
  <strategy>  Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol. (required)

Examples:
  idiotproof strategy explain NVDA

strategy export

Export a strategy as a stamp, armored payload, canonical JSON or IdiotScript.

Usage: idiotproof strategy export <strategy> [--format <stamp|armor|json|script>]
Risk: read

Parameters:
  <strategy>                              Id, id prefix, stamp id or symbol. (required)
  -f, --format <stamp|armor|json|script>  stamp (default), armor (payload only), json (canonical) or script (IdiotScript). (default: stamp)

Examples:
  idiotproof strategy export NVDA --format json

strategy fires

Why a strategy did or didn't fire: its recent gate verdicts (conditions met, LLM veto, Risk Guardian block, order placed or rejected) and where it stands now.

Usage: idiotproof strategy fires <strategy> [--limit <int>]
Risk: read

Parameters:
  <strategy>         Id, id prefix, stamp id or symbol. (required)
  -n, --limit <int>  How many verdicts to show (default 20, max 200). (default: 20)

Examples:
  idiotproof strategy fires NVDA
  idiotproof strategy fires NVDA --limit 50

strategy from-text

Turn a plain-English description into a strategy (via the LLM), show its stamp, and save it only when you confirm.

The first call writes the IdiotScript, validates it and shows the stamp with a confirmation code; nothing is saved. A script that does not validate is repaired: spelling and punctuation fixes that leave a fully valid script are applied directly, anything else goes back to the LLM with its errors for at most `llm.repair.rounds` more calls (default 2). The result's `repair` says what was corrected; a script that never validates is refused with its last errors. Re-run with --confirm <code> to save exactly what was shown (the LLM is not called again). It saves inactive, in Sandbox by default, 1 share when unsized.

Usage: idiotproof strategy from-text <description> [--ticker <string>] [--mode <sandbox|paper|live>] [--title <string>]
Risk: write

Parameters:
  <description>                    The strategy in plain English (`-` reads stdin). (required)
  -t, --ticker <string>            The symbol to trade (default: the first ticker-looking word, e.g. $NVDA or NVDA).
  -m, --mode <sandbox|paper|live>  Broker mode for the saved strategy: sandbox (default) or paper. (default: sandbox)
      --title <string>             Title for the saved strategy (default: its own name, else "SYM strategy").

Examples:
  idiotproof strategy from-text "Buy NVDA when it reclaims VWAP with volume, stop 2% under, take profit at 190"
  idiotproof strategy from-text "long on a 9 EMA reclaim above VWAP, 3% stop" --ticker AMD --mode paper

strategy from-watchlist

Create one strategy per item of a watchlist JSON file (the Monitor's create-strategies, through the CLI).

Each item's script is validated like `strategy create`; an item that fails is reported and skipped. Items already present (same symbol and title) or repeated in the file are skipped, so re-running is safe. New strategies start inactive in Sandbox with 1 share when unsized; --activate turns on the items marked active.

Usage: idiotproof strategy from-watchlist <file> [--mode <sandbox|paper|live>] [--activate] [--dry-run]
Risk: write

Parameters:
  <file>                           A watchlist JSON file (absolute path: the Hub reads it), the JSON itself, or `-` for stdin: [{"title","symbol","script","description","author","originTranscript","active"}]. (required)
  -m, --mode <sandbox|paper|live>  Broker mode for every new strategy: sandbox (default) or paper. (default: sandbox)
      --activate                   Activate items marked "active": true (default: everything starts inactive). (default: false)
      --dry-run                    Validate every item and report what would happen without saving. (default: false)

Examples:
  idiotproof strategy from-watchlist D:/watchlists/2026-10-30.json
  idiotproof strategy from-watchlist -
      Reads the watchlist JSON from stdin, e.g. `type watchlist.json | idiotproof strategy from-watchlist -`.
  idiotproof strategy from-watchlist - --mode paper --activate --dry-run

strategy history

A strategy's trail, newest first: Monitor verdicts and fills, diary trades, and the CLI/MCP commands that touched it.

Usage: idiotproof strategy history <strategy> [--limit <int>]
Risk: read

Parameters:
  <strategy>         Id, id prefix, stamp id or symbol. (required)
  -n, --limit <int>  How many events to show (default 40, max 500). (default: 40)

Examples:
  idiotproof strategy history NVDA
  idiotproof strategy history NVDA --limit 100

strategy import

Create a strategy from a stamp, canonical JSON or IdiotScript. It starts inactive in Sandbox.

Usage: idiotproof strategy import <source> [--title <string>] [--mode <sandbox|paper|live>]
Risk: write

Parameters:
  <source>                         A pasted stamp/armor/IPS1 payload, canonical JSON, or IdiotScript text (`-` reads stdin). (required)
      --title <string>             Title for the new strategy (default: the strategy's own name or symbol).
  -m, --mode <sandbox|paper|live>  Broker mode for the new strategy: sandbox (default) or paper. Live is a separate, confirmed step. (default: sandbox)

Examples:
  idiotproof strategy import -
      Reads the pasted stamp from stdin, e.g. `type gapper-stamp.txt | idiotproof strategy import -`.
  idiotproof strategy import "Ticker(\"NVDA\").IsAboveVwap().StopLoss(2)" --mode paper

strategy list

List your strategies with mode, position and live condition progress.

Usage: idiotproof strategy list [--active] [--symbol <string>] [--mode <sandbox|paper|live>] [--deleted] [--kind <string>]
Risk: read

Parameters:
  -a, --active                     Only strategies the Monitor is evaluating. (default: false)
      --symbol <string>            Only this symbol.
      --mode <sandbox|paper|live>  Only this broker mode (sandbox, paper, live).
      --deleted                    Include soft-deleted strategies (hidden by default). (default: false)
      --kind <string>              Only strategies of this kind (gapper, momentum, exhaustion, or any kind given at create); case-insensitive. `none` lists the ones with no kind.

Examples:
  idiotproof strategy list
  idiotproof strategy list --active --mode live
  idiotproof strategy list --kind gapper --mode paper --json
      Every paper gapper strategy, as JSON rows carrying their kind.

strategy mode

Route a strategy to sandbox, paper or live. Switching to live needs a confirmation code.

Usage: idiotproof strategy mode <strategy> <mode>
Risk: money

Parameters:
  <strategy>  Id, id prefix, stamp id or symbol. (required)
  <mode>      sandbox, paper or live (live needs a confirmation code). (required)

Examples:
  idiotproof strategy mode NVDA paper
  idiotproof strategy mode NVDA live

strategy progress

How close a strategy is to firing: conditions passing N/M, the first failing verb and the last price, optionally watched.

Reads the row the Monitor writes every tick. --watch samples it every --every seconds and reports each change, stopping when every condition passes: in a terminal each change streams live until Ctrl+C; for MCP and --json it takes --samples samples (at most two minutes in all).

Usage: idiotproof strategy progress <strategy> [--watch] [--every <int>] [--samples <int>]
Risk: read

Parameters:
  <strategy>           Id, id prefix, stamp id or symbol. (required)
  -w, --watch          Keep sampling the Monitor's progress row and report each change: a terminal streams until Ctrl+C or all conditions pass; MCP/--json are bounded by --samples. (default: false)
      --every <int>    Seconds between samples while watching (0-60, default 5). (default: 5)
      --samples <int>  How many samples to take while watching (1-120; default 12 for MCP/--json, unlimited in a terminal).

Examples:
  idiotproof strategy progress NVDA
  idiotproof strategy progress NVDA --watch --every 10 --samples 6

strategy quarantine

List strategies the Monitor refuses to evaluate (canon unreadable, or no canon and a script that doesn't parse), with the reason, why each was not repaired automatically, and the proposed repair.

A quarantined strategy never fires; one that is quarantined while holding a position has NO managed exit and is listed first. The Monitor repairs a quarantined strategy by itself only when it is active, flat, at step 1 of its sequence, Paper or Sandbox (Live needs quarantine.autorepair.live), its script has no errors, and the canon re-derived from the script loses nothing the stored canon expressed. Everything else is listed here with what blocks it. This command changes nothing; --diff shows the canon a repair would write.

Usage: idiotproof strategy quarantine [--symbol <string>] [--diff]
Risk: read

Parameters:
      --symbol <string>  Only this symbol.
      --diff             Also print each proposed repair as a line diff of the stored canon against the canon re-derived from the script. (default: false)

Examples:
  idiotproof strategy quarantine
  idiotproof strategy quarantine --symbol NVDA --diff

strategy rename

Give a strategy a new title. Its canon, stamp id and state are untouched.

Only the title changes, so the stamp id stays the same. The Monitor's audit lines carry the title at the time, so `strategy history` matches the new title from now on.

Usage: idiotproof strategy rename <strategy> <title>
Risk: write

Parameters:
  <strategy>  Id, id prefix, stamp id or symbol. (required)
  <title>     The new title (1-200 characters). (required)

Examples:
  idiotproof strategy rename NVDA "NVDA VWAP reclaim"

strategy resync-canon

Re-derive your strategies' canons from their scripts where the script now yields a richer canon; dry run unless --apply.

The repair for verbs an older parser dropped silently. A row is rewritten only when the re-derived canon has at least as many entry conditions and branches as the stored one; anything that would lose a condition is skipped and reported. Only the canon (ScriptJson) changes — position bookkeeping is untouched.

Usage: idiotproof strategy resync-canon [--apply]
Risk: write

Parameters:
      --apply  Write the repaired canons (default is a dry run that changes nothing). (default: false)

Examples:
  idiotproof strategy resync-canon
  idiotproof strategy resync-canon --apply

strategy samples

List the built-in sample strategies, or show one as IdiotScript, a stamp or canonical JSON.

Samples are worked examples you can save and edit: `idiotproof strategy samples vwap-reclaim --format json | idiotproof strategy create --canon -`.

Usage: idiotproof strategy samples [<name>] [--format <stamp|armor|json|script>]
Risk: read

Parameters:
  <name>                                  A sample's name to show in full (omit to list them all).
  -f, --format <stamp|armor|json|script>  How to show one sample: script (default), stamp or json. (default: script)

Examples:
  idiotproof strategy samples
  idiotproof strategy samples vwap-reclaim
  idiotproof strategy samples sune-wedge --format stamp

strategy set

Edit a strategy's stop, target, trailing, size, sell-by time or session; the canon is rewritten and re-validated.

Only the named fields change. The result must still validate (a stop, stop below target on a long, ...). A Live strategy needs a confirmation code bound to exactly these changes.

Usage: idiotproof strategy set <strategy> [--stop <decimal>] [--stop-percent <decimal>] [--target <decimal>] [--target-percent <decimal>] [--trailing <decimal>] [--giveback <decimal>] [--qty <int>] [--notional <decimal>] [--sell-by <string>] [--session <premarket|rth|after-hours|extended>]
Risk: money

Parameters:
  <strategy>                                          Id, id prefix, stamp id or symbol. (required)
      --stop <decimal>                                Stop-loss price (replaces a percent stop).
      --stop-percent <decimal>                        Stop-loss percent from the fill (replaces a price stop).
      --target <decimal>                              Take-profit price (replaces a percent target and any scale-out ladder).
      --target-percent <decimal>                      Take-profit percent from the fill (replaces a price target).
      --trailing <decimal>                            Trailing-stop percent; 0 removes it.
      --giveback <decimal>                            Peak-giveback exit percent; 0 removes it.
      --qty <int>                                     Share quantity per entry (replaces a notional size).
      --notional <decimal>                            Dollar size per entry (replaces a share quantity).
      --sell-by <string>                              Sell anything still held at this ET time (HH:mm); "none" removes it.
      --session <premarket|rth|after-hours|extended>  Trading session: premarket, rth, afterhours or extended.

Examples:
  idiotproof strategy set NVDA --stop 168.5 --target 195
  idiotproof strategy set NVDA --qty 2 --sell-by 15:45

strategy show

Everything about one strategy: settings, script, position, progress.

Usage: idiotproof strategy show <strategy>
Risk: read

Parameters:
  <strategy>  Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol. (required)

Examples:
  idiotproof strategy show NVDA
  idiotproof strategy show IP-P4AY-UXZU

strategy stamp

Print the strategy's ASCII stamp: header, phase flow, exit ladder, fingerprint and a paste-back payload.

Usage: idiotproof strategy stamp <strategy> [--unicode] [--qr] [--compact]
Risk: read

Parameters:
  <strategy>     Id, id prefix, stamp id or symbol. (required)
  -u, --unicode  Box-drawing characters instead of plain ASCII. (default: false)
      --qr       Add a terminal QR code of the payload. (default: false)
      --compact  Leave out the armored payload block (picture only). (default: false)

Examples:
  idiotproof strategy stamp NVDA
  idiotproof strategy stamp IP-P4AY-UXZU --unicode --qr

strategy step

Where a sequenced strategy stands (step k/N, armed or awaiting its transition); --reset starts it over at step 1.

Usage: idiotproof strategy step <strategy> [--reset]
Risk: write

Parameters:
  <strategy>   Id, id prefix, stamp id (IP-XXXX-XXXX) or symbol. (required)
      --reset  Put the sequence back at step 1 (refused while it holds a position). (default: false)

Examples:
  idiotproof strategy step NVDA
  idiotproof strategy step NVDA --reset

strategy validate

Check a saved strategy or a script: parse, canon round-trip, phase rules and a risk preview. Changes nothing.

Usage: idiotproof strategy validate [<strategy>] [--script <string>] [--canon <string>]
Risk: read

Parameters:
  <strategy>             Id, id prefix, stamp id or symbol of a saved strategy (omit with --script/--canon).
  -s, --script <string>  Validate this IdiotScript text instead of a saved strategy (`-` reads stdin).
      --canon <string>   Validate this canonical JSON instead of a saved strategy (`-` reads stdin).

Examples:
  idiotproof strategy validate NVDA
  idiotproof strategy validate --script "Stock.Ticker(\"AMD\").IsAboveVwap().Long().StopLoss(150).Build()"

trade

trade buy

Buy shares (open or add to a long). Sandbox by default; live needs a confirmation code.

Usage: idiotproof trade buy <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <qty>                            Shares. Leave out and pass --dollars to size by amount.
      --dollars <decimal>          Size by dollar amount instead of shares (fractional, regular hours only).
  -l, --limit <decimal>            Limit price. Without it the order is a market order.
  -s, --stop <decimal>             Protective stop price for an entry; the Risk Guardian refuses entries without one.
  -t, --target <decimal>           Take-profit price (for the reward:risk check).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --ext                        Extended hours (premarket/after-hours); requires --limit, DAY. (default: false)
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof trade buy NVDA 10 --limit 131.20 --stop 127.50
      Sandbox limit buy with a protective stop.
  idiotproof trade buy AAPL --dollars 500 --stop 220 --mode paper
  idiotproof trade buy GAPT 100 --limit 4.12 --stop 3.90 --ext --mode live
      Premarket live buy; prints a confirmation code first.

trade confirm

Execute a pending Live order by its confirmation code (exactly what was previewed, once).

Usage: idiotproof trade confirm <code>
Risk: money

Parameters:
  <code>  The six-character code a Live preview returned. (required)

Examples:
  idiotproof trade confirm K7Q2ZP

trade cover

Buy to cover a short.

Usage: idiotproof trade cover <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <qty>                            Shares. Leave out and pass --dollars to size by amount.
      --dollars <decimal>          Size by dollar amount instead of shares (fractional, regular hours only).
  -l, --limit <decimal>            Limit price. Without it the order is a market order.
  -s, --stop <decimal>             Protective stop price for an entry; the Risk Guardian refuses entries without one.
  -t, --target <decimal>           Take-profit price (for the reward:risk check).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --ext                        Extended hours (premarket/after-hours); requires --limit, DAY. (default: false)
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof trade cover TSLA 5 --mode paper

trade flatten

Flatten a symbol, a strategy's position, or the whole account with market exits through the TransactionGateway. Live needs a confirmation code.

Usage: idiotproof trade flatten [--symbol <string>] [--strategy <string>] [--all] [--mode <sandbox|paper|live>] [--preview]
Risk: money

Parameters:
      --symbol <string>            Close the whole broker position in this symbol.
      --strategy <string>          Close what this strategy books (id, id prefix, stamp id or symbol), capped at what the broker holds.
      --all                        Close every position in the account. (default: false)
  -m, --mode <sandbox|paper|live>  paper or live (live needs a confirmation code). Default: the strategy's mode with --strategy, else paper.
      --preview                    Run every gate and list the exits without sending them. (default: false)

Examples:
  idiotproof trade flatten --symbol HIHO --mode paper
  idiotproof trade flatten --strategy IP-P4AY-UXZU
      Uses the strategy's own mode.
  idiotproof trade flatten --all --mode live --preview
      List every Live exit without sending anything.

trade notional

Buy (or sell) a dollar amount of a stock: a fractional, DAY, market order sized in dollars. Live needs a code.

Usage: idiotproof trade notional <symbol> <amount> [--side <buy|sell>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. AAPL. (required)
  <amount>                         Dollars to buy (or sell) — Alpaca works out the fractional shares. (required)
      --side <buy|sell>            buy (default, opens/adds to a long) or sell (trims a long by dollar value). (default: buy)
  -s, --stop <decimal>             Protective stop price for a buy; the Risk Guardian refuses entries without one.
  -t, --target <decimal>           Take-profit price (for the reward:risk check).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof trade notional AAPL 500 --stop 220 --mode paper
  idiotproof trade notional AAPL 250 --side sell --mode live
      Trim $250 of a long; prints a confirmation code first.

trade pending

List Live confirmations still waiting for a yes.

Usage: idiotproof trade pending
Risk: read

Examples:
  idiotproof trade pending

trade preview

Run every gate on an order without placing it (no code issued).

Usage: idiotproof trade preview <action> <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext]
Risk: read

Parameters:
  <action>                         buy, sell, short or cover. (required)
  <symbol>                         Ticker. (required)
  <qty>                            Shares (or use --dollars).
      --dollars <decimal>          Size by dollar amount.
  -l, --limit <decimal>            Limit price.
  -s, --stop <decimal>             Protective stop price.
  -t, --target <decimal>           Take-profit price.
  -m, --mode <sandbox|paper|live>  sandbox (default), paper or live. (default: sandbox)
      --ext                        Extended hours. (default: false)

Examples:
  idiotproof trade preview buy NVDA 10 --limit 131 --stop 127 --mode live

trade sell

Sell shares you hold (close or trim a long). Exits always clear the gates.

Usage: idiotproof trade sell <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <qty>                            Shares. Leave out and pass --dollars to size by amount.
      --dollars <decimal>          Size by dollar amount instead of shares (fractional, regular hours only).
  -l, --limit <decimal>            Limit price. Without it the order is a market order.
  -s, --stop <decimal>             Protective stop price for an entry; the Risk Guardian refuses entries without one.
  -t, --target <decimal>           Take-profit price (for the reward:risk check).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --ext                        Extended hours (premarket/after-hours); requires --limit, DAY. (default: false)
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof trade sell NVDA 10 --mode paper

trade short

Sell short (open a short). Needs a stop above entry; margin + shortable name at the broker.

Usage: idiotproof trade short <symbol> [<qty>] [--dollars <decimal>] [--limit <decimal>] [--stop <decimal>] [--target <decimal>] [--mode <sandbox|paper|live>] [--ext] [--tif <string>] [--note <string>]
Risk: money

Parameters:
  <symbol>                         Ticker, e.g. NVDA. (required)
  <qty>                            Shares. Leave out and pass --dollars to size by amount.
      --dollars <decimal>          Size by dollar amount instead of shares (fractional, regular hours only).
  -l, --limit <decimal>            Limit price. Without it the order is a market order.
  -s, --stop <decimal>             Protective stop price for an entry; the Risk Guardian refuses entries without one.
  -t, --target <decimal>           Take-profit price (for the reward:risk check).
  -m, --mode <sandbox|paper|live>  Where it routes: sandbox (simulator, the default), paper, or live (needs confirmation). (default: sandbox)
      --ext                        Extended hours (premarket/after-hours); requires --limit, DAY. (default: false)
      --tif <string>               Time in force: day (default) or gtc. (default: day)
      --note <string>              Why — kept in the audit trail.

Examples:
  idiotproof trade short TSLA 5 --limit 240 --stop 246

users

users create

Create an IdiotProof account (blocklist and password rules of web sign-up; Argon2id via MindAttic.Authentication).

Usage: idiotproof users create <email> --password <string> [--role <string>] [--must-change]
Risk: write

Parameters:
  <email>                  The new account's email (also its user name). (required)
      --password <string>  Initial password: 8 to 128 characters with at least one digit. (required)
      --role <string>      User (default) or Admin. (default: User)
      --must-change        Make them choose a new password at first sign-in. (default: false)

Examples:
  idiotproof users create trader@example.com --password <password>
  idiotproof users create admin@example.com --password <password> --role Admin --must-change

users list

List the IdiotProof accounts (test fixtures hidden unless --all); * marks who you act as.

Usage: idiotproof users list [--all]
Risk: read

Parameters:
      --all  Include test-fixture accounts (@idiotproof.local and bare user names), hidden by default. (default: false)

Examples:
  idiotproof users list
  idiotproof users list --all

watchlist

watchlist add

Add symbols to your IdiotProof watchlist (creates a 'Main' workspace when you have none).

Usage: idiotproof watchlist add <symbols>... [--workspace <string>]
Risk: write

Parameters:
  <symbols>                 One or more ticker symbols (space or comma separated). (required)
      --workspace <string>  Which workspace (name or id); needed only when you have more than one.

Examples:
  idiotproof watchlist add NVDA AAPL
  idiotproof watchlist add TSLA --workspace Main

watchlist list

Your IdiotProof watchlist: the symbols on each of your workspaces (not Alpaca's watchlists).

Usage: idiotproof watchlist list [--workspace <string>]
Risk: read

Parameters:
      --workspace <string>  Only this workspace (name or id).

Examples:
  idiotproof watchlist list
  idiotproof watchlist list --workspace Main

watchlist remove

Remove symbols from your IdiotProof watchlist.

Usage: idiotproof watchlist remove <symbols>... [--workspace <string>]
Risk: write

Parameters:
  <symbols>                 One or more ticker symbols (space or comma separated). (required)
      --workspace <string>  Which workspace (name or id); needed only when you have more than one.

Examples:
  idiotproof watchlist remove AAPL

watchlists

watchlists add

Add symbols to an Alpaca watchlist (by id or name).

Usage: idiotproof watchlists add <watchlist> <symbols>... [--mode <paper|live>]
Risk: write

Parameters:
  <watchlist>              Watchlist id or name. (required)
  <symbols>                One or more symbols (space or comma separated). (required)
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists add tech AMD AVGO

watchlists create

Create an Alpaca watchlist, optionally with symbols.

Usage: idiotproof watchlists create <name> [<symbols>...] [--mode <paper|live>]
Risk: write

Parameters:
  <name>                   Name for the new watchlist. (required)
  <symbols>                Symbols to start with (space or comma separated).
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists create tech AAPL MSFT NVDA

watchlists delete

Delete an Alpaca watchlist (by id or name).

Usage: idiotproof watchlists delete <watchlist> [--mode <paper|live>]
Risk: destructive

Parameters:
  <watchlist>              Watchlist id or name. (required)
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists delete tech

watchlists list

Your Alpaca server-side watchlists (not IdiotProof's local watchlist): name, id, last update.

Usage: idiotproof watchlists list [--mode <paper|live>]
Risk: read

Parameters:
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists list
  idiotproof watchlists list --mode live

watchlists remove

Remove symbols from an Alpaca watchlist (by id or name).

Usage: idiotproof watchlists remove <watchlist> <symbols>... [--mode <paper|live>]
Risk: write

Parameters:
  <watchlist>              Watchlist id or name. (required)
  <symbols>                One or more symbols (space or comma separated). (required)
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists remove tech AMD

watchlists rename

Rename an Alpaca watchlist, keeping its symbols.

Usage: idiotproof watchlists rename <watchlist> <new-name> [--mode <paper|live>]
Risk: write

Parameters:
  <watchlist>              Watchlist id or current name. (required)
  <new-name>               The new name. (required)
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists rename tech megacaps

watchlists show

One Alpaca watchlist (by id or name) and its symbols.

Usage: idiotproof watchlists show <watchlist> [--mode <paper|live>]
Risk: read

Parameters:
  <watchlist>              Watchlist id or name. (required)
      --mode <paper|live>  Alpaca account: paper (default) or live. (default: paper)

Examples:
  idiotproof watchlists show tech
  idiotproof watchlists show 3174d6df-7726-44b4-a5bd-7fda5ae6e009 --mode live
Part 2 of 2: 1 · 2