본문으로 건너뛰기
cccskills
무료GitHub에 공개

ib-collar

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md4.0 KB
  • scripts/collar.py1.1 KB
  • templates/markdown-template.md3.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

IB Tactical Collar

Generate a tactical collar strategy report for protecting PMCC positions through earnings or high-risk events.

IB Connection

TWS or IB Gateway must be running locally with API enabled:

  • Paper trading — port 7497
  • Live trading — port 7496
  • IB_PORT env var — default port when --port is omitted (e.g. IB_PORT=4001 for a Gateway container). Precedence: --port flag > IB_PORT > built-in default. Set it in the shell or a .env file.

Port fallback: If the configured port fails, automatically retry on the other port. If the retry succeeds, save to memory which account type worked (live/paper) and reuse it for all IB skill calls in this and future sessions — until the user explicitly asks for the other account. If both ports fail, ask the user to verify that TWS or IB Gateway is running with API access enabled.

Instructions

Step 1: Gather Data

uv run python scripts/collar.py SYMBOL [--port PORT] [--account ACCOUNT]

The script returns JSON to stdout with all position and scenario data.

Step 2: Format Report

Read templates/markdown-template.md for formatting instructions. Generate a markdown report from the JSON data and save to sandbox/.

Step 3: Report Results

Present key findings to the user: recommended put protection, cost/benefit, and the saved report path.

Arguments

  • SYMBOL - Stock symbol to analyze (must be in portfolio)
  • --port - IB port (default: 7497 for paper trading)
  • --account - Specific account ID (optional, searches all accounts)

JSON Output

The script returns JSON with these key fields:

  • symbol, current_price - Basic info
  • long_strike, long_expiry, long_qty, long_cost - LEAPS position
  • short_positions - List of short calls
  • is_proper_pmcc, short_above_long - PMCC health flags
  • earnings_date, days_to_earnings - Earnings timing
  • put_analysis - List of put scenarios with costs and P&L under gap up/flat/down
  • unprotected_loss_10, unprotected_loss_15, unprotected_gain_10 - LEAPS risk without collar
  • volatility - Historical volatility data

Report Sections

  1. Position Summary: Current PMCC structure (long calls, short calls)
  2. PMCC Health Check: Is structure proper (short > long strike) or broken?
  3. Earnings Risk: Next earnings date and days until event
  4. Put Duration Analysis: Comparison of short vs medium vs long-dated puts
  5. Collar Scenarios: Gap up, flat, gap down outcomes with each put duration
  6. Cost/Benefit Analysis: Insurance cost vs protection value
  7. Implementation Timeline: Step-by-step checklist with dates
  8. Recommendation: Optimal put strike and expiration

Key Concepts

Proper PMCC Structure:

  • Long deep ITM LEAPS call
  • Short OTM calls ABOVE long strike
  • No additional margin required for collar

Broken PMCC Structure:

  • Long call is now OTM (after crash)
  • Short calls BELOW long strike require margin
  • Collar still works but margin implications exist

Tactical Collar:

  • Buy protective puts ONLY before high-risk events (earnings)
  • Sell puts after event passes
  • Balances income generation with crash protection

Put Duration Trade-offs:

  • Short-dated: Cheaper, more gamma, but zero salvage on gap up
  • Medium-dated (2-4 weeks): Best balance of cost, gamma, and salvage
  • Long-dated: Preserves value on gap up, but expensive and less gamma

Example Usage

# Analyze NVDA position (defaults to paper port 7497)
uv run python scripts/collar.py NVDA

# Analyze specific account
uv run python scripts/collar.py AMZN --account U790497

# Use paper trading port instead
uv run python scripts/collar.py NVDA --port 7497

Timezone

All timestamps and time-based calculations must use the America/New_York timezone. All JSON output must include generated_at (NY time string) and data_delay fields.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Get upcoming earnings dates with timing (before/after market) and EPS estimates. Use when user asks about earnings dates, earnings calendar, when a company reports, or upcoming earnings.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

staskh/trading_skills3792026년 10월 16일 업데이트

Get fundamental financial data including financials, earnings, and key metrics. Use when user asks about financials, earnings, revenue, profit, balance sheet, income statement, or company fundamentals.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

staskh/trading_skills3792026년 10월 16일 업데이트

greeks

무료

Calculate option Greeks (delta, gamma, theta, vega) and implied volatility for specific options. Use when user asks about Greeks, delta, gamma, theta, vega, IV, or option sensitivity analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

staskh/trading_skills3792026년 10월 16일 업데이트

ib_0dte

무료

Find and place the best 0DTE (zero-days-to-expiration) credit spreads from Interactive Brokers. Default execution route is the EMA9/EMA21 + VIX/VXN regime strategy (ema_vix_0dte.py), which auto-selects bull_put or bear_call from a bare EMA cross and skips the trade when the vol index is elevated (VXN ≥ 35 for NDX/QQQ, VIX ≥ 20 otherwise). Optional --rr-gate and --time-gate add red→red and bar-timing confirmation. Supports cash-settled indices (SPX, NDX, RUT, VIX) and any optionable stock/ETF. Manual spread type override is available via zero_dte.py. Requires TWS or IB Gateway running locally.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

staskh/trading_skills3792026년 10월 16일 업데이트

Get account summary from Interactive Brokers including cash balance, buying power, and account value. Use when user asks about their account, balance, buying power, or available cash. Requires TWS or IB Gateway running locally.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

staskh/trading_skills3792026년 10월 16일 업데이트

Consolidate IBRK trade CSV files from a directory into a summary report. Groups trades by symbol, underlying, date, strike, buy/sell, and open/close. Outputs both markdown and CSV.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

staskh/trading_skills3792026년 10월 16일 업데이트

staskh의 스킬 모두 보기

이 스킬의 문제 신고