Hedging & P&L attribution
Connect rebalance frequency, transaction costs and residual risk.
01Simulate a discrete delta hedge
02Attribute P&L to Greeks and carry
03Measure transaction-cost trade-offs
Define the exposure before compressing it into a metric.
Continuous replication is a theorem; an actual hedge is discrete, costly and exposed to model error.
Gamma creates rehedging demand.
More frequent hedging cuts discretization but raises costs.
Residual P&L is a diagnostic, not a dumping ground.
Fix portfolio, scenarios, horizon, and legal terms.
The hedge converts model assumptions into actual cash trades and realized P&L.
option portfolios
variance books
structured notes
Hedge timestamps, bid/ask costs and financing are explicit.
Aggregate with an explicit measure and convention.
Discrete hedge P&L
Option P&L is offset by the hedge and reduced by turnover cost.
Open in AnalyticsShort derivation
From information set to computable quantity
Each line states the information, measure and unit before manipulating the expression.
- 01
Form the hedge
Hold one option and −Δ units of underlying.
- 02
Advance one interval
Realize spot and volatility moves before rebalancing.
- 03
Charge turnover
Apply transaction cost to the change in hedge units.
- 04
Attribute residual
Subtract Greek explain and known costs from full-revaluation P&L.
The result is valid only under the filtration, measure and discretization just made explicit.
Inputs
Π: hedged portfolioc: proportional transaction cost
Assumptions and limits
- A single path cannot estimate hedge-error distribution.
- Liquidity and gap risk dominate smooth diffusion assumptions in stress.
Local explain
The attribution separates spot hedge, convexity, carry and volatility.
Open in AnalyticsReconcile valuation, risk, and model limitations.
Simulate common paths, rebalance at fixed intervals, charge explicit costs and reconcile full P&L to Greek buckets.
Use a market-calibrated volatility state; test historical dynamics separately from risk-neutral pricing dynamics.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
- Typed domain validation
- Deterministic seeded computation
- Readout plus invariant
Hedging & P&L attribution
Reproduce the governing quantity, then challenge it with an invariant.
import numpy as np def deltapindeltavndel(x: np.ndarray) -> float: x = np.asarray(x, dtype=float) assert np.isfinite(x).all() return float(np.mean(x)) sample = np.array([0.8, 1.0, 1.2])value = deltapindeltavndel(sample)assert sample.min() <= value <= sample.max()print(f"value={value:.6f}")Move the state. Challenge the equation.
Hedging & P&L attribution
Move spot, volatility and horizon. Prices, desk-unit Greeks and hedge residuals share one pricing state.
Synthetic cumulative hedge P&L after transaction costs.
- cumulative hedge P&L
Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.
Turn exposure into a controlled decision.
“The hedge frequency is part of the strategy, not an implementation footnote.”
rebalance schedule
transaction costs
Use a market-calibrated volatility state; test historical dynamics separately from risk-neutral pricing dynamics.
RISKhedge slippage
gap risk
- Validate market state and timestamp
- Recompute the baseline
- Run a controlled perturbation
- Explain P&L and residuals
Production failure modes
- Silent convention or measure changes
- Unstable numerics hidden by plausible prices
09MACRO CONNECTIONOpen the transmission channel.
Transmission from state to valuation
The causal chain separates the economic shock from the modelling response.
transmitschanges turnover
transmitssets hedge cost
outputtests model and execution
10COMMON PITFALLSOpen the failure checklist.
Hedging with future-close deltas
Calling transaction costs model error
11SOURCES / FURTHER READINGOpen sources and continue the track.
Measure theory, simulation and computational-finance lectures
The lesson uses original prose and a fresh typed implementation; the linked material is a research map, not copied product code.
- Source
- Computational Finance Course
- Author
- L. A. Grzelak
- Ref
- main