public ADouble FuturesNpvAD(Futures future)
        {
            Fra     fra         = future.FraSameSpec;
            ADouble fraRate     = ParFraRateAD(fra);
            ADouble notional    = fra.Notional;
            ADouble convexity   = future.Convexity;
            ADouble futuresRate = fraRate + convexity;

            return(notional * (1.0 - futuresRate));
        }
Exemple #2
0
        public double FuturesNpv(Futures future)
        {
            Fra    fra         = future.FraSameSpec;
            double fraRate     = ParFraRate(fra);
            double notional    = fra.Notional;
            double convexity   = future.Convexity;
            double futuresRate = fraRate + convexity;

            return(notional * (1 - futuresRate));
        }
        private void InterpretFuturesString(string instrumentString)
        {
            string     identifier, type, currency, endTenor, settlementLag, floatPayFreq, floatFixingTenor, fwdTenor;
            DayRule    dayRule;
            DayCount   dayCount;
            CurveTenor curveTenor;

            string[] infoArray = instrumentString.Split(',').ToArray();

            identifier       = infoArray[0];
            type             = infoArray[1];
            currency         = infoArray[2];
            endTenor         = infoArray[3];
            settlementLag    = infoArray[4];
            dayRule          = StrToEnum.DayRuleConvert(infoArray[5]);
            floatPayFreq     = infoArray[8];
            floatFixingTenor = infoArray[9];
            fwdTenor         = infoArray[15];
            dayCount         = StrToEnum.DayCountConvert(infoArray[11]);

            DateTime startDate, endDate;

            try
            {
                startDate = Convert.ToDateTime(fwdTenor);
                endDate   = DateHandling.AddTenorAdjust(startDate, floatPayFreq, dayRule);

                curveTenor = StrToEnum.CurveTenorFromSimpleTenor(floatPayFreq);
                Fra fra = new MasterThesis.Fra(AsOf, startDate, endDate, curveTenor, dayCount, dayRule, _defaultFixedRate, _defaultNotional, _defaultTradeSign);
                Futures[identifier]                 = new MasterThesis.Futures(fra, null);
                CurvePointMap[identifier]           = fra.GetCurvePoint();
                InstrumentTypeMap[identifier]       = QuoteType.FuturesRate;
                InstrumentFormatTypeMap[identifier] = InstrumentFormatType.Futures;
                IdentifierStringMap[identifier]     = instrumentString;
            }
            catch
            {
                // Ignore instrument
            }
        }
 // Futures
 public ADouble ParFutureRateAD(Futures future)
 {
     return(ParFraRateAD(future.FraSameSpec) + future.Convexity);
 }