public FlatForward(Date referenceDate, double forward, DayCounter dayCounter, Compounding compounding, Frequency frequency) : base(referenceDate, new Calendar(), dayCounter) { forward_ = new SimpleQuote(forward); compounding_ = compounding; frequency_ = frequency; }
public FlatForward(Date referenceDate, Quote forward, DayCounter dayCounter, Compounding compounding, Frequency frequency) : base(referenceDate, new Calendar(), dayCounter) { forward_ = forward; compounding_ = compounding; frequency_ = frequency; forward_.registerWith(update); }
public ZeroSpreadedTermStructure(Handle<YieldTermStructure> h, Quote spread, Compounding comp, Frequency freq, DayCounter dc) { originalCurve_ = h; spread_ = spread; comp_ = comp; freq_ = freq; dc_ = dc; //QL_REQUIRE(h->dayCounter()==dc_, // "spread daycounter (" << dc_ << // ") must be the same of the curve to be spreaded (" << // originalCurve_->dayCounter() << // ")"); originalCurve_.registerWith(update); spread_.registerWith(update); }
public static YieldTermStructure flatRate(Date today, Quote forward, DayCounter dc) { return new FlatForward(today, forward, dc); }
//philippe2009_17 public static BlackVolTermStructure flatVol(Quote vol, DayCounter dc) { return new BlackConstantVol(0, new NullCalendar(), new Handle<Quote>(vol), dc); }
public static YieldTermStructure flatRate(Quote forward, DayCounter dc) { return new FlatForward(0, new NullCalendar(), forward, dc); }
public FlatForward(int settlementDays, Calendar calendar, Quote forward, DayCounter dayCounter, Compounding compounding, Frequency frequency) : base(settlementDays, calendar, dayCounter) { forward_ = forward; compounding_ = compounding; frequency_ = frequency; forward_.registerWith(update); }
public FlatForward(int settlementDays, Calendar calendar, Quote forward, DayCounter dayCounter, Compounding compounding) : this(settlementDays, calendar, forward, dayCounter, compounding, Frequency.Annual) { }
public FlatForward(Date referenceDate, Quote forward, DayCounter dayCounter, Compounding compounding) : this(referenceDate, forward, dayCounter, compounding, Frequency.Annual) { }
// constructors public FlatForward(Date referenceDate, Quote forward, DayCounter dayCounter) : this(referenceDate, forward, dayCounter, Compounding.Continuous, Frequency.Annual) { }
public FlatForward(int settlementDays, Calendar calendar, double forward, DayCounter dayCounter, Compounding compounding, Frequency frequency) : base(settlementDays, calendar, dayCounter) { forward_ = new SimpleQuote(forward); compounding_ = compounding; frequency_ = frequency; }
GeneralizedBlackScholesProcess makeProcess(Quote u, YieldTermStructure q, YieldTermStructure r, BlackVolTermStructure vol) { return new BlackScholesMertonProcess(new Handle<Quote>(u), new Handle<YieldTermStructure>(q), new Handle<YieldTermStructure>(r), new Handle<BlackVolTermStructure>(vol)); }
VanillaOption makeOption(StrikedTypePayoff payoff, Exercise exercise, Quote u, YieldTermStructure q, YieldTermStructure r, BlackVolTermStructure vol, EngineType engineType, int binomialSteps, int samples) { GeneralizedBlackScholesProcess stochProcess = makeProcess(u, q, r, vol); IPricingEngine engine; switch (engineType) { case EngineType.Analytic: engine = new AnalyticEuropeanEngine(stochProcess); break; case EngineType.JR: engine = new BinomialVanillaEngine<JarrowRudd>(stochProcess, binomialSteps); break; case EngineType.CRR: engine = new BinomialVanillaEngine<CoxRossRubinstein>(stochProcess, binomialSteps); break; case EngineType.EQP: engine = new BinomialVanillaEngine<AdditiveEQPBinomialTree>(stochProcess, binomialSteps); break; case EngineType.TGEO: engine = new BinomialVanillaEngine<Trigeorgis>(stochProcess, binomialSteps); break; case EngineType.TIAN: engine = new BinomialVanillaEngine<Tian>(stochProcess, binomialSteps); break; case EngineType.LR: engine = new BinomialVanillaEngine<LeisenReimer>(stochProcess, binomialSteps); break; case EngineType.JOSHI: engine = new BinomialVanillaEngine<Joshi4>(stochProcess, binomialSteps); break; case EngineType.FiniteDifferences: engine = new FDEuropeanEngine(stochProcess, binomialSteps, samples); break; case EngineType.Integral: engine = new IntegralEngine(stochProcess); break; //case EngineType.PseudoMonteCarlo: // engine = MakeMCEuropeanEngine<PseudoRandom>(stochProcess) // .withSteps(1) // .withSamples(samples) // .withSeed(42); // break; //case EngineType.QuasiMonteCarlo: // engine = MakeMCEuropeanEngine<LowDiscrepancy>(stochProcess) // .withSteps(1) // .withSamples(samples); // break; default: throw new ArgumentException("unknown engine type"); } VanillaOption option = new EuropeanOption(payoff, exercise); option.setPricingEngine(engine); return option; }
public ZeroSpreadedTermStructure(Handle<YieldTermStructure> h, Quote spread) : this(h, spread, Compounding.Continuous, Frequency.NoFrequency, new DayCounter()) { }