예제 #1
0
 public static object _CreateFloatLeg(string objectName,
                                      object[,] currency,
                                      object[,] floatingIndex,
                                      object[,] resetDates,
                                      object[,] paymentDates,
                                      object[,] notionals,
                                      object[,] spreads,
                                      object[,] accrualFractions)
 {
     try
     {
         Currency      _currency         = XU.GetCurrency0D(currency, "currency");
         FloatingIndex _floatingIndex    = XU.GetFloatingIndex0D(floatingIndex, "floatingIndex");
         Date[]        _resetDates       = XU.GetDate1D(resetDates, "resetDates");
         Date[]        _paymentDates     = XU.GetDate1D(paymentDates, "paymentDates");
         Double[]      _notionals        = XU.GetDouble1D(notionals, "notionals");
         Double[]      _spreads          = XU.GetDouble1D(spreads, "spreads");
         Double[]      _accrualFractions = XU.GetDouble1D(accrualFractions, "accrualFractions");
         FloatLeg      _result           = XLRates.CreateFloatLeg(_currency, _floatingIndex, _resetDates, _paymentDates, _notionals, _spreads, _accrualFractions);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
예제 #2
0
 public static object _CreateRateForecastCurveFromDiscount(string objectName,
                                                           object[,] floatingRateIndex,
                                                           object[,] discountCurve,
                                                           object[,] fixingCurve)
 {
     try
     {
         FloatingIndex       _floatingRateIndex = XU.GetFloatingIndex0D(floatingRateIndex, "floatingRateIndex");
         IDiscountingSource  _discountCurve     = XU.GetObject0D <IDiscountingSource>(discountCurve, "discountCurve");
         IFloatingRateSource _fixingCurve       = XU.GetObject0D <IFloatingRateSource>(fixingCurve, "fixingCurve", null);
         IFloatingRateSource _result            = XLRates.CreateRateForecastCurveFromDiscount(_floatingRateIndex, _discountCurve, _fixingCurve);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
예제 #3
0
 public static object _CreateHWModelDemo(string objectName,
                                         object[,] meanReversion,
                                         object[,] flatVol,
                                         object[,] baseCurve,
                                         object[,] forecastIndices)
 {
     try
     {
         Double             _meanReversion   = XU.GetDouble0D(meanReversion, "meanReversion");
         Double             _flatVol         = XU.GetDouble0D(flatVol, "flatVol");
         IDiscountingSource _baseCurve       = XU.GetObject0D <IDiscountingSource>(baseCurve, "baseCurve");
         FloatingIndex      _forecastIndices = XU.GetFloatingIndex0D(forecastIndices, "forecastIndices");
         HullWhite1F        _result          = XLRates.CreateHWModelDemo(_meanReversion, _flatVol, _baseCurve, _forecastIndices);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
예제 #4
0
 public static object _CreateLoanFloatingRate(string objectName,
                                              object[,] currency,
                                              object[,] balanceDates,
                                              object[,] balanceAmounts,
                                              object[,] floatingIndex,
                                              object[,] floatingSpread)
 {
     try
     {
         Currency         _currency       = XU.GetCurrency0D(currency, "currency");
         Date[]           _balanceDates   = XU.GetDate1D(balanceDates, "balanceDates");
         Double[]         _balanceAmounts = XU.GetDouble1D(balanceAmounts, "balanceAmounts");
         FloatingIndex    _floatingIndex  = XU.GetFloatingIndex0D(floatingIndex, "floatingIndex");
         Double           _floatingSpread = XU.GetDouble0D(floatingSpread, "floatingSpread");
         LoanFloatingRate _result         = XLRates.CreateLoanFloatingRate(_currency, _balanceDates, _balanceAmounts, _floatingIndex, _floatingSpread);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }