Class DiscountingFxForwardEngine
- Namespace
- NanoQL.PricingEngines
- Assembly
- NanoQL.dll
The discounting engine for FxForward: each leg discounted on its currency's curve from the settlement date to maturity, the target leg converted at the spot rate, and the result discounted to each curve's reference date.
public static class DiscountingFxForwardEngine
- Inheritance
-
DiscountingFxForwardEngine
- Inherited Members
Remarks
In the source currency, the NPV is (±N_source·D_source(τ,T) ∓ N_target·D_target(τ,T) / S)·D_source(τ), the
signs by the side paid, where D(τ,T) is a curve's discount factor from the settlement date τ to the
maturity T and S the spot rate, units of the target per unit of the source; the fair forward rate is
S·D_source(τ,T) / D_target(τ,T). The results' NPV is the source currency's, and each NPV is as of its own
curve's reference date.
The additional results are QuantLib's: "spotFx", "sourceCurrencyDiscountFactor", "targetCurrencyDiscountFactor", "sourceCurrencySettlementDiscountFactor", "targetCurrencySettlementDiscountFactor", "sourceCurrencyPV" and "targetCurrencyPV". QuantLib's inspectors of the engine's curves and quote aren't ported: they are the arguments.
Methods
Calculate(FxForward, EvaluationContext, YieldTermStructure, YieldTermStructure, double)
Prices an FX forward.
public static FxForwardResults Calculate(FxForward forward, EvaluationContext context, YieldTermStructure sourceCurrencyDiscountCurve, YieldTermStructure targetCurrencyDiscountCurve, double spotFx)
Parameters
forwardFxForwardThe forward.
contextEvaluationContextThe evaluation context, whose evaluation date sets the settlement date.
sourceCurrencyDiscountCurveYieldTermStructureThe source currency's discount curve.
targetCurrencyDiscountCurveYieldTermStructureThe target currency's discount curve.
spotFxdoubleThe spot rate, units of the target currency per unit of the source.
Returns
- FxForwardResults
The forward's results.
Exceptions
- ArgumentNullException
The forward, the context or a curve is null, a curve with QuantLib's text.
- ArgumentException
A curve's reference date is after the settlement date, or the spot rate isn't positive.
- NanoQLException
A curve can't be read at the settlement or maturity date.