public static Dictionary<string, object> Build(fcSwapCurveParameters p, object discountCurve) { var singleton = FinCADWrapper.Instance(); lock (singleton.GetLock()) { var lib = FinCADWrapper.Instance().FCLibrary; var result = lib.fcLiborCurve(p.ValuationDate, FinCADHelpers.Flatten(p.FuturesQuotes), FinCADHelpers.Flatten(p.FuturesConvexity), FinCADHelpers.FlattenCashAsFRAs(p.CashQuotes), FinCADHelpers.Flatten(p.SwapQuotes), p.FixedLegConv, p.FloatingLegConv, p.FloatingIndex, FinCADHelpers.Flatten(p.RateFixings), discountCurve, p.BootstrapSettings, new string[3, 1] { {"DiscountCurve"}, {"RateCurveLabels"}, {"RateCurve"} }, null, p.SmoothingSettings ); return FinCADHelpers.SplitCurves(result); } }
protected override Dictionary<string, object> InternalBuildCurve() { var fcParams = new Symmetry.Analytics.FinCAD.fcSwapCurveParameters { ValuationDate = mValueDate, BootstrapSettings = mParameters.BootstrapSettings, CashConv = mParameters.CashConv, CashQuotes = FinCADHelpers.GetMVP(mMoneyMarkets.OrderBy(m => Tenor.FromString(m.Key).Days()), mQuotes, 1), FixedLegConv = mParameters.FixedLegConv, FloatingLegConv = mParameters.FloatingLegConv, FloatingIndex = mParameters.FloatingIndex, FRAQuotes = null, FuturesConvexity = FinCADHelpers.GetFuturesConvexity(mConvexities, mQuotes, 100M), FuturesQuotes = FinCADHelpers.GetMVP(mFutures, mQuotes), RateFixings = FinCADHelpers.GetMVP(mHistoricalFixings, 1), SmoothingSettings = mParameters.SmoothingSettings, SwapQuotes = FinCADHelpers.GetMVP(mSwaps, mQuotes, 1) }; var result = fcLiborCurveWrapper.Build(fcParams, mDiscountCurve.Table.ObjectTable); result.Add("Parameters", fcParams); return result; }