Example #1
0
            public TestData()
            {
                refDate = new Date(23, Month.February, 2018);
                Settings.Instance.setEvaluationDate(refDate);

                yts2 = new Handle <YieldTermStructure>(new FlatForward(refDate, 0.02, new Actual365Fixed()));

                swLn = new Handle <SwaptionVolatilityStructure>(new ConstantSwaptionVolatility(refDate, new TARGET(),
                                                                                               BusinessDayConvention.Following, 0.20, new Actual365Fixed(),
                                                                                               VolatilityType.ShiftedLognormal, 0.0));
                swSln = new Handle <SwaptionVolatilityStructure>(new ConstantSwaptionVolatility(refDate, new TARGET(),
                                                                                                BusinessDayConvention.Following, 0.10, new Actual365Fixed(),
                                                                                                VolatilityType.ShiftedLognormal, 0.01));
                swN = new Handle <SwaptionVolatilityStructure>(new ConstantSwaptionVolatility(refDate, new TARGET(),
                                                                                              BusinessDayConvention.Following, 0.0075, new Actual365Fixed(),
                                                                                              VolatilityType.Normal, 0.01));

                reversion    = new Handle <Quote>(new SimpleQuote(0.01));
                cmsPricerLn  = new LinearTsrPricer(swLn, reversion, yts2);
                cmsPricerSln = new LinearTsrPricer(swSln, reversion, yts2);
                cmsPricerN   = new LinearTsrPricer(swN, reversion, yts2);

                correlation    = new Handle <Quote>(new SimpleQuote(0.6));
                cmsspPricerLn  = new LognormalCmsSpreadPricer(cmsPricerLn, cmsPricerLn, correlation, yts2, 32);
                cmsspPricerSln = new LognormalCmsSpreadPricer(cmsPricerSln, cmsPricerSln, correlation, yts2, 32);
                cmsspPricerN   = new LognormalCmsSpreadPricer(cmsPricerN, cmsPricerN, correlation, yts2, 32);
            }
Example #2
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LognormalCmsSpreadPricer obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }