Class FxHedger
java.lang.Object
com.quantfinlib.hedging.FxHedger
FX exposure hedging with forwards: nets currency exposures across a book,
computes the variance-minimizing hedge ratio for a foreign-asset position,
and prices the carry cost of the forward hedge from forward points.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne currency exposure, signed, in base-currency terms. -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleforwardCarryBps(double spot, double forward, double tenorYears) Annualized carry of the forward hedge in bps: positive = hedging costs carry (forward above spot for the currency you sell), negative = carry pickup.static double[]hedgedReturns(double[] unhedgedReturnsBase, double[] fxReturns, double hedgeRatio) Return series with a fractionhedgeRatioof the FX exposure hedged away.static doublehedgeNotional(double netExposureBase, double hedgeRatio) Notional of forwards to sell (negative = buy) for a target hedge ratio.netExposures(List<FxHedger.FxExposure> exposures) Nets signed exposures per currency across the book.static doubleoptimalHedgeRatio(double[] unhedgedReturnsBase, double[] fxReturns) Variance-minimizing hedge ratio for a foreign asset held by a base-currency investor:h* = cov(unhedged, fx) / var(fx). 1 = full hedge is optimal; below 1 when the asset and the currency are negatively correlated (the currency already diversifies).
-
Method Details
-
netExposures
Nets signed exposures per currency across the book. -
optimalHedgeRatio
public static double optimalHedgeRatio(double[] unhedgedReturnsBase, double[] fxReturns) Variance-minimizing hedge ratio for a foreign asset held by a base-currency investor:h* = cov(unhedged, fx) / var(fx). 1 = full hedge is optimal; below 1 when the asset and the currency are negatively correlated (the currency already diversifies).- Parameters:
unhedgedReturnsBase- asset returns measured in the base currencyfxReturns- returns of the foreign currency vs base
-
hedgedReturns
public static double[] hedgedReturns(double[] unhedgedReturnsBase, double[] fxReturns, double hedgeRatio) Return series with a fractionhedgeRatioof the FX exposure hedged away. -
forwardCarryBps
public static double forwardCarryBps(double spot, double forward, double tenorYears) Annualized carry of the forward hedge in bps: positive = hedging costs carry (forward above spot for the currency you sell), negative = carry pickup. -
hedgeNotional
public static double hedgeNotional(double netExposureBase, double hedgeRatio) Notional of forwards to sell (negative = buy) for a target hedge ratio.
-