Beispiel #1
0
 public Libor(string familyName, Period tenor, uint settlementDays, Currency currency, Calendar financialCenterCalendar, DayCounter dayCounter, YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_Libor__SWIG_0(familyName, Period.getCPtr(tenor), settlementDays, Currency.getCPtr(currency), Calendar.getCPtr(financialCenterCalendar), DayCounter.getCPtr(dayCounter), YieldTermStructureHandle.getCPtr(h)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #2
0
 public SwaptionHelper(Period maturity, Period length, QuoteHandle volatility, IborIndex index, Period fixedLegTenor, DayCounter fixedLegDayCounter, DayCounter floatingLegDayCounter, YieldTermStructureHandle termStructure) : this(NQuantLibcPINVOKE.new_SwaptionHelper__SWIG_1(Period.getCPtr(maturity), Period.getCPtr(length), QuoteHandle.getCPtr(volatility), IborIndex.getCPtr(index), Period.getCPtr(fixedLegTenor), DayCounter.getCPtr(fixedLegDayCounter), DayCounter.getCPtr(floatingLegDayCounter), YieldTermStructureHandle.getCPtr(termStructure)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #3
0
 public EuriborSwapIsdaFixB(Period tenor, YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_EuriborSwapIsdaFixB__SWIG_0(Period.getCPtr(tenor), YieldTermStructureHandle.getCPtr(h)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #4
0
 public HestonProcess(YieldTermStructureHandle riskFreeTS, YieldTermStructureHandle dividendTS, QuoteHandle s0, double v0, double kappa, double theta, double sigma, double rho) : this(NQuantLibcPINVOKE.new_HestonProcess(YieldTermStructureHandle.getCPtr(riskFreeTS), YieldTermStructureHandle.getCPtr(dividendTS), QuoteHandle.getCPtr(s0), v0, kappa, theta, sigma, rho), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #5
0
 public TreeSwaptionEngine(ShortRateModel model, TimeGrid grid, YieldTermStructureHandle termStructure) : this(NQuantLibcPINVOKE.new_TreeSwaptionEngine__SWIG_2(ShortRateModel.getCPtr(model), TimeGrid.getCPtr(grid), YieldTermStructureHandle.getCPtr(termStructure)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #6
0
 public HestonModelHelper(Period maturity, Calendar calendar, double s0, double strikePrice, QuoteHandle volatility, YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield) : this(NQuantLibcPINVOKE.new_HestonModelHelper__SWIG_1(Period.getCPtr(maturity), Calendar.getCPtr(calendar), s0, strikePrice, QuoteHandle.getCPtr(volatility), YieldTermStructureHandle.getCPtr(riskFreeRate), YieldTermStructureHandle.getCPtr(dividendYield)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #7
0
 public SpreadCdsHelper(double spread, Period tenor, int settlementDays, Calendar calendar, Frequency frequency, BusinessDayConvention convention, DateGeneration.Rule rule, DayCounter dayCounter, double recoveryRate, YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_SpreadCdsHelper__SWIG_5(spread, Period.getCPtr(tenor), settlementDays, Calendar.getCPtr(calendar), (int)frequency, (int)convention, (int)rule, DayCounter.getCPtr(dayCounter), recoveryRate, YieldTermStructureHandle.getCPtr(discountCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #8
0
 public LinearTsrPricer(SwaptionVolatilityStructureHandle swaptionVol, QuoteHandle meanReversion, YieldTermStructureHandle couponDiscountCurve) : this(NQuantLibcPINVOKE.new_LinearTsrPricer__SWIG_1(SwaptionVolatilityStructureHandle.getCPtr(swaptionVol), QuoteHandle.getCPtr(meanReversion), YieldTermStructureHandle.getCPtr(couponDiscountCurve)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public Bbsw5M(YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_Bbsw5M__SWIG_0(YieldTermStructureHandle.getCPtr(h)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
        public double impliedVolatility(double price, YieldTermStructureHandle discountCurve, double guess, double accuracy, uint maxEvaluations, double minVol)
        {
            double ret = NQuantLibcPINVOKE.Swaption_impliedVolatility__SWIG_3(swigCPtr, price, YieldTermStructureHandle.getCPtr(discountCurve), guess, accuracy, maxEvaluations, minVol);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public double impliedVolatility(double price, YieldTermStructureHandle discountCurve, double guess)
        {
            double ret = NQuantLibcPINVOKE.Swaption_impliedVolatility__SWIG_6(swigCPtr, price, YieldTermStructureHandle.getCPtr(discountCurve), guess);

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Beispiel #12
0
 public HestonProcess(YieldTermStructureHandle riskFreeTS, YieldTermStructureHandle dividendTS, QuoteHandle s0, double v0, double kappa, double theta, double sigma, double rho) : this(NQuantLibcPINVOKE.new_HestonProcess(YieldTermStructureHandle.getCPtr(riskFreeTS), YieldTermStructureHandle.getCPtr(dividendTS), QuoteHandle.getCPtr(s0), v0, kappa, theta, sigma, rho), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #13
0
 public SpreadCdsHelper(double spread, Period tenor, int settlementDays, Calendar calendar, Frequency frequency, BusinessDayConvention convention, DateGeneration.Rule rule, DayCounter dayCounter, double recoveryRate, YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_SpreadCdsHelper__SWIG_5(spread, Period.getCPtr(tenor), settlementDays, Calendar.getCPtr(calendar), (int)frequency, (int)convention, (int)rule, DayCounter.getCPtr(dayCounter), recoveryRate, YieldTermStructureHandle.getCPtr(discountCurve)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #14
0
 public SwapIndex(string familyName, Period tenor, int settlementDays, Currency currency, Calendar calendar, Period fixedLegTenor, BusinessDayConvention fixedLegConvention, DayCounter fixedLegDayCounter, IborIndex iborIndex, YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_SwapIndex__SWIG_1(familyName, Period.getCPtr(tenor), settlementDays, Currency.getCPtr(currency), Calendar.getCPtr(calendar), Period.getCPtr(fixedLegTenor), (int)fixedLegConvention, DayCounter.getCPtr(fixedLegDayCounter), IborIndex.getCPtr(iborIndex), YieldTermStructureHandle.getCPtr(discountCurve)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #15
0
 public double impliedHazardRate(double targetNPV, YieldTermStructureHandle discountCurve, DayCounter dayCounter) {
   double ret = NQuantLibcPINVOKE.CreditDefaultSwap_impliedHazardRate__SWIG_2(swigCPtr, targetNPV, YieldTermStructureHandle.getCPtr(discountCurve), DayCounter.getCPtr(dayCounter));
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Beispiel #16
0
 public Gsr(YieldTermStructureHandle termStructure, DateVector volstepdates, QuoteHandleVector volatilities, QuoteHandleVector reversions) : this(NQuantLibcPINVOKE.new_Gsr__SWIG_1(YieldTermStructureHandle.getCPtr(termStructure), DateVector.getCPtr(volstepdates), QuoteHandleVector.getCPtr(volatilities), QuoteHandleVector.getCPtr(reversions)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #17
0
 public ImpliedTermStructure(YieldTermStructureHandle curveHandle, Date referenceDate) : this(NQuantLibcPINVOKE.new_ImpliedTermStructure(YieldTermStructureHandle.getCPtr(curveHandle), Date.getCPtr(referenceDate)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #18
0
        static void Main(string[] args)
        {
            DateTime startTime = DateTime.Now;

            Option.Type optionType      = Option.Type.Put;
            double      underlyingPrice = 36;
            double      strikePrice     = 40;
            double      dividendYield   = 0.0;
            double      riskFreeRate    = 0.06;
            double      volatility      = 0.2;

            Date todaysDate = new Date(15, Month.May, 1998);

            Settings.instance().setEvaluationDate(todaysDate);

            Date settlementDate = new Date(17, Month.May, 1998);
            Date maturityDate   = new Date(17, Month.May, 1999);

            Calendar calendar = new TARGET();

            DateVector exerciseDates = new DateVector(4);

            for (int i = 1; i <= 4; i++)
            {
                Period forwardPeriod = new Period(3 * i, TimeUnit.Months);
                Date   forwardDate   = settlementDate.Add(forwardPeriod);
                exerciseDates.Add(forwardDate);
            }

            EuropeanExercise europeanExercise =
                new EuropeanExercise(maturityDate);
            BermudanExercise bermudanExercise =
                new BermudanExercise(exerciseDates);
            AmericanExercise americanExercise =
                new AmericanExercise(settlementDate, maturityDate);

            // bootstrap the yield/dividend/vol curves and create a
            // BlackScholesMerton stochastic process
            DayCounter dayCounter = new Actual365Fixed();
            YieldTermStructureHandle flatRateTSH =
                new YieldTermStructureHandle(
                    new FlatForward(settlementDate, riskFreeRate,
                                    dayCounter));
            YieldTermStructureHandle flatDividendTSH =
                new YieldTermStructureHandle(
                    new FlatForward(settlementDate, dividendYield,
                                    dayCounter));
            BlackVolTermStructureHandle flatVolTSH =
                new BlackVolTermStructureHandle(
                    new BlackConstantVol(settlementDate, calendar,
                                         volatility, dayCounter));

            QuoteHandle underlyingQuoteH =
                new QuoteHandle(new SimpleQuote(underlyingPrice));
            BlackScholesMertonProcess stochasticProcess =
                new BlackScholesMertonProcess(underlyingQuoteH,
                                              flatDividendTSH,
                                              flatRateTSH,
                                              flatVolTSH);

            PlainVanillaPayoff payoff =
                new PlainVanillaPayoff(optionType, strikePrice);

            // options
            VanillaOption europeanOption =
                new VanillaOption(payoff, europeanExercise);
            VanillaOption bermudanOption =
                new VanillaOption(payoff, bermudanExercise);
            VanillaOption americanOption =
                new VanillaOption(payoff, americanExercise);

            // report the parameters we are using
            ReportParameters(optionType, underlyingPrice, strikePrice,
                             dividendYield, riskFreeRate,
                             volatility, maturityDate);

            // write out the column headings
            ReportHeadings();

            #region Analytic Formulas

            // Black-Scholes for European
            try {
                europeanOption.setPricingEngine(
                    new AnalyticEuropeanEngine(stochasticProcess));
                ReportResults("Black-Scholes",
                              europeanOption.NPV(), null, null);
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Barone-Adesi and Whaley approximation for American
            try {
                americanOption.setPricingEngine(
                    new BaroneAdesiWhaleyEngine(stochasticProcess));
                ReportResults("Barone-Adesi/Whaley",
                              null, null, americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Bjerksund and Stensland approximation for American
            try {
                americanOption.setPricingEngine(
                    new BjerksundStenslandEngine(stochasticProcess));
                ReportResults("Bjerksund/Stensland",
                              null, null, americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Integral
            try {
                europeanOption.setPricingEngine(
                    new IntegralEngine(stochasticProcess));
                ReportResults("Integral",
                              europeanOption.NPV(), null, null);
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            uint timeSteps = 801;

            // Finite differences
            try {
                europeanOption.setPricingEngine(
                    new FdBlackScholesVanillaEngine(stochasticProcess,
                                                    timeSteps, timeSteps - 1));
                bermudanOption.setPricingEngine(
                    new FdBlackScholesVanillaEngine(stochasticProcess,
                                                    timeSteps, timeSteps - 1));
                americanOption.setPricingEngine(
                    new FdBlackScholesVanillaEngine(stochasticProcess,
                                                    timeSteps, timeSteps - 1));
                ReportResults("Finite differences",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            //Variance Gamma
            try
            {
                VarianceGammaProcess vgProcess = new VarianceGammaProcess(underlyingQuoteH,
                                                                          flatDividendTSH,
                                                                          flatRateTSH,
                                                                          volatility, 0.01, 0.0
                                                                          );
                europeanOption.setPricingEngine(
                    new VarianceGammaEngine(vgProcess));
                ReportResults("Variance-Gamma",
                              europeanOption.NPV(), null, null);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            #endregion Analytic Formulas

            #region Binomial Methods

            // Binomial Jarrow-Rudd
            try {
                europeanOption.setPricingEngine(
                    new BinomialJRVanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialJRVanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialJRVanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Binomial Jarrow-Rudd",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Binomial Cox-Ross-Rubinstein
            try {
                europeanOption.setPricingEngine(
                    new BinomialCRRVanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialCRRVanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialCRRVanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Binomial Cox-Ross-Rubinstein",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Additive Equiprobabilities
            try {
                europeanOption.setPricingEngine(
                    new BinomialEQPVanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialEQPVanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialEQPVanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Additive Equiprobabilities",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Binomial Trigeorgis
            try {
                europeanOption.setPricingEngine(
                    new BinomialTrigeorgisVanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialTrigeorgisVanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialTrigeorgisVanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Binomial Trigeorgis",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Binomial Tian
            try {
                europeanOption.setPricingEngine(
                    new BinomialTianVanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialTianVanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialTianVanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Binomial Tian",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Binomial Leisen-Reimer
            try {
                europeanOption.setPricingEngine(
                    new BinomialLRVanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialLRVanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialLRVanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Binomial Leisen-Reimer",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // Binomial Joshi
            try {
                europeanOption.setPricingEngine(
                    new BinomialJ4VanillaEngine(stochasticProcess, timeSteps));
                bermudanOption.setPricingEngine(
                    new BinomialJ4VanillaEngine(stochasticProcess, timeSteps));
                americanOption.setPricingEngine(
                    new BinomialJ4VanillaEngine(stochasticProcess, timeSteps));
                ReportResults("Binomial Joshi",
                              europeanOption.NPV(),
                              bermudanOption.NPV(),
                              americanOption.NPV());
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            #endregion Binomial Methods

            #region Monte Carlo Methods

            // quantlib appears to use max numeric (int and real) values to test for 'null' (or rather 'default') values

            // MC (crude)
            try {
                int    mcTimeSteps       = 1;
                int    timeStepsPerYear  = int.MaxValue;
                bool   brownianBridge    = false;
                bool   antitheticVariate = false;
                int    requiredSamples   = int.MaxValue;
                double requiredTolerance = 0.02;
                int    maxSamples        = int.MaxValue;
                int    seed = 42;
                europeanOption.setPricingEngine(
                    new MCPREuropeanEngine(stochasticProcess,
                                           mcTimeSteps,
                                           timeStepsPerYear,
                                           brownianBridge,
                                           antitheticVariate,
                                           requiredSamples,
                                           requiredTolerance,
                                           maxSamples, seed));
                ReportResults("MC (crude)", europeanOption.NPV(), null, null);
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            // MC (Sobol)
            try {
                int    mcTimeSteps       = 1;
                int    timeStepsPerYear  = int.MaxValue;
                bool   brownianBridge    = false;
                bool   antitheticVariate = false;
                int    requiredSamples   = 32768; // 2^15
                double requiredTolerance = double.MaxValue;
                int    maxSamples        = int.MaxValue;
                int    seed = 0;
                europeanOption.setPricingEngine(
                    new MCLDEuropeanEngine(stochasticProcess,
                                           mcTimeSteps,
                                           timeStepsPerYear,
                                           brownianBridge,
                                           antitheticVariate,
                                           requiredSamples,
                                           requiredTolerance,
                                           maxSamples, seed));
                ReportResults("MC (Sobol)", europeanOption.NPV(), null, null);
            }
            catch (Exception e) {
                Console.WriteLine(e.ToString());
            }

            #endregion Monte Carlo Methods

            DateTime endTime = DateTime.Now;
            TimeSpan delta   = endTime - startTime;
            Console.WriteLine();
            Console.WriteLine("Run completed in {0} s", delta.TotalSeconds);
            Console.WriteLine();
        }
Beispiel #19
0
 public BlackKarasinski(YieldTermStructureHandle termStructure) : this(NQuantLibcPINVOKE.new_BlackKarasinski__SWIG_2(YieldTermStructureHandle.getCPtr(termStructure)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public HestonModelHelper(Period maturity, Calendar calendar, double s0, double strikePrice, QuoteHandle volatility, YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield) : this(NQuantLibcPINVOKE.new_HestonModelHelper__SWIG_1(Period.getCPtr(maturity), Calendar.getCPtr(calendar), s0, strikePrice, QuoteHandle.getCPtr(volatility), YieldTermStructureHandle.getCPtr(riskFreeRate), YieldTermStructureHandle.getCPtr(dividendYield)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #21
0
 public double impliedVolatility(double price, YieldTermStructureHandle curve, double guess) {
   double ret = NQuantLibcPINVOKE.CapFloor_impliedVolatility__SWIG_4(swigCPtr, price, YieldTermStructureHandle.getCPtr(curve), guess);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Beispiel #22
0
 public OvernightIndex(string familyName, int settlementDays, Currency currency, Calendar calendar, DayCounter dayCounter, YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_OvernightIndex__SWIG_0(familyName, settlementDays, Currency.getCPtr(currency), Calendar.getCPtr(calendar), DayCounter.getCPtr(dayCounter), YieldTermStructureHandle.getCPtr(h)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #23
0
 public PiecewiseZeroInflation(Date referenceDate, Calendar calendar, DayCounter dayCounter, Period lag, Frequency frequency, bool indexIsInterpolated, double baseRate, YieldTermStructureHandle nominalTS, ZeroHelperVector instruments) : this(NQuantLibcPINVOKE.new_PiecewiseZeroInflation__SWIG_2(Date.getCPtr(referenceDate), Calendar.getCPtr(calendar), DayCounter.getCPtr(dayCounter), Period.getCPtr(lag), (int)frequency, indexIsInterpolated, baseRate, YieldTermStructureHandle.getCPtr(nominalTS), ZeroHelperVector.getCPtr(instruments)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public SpreadedLinearZeroInterpolatedTermStructure(YieldTermStructureHandle curveHandle, QuoteHandleVector spreadHandles, DateVector dates) : this(NQuantLibcPINVOKE.new_SpreadedLinearZeroInterpolatedTermStructure(YieldTermStructureHandle.getCPtr(curveHandle), QuoteHandleVector.getCPtr(spreadHandles), DateVector.getCPtr(dates)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #25
0
 public IborIndex(string familyName, Period tenor, int settlementDays, Currency currency, Calendar calendar, BusinessDayConvention convention, bool endOfMonth, DayCounter dayCounter, YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_IborIndex__SWIG_0(familyName, Period.getCPtr(tenor), settlementDays, Currency.getCPtr(currency), Calendar.getCPtr(calendar), (int)convention, endOfMonth, DayCounter.getCPtr(dayCounter), YieldTermStructureHandle.getCPtr(h)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public ZeroSpreadedTermStructure(YieldTermStructureHandle curveHandle, QuoteHandle spreadHandle) : this(NQuantLibcPINVOKE.new_ZeroSpreadedTermStructure(YieldTermStructureHandle.getCPtr(curveHandle), QuoteHandle.getCPtr(spreadHandle)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #27
0
 public DiscountingSwapEngine(YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_DiscountingSwapEngine__SWIG_2(YieldTermStructureHandle.getCPtr(discountCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
        public double impliedHazardRate(double targetNPV, YieldTermStructureHandle discountCurve, DayCounter dayCounter)
        {
            double ret = NQuantLibcPINVOKE.CreditDefaultSwap_impliedHazardRate__SWIG_2(swigCPtr, targetNPV, YieldTermStructureHandle.getCPtr(discountCurve), DayCounter.getCPtr(dayCounter));

            if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
            {
                throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Beispiel #29
0
 public SwapRateHelper(double rate, SwapIndex index, QuoteHandle spread, Period fwdStart, YieldTermStructureHandle discountingCurve) : this(NQuantLibcPINVOKE.new_SwapRateHelper__SWIG_12(rate, SwapIndex.getCPtr(index), QuoteHandle.getCPtr(spread), Period.getCPtr(fwdStart), YieldTermStructureHandle.getCPtr(discountingCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public EnergyBasisSwapExt(CommodityIndexExt payIndex, CommodityIndexExt receiveIndex, PricingPeriodExts PricingPeriodExts, string commodityName, YieldTermStructureHandle payLegTermStructure, YieldTermStructureHandle receiveLegTermStructure) : this(NQuantLibcPINVOKE.new_EnergyBasisSwapExt__SWIG_2(CommodityIndexExt.getCPtr(payIndex), CommodityIndexExt.getCPtr(receiveIndex), PricingPeriodExts.getCPtr(PricingPeriodExts), commodityName, YieldTermStructureHandle.getCPtr(payLegTermStructure), YieldTermStructureHandle.getCPtr(receiveLegTermStructure)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #31
0
 public static double npv(Leg leg, YieldTermStructureHandle discountCurve, bool includeSettlementDateFlows) {
   double ret = NQuantLibcPINVOKE.CashFlows_npv__SWIG_5(Leg.getCPtr(leg), YieldTermStructureHandle.getCPtr(discountCurve), includeSettlementDateFlows);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Beispiel #32
0
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve, bool telescopicValueDates, uint paymentLag, BusinessDayConvention paymentConvention, Frequency paymentFrequency) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_3(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve), telescopicValueDates, paymentLag, (int)paymentConvention, (int)paymentFrequency), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #33
0
 public HullWhiteProcess(YieldTermStructureHandle riskFreeTS, double a, double sigma) : this(NQuantLibcPINVOKE.new_HullWhiteProcess(YieldTermStructureHandle.getCPtr(riskFreeTS), a, sigma), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #34
0
 public OISRateHelper(uint settlementDays, Period tenor, QuoteHandle rate, OvernightIndex index, YieldTermStructureHandle discountingCurve, bool telescopicValueDates) : this(NQuantLibcPINVOKE.new_OISRateHelper__SWIG_6(settlementDays, Period.getCPtr(tenor), QuoteHandle.getCPtr(rate), OvernightIndex.getCPtr(index), YieldTermStructureHandle.getCPtr(discountingCurve), telescopicValueDates), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #35
0
 public MidPointCdsEngine(DefaultProbabilityTermStructureHandle probability, double recoveryRate, YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_MidPointCdsEngine(DefaultProbabilityTermStructureHandle.getCPtr(probability), recoveryRate, YieldTermStructureHandle.getCPtr(discountCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #36
0
 public FdCEVVanillaEngine(double f0, double alpha, double beta, YieldTermStructureHandle rTS, uint tGrid, uint xGrid, uint dampingSteps, double scalingFactor) : this(NQuantLibcPINVOKE.new_FdCEVVanillaEngine__SWIG_2(f0, alpha, beta, YieldTermStructureHandle.getCPtr(rTS), tGrid, xGrid, dampingSteps, scalingFactor), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #37
0
 public BlackCapFloorEngine(YieldTermStructureHandle termStructure, OptionletVolatilityStructureHandle vol) : this(NQuantLibcPINVOKE.new_BlackCapFloorEngine__SWIG_1(YieldTermStructureHandle.getCPtr(termStructure), OptionletVolatilityStructureHandle.getCPtr(vol)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #38
0
 public FdCEVVanillaEngine(double f0, double alpha, double beta, YieldTermStructureHandle rTS) : this(NQuantLibcPINVOKE.new_FdCEVVanillaEngine__SWIG_6(f0, alpha, beta, YieldTermStructureHandle.getCPtr(rTS)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #39
0
 public HullWhite(YieldTermStructureHandle termStructure) : this(NQuantLibcPINVOKE.new_HullWhite__SWIG_2(YieldTermStructureHandle.getCPtr(termStructure)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #40
0
 public BatesProcess(YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield, QuoteHandle s0, double v0, double kappa, double theta, double sigma, double rho, double lambda, double nu, double delta) : this(NQuantLibcPINVOKE.new_BatesProcess(YieldTermStructureHandle.getCPtr(riskFreeRate), YieldTermStructureHandle.getCPtr(dividendYield), QuoteHandle.getCPtr(s0), v0, kappa, theta, sigma, rho, lambda, nu, delta), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #41
0
 public double impliedVolatility(double price, YieldTermStructureHandle curve, double guess, double accuracy, uint maxEvaluations, double minVol) {
   double ret = NQuantLibcPINVOKE.CapFloor_impliedVolatility__SWIG_1(swigCPtr, price, YieldTermStructureHandle.getCPtr(curve), guess, accuracy, maxEvaluations, minVol);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
 public EurLiborSwapIsdaFixB(Period tenor, YieldTermStructureHandle h1, YieldTermStructureHandle h2) : this(NQuantLibcPINVOKE.new_EurLiborSwapIsdaFixB__SWIG_2(Period.getCPtr(tenor), YieldTermStructureHandle.getCPtr(h1), YieldTermStructureHandle.getCPtr(h2)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #43
0
 public VarianceGammaProcess(QuoteHandle s0, YieldTermStructureHandle dividendYield, YieldTermStructureHandle riskFreeRate, double sigma, double nu, double theta) : this(NQuantLibcPINVOKE.new_VarianceGammaProcess(QuoteHandle.getCPtr(s0), YieldTermStructureHandle.getCPtr(dividendYield), YieldTermStructureHandle.getCPtr(riskFreeRate), sigma, nu, theta), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public PiecewiseYoYInflation(Date referenceDate, Calendar calendar, DayCounter dayCounter, Period lag, Frequency frequency, bool indexIsInterpolated, double baseRate, YieldTermStructureHandle nominalTS, YoYHelperVector instruments) : this(NQuantLibcPINVOKE.new_PiecewiseYoYInflation__SWIG_2(Date.getCPtr(referenceDate), Calendar.getCPtr(calendar), DayCounter.getCPtr(dayCounter), Period.getCPtr(lag), (int)frequency, indexIsInterpolated, baseRate, YieldTermStructureHandle.getCPtr(nominalTS), YoYHelperVector.getCPtr(instruments)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #45
0
 public YieldTermStructureHandle riskFreeRate() {
   YieldTermStructureHandle ret = new YieldTermStructureHandle(NQuantLibcPINVOKE.HestonProcess_riskFreeRate(swigCPtr), true);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Beispiel #46
0
 public Euribor365_3W(YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_Euribor365_3W__SWIG_0(YieldTermStructureHandle.getCPtr(h)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #47
0
 public IntegralCdsEngine(Period integrationStep, DefaultProbabilityTermStructureHandle probability, double recoveryRate, YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_IntegralCdsEngine__SWIG_1(Period.getCPtr(integrationStep), DefaultProbabilityTermStructureHandle.getCPtr(probability), recoveryRate, YieldTermStructureHandle.getCPtr(discountCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #48
0
 public Gaussian1dSwaptionEngine(Gaussian1dModel model, int integrationPoints, double stddevs, bool extrapolatePayoff, bool flatPayoffExtrapolation, YieldTermStructureHandle discountCurve) : this(NQuantLibcPINVOKE.new_Gaussian1dSwaptionEngine__SWIG_1(Gaussian1dModel.getCPtr(model), integrationPoints, stddevs, extrapolatePayoff, flatPayoffExtrapolation, YieldTermStructureHandle.getCPtr(discountCurve)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #49
0
 public TreeSwaptionEngine(ShortRateModelHandle model, uint timeSteps, YieldTermStructureHandle termStructure) : this(NQuantLibcPINVOKE.new_TreeSwaptionEngine__SWIG_4(ShortRateModelHandle.getCPtr(model), timeSteps, YieldTermStructureHandle.getCPtr(termStructure)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public GarmanKohlagenProcess(QuoteHandle s0, YieldTermStructureHandle foreignRiskFreeTS, YieldTermStructureHandle domesticRiskFreeTS, BlackVolTermStructureHandle volTS) : this(NQuantLibcPINVOKE.new_GarmanKohlagenProcess(QuoteHandle.getCPtr(s0), YieldTermStructureHandle.getCPtr(foreignRiskFreeTS), YieldTermStructureHandle.getCPtr(domesticRiskFreeTS), BlackVolTermStructureHandle.getCPtr(volTS)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #51
0
 public YieldTermStructureHandle forwardingTermStructure() {
   YieldTermStructureHandle ret = new YieldTermStructureHandle(NQuantLibcPINVOKE.IborIndex_forwardingTermStructure(swigCPtr), true);
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
 public G2(YieldTermStructureHandle termStructure, double a, double sigma, double b) : this(NQuantLibcPINVOKE.new_G2__SWIG_2(YieldTermStructureHandle.getCPtr(termStructure), a, sigma, b), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #53
0
 public BlackSwaptionEngine(YieldTermStructureHandle discountCurve, SwaptionVolatilityStructureHandle v) : this(NQuantLibcPINVOKE.new_BlackSwaptionEngine__SWIG_1(YieldTermStructureHandle.getCPtr(discountCurve), SwaptionVolatilityStructureHandle.getCPtr(v)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
 public G2(YieldTermStructureHandle termStructure) : this(NQuantLibcPINVOKE.new_G2__SWIG_5(YieldTermStructureHandle.getCPtr(termStructure)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #55
0
 public DiscountingSwapEngine(YieldTermStructureHandle discountCurve, bool includeSettlementDateFlows) : this(NQuantLibcPINVOKE.new_DiscountingSwapEngine__SWIG_5(YieldTermStructureHandle.getCPtr(discountCurve), includeSettlementDateFlows), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #56
0
 public Jibar(Period tenor, YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_Jibar__SWIG_0(Period.getCPtr(tenor), YieldTermStructureHandle.getCPtr(h)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #57
0
 public SwapRateHelper(double rate, Period tenor, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, IborIndex index, QuoteHandle spread, Period fwdStart, YieldTermStructureHandle discountingCurve) : this(NQuantLibcPINVOKE.new_SwapRateHelper__SWIG_4(rate, Period.getCPtr(tenor), Calendar.getCPtr(calendar), (int)fixedFrequency, (int)fixedConvention, DayCounter.getCPtr(fixedDayCount), IborIndex.getCPtr(index), QuoteHandle.getCPtr(spread), Period.getCPtr(fwdStart), YieldTermStructureHandle.getCPtr(discountingCurve)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #58
0
 public OvernightIndex(string familyName, int settlementDays, Currency currency, Calendar calendar, DayCounter dayCounter, YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_OvernightIndex__SWIG_0(familyName, settlementDays, Currency.getCPtr(currency), Calendar.getCPtr(calendar), DayCounter.getCPtr(dayCounter), YieldTermStructureHandle.getCPtr(h)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #59
0
 public Euribor365_9M(YieldTermStructureHandle h) : this(NQuantLibcPINVOKE.new_Euribor365_9M__SWIG_0(YieldTermStructureHandle.getCPtr(h)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
        public static object eqInstIROISSwap(
            [ExcelArgument(Description = "trade id ")] string tradeid,
            [ExcelArgument(Description = "payer/receiver (1/0) ")] bool ispayer,
            [ExcelArgument(Description = "notional ")] double notional,
            [ExcelArgument(Description = "fixed rate ")] double fixedRate,
            [ExcelArgument(Description = "start date ")] DateTime startdate,
            [ExcelArgument(Description = " (String) forward start month, e.g. 7D, 3M, 7Y ")] string Tenor,
            [ExcelArgument(Description = "id of overnight index ")] string indexid,
            [ExcelArgument(Description = "floating leg spread ")] double spread,
            [ExcelArgument(Description = "id of discount curve ")] string discountId,
            [ExcelArgument(Description = "trigger ")] object trigger)
        {
            if (ExcelUtil.CallFromWizard())
            {
                return("");
            }

            string callerAddress = "";

            callerAddress = ExcelUtil.getActiveCellAddress();

            try
            {
                Xl.Range rng = ExcelUtil.getActiveCellRange();

                // by default
                // endOfMonth_(1*Months<=swapTenor && swapTenor<=2*Years ? true : false),
                bool end_of_month             = true;
                EliteQuant.DayCounter fixeddc = new EliteQuant.Actual360();

                if (!indexid.Contains('@'))
                {
                    indexid = "IDX@" + indexid;
                }
                OvernightIndex idx = OHRepository.Instance.getObject <OvernightIndex>(indexid);
                if (!discountId.Contains('@'))
                {
                    discountId = "CRV@" + discountId;
                }
                YieldTermStructure       discountcurve = OHRepository.Instance.getObject <YieldTermStructure>(discountId);
                YieldTermStructureHandle dch           = new YieldTermStructureHandle(discountcurve);

                EliteQuant.Period tenor_ = EliteQuant.EQConverter.ConvertObject <EliteQuant.Period>(Tenor);
                EliteQuant.Date   sdate  = EliteQuant.EQConverter.ConvertObject <EliteQuant.Date>(startdate);
                EliteQuant.Date   fdate  = idx.fixingDate(sdate);
                EliteQuant.Date   tdate  = idx.fixingCalendar().advance(sdate, tenor_);

                // fixed leg 1 yr. Forward?
                Schedule fixedsch = new Schedule(sdate, tdate, new Period(1, TimeUnit.Years),
                                                 idx.fixingCalendar(), idx.businessDayConvention(), idx.businessDayConvention(),
                                                 DateGeneration.Rule.Forward, end_of_month);

                OvernightIndexedSwap swap = new OvernightIndexedSwap(ispayer ? _OvernightIndexedSwap.Type.Payer : _OvernightIndexedSwap.Type.Receiver,
                                                                     notional, fixedsch, fixedRate, fixeddc, idx, spread);

                DiscountingSwapEngine engine = new DiscountingSwapEngine(dch);
                swap.setPricingEngine(engine);

                Date refDate = discountcurve.referenceDate();

                // Store the futures and return its id
                string id = "SWP@" + tradeid;
                OHRepository.Instance.storeObject(id, swap, callerAddress);
                id += "#" + (String)DateTime.Now.ToString(@"HH:mm:ss");
                return(id);
            }
            catch (Exception e)
            {
                ExcelUtil.logError(callerAddress, System.Reflection.MethodInfo.GetCurrentMethod().Name.ToString(), e.Message);
                return("#EQ_ERR!");
            }
        }