public double CalculateParRate(IFundingModel model) { var discountCurve = model.Curves[CashDiscountCurve]; var SpotRate = model.GetFxRate(SpotDate, MetalCCY, CashCCY); var t = SpotDate.CalculateYearFraction(DeliveryDate, Basis); var fwd = model.GetFxRate(DeliveryDate, MetalCCY, CashCCY); var ctgo = (fwd / SpotRate - 1.0) / t; return(ctgo); }
public double Pv(IFundingModel model, bool updateState) { var discountCurve = model.Curves[CashDiscountCurve]; var SpotRate = model.GetFxRate(SpotDate, MetalCCY, CashCCY); var t = SpotDate.CalculateYearFraction(DeliveryDate, Basis); var strike = SpotRate * (1.0 + ContangoRate * t); var fwd = model.GetFxRate(DeliveryDate, MetalCCY, CashCCY); var FV = (fwd - strike) * MetalQuantity; var PV = discountCurve.Pv(FV, DeliveryDate); return(PV); }
public double SuggestPillarValue(IFundingModel model) { var discountCurve = model.Curves[CashDiscountCurve]; var SpotRate = model.GetFxRate(SpotDate, MetalCCY, CashCCY); var t = SpotDate.CalculateYearFraction(DeliveryDate, Basis); var fwd = SpotRate * (1.0 + ContangoRate * t); var fxr = fwd / SpotRate; var df1 = discountCurve.GetDf(SpotDate, PillarDate); var df2 = df1 / fxr; var rate = -System.Math.Log(df2) / t; return(rate); }
private double GetFwd(DateTime fwdDate, double contango) { var t = SpotDate.CalculateYearFraction(fwdDate, Basis); return(Spot * (1.0 + contango * t)); }