Class FXForwardComponent

java.lang.Object
All Implemented Interfaces:
ComponentMarketParamRef

public class FXForwardComponent
extends CalibratableComponent
FXForwardComponent contains the Standard FX forward Component contract details - the effective date, the maturity date, the currency pair and the product code. It also exports a calibrator that computes the forward points from the discount curve.



Author:
Lakshmi Krishnamurthy
  • Constructor Details

    • FXForwardComponent

      public FXForwardComponent​(java.lang.String strName, CurrencyPair ccyPair, int iEffectiveDate, int iMaturityDate, double dblNotional, CashSettleParams csp) throws java.lang.Exception
      Create an FXForwardComponent from the currency pair, the effective and the maturity dates
      Parameters:
      strName - Name
      ccyPair - Currency Pair
      iEffectiveDate - Effective Date
      iMaturityDate - Maturity Date
      dblNotional - Notional
      csp - Cash Settle Parameters
      Throws:
      java.lang.Exception - Thrown if the inputs are invalid
  • Method Details

    • currencyPair

      public CurrencyPair currencyPair()
      Get the Currency Pair
      Returns:
      CurrencyPair
    • fxForward

      public double fxForward​(ValuationParams valParams, MergedDiscountForwardCurve dcNum, MergedDiscountForwardCurve dcDenom, double dblFXSpot, boolean bFwdAsPIP) throws java.lang.Exception
      Imply the FX Forward
      Parameters:
      valParams - Valuation Parameters
      dcNum - Discount Curve for the numerator
      dcDenom - Discount Curve for the denominator
      dblFXSpot - FXSpot
      bFwdAsPIP - Calculate FXFwd as a PIP
      Returns:
      Implied FXForward
      Throws:
      java.lang.Exception - Thrown if inputs are invalid
    • discountCurveBasis

      public double discountCurveBasis​(ValuationParams valParams, MergedDiscountForwardCurve dcNum, MergedDiscountForwardCurve dcDenom, double dblFXSpot, double dblMarketFXFwdPrice, boolean bBasisOnDenom) throws java.lang.Exception
      Calculate the basis to either the numerator or the denominator discount curve
      Parameters:
      valParams - ValuationParams
      dcNum - Discount Curve for the numerator
      dcDenom - Discount Curve for the denominator
      dblFXSpot - FXSpot
      dblMarketFXFwdPrice - FXForward Market Value
      bBasisOnDenom - Boolean indicating whether the basis is applied on the denominator (true) or denominator
      Returns:
      Basis
      Throws:
      java.lang.Exception - Thrown if inputs are invalid
    • name

      public java.lang.String name()
      Description copied from interface: ComponentMarketParamRef
      Get the component name
      Returns:
      The component name
    • primaryCode

      public java.lang.String primaryCode()
      Description copied from class: CalibratableComponent
      Return the primary code
      Specified by:
      primaryCode in class CalibratableComponent
      Returns:
      Primary Code
    • setPrimaryCode

      public void setPrimaryCode​(java.lang.String strCode)
      Description copied from class: CalibratableComponent
      Set the component's primary code
      Specified by:
      setPrimaryCode in class CalibratableComponent
      Parameters:
      strCode - Primary Code
    • effectiveDate

      public JulianDate effectiveDate()
      Description copied from class: Component
      Get the Effective Date
      Specified by:
      effectiveDate in class Component
      Returns:
      Effective Date
    • maturityDate

      public JulianDate maturityDate()
      Description copied from class: Component
      Get the Maturity Date
      Specified by:
      maturityDate in class Component
      Returns:
      Maturity Date
    • firstCouponDate

      public JulianDate firstCouponDate()
      Description copied from class: Component
      Get the First Coupon Date
      Specified by:
      firstCouponDate in class Component
      Returns:
      First Coupon Date
    • freq

      public int freq()
      Description copied from class: Component
      Retrieve the Coupon Frequency
      Specified by:
      freq in class Component
      Returns:
      The Coupon Frequency
    • couponPeriods

      public java.util.List<CompositePeriod> couponPeriods()
      Description copied from class: Component
      Get the Product's Cash Flow Periods
      Specified by:
      couponPeriods in class Component
      Returns:
      List of the Product's Cash Flow Periods
    • couponMetrics

      public CompositePeriodCouponMetrics couponMetrics​(int iAccrualEndDate, ValuationParams valParams, CurveSurfaceQuoteContainer csqs)
      Description copied from class: Component
      Get the Product's coupon Metrics at the specified accrual date
      Specified by:
      couponMetrics in class Component
      Parameters:
      iAccrualEndDate - Accrual End Date
      valParams - The Valuation Parameters
      csqs - Component Market Parameters
      Returns:
      The Product's coupon Nominal/Adjusted Coupon Measures
    • couponCurrency

      public CaseInsensitiveTreeMap<java.lang.String> couponCurrency()
      Description copied from interface: ComponentMarketParamRef
      Get the Map of Coupon Currencies
      Returns:
      The Map of Coupon Currencies
    • payCurrency

      public java.lang.String payCurrency()
      Description copied from interface: ComponentMarketParamRef
      Get the Pay Currency
      Returns:
      The Pay Currency
    • principalCurrency

      public java.lang.String principalCurrency()
      Description copied from interface: ComponentMarketParamRef
      Get the Principal Currency
      Returns:
      The Principal Currency
    • creditLabel

      public EntityCDSLabel creditLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Credit Curve Latent State Identifier Label
      Returns:
      The Credit Curve Latent State Identifier Label
    • forwardLabel

      public CaseInsensitiveTreeMap<ForwardLabel> forwardLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Map of Forward Latent State Labels
      Returns:
      The Map of the Forward Latent State Labels
    • otcFixFloatLabel

      public CaseInsensitiveTreeMap<OTCFixFloatLabel> otcFixFloatLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Map of OTC Fix Float Latent State Labels
      Returns:
      The Map of the OTC Fix Float Latent State Labels
    • fundingLabel

      public FundingLabel fundingLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Funding Curve Latent State Label
      Returns:
      Funding Curve Latent State Label
    • govvieLabel

      public GovvieLabel govvieLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Govvie Curve Latent State Label
      Returns:
      Govvie Curve Latent State Label
    • fxLabel

      public CaseInsensitiveTreeMap<FXLabel> fxLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Map of FX Latent State Identifier Labels
      Returns:
      The Map of FX Latent State Identifier Labels
    • volatilityLabel

      public CaseInsensitiveTreeMap<VolatilityLabel> volatilityLabel()
      Description copied from interface: ComponentMarketParamRef
      Get the Map of Volatility Latent State Identifier Labels
      Returns:
      The Map of Volatility Latent State Identifier Labels
    • initialNotional

      public double initialNotional() throws java.lang.Exception
      Description copied from class: Component
      Get the Initial Notional for the Product
      Specified by:
      initialNotional in class Component
      Returns:
      Initial Notional
      Throws:
      java.lang.Exception - Thrown if Initial Notional cannot be computed
    • notional

      public double notional​(int iDate) throws java.lang.Exception
      Description copied from class: Component
      Get the Notional for the Product at the given date
      Specified by:
      notional in class Component
      Parameters:
      iDate - Date
      Returns:
      Product Notional
      Throws:
      java.lang.Exception - Thrown if Notional cannot be computed
    • notional

      public double notional​(int iDate1, int iDate2) throws java.lang.Exception
      Description copied from class: Component
      Get the time-weighted Notional for the Product between 2 dates
      Specified by:
      notional in class Component
      Parameters:
      iDate1 - Date #1
      iDate2 - Date #2
      Returns:
      The Product Notional
      Throws:
      java.lang.Exception - Thrown if Notional cannot be computed
    • cashSettleParams

      public CashSettleParams cashSettleParams()
      Description copied from class: Component
      Get the Product's cash settlement parameters
      Specified by:
      cashSettleParams in class Component
      Returns:
      Cash settlement Parameters
    • value

      public CaseInsensitiveTreeMap<java.lang.Double> value​(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp)
      Description copied from class: Component
      Generate a full list of the Product measures for the full input set of market parameters
      Specified by:
      value in class Component
      Parameters:
      valParams - ValuationParams
      pricerParams - PricerParams
      csqs - Market Parameters
      vcp - Valuation Customization Parameters
      Returns:
      Map of measure name and value
    • measureNames

      public java.util.Set<java.lang.String> measureNames()
      Description copied from class: Component
      Retrieve the ordered set of the measure names whose values will be calculated
      Specified by:
      measureNames in class Component
      Returns:
      Set of Measure Names
    • pv

      public double pv​(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp) throws java.lang.Exception
      Description copied from class: Component
      Compute the PV for the specified Market Parameters
      Specified by:
      pv in class Component
      Parameters:
      valParams - ValuationParams
      pricerParams - PricerParams
      csqs - Market Parameters
      vcp - Valuation Customization Parameters
      Returns:
      The PV
      Throws:
      java.lang.Exception - Thrown if the PV cannot be computed
    • calibMeasures

      public CaseInsensitiveTreeMap<java.lang.Double> calibMeasures​(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp)
      Description copied from class: CalibratableComponent
      Generate a Map of the Calibration Measures
      Specified by:
      calibMeasures in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Market Parameters
      vcp - Valuation Customization Parameters
      Returns:
      Map of the Calibration Measures
    • calibQuoteSet

      public ProductQuoteSet calibQuoteSet​(LatentStateSpecification[] aLSS)
      Description copied from class: CalibratableComponent
      Generate the Product Specific Calibration Quote Set
      Specified by:
      calibQuoteSet in class CalibratableComponent
      Parameters:
      aLSS - Array of Latent State Specification
      Returns:
      The Product Specific Calibration Quote Set
    • forwardPRWC

      Description copied from class: CalibratableComponent
      Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Non-merged Forward Factor Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
      Specified by:
      forwardPRWC in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      vcp - Valuation Customization Parameters
      pqs - Product Quote Set
      Returns:
      The Calibratable Linearized Predictor/Response Constraints (Date/Cash Flow pairs and the corresponding PV)
    • fundingPRWC

      Description copied from class: CalibratableComponent
      Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Non-merged Funding Curve Discount Factor Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
      Specified by:
      fundingPRWC in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      vcp - Valuation Customization Parameters
      pqs - Product Quote Set
      Returns:
      The Calibratable Linearized Predictor/Response Constraints (Date/Cash Flow pairs and the corresponding PV)
    • fundingForwardPRWC

      Description copied from class: CalibratableComponent
      Generate the Calibratable Linearized Predictor/Response Constraint Weights for the merged Funding and Forward Latent States from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
      Specified by:
      fundingForwardPRWC in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      vcp - Valuation Customization Parameters
      pqs - Product Quote Set
      Returns:
      The Calibratable Linearized Predictor/Response Constraints (Date/Cash Flow pairs and the corresponding PV)
    • fxPRWC

      Description copied from class: CalibratableComponent
      Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Non-merged FX Curve FX Forward Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
      Specified by:
      fxPRWC in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      vcp - Valuation Customization Parameters
      pqs - Product Quote Set
      Returns:
      The Calibratable Linearized Predictor/Response Constraints (Date/Cash Flow pairs and the corresponding FX Forward)
    • govviePRWC

      Description copied from class: CalibratableComponent
      Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Non-merged Govvie Curve FX Forward Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
      Specified by:
      govviePRWC in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      vcp - Valuation Customization Parameters
      pqs - Product Quote Set
      Returns:
      The Calibratable Linearized Predictor/Response Constraints (Date/Cash Flow pairs and the corresponding Govvie Forward)
    • volatilityPRWC

      Description copied from class: CalibratableComponent
      Generate the Calibratable Linearized Predictor/Response Constraint Weights for the Non-merged Volatility Latent State from the Component's Cash Flows. The Constraints here typically correspond to Date/Cash Flow pairs and the corresponding leading PV.
      Specified by:
      volatilityPRWC in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      vcp - Valuation Customization Parameters
      pqs - Product Quote Set
      Returns:
      The Calibratable Linearized Predictor/Response Constraints (Date/Cash Flow pairs and the corresponding PV)
    • jackDDirtyPVDManifestMeasure

      public WengertJacobian jackDDirtyPVDManifestMeasure​(ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams quotingParams)
      Description copied from class: CalibratableComponent
      Compute the Jacobian of the Dirty PV to the Calibrated Input Manifest Measures
      Specified by:
      jackDDirtyPVDManifestMeasure in class CalibratableComponent
      Parameters:
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      quotingParams - Valuation Customization Parameters
      Returns:
      The micro-Jacobian
    • manifestMeasureDFMicroJack

      public WengertJacobian manifestMeasureDFMicroJack​(java.lang.String strManifestMeasure, ValuationParams valParams, CreditPricerParams pricerParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams quotingParams)
      Description copied from class: CalibratableComponent
      Compute the micro-Jacobian of the given measure to the DF
      Specified by:
      manifestMeasureDFMicroJack in class CalibratableComponent
      Parameters:
      strManifestMeasure - Manifest Measure Name
      valParams - Valuation Parameters
      pricerParams - Pricer Parameters
      csqs - Component Market Parameters
      quotingParams - Valuation Customization Parameters
      Returns:
      The micro-Jacobian