본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트37k · #7539

options-strategy

하는 일

이 스킬은 과거 가격 데이터로 옵션 거래 전략을 시험합니다. 여러 다리로 이루어진 옵션 포트폴리오가 과거에 어떻게 성과를 냈을지 보려는 트레이더와 연구자를 위한 스킬입니다.

사용하는 경우

  • ✓과거 가격으로 커버드 콜이나 프로텍티브 풋 전략을 시험하고 싶을 때.
  • ✓아이언 콘도르, 버터플라이, 캘린더 스프레드 아이디어를 비교할 때.
  • ✓옵션 전략의 수명 동안 그릭스 노출이 어떻게 변하는지 보고 싶은 경우.

스킬 링크

https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/options-strategy/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/options-strategy/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 암호화폐 가격 이력으로 커버드 콜 전략을 백테스트하고 결과를 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 Black-Scholes 모델로 기초자산 가격에서 옵션 가격을 추정합니다. 그다음 각 포지션의 수익, 그릭스, 만기 행사를 시간에 따라 시뮬레이션합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Purpose

Backtesting of option portfolio strategies. Starting from the underlying price, the engine synthesizes theoretical option prices with the Black-Scholes model, then simulates PnL, Greeks exposure, and expiration exercise for multi-leg option portfolios.

Applicable scenarios:

  • Hedging strategies (covered call, protective put)
  • Volatility trading (straddle, strangle)
  • Spread strategies (iron condor, butterfly, calendar spread)
  • Option pricing analysis and Greeks sensitivity research

Supported Strategy Types

Strategy Structure Applicable Market View
Covered Call Hold underlying + short call Mildly bullish, collect premium
Protective Put Hold underlying + long put Bullish but wants downside protection
Straddle Buy same-strike call + put Expect large movement, direction uncertain
Strangle Buy different-strike call + put Expect large movement, lower cost
Iron Condor Sell put spread + sell call spread Range-bound market, collect premium
Butterfly Buy low call + sell 2 middle calls + buy high call Expect narrow-range movement
Calendar Spread Sell near-month + buy far-month at same strike Exploit differences in time decay

OptionsSignalEngine Interface

Write the strategy in code/signal_engine.py, with class name SignalEngine, implementing the generate method:

class SignalEngine:
    """Option strategy signal engine."""

    def generate(self, data_map: dict) -> list:
        """Generate option trading instructions.

        Args:
            data_map: code -> DataFrame (columns: open, high, low, close, volume)

        Returns:
            List of trading instructions. Each instruction has the format:
            {
                "date": "2024-01-15",        # Trading date
                "action": "open" / "close",  # Open or close position
                "underlying": "BTC-USDT",    # Underlying code
                "legs": [                    # List of option legs
                    {
                        "type": "call" / "put",  # Option type
                        "strike": 50000,          # Strike price
                        "expiry": "2024-02-15",   # Expiration date
                        "qty": 1                  # Quantity (positive = long, negative = short)
                    }
                ]
            }
        """

Multi-Leg Combination Example

Iron Condor opening signal:

{
    "date": "2024-01-15",
    "action": "open",
    "underlying": "000300.SH",
    "legs": [
        {"type": "put",  "strike": 3800, "expiry": "2024-02-15", "qty": -1},  # Sell put
        {"type": "put",  "strike": 3700, "expiry": "2024-02-15", "qty":  1},  # Buy protective put
        {"type": "call", "strike": 4200, "expiry": "2024-02-15", "qty": -1},  # Sell call
        {"type": "call", "strike": 4300, "expiry": "2024-02-15", "qty":  1},  # Buy protective call
    ]
}

Ready-made engines for covered call, cash-secured put, iron condor, vol-gated short strangle and protective put live in example_signal_engine.py next to this file.

config.json Format

{
    "codes": ["000300.SH"],
    "start_date": "2020-01-01",
    "end_date": "2024-12-31",
    "source": "tushare",
    "engine": "options",
    "initial_cash": 1000000,
    "commission": 0.001,
    "options_config": {
        "risk_free_rate": 0.05,
        "iv_source": "historical",
        "contract_multiplier": 1.0,
        "same_day_fill": false,
        "default_iv": 0.3
    }
}

Key fields:

  • engine must be set to "options" so the runner selects the option backtest engine
  • options_config.risk_free_rate: risk-free rate, default 0.05
  • options_config.iv_source: volatility source, currently supports "historical" (30-day rolling historical volatility computed from underlying closes)
  • options_config.contract_multiplier: contract multiplier, default 1.0
  • options_config.same_day_fill: false (default) fills a signal dated T on the next bar's close; true restores the legacy same-date fill (signal and fill share T's close and IV)
  • options_config.default_iv: volatility used for bars without a full rolling window (warm-up and NaN gaps), default 0.3; must be finite and positive

BS Model Principles

Black-Scholes formula (European options):

Call = S * N(d1) - K * e^(-rT) * N(d2)
Put  = K * e^(-rT) * N(-d2) - S * N(-d1)

d1 = [ln(S/K) + (r + sigma^2/2) * 
자주 묻는 질문

실제 옵션 가격이 필요한가요?

아닙니다. 기초자산 가격으로 Black-Scholes를 써서 이론 가격을 만듭니다.

어떤 시장에 맞나요?

스킬은 암호화폐 옵션과 주식 옵션 모두에 적합하다고 설명합니다.

아이언 콘도르란 무엇인가요?

풋 스프레드와 콜 스프레드를 함께 팔아 프리미엄을 얻는, 가격이 일정 범위에 머무는 것을 노리는 전략입니다.

상세 정보

작성자의 원본 설명

Options strategy framework supporting Black-Scholes pricing, Greeks analysis, and multi-leg backtesting. Suitable for cryptocurrency and equity options.

repo: HKUDS/Vibe-Trading

인기도

GitHub 스타
37k
순위
#7539
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬