Esempio n. 1
0
 public static object _ValueZARSwap1Curve(object[,] swap,
                                          object[,] valueDate,
                                          object[,] curve)
 {
     try
     {
         IRSwap             _swap      = XU.GetObject0D <IRSwap>(swap, "swap");
         Date               _valueDate = XU.GetDate0D(valueDate, "valueDate");
         IDiscountingSource _curve     = XU.GetObject0D <IDiscountingSource>(curve, "curve");
         Double             _result    = XLRates.ValueZARSwap1Curve(_swap, _valueDate, _curve);
         return(XU.ConvertToObjects(_result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 2
0
 public static object _CreateCashLeg(string objectName,
                                     object[,] paymentDates,
                                     object[,] amounts,
                                     object[,] currencies)
 {
     try
     {
         var _paymentDates = XU.GetDate1D(paymentDates, "paymentDates");
         var _amounts      = XU.GetDouble1D(amounts, "amounts");
         var _currencies   = XU.GetSpecialType1D <Currency>(currencies, "currencies");
         var _result       = XLRates.CreateCashLeg(_paymentDates, _amounts, _currencies);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 3
0
 public static object _CreateCashLeg(string objectName,
                                     object[,] paymentDates,
                                     object[,] amounts,
                                     object[,] currencies)
 {
     try
     {
         Date[]     _paymentDates = XU.GetDate1D(paymentDates, "paymentDates");
         Double[]   _amounts      = XU.GetDouble1D(amounts, "amounts");
         Currency[] _currencies   = XU.GetCurrency1D(currencies, "currencies");
         CashLeg    _result       = XLRates.CreateCashLeg(_paymentDates, _amounts, _currencies);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 4
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));
     }
 }
Esempio n. 5
0
 public static object _CreateHWModelDemo(string objectName,
                                         object[,] meanReversion,
                                         object[,] flatVol,
                                         object[,] baseCurve,
                                         object[,] forecastIndices)
 {
     try
     {
         var _meanReversion   = XU.GetDouble0D(meanReversion, "meanReversion");
         var _flatVol         = XU.GetDouble0D(flatVol, "flatVol");
         var _baseCurve       = XU.GetObject0D <IDiscountingSource>(baseCurve, "baseCurve");
         var _forecastIndices = XU.GetSpecialType0D <FloatingIndex>(forecastIndices, "forecastIndices");
         var _result          = XLRates.CreateHWModelDemo(_meanReversion, _flatVol, _baseCurve, _forecastIndices);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 6
0
 public static object _CreateLoanFixedRate(string objectName,
                                           object[,] currency,
                                           object[,] balanceDates,
                                           object[,] balanceAmounts,
                                           object[,] fixedRate)
 {
     try
     {
         var _currency       = XU.GetSpecialType0D <Currency>(currency, "currency");
         var _balanceDates   = XU.GetDate1D(balanceDates, "balanceDates");
         var _balanceAmounts = XU.GetDouble1D(balanceAmounts, "balanceAmounts");
         var _fixedRate      = XU.GetDouble0D(fixedRate, "fixedRate");
         var _result         = XLRates.CreateLoanFixedRate(_currency, _balanceDates, _balanceAmounts, _fixedRate);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 7
0
 public static object _CreateZARFRA(string objectName,
                                    object[,] tradeDate,
                                    object[,] notional,
                                    object[,] rate,
                                    object[,] fraCode,
                                    object[,] payFixed)
 {
     try
     {
         var _tradeDate = XU.GetDate0D(tradeDate, "tradeDate");
         var _notional  = XU.GetDouble0D(notional, "notional");
         var _rate      = XU.GetDouble0D(rate, "rate");
         var _fraCode   = XU.GetSpecialType0D <string>(fraCode, "fraCode");
         var _payFixed  = XU.GetBoolean0D(payFixed, "payFixed");
         var _result    = XLRates.CreateZARFRA(_tradeDate, _notional, _rate, _fraCode, _payFixed);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 8
0
 public static object _CreateZARSwap(string objectName,
                                     object[,] startDate,
                                     object[,] tenor,
                                     object[,] rate,
                                     object[,] payFixed,
                                     object[,] notional)
 {
     try
     {
         var _startDate = XU.GetDate0D(startDate, "startDate");
         var _tenor     = XU.GetSpecialType0D <Tenor>(tenor, "tenor");
         var _rate      = XU.GetDouble0D(rate, "rate");
         var _payFixed  = XU.GetBoolean0D(payFixed, "payFixed");
         var _notional  = XU.GetDouble0D(notional, "notional");
         var _result    = XLRates.CreateZARSwap(_startDate, _tenor, _rate, _payFixed, _notional);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 9
0
 public static object _CreateFixedLeg(string objectName,
                                      object[,] currency,
                                      object[,] paymentDates,
                                      object[,] notionals,
                                      object[,] rates,
                                      object[,] accrualFractions)
 {
     try
     {
         var _currency         = XU.GetSpecialType0D <Currency>(currency, "currency");
         var _paymentDates     = XU.GetDate1D(paymentDates, "paymentDates");
         var _notionals        = XU.GetDouble1D(notionals, "notionals");
         var _rates            = XU.GetDouble1D(rates, "rates");
         var _accrualFractions = XU.GetDouble1D(accrualFractions, "accrualFractions");
         var _result           = XLRates.CreateFixedLeg(_currency, _paymentDates, _notionals, _rates, _accrualFractions);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Esempio n. 10
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));
     }
 }
Esempio n. 11
0
 public static object _CreateLoanFloatingRate(string objectName,
                                              object[,] currency,
                                              object[,] balanceDates,
                                              object[,] balanceAmounts,
                                              object[,] floatingIndex,
                                              object[,] floatingSpread)
 {
     try
     {
         var _currency       = XU.GetSpecialType0D <Currency>(currency, "currency");
         var _balanceDates   = XU.GetDate1D(balanceDates, "balanceDates");
         var _balanceAmounts = XU.GetDouble1D(balanceAmounts, "balanceAmounts");
         var _floatingIndex  = XU.GetSpecialType0D <FloatingIndex>(floatingIndex, "floatingIndex");
         var _floatingSpread = XU.GetDouble0D(floatingSpread, "floatingSpread");
         var _result         = XLRates.CreateLoanFloatingRate(_currency, _balanceDates, _balanceAmounts, _floatingIndex,
                                                              _floatingSpread);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }