Class FxHedger

java.lang.Object
com.quantfinlib.hedging.FxHedger

public final class FxHedger extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static final record 
    One currency exposure, signed, in base-currency terms.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static double[]
    hedgedReturns(double[] unhedgedReturnsBase, double[] fxReturns, double hedgeRatio)
    Return series with a fraction hedgeRatio of the FX exposure hedged away.
    static double
    hedgeNotional(double netExposureBase, double hedgeRatio)
    Notional of forwards to sell (negative = buy) for a target hedge ratio.
    static Map<String,Double>
    Nets signed exposures per currency across the book.
    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).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • netExposures

      public static Map<String,Double> netExposures(List<FxHedger.FxExposure> exposures)
      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 currency
      fxReturns - returns of the foreign currency vs base
    • hedgedReturns

      public static double[] hedgedReturns(double[] unhedgedReturnsBase, double[] fxReturns, double hedgeRatio)
      Return series with a fraction hedgeRatio of 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.