Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/joncovington/meicagent/stop-managementgit clone --depth 1 https://github.com/joncovington/MEICAgentWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.02346 |
| Opus 5 | $0.00000 | $0.01173 |
| Sonnet 5 | $0.00000 | $0.00469 |
| Haiku 4.5 | $0.00000 | $0.00235 |
Grade A, and why
stop-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Run the MEICAgent stop management step. Executes every loop iteration for all open trades across every configured symbol in one pass (not scoped to one symbol) — each trade record already carries its own symbol, so every rule below that references "the symbol" means that specific trade's symbol, not a single configured default.
Requires: open trades list and current market data (underlying price, option chain) already gathered this iteration.
-
Detect and chase unfilled stop-close orders — tastytrade doesn't support exchange-level multi-leg stop orders for combos, so
put_stop_order_id/call_stop_order_idon an open or partial IC identify a software-triggered closing order placed in a prior iteration (Step 5 below), not a resting exchange stop. For each open/partial IC with one of these order IDs set, check working orders:- Order no longer working (filled): the side is closed. Confirm the fill price from the order/transaction history, update
put_stop_cost/call_stop_costwith the actual fill, and record the leg now:python src/db.py record_leg_exit --ic_order_id "<id>" --side put|call --status stopped --exit_time "<iso>" --exit_reason "<reason>" --exit_price <actual_fill_price> --pnl <leg_pnl>. Clear the stored order ID. - Order still working (unfilled): the quote moved away since it was placed. Cancel it (
python src/tt.py close_position --order_id <id>), recompute the closing price from fresh quotes using the same formula as Step 5 ((short_ask − long_bid) × stop_limit_current), resubmit a new Day limit, and update the stored order ID to the new order. Do not callrecord_leg_exityet — that only happens once a fill is confirmed, so P&L isn't recorded against an order that never actually executed.
- Order no longer working (filled): the side is closed. Confirm the fill price from the order/transaction history, update
-
Cancel stale pending entries — any IC in
pendingorpartial_entrystatus withentry_timemore than 10 minutes ago:- Cancel the working order:
python src/tt.py close_position --order_id <id> - If partially filled (one spread filled, one not), close the filled spread immediately to remove unhedged exposure.
- Update status to
cancelled.
- Cancel the working order:
-
Confirm fills — for any IC in
pendingstatus, check working orders. If the order is no longer listed, confirm the fill:- Update status to
open, setfill_confirmed_at. put_stop_order_id/call_stop_order_idstay unset at this point — tastytrade doesn't support exchange-level combo stops, so these fields are only populated later, in Step 5, when a software stop actually places a closing order.
- Update status to
-
No profit target — MEIC does not close iron condors at a percentage of profit. A spread is only ever exited by a per-side stop (Step 5), a time-based/event force-close or physical-settlement close (Step 7), or — for cash-settled symbols — left to expire and settled at the close (Step 7). Do not close an IC early just because it has become cheap/profitable. (This is distinct from ORB debit spreads, which have their own
orb_profit_target_pct.) -
Monitor software stops (per-side) — for each
openIC, manage the call spread and put spread independently:Per-side cost computation:
call_spread_cost_mid= short_call_mid − long_call_mid (positive = cost to close the short call spread)put_spread_cost_mid= short_put_mid − long_put_mid (positive = cost to close the short put spread, note: put mids are positive)
Per-side stop trigger: each side's stop fires when its cost equals or exceeds
net_credit(the total IC credit). This means a single bad side can cost up to the full collected premium before being stopped — protecting capital at net breakeven while allowing the other side to continue decaying.- If
call_spread_cost_mid ≥ stop_trigger_current × net_creditand nocall_stop_order_idis already working (i.e. this side isn't already being chased per Step 1):- Close the call spread only (BTC short call + STC long call) at
(short_call_ask − long_call_bid) × stop_limit_currentas a Day limit. Thestop_limit_currentcushion (default 1.02, configstop_limit_ratio) prices the limit slightly past the marketable crossing price so it fills promptly even if the quote ticks against you before the order reaches the exchange. - Update
call_stop_costandexit_reasonfor the call side. Set IC status topartial(put spread still open). Record the new order's ID intocall_stop_order_id(python src/db.py update_trade --ic_order_id "<id>" --call_stop_order_id <order_id>). - Do not call
record_leg_exityet — Step 1 confirms the fill and records the leg next iteration (or immediately if you can confirm the fill within this same iteration). - The put spread continues to run independently; re-evaluate it on every subsequent iteration.
- Close the call spread only (BTC short call + STC long call) at
- If
put_spread_cost_mid ≥ stop_trigger_current × net_creditand noput_stop_order_idis already working:- Close the put spread only (BTC short put + STC long put) at
(short_put_ask − long_put_bid) × stop_limit_currentas a Day limit, same cushion rationale as above. - Update
put_stop_costandexit_reasonfor the put side. Set IC status topartial. Record the new order's ID intoput_stop_order_id. - Do not call
record_leg_exityet — same as above, Step 1 confirms and records the fill. - The call spread continues to run independently.
- Close the put spread only (BTC short put + STC long put) at
- If both sides have triggered in the same iteration (uncommon), close the full IC in one combo order, record its ID into both
put_stop_order_idandcall_stop_order_id, and let Step 1 confirm and record both legs next iteration.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 63 lines · 0 tokens per session scan A 6ce51767da8b
stop-management is a command published in the GitHub repository joncovington/MEICAgent (4 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,346 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
scan
Universal scan — auto-detects asset class (stock / crypto / index / FX / commodity) and runs the matching protocol. With no args, regenerates scanned/INDEX.md.
scan-flow
Partial scan — refresh ONLY the asset-class flow & positioning section of an existing current.md (Flow & Squeeze for stocks, Crypto/Index/FX/Commodity Flow for non-stocks). Does not re-run charts, 6-pillar, or earnings.
rescan
Refresh existing scan, rotating prior snapshot to archive/. Args: or "macro.
scan-earnings
Earnings setup analysis for ticker. 8-point checklist + pre-print read.
scan-macro
Top-down macro/regime scan. Saves to scanned/MACRO/current.md.
discover
Run a Finviz screener aligned with the framework + current macro regime. Saves a dated candidate list to scanned/SCREENS/.