Phase 2 (Invested): Si assignation, vendre des calls couverts
DTE: 30 jours
Max exposition: 20% du portfolio par equity
Performance de référence
Sharpe ~1.5-2.0 (2020-2025) - excellente sur les tech à haute volatilité.
Hypothèses à tester
DTE: 21, 30, 45 jours
OTM threshold: 3%, 5%, 7%
Max exposition: 10%, 20%, 30%
Prérequis
Environnement Lean Research
Données actions + approximation option premium
Durée estimée: ~8 minutes
Note : Les options complètes ne sont pas disponibles dans QuantBook. Ce notebook utilise une approximation du premium basée sur la volatilité historique et le delta.
# Setup QuantBookfrom AlgorithmImports import*import numpy as npimport pandas as pdimport matplotlib.pyplot as pltfrom scipy.stats import normimport warningswarnings.filterwarnings('ignore')plt.style.use('seaborn-v0_8-darkgrid')plt.rcParams['figure.figsize'] = (14, 5)qb = QuantBook()print("QuantBook initialisé.")
QuantBook initialisé.
1. Chargement des données
On charge les données actions tech pour la période 2020-2026.
Pivot de la série ‘close’ en DataFrame large, avec remapping des colonnes Symbol → ticker pour Options-VGT.
# Pivoter les donnéescloses = history['close'].unstack(level=0)symbol_to_ticker = {str(v): k for k, v in symbols.items()}closes.columns = [symbol_to_ticker.get(str(c), str(c)) for c in closes.columns]closes = closes.dropna()print(f"Période: {closes.index[0].date()} à {closes.index[-1].date()}")print(f"Données: {len(closes)} jours de trading")print(f"Actions: {list(closes.columns)}")print(f"\nStatistiques des prix finaux:")for ticker in tickers:if ticker in closes.columns: ret = (closes[ticker].iloc[-1] / closes[ticker].iloc[0] -1) *100 vol = closes[ticker].pct_change().std() * np.sqrt(252)print(f" {ticker}: {ret:+.1f}% (vol: {vol:.1%})")
Période: 2020-01-02 à 2025-12-31
Données: 1508 jours de trading
Actions: ['AAPL', 'GOOGL']
Statistiques des prix finaux:
AAPL: +64.3% (vol: 20.3%)
GOOGL: +50.7% (vol: 17.0%)
2. Approximation du premium d’options
Comme les options complètes ne sont pas disponibles dans QuantBook, on utilise une approximation basée sur la volatilité historique et Black-Scholes.
def estimate_option_premium(stock_price, historical_vol, days_to_expiry, otm_pct=0.05, option_type='put'):""" Estime le premium d'une option via Black-Scholes simplifié. Args: stock_price: Prix actuel de l'action historical_vol: Volatilité historique annualisée days_to_expiry: Jours jusqu'à expiration otm_pct: % OTM (0.05 = 5% OTM) option_type: 'put' ou 'call' """# Paramètres vol = historical_vol t = days_to_expiry /365.0 r =0.05# Taux sans risque# Strike OTMif option_type =='put': strike = stock_price * (1- otm_pct)else: strike = stock_price * (1+ otm_pct)# Black-Scholes d1 = (np.log(stock_price / strike) + (r +0.5* vol**2) * t) / (vol * np.sqrt(t)) d2 = d1 - vol * np.sqrt(t)if option_type =='put': premium = strike * np.exp(-r * t) * norm.cdf(-d2) - stock_price * norm.cdf(-d1)else: premium = stock_price * norm.cdf(d1) - strike * np.exp(-r * t) * norm.cdf(d2)returnmax(0, premium)# Test de la fonction d'estimationtest_price =150.0test_vol =0.35test_dte =30put_premium = estimate_option_premium(test_price, test_vol, test_dte, 0.05, 'put')call_premium = estimate_option_premium(test_price, test_vol, test_dte, 0.05, 'call')print(f"Premium estimé pour action à ${test_price}, vol={test_vol:.1%}, DTE={test_dte}:")print(f" PUT (5% OTM): ${put_premium:.2f}")print(f" CALL (5% OTM): ${call_premium:.2f}")
Premium estimé pour action à $150.0, vol=35.0%, DTE=30:
PUT (5% OTM): $2.67
CALL (5% OTM): $3.31
Interprétation: Premium d’options
Volatilité élevée → Premium plus élevé (avantageux pour le vendeur)
OTM → Plus OTM = premium moins élevé mais probabilité d’exercice plus faible