public QuantoVanillaOption(Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_QuantoVanillaOption(Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public ContinuousAveragingAsianOption(Average.Type averageType, Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_ContinuousAveragingAsianOption((int)averageType, Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public DividendVanillaOption(Payoff payoff, Exercise exercise, DateVector dividendDates, DoubleVector dividends) : this(NQuantLibcPINVOKE.new_DividendVanillaOption(Payoff.getCPtr(payoff), Exercise.getCPtr(exercise), DateVector.getCPtr(dividendDates), DoubleVector.getCPtr(dividends)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public ForwardVanillaOption(double moneyness, Date resetDate, Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_ForwardVanillaOption(moneyness, Date.getCPtr(resetDate), Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public VanillaSwingOption(Payoff payoff, SwingExercise ex, uint minExerciseRights, uint maxExerciseRights) : this(NQuantLibcPINVOKE.new_VanillaSwingOption(Payoff.getCPtr(payoff), SwingExercise.getCPtr(ex), minExerciseRights, maxExerciseRights), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public BlackCalculator(Payoff payoff, double forward, double stdDev) : this(NQuantLibcPINVOKE.new_BlackCalculator__SWIG_1(Payoff.getCPtr(payoff), forward, stdDev), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public BrownianBridgePricer(Payoff payoff, Func <double> discounter, GBM stochasticDE, double step) : base(payoff, discounter) { price = sum = sum2 = 0.0; NSim = 0; rand = new Random(); dt = step; sde = stochasticDE; }
public AverageBasketPayoff(Payoff p, uint n) : this(NQuantLibcPINVOKE.new_AverageBasketPayoff__SWIG_1(Payoff.getCPtr(p), n), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
public AverageBasketPayoff(Payoff p, QlArray a) : this(NQuantLibcPINVOKE.new_AverageBasketPayoff__SWIG_0(Payoff.getCPtr(p), QlArray.getCPtr(a)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
//Smoothing as describe in Orc quant guide. private void Smooth(string str, ITree spotTree) { if (str != null) { double dt = spotTree.Tau / spotTree.Gridsteps; if ((str.ToLower() == "y") | (str.ToLower() == "yes")) { int centre = 0; int k, j; int idx = Gridsteps - 1; for (k = 1; spotTree.GetSpotMatrix(idx, k - 1) <= Strike && spotTree.GetSpotMatrix(idx, k) <= Strike && k <= Gridsteps - 1; k++) { } if (k == 1) { centre = 2; } else if (k >= Gridsteps - 1) { centre = Gridsteps - 2; } else if (k <= Gridsteps - 2 && (k > 1)) { if (Math.Abs(spotTree.GetSpotMatrix(idx, k - 2) / Strike - 1) > Math.Abs(spotTree.GetSpotMatrix(idx, k + 1) / Strike - 1)) { centre = k; } else { centre = k - 1; } } for (j = centre - 1; j <= centre + 1; j++) { double temp; if (Payoff.ToLower() == "c" || (Payoff.ToLower() == "call")) { //temp = BSprice(SpotTree.Get_SpotMatrix(idx, j) //, dt, Strike, get_r(idx), SpotTree.sig, "C"); double fwd = spotTree.GetSpotMatrix(idx, j) - spotTree.GetDiv(idx); fwd *= Math.Exp(spotTree.GetR(idx) * dt); temp = BSprice(fwd, dt, Strike, spotTree.GetR(idx), spotTree.Sig, "C"); SetPriceMatrix(idx, j, temp); } else if ((Payoff.ToLower() == "p") || (Payoff.ToLower() == "put")) { //temp = BSprice(SpotTree.Get_SpotMatrix(idx, j) //, dt, Strike, get_r(idx), SpotTree.sig, "P"); double fwd = spotTree.GetSpotMatrix(idx, j) - spotTree.GetDiv(idx); fwd *= Math.Exp(spotTree.GetR(idx) * dt); temp = BSprice(fwd, dt, Strike, spotTree.GetR(idx), spotTree.Sig, "P"); SetPriceMatrix(idx, j, temp); } } } } }
public MinBasketPayoff(Payoff p) : this(NQuantLibcPINVOKE.new_MinBasketPayoff(Payoff.getCPtr(p)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } }
private IPricer GetPricer(Payoff payoff, Func <double> discounter) { // Choice here IPricer op = new EuropeanPricer(payoff, discounter); path += op.ProcessPath; finish += op.PostProcess; // Payoff payoff2 = x => Math.Max(0.0, x - K); Payoff fixedStrikePayoff = x => Math.Max(0.0, K - x); /* IPricer op2 = new EuropeanPricer(payoff2, discounter); * path += op2.ProcessPath; * finish += op2.PostProcess;*/ // Payoff fixedStrikePayoff = x => Math.Max(0.0, x - K); Payoff ArithmeticAverage = A => Math.Max(0.0, A - K); IPricer op3 = new AsianPricer(ArithmeticAverage, discounter); path += op3.ProcessPath; finish += op3.PostProcess; /* IPricer op4 = new LSMPricer(payoff2, discounter, 10, 10, 60.0); * path += op4.ProcessPath; * finish += op4.PostProcess;*/ return(op); }
public bool PayOff(Payoff payoff) { using (var dbContext = new TextLandDbContext()) { dbContext.Users.Attach(payoff.RequestingUser); var newPayoff = dbContext.Payoffs.Add(payoff); dbContext.SaveChanges(); return((newPayoff != null) ? true : false); } }
//Make grid passing in a tree object. public void MakeGrid(ITree spotTree) { Gridsteps = spotTree.Gridsteps; EmptyArrays(); MakeArrays(); FillRates(spotTree); TermValue(spotTree); FillP(spotTree); PreTermValue(spotTree); Smooth(Smoothing, spotTree); //Iterate backward through tree to price American or Euro calls or puts. double temp; double dt = spotTree.Tau / spotTree.Gridsteps; if ((Style.ToLower() == "a") | (Style.ToLower() == "american")) { for (int i = Gridsteps - 2; i >= 0; i--) { for (int j = 0; j <= i; j++) { if ((Payoff.ToLower() == "c") | (Payoff.ToLower() == "call")) { temp = Math.Max(Math.Exp(-spotTree.GetR(i) * dt) * (GetP(i) * GetPriceMatrix(i + 1, j + 1) + (1 - GetP(i)) * GetPriceMatrix(i + 1, j)), spotTree.GetSpotMatrix(i, j) - Strike); SetPriceMatrix(i, j, temp); } else if ((Payoff.ToLower() == "p") | (Payoff.ToLower() == "put")) { temp = Math.Max(Math.Exp(-spotTree.GetR(i) * dt) * (GetP(i) * GetPriceMatrix(i + 1, j + 1) + (1 - GetP(i)) * GetPriceMatrix(i + 1, j)), Strike - spotTree.GetSpotMatrix(i, j)); SetPriceMatrix(i, j, temp); } } } } else if ((Style.ToLower() == "e") | (Style.ToLower() == "european")) { for (int i = Gridsteps - 2; i >= 0; i--) { for (int j = 0; j <= i; j++) { temp = Math.Exp(-spotTree.GetR(i) * dt) * (GetP(i) * GetPriceMatrix(i + 1, j + 1) + (1 - GetP(i)) * GetPriceMatrix(i + 1, j)); SetPriceMatrix(i, j, temp); } } } }
public Payoff payoff() { global::System.IntPtr cPtr = NQuantLibcPINVOKE.Option_payoff(swigCPtr); Payoff ret = (cPtr == global::System.IntPtr.Zero) ? null : new Payoff(cPtr, true); if (NQuantLibcPINVOKE.SWIGPendingException.Pending) { throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
/// <summary> /// Makes the grid. /// </summary> private void MakeGrid() { EmptyArrays(); MakeArrays(); TermValue(); PreTermValue(); Smooth(Smoothing); //Iterate backward through tree to price American or Euro calls or puts. int n = Tree.Columns; double _tau = Tree.Time; double temp = 0; double dt = _tau / Tree.Columns; if ((Style.ToLower() == "a") | (Style.ToLower() == "american")) { for (int i = n - 2; i >= 0; i--) { for (int j = 0; j <= i; j++) { if ((Payoff.ToLower() == "c") | (Payoff.ToLower() == "call")) { temp = Math.Max(Math.Exp(-Tree.Rate(i) * dt) * (GetP(i) * GetPriceMatrix(i + 1, j + 1) + (1 - GetP(i)) * GetPriceMatrix(i + 1, j)), Tree.Underlying(i, j) - Strike); SetPriceMatrix(i, j, temp); } else if ((Payoff.ToLower() == "p") | (Payoff.ToLower() == "put")) { temp = Math.Max(Math.Exp(-Tree.Rate(i) * dt) * (GetP(i) * GetPriceMatrix(i + 1, j + 1) + (1 - GetP(i)) * GetPriceMatrix(i + 1, j)), Strike - Tree.Underlying(i, j)); SetPriceMatrix(i, j, temp); } } } } else if ((Style.ToLower() == "e") | (Style.ToLower() == "european")) { for (int i = n - 2; i >= 0; i--) { for (int j = 0; j <= i; j++) { temp = Math.Exp(-Tree.Rate(i) * dt) * (GetP(i) * GetPriceMatrix(i + 1, j + 1) + (1 - GetP(i)) * GetPriceMatrix(i + 1, j)); SetPriceMatrix(i, j, temp); } } } }
public Tuple <ISde, FdmBase, IRng> Parts() { // V2, parts initialised from the inside // Get the SDE ISde sde = GetSde(); IRng rng = GetRng(); FdmBase fdm = GetFdm(sde); Payoff payoff = x => Math.Max(0.0, K - x); //Payoff payoff = x => Math.Max(0.0, x - K); Func <double> discounter = () => Math.Exp(-r * T); IPricer pricer = GetPricer(payoff, discounter); return(new Tuple <ISde, FdmBase, IRng>(sde, fdm, rng)); }
public static String payoffTypeToString(Payoff h) { object hd = null; hd = h as PlainVanillaPayoff; if (hd != null) { return("plain-vanilla"); } hd = h as CashOrNothingPayoff; if (hd != null) { return("cash-or-nothing"); } hd = h as AssetOrNothingPayoff; if (hd != null) { return("asset-or-nothing"); } hd = h as SuperSharePayoff; if (hd != null) { return("super-share"); } hd = h as SuperFundPayoff; if (hd != null) { return("super-fund"); } hd = h as PercentageStrikePayoff; if (hd != null) { return("percentage-strike"); } hd = h as GapPayoff; if (hd != null) { return("gap"); } hd = h as FloatingTypePayoff; if (hd != null) { return("floating-type"); } Utils.QL_FAIL("unknown payoff type"); return(String.Empty); }
public double Run(int iter, Payoff payoff) { int it = iter; ParallelOptions parallel_options = new ParallelOptions { MaxDegreeOfParallelism = 16 }; double sum = 0.0; Parallel.For(0, iter, parallel_options, (i) => { ParallelOperation.Add(ref sum, payoff(this.param, this.mc.Next())); }); return(sum / iter); }
private IPricer GetPricer(Payoff payoff, Func <double> discounter) { // Choice here // IPricer op = new EuropeanPricer(payoff, discounter); // path += op.ProcessPath; // finish += op.PostProcess; //Payoff payoff2 = x => Math.Max(0.0, x - K); Payoff payoff2 = x => Math.Max(0.0, K - x); IPricer op2 = new EuropeanPricer(payoff2, discounter); path += op2.ProcessPath; finish += op2.PostProcess; return(op2); }
/// <summary> /// Gets the vega. /// </summary> /// <returns></returns> public double GetVega() { double spot = Tree.Underlying(0, 0); double _tau = Tree.Time; BinomialTreePricer lhs1 = new BinomialTreePricer(spot, Strike, Payoff.ToLower()[0] == 'p', _tau, 0.99 * _vol, Tree.Columns, _flatFlag, Style, Smoothing, _ratedays, _rateamts, _divdays, _divamts, _treeType); BinomialTreePricer lhs2 = new BinomialTreePricer(spot, Strike, Payoff.ToLower()[0] == 'p', _tau, 1.01 * _vol, Tree.Columns, _flatFlag, Style, Smoothing, _ratedays, _rateamts, _divdays, _divamts, _treeType); double P1 = lhs1.GetPrice(); double P2 = lhs2.GetPrice(); double vega = 0.0; if (_vol != 0) { vega = 0.01 * (P2 - P1) / (2 * 0.01 * _vol); } return(vega); }
public BasketPayoff basketTypeToPayoff(BasketType basketType, Payoff p) { switch (basketType) { case BasketType.MinBasket: return(new MinBasketPayoff(p)); case BasketType.MaxBasket: return(new MaxBasketPayoff(p)); case BasketType.SpreadBasket: return(new SpreadBasketPayoff(p)); } Utils.QL_FAIL("unknown basket option type"); return(null); }
/// <summary> /// Gets the vega. /// </summary> /// <returns></returns> public double GetVega() { double spot = Tree.Underlying(0, 0); double tau = Tree.Time; BinomialTreePricer lhs1 = new BinomialTreePricer(spot, Strike, Payoff.ToLower()[0] == 'p', tau, 0.99 * _volatility, Tree.Columns, _flatFlag, Style, Smoothing, _rateDays, _rateAmounts, _dividendDays, _dividendAmounts, _treeType); BinomialTreePricer lhs2 = new BinomialTreePricer(spot, Strike, Payoff.ToLower()[0] == 'p', tau, 1.01 * _volatility, Tree.Columns, _flatFlag, Style, Smoothing, _rateDays, _rateAmounts, _dividendDays, _dividendAmounts, _treeType); double p1 = lhs1.GetPrice(); double p2 = lhs2.GetPrice(); double vega = 0.0; if (_volatility != 0) { vega = 0.01 * (p2 - p1) / (2 * 0.01 * _volatility); } return(vega); }
protected Forward(DayCounter dayCounter, Calendar calendar, BusinessDayConvention businessDayConvention, int settlementDays, Payoff payoff, Date valueDate, Date maturityDate, Handle <YieldTermStructure> discountCurve) { dayCounter_ = dayCounter; calendar_ = calendar; businessDayConvention_ = businessDayConvention; settlementDays_ = settlementDays; payoff_ = payoff; valueDate_ = valueDate; maturityDate_ = maturityDate; discountCurve_ = discountCurve; maturityDate_ = calendar_.adjust(maturityDate_, businessDayConvention_); Settings.registerWith(update); discountCurve_.registerWith(update); }
public bool PayOff(int userId) { var user = _usersRepository.GetUserById(userId); if (user == null || user.AccountForCompletedOrders <= 0) { return(false); } var payoff = new Payoff() { RequestingUser = user, Value = user.AccountForCompletedOrders }; ResetAccount(user); //to chcę stąd wywalić i zrobić w inny sposób return(_usersRepository.PayOff(payoff)); }
/// <summary> /// Gets the gamma. /// </summary> /// <returns></returns> public double GetGamma() { double spot = Tree.Underlying(0, 0); int steps = Tree.Columns + 2; double tau = Tree.Time * (1 + 2 / steps); BinomialTreePricer clone = new BinomialTreePricer(spot, Strike, Payoff.ToLower()[0] == 'p', tau, _volatility, steps, _flatFlag, Style, Smoothing, _rateDays, _rateAmounts, _dividendDays, _dividendAmounts, _treeType); double[] s = new double[3]; double[] c = new double[3]; for (int i = 0; i <= 2; ++i) { s[i] = clone.Tree.Underlying(2, i); c[i] = clone.GetPriceMatrix(2, i); } double gamma = 2 * (s[0] * (c[1] - c[2]) + s[1] * (c[2] - c[0]) + s[2] * (c[0] - c[1])) / (s[1] - s[0]) / (s[2] - s[0]) / (s[2] - s[1]); return(gamma); }
/// <summary> /// Gets the gamma. /// </summary> /// <returns></returns> public double GetGamma() { double spot = Tree.Underlying(0, 0); int steps = Tree.Columns + 2; double tau = Tree.Time * (1 + 2 / steps); BinomialTreePricer clone = new BinomialTreePricer(spot, Strike, Payoff.ToLower()[0] == 'p', tau, _vol, steps, _flatFlag, Style, Smoothing, _ratedays, _rateamts, _divdays, _divamts, _treeType); double[] S = new double[3]; double[] C = new double[3]; for (int i = 0; i <= 2; ++i) { S[i] = clone.Tree.Underlying(2, i); C[i] = clone.GetPriceMatrix(2, i); } double gamma = 2 * (S[0] * (C[1] - C[2]) + S[1] * (C[2] - C[0]) + S[2] * (C[0] - C[1])) / (S[1] - S[0]) / (S[2] - S[0]) / (S[2] - S[1]); return(gamma); }
/// <summary> /// Transfer Payoff to the DeSciL AMT Service /// </summary> /// <param name="accessCode">AccessCode of Turker</param> /// <param name="bonus">Exit Code of Turker</param> /// <returns>Service Response as JSON string</returns> public string AddPayoff(string accessCode, double bonus) { var payoff = new Payoff { AccessCode = accessCode, Bonus = bonus, BonusReason = "" }; var contract = new PostPayoffContract { Operation = "PostPayoffs", ServiceKey = _serviceKey, ProjectCode = _projectCode }; contract.Payoffs.Add(payoff); string json = JsonConvert.SerializeObject(contract); return Post(json); }
//Assign terminal payoff condition. private void TermValue(ITree spotTree) { if (spotTree != null) { for (int j = 0; j <= Gridsteps; j++) { double temp; Payoff = Payoff.ToLower(); if ((Payoff == "c") | (Payoff == "call")) { temp = Math.Max(spotTree.GetSpotMatrix(Gridsteps, j) - Strike, 0); SetPriceMatrix(Gridsteps, j, temp); } else if ((Payoff.ToLower() == "p") | (Payoff.ToLower() == "put")) { temp = Math.Max(Strike - spotTree.GetSpotMatrix(Gridsteps, j), 0); SetPriceMatrix(Gridsteps, j, temp); } } } }
private double Bisection(double prem, double fwdPrice) { double right = 0.75; double left = 0.35; double mid; var cp = Payoff.ToLower() == "c" ? 1 : -1; int days = Expiry.Subtract(Today).Days; double t = days / 365.0; var priceClone = (AmOptionAnalytics)Clone(); if (fwdPrice <= 0 || Strike <= 0 || t <= 0 || prem <= 0) { return(0); } double df = Convert.ToDouble(RateCurve.GetDf(days)); if (prem < Math.Max(cp * df * (fwdPrice - priceClone.Strike), 0)) { throw new System.Exception("No solution for volatility"); } do { mid = (right + left) / 2; priceClone.Sig = left; double fleft = priceClone.Price() - prem; priceClone.Sig = right; double fright = priceClone.Price() - prem; priceClone.Sig = mid; double fmid = priceClone.Price() - prem; if (fleft * fmid < 0) { right = mid; } else if (fright * fmid < 0) { left = mid; } } while (Math.Abs(right - left) > 2 * Eps); return(mid); }
//Assign values at Gridsteps-1 node. private void PreTermValue(Tree SpotTree) { if (SpotTree != null) { double temp = 0; double dt = SpotTree.Tau / SpotTree.Gridsteps; int idx = Gridsteps - 1; for (int j = 0; j <= Gridsteps - 1; j++) { if ((Style.ToLower() == "a") | (Style.ToLower() == "american")) { if ((Payoff.ToLower() == "c") | (Payoff.ToLower() == "call")) { temp = Math.Max(Math.Exp(-SpotTree.GetR(idx) * dt) * (Get_P(idx) * Get_PriceMatrix(idx + 1, j + 1) + (1 - Get_P(idx)) * Get_PriceMatrix(idx + 1, j)), SpotTree.GetSpotMatrix(idx, j) - Strike); Set_PriceMatrix(idx, j, temp); } else if ((Payoff.ToLower() == "p") | (Payoff.ToLower() == "put")) { temp = Math.Max(Math.Exp(-SpotTree.GetR(idx) * dt) * (Get_P(idx) * Get_PriceMatrix(idx + 1, j + 1) + (1 - Get_P(idx)) * Get_PriceMatrix(idx + 1, j)), -SpotTree.GetSpotMatrix(idx, j) + Strike); Set_PriceMatrix(idx, j, temp); } } else if ((Style.ToLower() == "e") | (Style.ToLower() == "european")) { temp = Math.Exp(-SpotTree.GetR(idx) * dt) * (Get_P(idx) * Get_PriceMatrix(idx + 1, j + 1) + (1 - Get_P(idx)) * Get_PriceMatrix(idx + 1, j)); Set_PriceMatrix(idx, j, temp); } } } }
public AverageBasketPayoff(Payoff p, uint n) : this(NQuantLibcPINVOKE.new_AverageBasketPayoff__SWIG_1(Payoff.getCPtr(p), n), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public AverageBasketPayoff(Payoff p, QlArray a) : this(NQuantLibcPINVOKE.new_AverageBasketPayoff__SWIG_0(Payoff.getCPtr(p), QlArray.getCPtr(a)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public BarrierOption(Barrier.Type barrierType, double barrier, double rebate, Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_BarrierOption((int)barrierType, barrier, rebate, Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public ContinuousAveragingAsianOption(Average.Type averageType, Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_ContinuousAveragingAsianOption((int)averageType, Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public EuropeanOption(Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_EuropeanOption(Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Payoff obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; }
public MaxBasketPayoff(Payoff p) : this(NQuantLibcPINVOKE.new_MaxBasketPayoff(Payoff.getCPtr(p)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public BlackCalculator(Payoff payoff, double forward, double stdDev) : this(NQuantLibcPINVOKE.new_BlackCalculator__SWIG_1(Payoff.getCPtr(payoff), forward, stdDev), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public DividendVanillaOption(Payoff payoff, Exercise exercise, DateVector dividendDates, DoubleVector dividends) : this(NQuantLibcPINVOKE.new_DividendVanillaOption(Payoff.getCPtr(payoff), Exercise.getCPtr(exercise), DateVector.getCPtr(dividendDates), DoubleVector.getCPtr(dividends)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public QuantoForwardVanillaOption(double moneyness, Date resetDate, Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_QuantoForwardVanillaOption(moneyness, Date.getCPtr(resetDate), Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }
public DiscreteAveragingAsianOption(Average.Type averageType, double runningAccumulator, uint pastFixings, DateVector fixingDates, Payoff payoff, Exercise exercise) : this(NQuantLibcPINVOKE.new_DiscreteAveragingAsianOption((int)averageType, runningAccumulator, pastFixings, DateVector.getCPtr(fixingDates), Payoff.getCPtr(payoff), Exercise.getCPtr(exercise)), true) { if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve(); }