Skillpedia
التحليل وجداول البيانات37k · #7539

options-strategy

ما الذي تفعله

تختبر هذه المهارة استراتيجيات تداول الخيارات على بيانات أسعار سابقة. وهي موجهة للمتداولين والباحثين الذين يريدون معرفة أداء محافظ الخيارات متعددة الأرجل لو كانت قائمة.

متى تستخدمها

  • ✓عندما تريد اختبار استراتيجية الكول المغطى أو الحماية بالبيع على أسعار سابقة.
  • ✓عندما تقارن أفكار أيرون كوندور أو الباترفلاي أو سبريد التقويم.
  • ✓عندما تحتاج إلى رؤية تعرض مؤشرات Greeks طوال عمر استراتيجية الخيارات.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/options-strategy/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اختبر استراتيجية الكول المغطى على تاريخ الأسعار لهذه العملة الرقمية، وأرني النتائج.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تقدّر المهارة أسعار الخيارات من السعر الأساسي باستخدام نموذج بلاك شولز. ثم تحاكي الربح ومؤشرات Greeks والممارسة عند الانتهاء لكل مركز عبر الزمن.

المحتوى التقني (ملف 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) * 
الأسئلة الشائعة

هل تحتاج إلى أسعار خيارات حقيقية؟

لا. تبني أسعارًا نظرية باستخدام بلاك شولز من السعر الأساسي.

لأي أسواق تعمل؟

تذكر المهارة أنها مناسبة لخيارات العملات الرقمية والأسهم.

ما أيرون كوندور؟

هي استراتيجية نطاق سعري، تبيع سبريد بيع وسبريد شراء لتحصيل العلاوة.

التفاصيل

الوصف الأصلي من المؤلف

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
آخر تحديث
1‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة