options-strategy
できること
このスキルは、過去の価格データでオプション取引戦略をテストします。複数の脚からなるオプションのポートフォリオが、過去にどう機能したかを見たいトレーダーや研究者向けです。
使う場面
- ✓過去の価格で、カバードコールやプロテクティブプットの戦略をテストしたいとき。
- ✓アイアンコンドール、バタフライ、カレンダースプレッドのアイデアを比べたいとき。
- ✓オプション戦略の寿命の間、ギリシャ文字のエクスポージャーを見たいとき。
スキルのリンク
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/options-strategy/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“この暗号資産の価格履歴でカバードコールの戦略をバックテストし、結果を見せてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、ブラック・ショールズモデルを使って、原資産の価格からオプションの理論価格を推定します。その後、各ポジションについて、利益、ギリシャ文字、満期の行使を時間を追ってシミュレートします。
技術的な内容(元の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) *
よくある質問
実際のオプションの価格が必要ですか?
いいえ。原資産の価格からブラック・ショールズで理論価格を作ります。
どの市場に対応していますか?
このスキルは、暗号資産と株式のオプションに適しているとしています。
アイアンコンドールとは何ですか?
プットスプレッドとコールスプレッドを売って、プレミアムを得るレンジ相場向けの戦略です。
詳細
作者による元の説明
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
コメント
- …
このリポジトリの他のスキル
vibe-trading
37kバックテスト、ファクター分析、オプション価格、多くの市場にまたがる市場データを含む、金融リサーチの完全なツールキットをエージェントに与えます。
adr-hshare
37k中国企業が複数の市場に上場している価格差、例えば米国のADRと香港株の差を比べる方法をエージェントに示します。
akshare
37kエージェントが、APIキーなしで、中国と世界の株式、先物、外国為替、経済指標の無料の市場データを取得できるよう支援します。
alpha-zoo
37k既製のストックファクターのライブラリを閲覧し、選んだ市場で一群のファクターがリターンをどれだけ予測するかを検証できるよう支援します。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。