All skills
staskh avatar

/ib-find-short-roll

@c0c554f
by staskhstaskh/trading_skills373 stars
85

Find roll options for existing short positions OR find best covered call/put to open against long stock. Use when user asks about rolling shorts, finding roll candidates, writing covered calls, or managing option positions. Requires TWS or IB Gateway running locally.

Use this Skill: https://skilld.dev/gh/staskh/trading_skills/ib-find-short-roll

This session only. Nothing lands on disk.

templatesmarkdown-template.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Short Position Roll Report - Markdown Template

Format the JSON data into a markdown report saved to sandbox/. Use the mode field to determine which format to use.

Filename formats:

  • Roll mode: ib_short_report_{SYMBOL}_{YYYY-MM-DD}_{HHmm}.md
  • Spread mode: ib_spread_{SYMBOL}_{YYYY-MM-DD}_{HHmm}.md
  • New short mode: ib_new_short_{SYMBOL}_{YYYY-MM-DD}_{HHmm}.md

Common Fields

All modes include:

  • generated - Timestamp string
  • symbol - Ticker symbol
  • underlying_price - Current stock price
  • earnings_date - Next earnings date or null
  • candidates_by_expiry or roll_candidates - Dict of expiry -> candidate list

Mode: "roll" (Rolling existing short)

Current Short Position Table

Field Value
Symbol symbol
Position -{abs(quantity)} Call/Put
Strike $current_position.strike
Expiration Format current_position.expiry (YYYYMMDD) as "Mon DD, YYYY" + days until
Underlying Price $underlying_price
OTM % Calculate: (strike - underlying) / underlying * 100 for calls, inverse for puts
Buy to Close $buy_to_close
Total Cost to Close $buy_to_close * abs(quantity) * 100
Earnings Date Show if present

Roll Candidates by Expiration

For each expiry in roll_candidates:

Header: "Mon DD, YYYY (N days)"

Strike OTM% Sell @ Net Total (N contracts) Rating
  • OTM%: (strike - underlying) / underlying * 100 for calls
  • Net: sell_price - buy_to_close. Show as +$X.XX credit or -$X.XX debit
  • Total: net * abs(quantity) * 100
  • Rating: credit + OTM≥5% = "Excellent"(net>2)/"Good"; credit only = "OK"; small debit = "Fair"; large debit = "Poor"

Recommendations

Rank credit rolls by score: otm_pct * 0.5 + otm_improvement * 2 + min(net, 10) * 0.3 + min(days/60, 3) * 0.2

Show top 5 with: expiry, strike, net credit, OTM%, days to expiration.

Recommended Roll: Best scored candidate with BUY TO CLOSE / SELL TO OPEN order syntax.

Mode: "spread" (Vertical spread against long option)

Current Long Option Table

Field Value
Symbol symbol
Position +{quantity} Call/Put
Strike $long_option.strike
Expiration Format expiry + days
Avg Cost $long_option.avg_cost
Underlying Price $underlying_price
Earnings Date Show if present

Short Candidates by Expiration

For each expiry in candidates_by_expiry:

Strike OTM% Bid Width Max Profit Max Loss Score
  • Width: abs(candidate.strike - long_option.strike)
  • Max Profit: bid * 100
  • Max Loss: max(avg_cost - bid, 0) * 100

Recommendations

Top 5 by score. Show premium, total for N contracts, OTM%, spread width, days.

Recommended Position: SELL TO OPEN order syntax. Describe the spread type (call/put debit/credit spread).

Mode: "new_short" (Covered call/protective put)

Current Long Stock Table

Field Value
Symbol symbol
Shares long_position.shares
Avg Cost $long_position.avg_cost
Current Price $underlying_price
P&L Calculate from avg_cost and current price
Contracts Available shares // 100
Earnings Date Show if present

Covered Call/Protective Put Candidates by Expiration

For each expiry in candidates_by_expiry:

Strike OTM% Bid Premium/Contract Ann. Return Score
  • Premium/Contract: bid * 100
  • Annual Return: annual_return from candidate data

Recommendations

Top 5 by score. Show premium per share, total, OTM%, annualized return, days.

Recommended Position: SELL TO OPEN order with best candidate.

Formatting Rules

  • Currency: $X.XX for prices, $X,XXX for totals
  • Percentages: 1 decimal, show sign for changes
  • Expiry dates: "Mon DD, YYYY" format
  • Bold key values in recommendations
  • Include horizontal rules between sections
  • Footer: *Report generated by Trading Skills on YYYY-MM-DD HH:MM*

Source: SKILL.md on GitHub

No alerts12d5 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    This skill is a financial utility for analyzing option roll candidates and covered call opportunities using a local Interactive Brokers connection. It fetches market data via the Interactive Brokers API and generates markdown reports in a local sandbox directory. No malicious patterns, data exfiltration, or unauthorized code execution were detected.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

  • Runlayer7mo

    1/3 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at c0c554f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 3 months ago
dependencies
[
  "trading-skills"
]

README badge

README badge for staskh/trading_skills/ib-find-short-roll