Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        private double GetFwd(DateTime fwdDate, double contango)
        {
            var t = SpotDate.CalculateYearFraction(fwdDate, Basis);

            return(Spot * (1.0 + contango * t));
        }