/// <summary> /// Creates a stream environment. /// </summary> /// <param name="baseDate"></param> /// <param name="discountCurve"></param> /// <param name="forecastCurve"></param> /// <param name="fxCurve"></param> /// <returns></returns> public static ISwapLegEnvironment CreateInterestRateStreamEnvironment(DateTime baseDate, IRateCurve discountCurve, IRateCurve forecastCurve, IFxCurve fxCurve) { var market = new SwapLegEnvironment(); market.AddPricingStructure(InterestRateStreamPSTypes.DiscountCurve.ToString(), discountCurve); market.AddPricingStructure(InterestRateStreamPSTypes.ForecastCurve.ToString(), forecastCurve); market.AddPricingStructure(InterestRateStreamPSTypes.ReportingCurrencyFxCurve.ToString(), fxCurve); return(market); }
private static ISwapLegEnvironment CreateMarket(IPricingStructure discountCurve, IPricingStructure forwardCurve) { var market = new SwapLegEnvironment(); market.AddPricingStructure(InterestRateStreamPSTypes.DiscountCurve.ToString(), discountCurve); market.AddPricingStructure(InterestRateStreamPSTypes.ForecastCurve.ToString(), forwardCurve); market.AddPricingStructure(InterestRateStreamPSTypes.ReportingCurrencyFxCurve.ToString(), null); return(market); }
static public ISwapLegEnvironment CreateInterestRateStreamEnvironment(DateTime baseDate, Double[] times, Double[] dfs) { var market = new SwapLegEnvironment(); var interpMethod = InterpolationMethodHelper.Parse("LogLinearInterpolation"); var curve = new SimpleDiscountFactorCurve(baseDate, interpMethod, true, times, dfs); market.AddPricingStructure("DiscountCurve", curve); market.AddPricingStructure("ForecastCurve", curve); return(market); }
public ISwapLegEnvironment CreateInterestRateStreamTestEnvironment(DateTime baseDate) { var market = new SwapLegEnvironment(); var curve = TestRateCurve(baseDate); var fxcurve = TestFxCurve(baseDate); market.AddPricingStructure("DiscountCurve", curve); market.AddPricingStructure("ForecastCurve", curve); market.AddPricingStructure("ReportingCurrencyFxCurve", fxcurve); return(market); }
static public IMarketEnvironment CreateFxLegTestEnvironment(DateTime baseDate) { var market1 = new SwapLegEnvironment(); var market2 = new SwapLegEnvironment(); var discurve1 = TestRateCurve(baseDate); var fx1Curve = TestFxCurve(baseDate); market1.AddPricingStructure("DiscountCurve", discurve1); market2.AddPricingStructure("DiscountCurve", discurve1); market1.AddPricingStructure("ReportingCurrencyFxCurve", fx1Curve); market2.AddPricingStructure("ReportingCurrencyFxCurve", fx1Curve); var marketEnv = new FxLegEnvironment("temp", market1, market2); return(marketEnv); }