hedging-strategy
できること
このスキルは、すでに保有しているポジションのリスクを減らす計画を立てます。保護を求め、そのコストを知る必要がある投資家向けです。
使う場面
- ✓大きな株式ポートフォリオを持ち、市場の下落を心配しているとき。
- ✓ポートフォリオの市場リスクを相殺するのに、株価指数先物が何枚必要か知りたいとき。
- ✓オプションによる保護のコストと、保有銘柄を単純に売ることを比べたいとき。
スキルのリンク
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/hedging-strategy/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“今年の市場の暴落から、1000万元の株式ポートフォリオをどう守れますか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、ポートフォリオの市場への感応度を示すベータを使ってヘッジ比率を計算します。その後、先物、オプション、ETFなどの商品を比べ、それぞれのコストを見積もります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Hedging Strategy Design
Overview
Design systematic hedging plans for existing positions, covering linear hedges (futures / ETFs) and nonlinear hedges (options). Output hedge ratios, cost estimates, and execution plans. Core principle: hedging does not eliminate risk; it exchanges unknown losses for known costs.
Core Concepts
1. Beta Hedging (Futures / ETFs)
Principle: hedge portfolio systematic risk (beta) with index futures or ETFs while preserving single-stock alpha.
Hedge ratio calculation:
# Minimum-variance hedge ratio
hedge_ratio = beta_portfolio * (portfolio_value / futures_value)
# Example: hold a 10 million RMB China A-share portfolio, beta = 1.2
# CSI 300 futures (IF) contract value = index level × 300
# IF level = 4000, contract value = 4000 × 300 = 1.2 million
# Required number of short contracts = 1.2 × (1000 / 120) = 10
# Beta estimation method
import numpy as np
# OLS regression: portfolio_returns = alpha + beta * index_returns + epsilon
beta = np.cov(portfolio_returns, index_returns)[0][1] / np.var(index_returns)
China A-share beta hedging instruments:
| Instrument | Code | Contract Multiplier | Margin | Suitable Scale |
|---|---|---|---|---|
| IF (CSI 300 futures) | IF2403 | 300 RMB / point | ~12% | > 5 million RMB |
| IC (CSI 500 futures) | IC2403 | 200 RMB / point | ~14% | > 3 million RMB |
| IM (CSI 1000 futures) | IM2403 | 200 RMB / point | ~15% | > 3 million RMB |
| CSI 300 ETF (510300) | 510300.SH | — | Unlevered | Any size |
Note: stock-index futures have basis (spot-futures spread). Shorting futures when they trade at a discount brings extra return (basis convergence), while premium pricing adds extra cost.
2. Option Hedging Strategies
Protective Put
Hold the underlying + buy a put option
- Cost: option premium (typically 1-3% of underlying value per month)
- Protection range: fully protected below the strike price
- Applicable scenario: worried about a large drawdown but do not want to sell the position
China A-share example (50ETF options):
# Hold 1 million shares of 50ETF (about 2.7 million RMB)
# Buy 100 contracts of 50ETF put 2700 (strike 2.700)
# Premium ≈ 0.05 RMB/share × 10000 shares/contract × 100 contracts = 50,000 RMB
# Cost ratio = 50,000 / 2,700,000 ≈ 1.85%
# Protection effect: losses are capped once ETF falls below 2.700
Collar
Hold the underlying + buy an OTM put + sell an OTM call
- Cost: close to zero-cost (the call premium offsets the put premium)
- Trade-off: gives up upside above the call strike
- Applicable scenario: willing to cap upside in exchange for free downside protection
Parameter selection guide:
| Parameter | Aggressive | Balanced | Conservative |
|---|---|---|---|
| Put strike | ATM-5% | ATM-8% | ATM-10% |
| Call strike | ATM+8% | ATM+5% | ATM+3% |
| Net cost | Slightly positive | Near zero | Slightly negative (income) |
| Maximum downside loss | -5% | -8% | -10% |
| Maximum upside gain | +8% | +5% | +3% |
Put Spread (Bear Put Spread Hedge)
Buy a higher-strike put + sell a lower-strike put
- Cost: 30-50% cheaper than buying a naked put
- Protection range: only between the two strikes; no protection below the lower strike
- Applicable scenario: hedging against moderate drawdowns while being cost-sensitive
3. Tail-Risk Hedging
Far OTM put strategy:
# Buy deep OTM puts (delta ≈ -0.05 ~ -0.10)
# Characteristics: expires worthless most of the time, but pays off massively during black swans
# Parameters
otm_put_strike = current_price * 0.85 # 15% OTM
cost_per_month = portfolio_value * 0.003 # about 0.3% / month
expected_payoff_in_crash = portfolio_value * 0.10 # ~10% payoff in a severe selloff
# Cost management: ongoing spend of about 3.6% / year, profitable only in tail events
# Taleb-style hedge: lose small amounts often, make large gains occasionally
VIX call strategy (US equities / options market):
# Buy OTM VIX calls (strike = current VIX + 10)
# If VIX jumps from 15 to 40, call value explodes
# Naturally negatively correlated with an equity portfolio
# China A-share substitutes:
# China has no VIX futures, so alternatives are:
# 1. Buy OTM 50ETF puts (similar tail protection)
# 2. Go long volatility: buy a straddle
# 3. Allocate to gold ETF (518880.SH) as a safe-haven asset
4. Cross-Asset Hedging
**S
よくある質問
ヘッジでリスクはすべてなくなりますか?
いいえ。ヘッジは、不確かな損失を、手数料やオプションのプレミアムなどの確定したコストに置き換えるものです。
どの商品に言及していますか?
CSI 300やCSI 500などの中国A株の株価指数先物、オプション、ETFに言及しています。
どれくらいヘッジすべきかはどう決めますか?
ベータを使ってヘッジの大きさを決めるので、保護はポートフォリオが市場と動く傾向に合います。
詳細
作者による元の説明
Hedging strategy design (beta hedge / option protection / tail risk / cross-asset hedging), including hedge-ratio calculation and cost evaluation.
repo: HKUDS/Vibe-Trading
人気
- GitHubのスター
- 37k
- ランキング
- #7524
- ライセンス
- 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出力もできます。