Skip to main content
ClaudeWave
Skill12k estrellas del repoactualizado today

hedging-strategy

Hedging Strategy Design provides a structured framework for protecting investment positions against adverse market movements through multiple approaches. It covers beta hedging using futures and ETFs to neutralize systematic market risk while preserving stock-specific returns, option strategies like protective puts and collars for downside protection, and tail-risk hedging for extreme market events. Use this skill to calculate precise hedge ratios, estimate hedging costs, and design execution plans appropriate to portfolio size and risk tolerance. It applies to portfolios ranging from several million to institutional scale across Chinese A-share markets and global assets.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/hedging-strategy && cp -r /tmp/hedging-strategy/agent/src/skills/hedging-strategy ~/.claude/skills/hedging-strategy
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# 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:**

```python
# 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):**
```python
# 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:**

```python
# 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):**

```python
# 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

**Stock-bond hedge:**

| Stock/Bond Mix | Expected Volatility | Applicable Scenario |
|---------|-----------|---------|
| 80/20 | ~15% | Bull market environment, small bond buffer |
| 60/40 | ~10% | Classic allocation, suitable for most environments |
| 40/60 | ~7% | Bear market environment, bond-led |
| Risk Parity | ~8% | Volatility-balanced allocation |

**Note:** stock-bond correlation is not stable. In 2022, US stocks and bonds both fell (rising rates), and the traditional 60/40 mix failed. In China, negative stock-bond correlation has been relatively more stable.

**Stock-commodity hedge (equities + commodities):**
- During rising inflation: commodities rise while equities come under pressure → commodities hedge inflation risk
- During falling inflation: equities rise while commodities come under pressure → equities drive returns
- Gold ETF (`518880.SH`): low correlation with China A-shares and effective for tail-risk hedging

### 5. Hedge-Ratio Calculation Methods

**Comparison of three methods:**

```python
import numpy as np
from scipy import stats

# Method 1: OLS regression (simplest)
slope, intercept, r, p, se = stats.linregress(hedge_returns, portfolio_returns)
hedge_ratio_ols = slope

# Method 2: Minimum variance
covariance = np.cov(portfolio_returns, hedge_returns)[0][1]
variance_hedge = np.var(hedge_returns)
hedge_ratio_mv = covariance / variance_hedge

# Method 3: EWMA (exponentially weighted, more sensitive)
lambda_param = 0.94  # RiskMetrics default
ewma_cov =
vibe-tradingSkill

Professional finance research toolkit — backtesting (7 engines + benchmark comparison panel), factor analysis, Alpha Zoo (452 pre-built alphas across qlib158/alpha101/gtja191/academic), options pricing, 77 finance skills, 29 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 7 data sources (tushare, yfinance, okx, akshare, mootdx, ccxt, futu).

adr-hshareSkill

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

akshareSkill

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

alpha-zooSkill

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

ashare-pre-st-filterSkill

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

asset-allocationSkill

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 4 optimizers and rebalancing rules.

backtest-diagnoseSkill

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

behavioral-financeSkill

Behavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies.