ib-stop-loss

Solid

Downside stop-loss management for PMCC, naked LEAPS, and stock positions in IB. Computes stop prices, detects alerts, and places conditional combo orders. Dry-run by default. Requires TWS or IB Gateway running locally.

AI & Automation 229 stars 56 forks Updated today MIT

Install

View on GitHub

Quality Score: 90/100

Stars 20%
79
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# IB Stop-Loss Manager Analyzes PMCC (diagonal call spread), naked LEAPS, and stock positions in the IB portfolio and manages conditional stop-loss orders. **Default mode is dry-run** — no orders are placed unless `--execute` is in the request. ## Prerequisites TWS or IB Gateway running locally with API enabled: - Live trading: port 7496 - Paper trading: port 7497 ## Instructions ### Step 1: Run the script Dry-run (default — no orders placed): ```bash uv run python .claude/skills/ib-stop-loss/scripts/stop_loss.py --port 7496 ``` Execute (cancel orphan orders + place SL_ conditional orders): ```bash uv run python .claude/skills/ib-stop-loss/scripts/stop_loss.py --port 7496 --execute ``` Execute forced (basis = current mid price, can lower existing stops): ```bash uv run python .claude/skills/ib-stop-loss/scripts/stop_loss.py --port 7496 --execute --forced ``` ### Step 2: Format the report Format JSON output as a markdown report with four sections: #### Section 1: Alert Soon List symbols in `alert_soon` prominently — these are past the early-warning threshold. #### Section 2: Existing Conditional Orders Show `all_conditional_orders.module` (SL_ orders) and `all_conditional_orders.manual` (manually placed). If `orphan_orders` is non-empty, warn that these were cancelled (execute mode) or need manual cancellation (dry-run). #### Section 3: Positions For each entry in `positions`, show a table: | Field | Value | |---|---| | Symbol | NVDA — pmcc (3 contracts) | | Spo...

Details

Author
staskh
Repository
staskh/trading_skills
Created
3 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

ib-pmcc-advisor

Analyze PMCC (Poor Man's Covered Call / diagonal spread) positions from IB portfolio. For each diagonal spread, reports short leg risk (delta, IV, assignment probability), daily P&L projections, top-3 roll candidates, and a side-by-side comparison table. Requires TWS or IB Gateway running locally.

229 Updated today
staskh
AI & Automation Solid

ib-collar

Generate tactical collar strategy reports for protecting PMCC positions through earnings or high-risk events. Requires TWS or IB Gateway running locally.

229 Updated today
staskh
Data & Documents Solid

ib-report-delta-adjusted-notional-exposure

Report delta-adjusted notional exposure across all IBKR accounts. Calculates option deltas using Black-Scholes and reports long/short exposure by account and underlying. Use when user asks about delta exposure, portfolio risk, or directional exposure.

229 Updated today
staskh
Data & Documents Solid

ib-portfolio-action-report

Generate a comprehensive portfolio action report with earnings dates and risk assessment. Use when user asks for portfolio review, action items, earnings risk, or position management across IB accounts. Requires TWS or IB Gateway running locally.

229 Updated today
staskh
AI & Automation Solid

scanner-pmcc

Scan stocks for Poor Man's Covered Call (PMCC) suitability. Analyzes LEAPS and short call options for delta, liquidity, spread, IV, yield, trend direction, and earnings proximity. Use when user asks about PMCC candidates, diagonal spreads, or LEAPS strategies.

229 Updated today
staskh