options-strategy
यह क्या करती है
यह स्किल बीते कीमत डेटा पर ऑप्शन ट्रेडिंग रणनीतियाँ टेस्ट करती है। यह उन ट्रेडरों और शोधकर्ताओं के लिए है जो देखना चाहते हैं कि कई लेग वाले ऑप्शन पोर्टफ़ोलियो पहले कैसे चलते।
कब इस्तेमाल करें
- ✓जब आप बीती कीमतों पर कवर्ड कॉल या प्रोटेक्टिव पुट रणनीति टेस्ट करना चाहें।
- ✓जब आप आयरन कंडोर, बटरफ़्लाई या कैलेंडर स्प्रेड के विचारों की तुलना कर रहे हों।
- ✓जब आपको ऑप्शन रणनीति के जीवनकाल में ग्रीक्स का एक्सपोज़र देखना हो।
Skill का लिंक
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/options-strategy/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस क्रिप्टो कीमत इतिहास पर कवर्ड कॉल रणनीति का बैकटेस्ट कीजिए और नतीजे दिखाइए।”
हर हफ़्ते 5 नई skills, 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:
enginemust be set to"options"so the runner selects the option backtest engineoptions_config.risk_free_rate: risk-free rate, default0.05options_config.iv_source: volatility source, currently supports"historical"(30-day rolling historical volatility computed from underlying closes)options_config.contract_multiplier: contract multiplier, default1.0options_config.same_day_fill:false(default) fills a signal dated T on the next bar's close;truerestores 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), default0.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
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
vibe-trading
37kयह आपके एजेंट को वित्त शोध का पूरा टूलकिट देती है, जिसमें बैकटेस्ट, फ़ैक्टर एनालिसिस, ऑप्शन प्राइसिंग और कई बाज़ारों का डेटा शामिल है।
adr-hshare
37kयह आपके एजेंट को दिखाती है कि कई बाज़ारों में लिस्टेड एक चीनी कंपनी के भाव की तुलना कैसे करें, जैसे अमेरिकी ADR और हॉन्गकॉन्ग शेयर।
akshare
37kयह आपके एजेंट को चीनी और वैश्विक शेयरों, फ़्यूचर्स, फ़ॉरेक्स और आर्थिक संकेतकों का मुफ़्त बाज़ार डेटा लेने देती है, बिना API key के।
alpha-zoo
37kयह आपके एजेंट को बने-बनाए स्टॉक फ़ैक्टरों की लाइब्रेरी देखने और चुने हुए बाज़ार पर उनके पूरे समूह के रिटर्न की भविष्यवाणी की क्षमता जाँचने देती है।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।