All skills
staskh avatar

/ib-portfolio-action-report

@c0c554f
by staskhstaskh/trading_skills373 stars
85

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.

Use this Skill: https://skilld.dev/gh/staskh/trading_skills/ib-portfolio-action-report

This session only. Nothing lands on disk.

templatesmarkdown-template.md

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

Portfolio Action Report - Markdown Template

Format the JSON data into a markdown report saved to sandbox/.

Filename: ib_portfolio_action_report_{ACCOUNT}_{YYYY-MM-DD}_{HHmm}.md

  • Use first account ID if single account, "multi" if multiple

JSON Structure

{
  "generated": "YYYY-MM-DD HH:MM",
  "accounts": ["ACC1", "ACC2"],
  "summary": { "red_count": N, "yellow_count": N, "green_count": N },
  "today_earnings_symbols": ["SYM1"],
  "spreads": [
    {
      "symbol": "AAPL",
      "account": "ACC1",
      "long": { "strike": 150, "expiry": "YYYYMMDD", "right": "C", "quantity": 1, "avg_cost": 5.00, "days_to_exp": 30 },
      "short": { ... },
      "underlying_price": 155.50,
      "earnings_date": "2026-03-15",
      "risk_level": "red|yellow|green",
      "risk_emoji": "🔴|🟡|🟢",
      "recommendation": "text",
      "min_days_to_exp": 7,
      "urgency": "expiring_2_days|expiring_1_week|expiring_2_weeks|longer_dated",
      "earnings_urgency": "this_week|next_week" (optional)
    }
  ],
  "earnings": { "AAPL": "2026-03-15", ... },
  "technicals": { "AAPL": { "rsi": 65.2, "trend": "bullish", "sma20": 150.5, "above_sma20": true, ... } },
  "prices": { "AAPL": 155.50 },
  "earnings_calendar": [ { "date": "2026-03-15", "symbol": "AAPL", "accounts": ["ACC1"], "position_types": ["Spread"] } ],
  "account_summary": [ { "account": "ACC1", "position_count": 10, "spread_count": 5, "red_count": 1, ... } ]
}

Report Sections

1. Header

# IB Portfolio Action Report - All Accounts
**Generated:** {generated}
**Market Status:** Earnings day (SYM1, SYM2 reporting today)  ← only if today_earnings_symbols non-empty

2. Critical Summary

Status Count Description
🔴 RED {red_count} Immediate action required
🟡 YELLOW {yellow_count} Warning - earnings/expiration within 2 weeks
🟢 GREEN {green_count} Monitor - no immediate action needed

3. Urgency Sections

Group spreads by urgency field. For each group, render by account:

  • expiring_2_days: ## 🔴 IMMEDIATE ACTION REQUIRED (Expiring ~{date} - 2 DAYS)
  • expiring_1_week: ## 🔴 URGENT - Expiring Within 1 Week (include earnings column)
  • expiring_2_weeks: ## 🟡 EXPIRING IN 2 WEEKS (include earnings column)
  • longer_dated: ## 🟢 LONGER-DATED POSITIONS (No Immediate Action)

Table columns for short positions: | Symbol | Position | Strike | Exp | Avg Cost | Underlying | [Earnings] | Action |

For longer-dated, use spread summary format: | Spread | Long | Short | Underlying | Status |

4. Earnings Sections

Group spreads by earnings_urgency:

  • this_week: ## 🔴 CRITICAL EARNINGS ALERT - This Week
  • next_week: ## 🟡 EARNINGS NEXT WEEK

Show by symbol with position details and OTM/ITM status.

5. Top Priority Actions

Red spreads: ### 🔴 DO TODAY ({date}) Yellow spreads: ### 🟡 MONITOR THIS WEEK

Numbered list, top 5 each.

6. Position Size Summary

Use account_summary array:

| Account | Positions | Spreads | 🔴 Red | 🟡 Yellow | 🟢 Green |

7. Earnings Calendar

Use earnings_calendar array:

| Date | Symbol | Account | Position Type |

8. Technical Analysis Summary

Use technicals and prices:

| Symbol | Price | RSI | Trend | SMA20 | SMA50 | MACD | ADX |

Formatting:

  • RSI >70: bold + 🔴; RSI <30: bold + 🟢
  • Trend: bullish 📈, bearish 📉, neutral ➡️
  • SMA: show price + ✓/✗ for above/below
  • ADX >25: bold (strong trend)

9. Footer

*Report generated by Trading Skills on {generated}*

Traffic Light Indicators

  • 🔴 RED: Immediate action (expiring soon, ITM short, earnings gap risk)
  • 🟡 YELLOW: Warning zone (earnings within 2 weeks, monitor)
  • 🟢 GREEN: Safe, no immediate action

Expiry Formatting

Convert YYYYMMDD to "Mon DD" (e.g., "Feb 14").

Source: SKILL.md on GitHub

1 warning12d5 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    The skill generates a financial portfolio report by connecting to a local Interactive Brokers instance. It uses standard financial libraries and generates a report in a local sandbox directory. No malicious behavior or data exfiltration to untrusted sources was 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-portfolio-action-report