Exemplo n.º 1
0
 public static object _CreateMultiHWAndFXToy(string objectName,
                                             object[,] anchorDate,
                                             object[,] numeraireCcy,
                                             object[,] rateSimulators,
                                             object[,] currencies,
                                             object[,] spots,
                                             object[,] vols,
                                             object[,] correlations)
 {
     try
     {
         var _anchorDate     = XU.GetDate0D(anchorDate, "anchorDate");
         var _numeraireCcy   = XU.GetSpecialType0D <Currency>(numeraireCcy, "numeraireCcy");
         var _rateSimulators = XU.GetObject1D <HullWhite1F>(rateSimulators, "rateSimulators");
         var _currencies     = XU.GetSpecialType1D <Currency>(currencies, "currencies");
         var _spots          = XU.GetDouble1D(spots, "spots");
         var _vols           = XU.GetDouble1D(vols, "vols");
         var _correlations   = XU.GetDouble2D(correlations, "correlations");
         var _result         = XLFX.CreateMultiHWAndFXToy(_anchorDate, _numeraireCcy, _rateSimulators, _currencies,
                                                          _spots, _vols, _correlations);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 2
0
 public static object _CreateEquityModel(string objectName,
                                         object[,] discountCurve,
                                         object[,] shares,
                                         object[,] spotPrices,
                                         object[,] volatilities,
                                         object[,] divYields,
                                         object[,] correlations,
                                         object[,] rateForecastCurves)
 {
     try
     {
         var _discountCurve      = XU.GetObject0D <IDiscountingSource>(discountCurve, "discountCurve");
         var _shares             = XU.GetSpecialType1D <Share>(shares, "shares");
         var _spotPrices         = XU.GetDouble1D(spotPrices, "spotPrices");
         var _volatilities       = XU.GetDouble1D(volatilities, "volatilities");
         var _divYields          = XU.GetDouble1D(divYields, "divYields");
         var _correlations       = XU.GetDouble2D(correlations, "correlations");
         var _rateForecastCurves = XU.GetObject1D <IFloatingRateSource>(rateForecastCurves, "rateForecastCurves");
         var _result             = XLEquities.CreateEquityModel(_discountCurve, _shares, _spotPrices, _volatilities,
                                                                _divYields, _correlations, _rateForecastCurves);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 3
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));
     }
 }
Exemplo n.º 4
0
 public static object _CreateZARBermudanSwaption(string objectName,
                                                 object[,] exerciseDates,
                                                 object[,] longOptionality,
                                                 object[,] startDate,
                                                 object[,] tenor,
                                                 object[,] rate,
                                                 object[,] payFixed,
                                                 object[,] notional)
 {
     try
     {
         var _exerciseDates   = XU.GetDate1D(exerciseDates, "exerciseDates");
         var _longOptionality = XU.GetBoolean0D(longOptionality, "longOptionality");
         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.CreateZARBermudanSwaption(_exerciseDates, _longOptionality, _startDate, _tenor,
                                                                  _rate, _payFixed, _notional);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 5
0
 public static object _CreateFloatLeg(string objectName,
                                      object[,] currency,
                                      object[,] floatingIndex,
                                      object[,] resetDates,
                                      object[,] paymentDates,
                                      object[,] notionals,
                                      object[,] spreads,
                                      object[,] accrualFractions)
 {
     try
     {
         var _currency         = XU.GetSpecialType0D <Currency>(currency, "currency");
         var _floatingIndex    = XU.GetSpecialType0D <FloatingIndex>(floatingIndex, "floatingIndex");
         var _resetDates       = XU.GetDate1D(resetDates, "resetDates");
         var _paymentDates     = XU.GetDate1D(paymentDates, "paymentDates");
         var _notionals        = XU.GetDouble1D(notionals, "notionals");
         var _spreads          = XU.GetDouble1D(spreads, "spreads");
         var _accrualFractions = XU.GetDouble1D(accrualFractions, "accrualFractions");
         var _result           = XLRates.CreateFloatLeg(_currency, _floatingIndex, _resetDates, _paymentDates, _notionals,
                                                        _spreads, _accrualFractions);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 6
0
 public static object _CreateCDS(string objectName,
                                 object[,] refEntity,
                                 object[,] ccy,
                                 object[,] paymentDates,
                                 object[,] notionals,
                                 object[,] rates,
                                 object[,] accrualFractions,
                                 object[,] boughtProtection)
 {
     try
     {
         var _refEntity        = XU.GetSpecialType0D <ReferenceEntity>(refEntity, "refEntity");
         var _ccy              = XU.GetSpecialType0D <Currency>(ccy, "ccy");
         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 _boughtProtection = XU.GetBoolean0D(boughtProtection, "boughtProtection");
         var _result           = XLCredit.CreateCDS(_refEntity, _ccy, _paymentDates, _notionals, _rates, _accrualFractions,
                                                    _boughtProtection);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 7
0
 public static object _CreateModelDeterministicCreditWithFXJump(string objectName,
                                                                object[,] survivalProbSource,
                                                                object[,] otherCurrency,
                                                                object[,] fxSource,
                                                                object[,] valueCurrencyDiscount,
                                                                object[,] fxVol,
                                                                object[,] relJumpSizeInDefault,
                                                                object[,] expectedRecoveryRate)
 {
     try
     {
         var _survivalProbSource =
             XU.GetObject0D <ISurvivalProbabilitySource>(survivalProbSource, "survivalProbSource");
         var _otherCurrency         = XU.GetSpecialType0D <Currency>(otherCurrency, "otherCurrency");
         var _fxSource              = XU.GetObject0D <IFXSource>(fxSource, "fxSource");
         var _valueCurrencyDiscount =
             XU.GetObject0D <IDiscountingSource>(valueCurrencyDiscount, "valueCurrencyDiscount");
         var _fxVol = XU.GetDouble0D(fxVol, "fxVol");
         var _relJumpSizeInDefault = XU.GetDouble0D(relJumpSizeInDefault, "relJumpSizeInDefault");
         var _expectedRecoveryRate = XU.GetDouble0D(expectedRecoveryRate, "expectedRecoveryRate");
         var _result = XLCredit.CreateModelDeterministicCreditWithFXJump(_survivalProbSource, _otherCurrency,
                                                                         _fxSource, _valueCurrencyDiscount, _fxVol, _relJumpSizeInDefault, _expectedRecoveryRate);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 8
0
 public static object _CreateFXForecastCurve(string objectName,
                                             object[,] baseCurrency,
                                             object[,] counterCurrency,
                                             object[,] fxRateAtAnchorDate,
                                             object[,] baseCurrencyFXBasisCurve,
                                             object[,] counterCurrencyFXBasisCurve)
 {
     try
     {
         var _baseCurrency             = XU.GetSpecialType0D <Currency>(baseCurrency, "baseCurrency");
         var _counterCurrency          = XU.GetSpecialType0D <Currency>(counterCurrency, "counterCurrency");
         var _fxRateAtAnchorDate       = XU.GetDouble0D(fxRateAtAnchorDate, "fxRateAtAnchorDate");
         var _baseCurrencyFXBasisCurve =
             XU.GetObject0D <IDiscountingSource>(baseCurrencyFXBasisCurve, "baseCurrencyFXBasisCurve");
         var _counterCurrencyFXBasisCurve =
             XU.GetObject0D <IDiscountingSource>(counterCurrencyFXBasisCurve, "counterCurrencyFXBasisCurve");
         var _result = XLFX.CreateFXForecastCurve(_baseCurrency, _counterCurrency, _fxRateAtAnchorDate,
                                                  _baseCurrencyFXBasisCurve, _counterCurrencyFXBasisCurve);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
 public static object _CreatePCACurveSimulator(string objectName,
                                               object[,] anchorDate,
                                               object[,] initialRates,
                                               object[,] tenors,
                                               object[,] components,
                                               object[,] vols,
                                               object[,] multiplier,
                                               object[,] useRelative,
                                               object[,] floorAtZero)
 {
     try
     {
         Date     _anchorDate   = XU.GetDate0D(anchorDate, "anchorDate");
         Double[] _initialRates = XU.GetDouble1D(initialRates, "initialRates");
         Tenor[]  _tenors       = XU.GetTenor1D(tenors, "tenors");
         Double[,] _components = XU.GetDouble2D(components, "components");
         Double[] _vols        = XU.GetDouble1D(vols, "vols");
         Double   _multiplier  = XU.GetDouble0D(multiplier, "multiplier");
         Boolean  _useRelative = XU.GetBoolean0D(useRelative, "useRelative");
         Boolean  _floorAtZero = XU.GetBoolean0D(floorAtZero, "floorAtZero");
         Object   _result      = XLCurves.CreatePCACurveSimulator(_anchorDate, _initialRates, _tenors, _components, _vols, _multiplier, _useRelative, _floorAtZero);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 10
0
 public static object CreateProductFromFile([ExcelArgument(Description = "Name of product")] string name,
                                            [ExcelArgument(Description = "Full path to the file.")] string filename)
 {
     try
     {
         Product runtimeProduct = RuntimeProduct.CreateFromScript(filename);
         return(XU.AddObject(name, runtimeProduct));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 11
0
 public static object _CreateBusiness252DayCount(string objectName,
                                                 object[,] calendar)
 {
     try
     {
         var _calendar = XU.GetSpecialType0D <Calendar>(calendar, "calendar");
         var _result   = XLConventions.CreateBusiness252DayCount(_calendar);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 12
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));
     }
 }
Exemplo n.º 13
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));
     }
 }
Exemplo n.º 14
0
 public static object _FitCurveNelsonSiegel(string objectName,
                                            object[,] anchorDate,
                                            object[,] dates,
                                            object[,] rates)
 {
     try
     {
         Date     _anchorDate = XU.GetDate0D(anchorDate, "anchorDate");
         Date[]   _dates      = XU.GetDate1D(dates, "dates");
         Double[] _rates      = XU.GetDouble1D(rates, "rates");
         ICurve   _result     = XLCurves.FitCurveNelsonSiegel(_anchorDate, _dates, _rates);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 15
0
 public static object _CreateEquityCall(string objectName,
                                        object[,] share,
                                        object[,] exerciseDate,
                                        object[,] strike)
 {
     try
     {
         var _share        = XU.GetSpecialType0D <Share>(share, "share");
         var _exerciseDate = XU.GetDate0D(exerciseDate, "exerciseDate");
         var _strike       = XU.GetDouble0D(strike, "strike");
         var _result       = XLEquities.CreateEquityCall(_share, _exerciseDate, _strike);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 16
0
 public static object _CreateDatesAndRatesCurve(string objectName,
                                                object[,] dates,
                                                object[,] rates,
                                                object[,] currency)
 {
     try
     {
         Date[]             _dates    = XU.GetDate1D(dates, "dates");
         Double[]           _rates    = XU.GetDouble1D(rates, "rates");
         Currency           _currency = XU.GetCurrency0D(currency, "currency", Currency.ANY);
         IDiscountingSource _result   = XLCurves.CreateDatesAndRatesCurve(_dates, _rates, _currency);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 17
0
 public static object _CreateDatesAndRatesCurve(string objectName,
                                                object[,] dates,
                                                object[,] rates,
                                                object[,] currency)
 {
     try
     {
         var _dates    = XU.GetDate1D(dates, "dates");
         var _rates    = XU.GetDouble1D(rates, "rates");
         var _currency = XU.GetSpecialType0D(currency, "currency", Currency.ANY);
         var _result   = XLCurves.CreateDatesAndRatesCurve(_dates, _rates, _currency);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 18
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));
     }
 }
Exemplo n.º 19
0
 public static object _CreateCurveModel(string objectName,
                                        object[,] discountCurve,
                                        object[,] rateForecastCurves,
                                        object[,] fxForecastCurves)
 {
     try
     {
         IDiscountingSource    _discountCurve      = XU.GetObject0D <IDiscountingSource>(discountCurve, "discountCurve");
         IFloatingRateSource[] _rateForecastCurves = XU.GetObject1D <IFloatingRateSource>(rateForecastCurves, "rateForecastCurves");
         IFXSource[]           _fxForecastCurves   = XU.GetObject1D <IFXSource>(fxForecastCurves, "fxForecastCurves");
         NumeraireSimulator    _result             = XLValuation.CreateCurveModel(_discountCurve, _rateForecastCurves, _fxForecastCurves);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 20
0
 public static object _CreateHazardCurve(string objectName,
                                         object[,] referenceEntity,
                                         object[,] anchorDate,
                                         object[,] dates,
                                         object[,] hazardRates)
 {
     try
     {
         var _referenceEntity = XU.GetSpecialType0D <ReferenceEntity>(referenceEntity, "referenceEntity");
         var _anchorDate      = XU.GetDate0D(anchorDate, "anchorDate");
         var _dates           = XU.GetDate1D(dates, "dates");
         var _hazardRates     = XU.GetDouble1D(hazardRates, "hazardRates");
         var _result          = XLCredit.CreateHazardCurve(_referenceEntity, _anchorDate, _dates, _hazardRates);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 21
0
 public static object _Value(string objectName,
                             object[,] products,
                             object[,] valueDate,
                             object[,] model,
                             object[,] nSims)
 {
     try
     {
         Product[]          _products  = XU.GetObject1D <Product>(products, "products");
         Date               _valueDate = XU.GetDate0D(valueDate, "valueDate");
         NumeraireSimulator _model     = XU.GetObject0D <NumeraireSimulator>(model, "model");
         Int32              _nSims     = XU.GetInt320D(nSims, "nSims", 1);
         ResultStore        _result    = XLValuation.Value(_products, _valueDate, _model, _nSims);
         return(XU.AddObject(objectName, _result));
     }
     catch (Exception e)
     {
         return(XU.Error0D(e));
     }
 }
Exemplo n.º 22
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));
     }
 }
Exemplo n.º 23
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));
     }
 }
Exemplo n.º 24
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));
     }
 }
Exemplo n.º 25
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));
     }
 }
Exemplo n.º 26
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));
     }
 }
Exemplo n.º 27
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));
     }
 }
Exemplo n.º 28
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));
     }
 }