hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.PricingEngine

Synopsis

Types

Engines

Option calculators

type BlackCalculator = GenBlackCalculator CBlackCalculator Source #

The root of the hierarchy shown under GenBlackCalculator.

type BlackScholesCalculator = GenBlackCalculator CBlackScholesCalculator Source #

A BlackCalculator; see the hierarchy under GenBlackCalculator.

Configuration

data ForwardsInCouponPeriod Source #

Constructors

Flat 
Piecewise 

data IntegrationControl Source #

Numerical integration control for analytic Heston-family engines.

data LatticeTime Source #

Time discretization for lattice pricing engines.

data FdmGrid Source #

Spatial discretization for an n-dimensional finite-difference engine.

Instances

Instances details
Show FdmGrid Source # 
Instance details

Defined in QuantLib.PricingEngine

Eq FdmGrid Source # 
Instance details

Defined in QuantLib.PricingEngine

Methods

(==) :: FdmGrid -> FdmGrid -> Bool #

(/=) :: FdmGrid -> FdmGrid -> Bool #

data OperatorSplittingOrder Source #

Constructors

First 
Second 

data PerpetualFuturesInterpolationType Source #

Instances

Instances details
Enum PerpetualFuturesInterpolationType Source # 
Instance details

Defined in QuantLib.PricingEngine

Read PerpetualFuturesInterpolationType Source # 
Instance details

Defined in QuantLib.PricingEngine

Show PerpetualFuturesInterpolationType Source # 
Instance details

Defined in QuantLib.PricingEngine

Eq PerpetualFuturesInterpolationType Source # 
Instance details

Defined in QuantLib.PricingEngine

data StrikeSpec Source #

An option's type and strike, given directly or carried by a striked payoff.

Constructors

Discounting and counterparty engines

discountingBondEngine Source #

Arguments

:: GenYieldTermStructure y 
-> Maybe Bool

includeSettlementDateFlows

-> IO PricingEngine 

discounts a bond's cash flows off a yield term structure

riskyBondEngine Source #

discounts a bond's cash flows off a default-risky curve and a flat recovery rate

discountingSwapEngine Source #

Arguments

:: GenYieldTermStructure y 
-> Maybe Bool

includeSettlementDateFlows

-> Maybe Day

settlementDate

-> Maybe Day

npvDate

-> IO PricingEngine 

discounts a swap's legs off a single discount curve

discountingFxForwardEngine Source #

Arguments

:: GenYieldTermStructure y1

sourceCurrencyDiscountCurve

-> GenYieldTermStructure y2

targetCurrencyDiscountCurve

-> GenQuote q

spotFx

-> IO PricingEngine 

discounts an FX forward's two legs off their respective currency discount curves

discountingConstNotionalCrossCurrencySwapEngine Source #

Arguments

:: Currency

domesticCcy

-> GenYieldTermStructure y1

domesticCcyDiscountCurve

-> Currency

foreignCcy

-> GenYieldTermStructure y2

foreignCcyDiscountCurve

-> GenQuote q

spotFX

-> Maybe Bool

includeSettlementDateFlows

-> Maybe Day

settlementDate

-> Maybe Day

npvDate

-> Maybe Day

spotFXSettleDate

-> IO PricingEngine 

Discounts each leg of a ConstNotionalCrossCurrencySwap (or either of its two leaves) off its own currency's discount curve, converting to domesticCcy via spotFX (quoted as units of domesticCcy per unit of foreignCcy, w.r.t. a settlement equal to the npv date unless spotFXSettleDate says otherwise). Each leg's stored currency must equal domesticCcy or foreignCcy; the two discount curves must share the same reference date.

counterpartyAdjSwapEngine Source #

Arguments

:: GenYieldTermStructure y

discountCurve

-> GenQuote q

blackVol

-> GenDefaultProbabilityTermStructure d1

ctptyDTS

-> Double

ctptyRecoveryRate

-> Maybe (GenDefaultProbabilityTermStructure d2)

invstDTS

-> Double

invstRecoveryRate

-> IO PricingEngine 

CVA/DVA-adjusted swap pricing engine. invstDTS/invstRecoveryRate are the own (investor-side) default probability curve and recovery rate for bilateral CVA/DVA; pass Nothing for invstDTS and 0.999 for invstRecoveryRate to match upstream's unilateral-CVA-only defaults.

discountingPerpetualFuturesEngine Source #

Arguments

:: GenYieldTermStructure y1 
-> GenYieldTermStructure y2 
-> GenQuote q 
-> NonEmpty (Double, Double, Double)
(fundingTime, fundingRate, interestRateDiff)
-> PerpetualFuturesInterpolationType 
-> Double 
-> IO PricingEngine 

Discounts perpetual-futures cashflows to the curves' reference date. The three funding vectors must be non-empty and have identical lengths. The engine supports only PerpetualFuturesLinear and PerpetualFuturesInverse payoffs; QuantLib rejects a Quanto payoff at pricing time.

Analytic, lattice and Monte Carlo engines

analyticBarrierEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for barrier options

analyticTwoAssetBarrierEngine Source #

analytic (Heynen and Kat) pricing engine for a barrier option on two assets, where the first asset's value is compared to the strike and the second's is monitored against the barrier

analyticSoftBarrierEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for soft barrier options, knocked in/out proportionally over a barrier range

analyticPartialTimeBarrierOptionEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for partial-time barrier options

analyticBinaryBarrierEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for American binary barrier options (cash-or-nothing/asset-or-nothing)

analyticSimpleChooserEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for simple chooser options

analyticComplexChooserEngine Source #

Analytic Black-Scholes engine for a complexChooserOption. Both alternatives must have European exercise.

analyticTwoAssetCorrelationEngine Source #

analytic pricing engine for two-asset correlation options

analyticEuropeanMargrabeEngine Source #

Analytic (Margrabe) engine for a European margrabeOption: the closed-form price of an option to exchange one asset for another, from W. Margrabe, "The Value of an Option to Exchange One Asset for Another", Journal of Finance 33 (March 1978), 177-186.

analyticAmericanMargrabeEngine Source #

Analytic (Margrabe) engine for an American margrabeOption: the closed-form price of an option to exchange one asset for another with early exercise, from W. Margrabe, "The Value of an American Option to Exchange One Asset for Another", Journal of Finance 33, 177-86.

analyticWriterExtensibleOptionEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for writer-extensible options

analyticHolderExtensibleOptionEngine Source #

Analytic Black-Scholes engine for a holderExtensibleOption. The original option must have European exercise.

fdBlackScholesBarrierEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> Word

tGrid

-> Word

xGrid

-> Word

dampingSteps

-> FdmScheme 
-> Bool

localVol

-> Double

illegalLocalVolOverwrite

-> IO PricingEngine 

finite-differences Black-Scholes barrier-option pricing engine

fdHestonBarrierEngine :: GenHestonModel hm -> [Dividend] -> Word -> Word -> Word -> Word -> FdmScheme -> Maybe (GenLocalVolTermStructure lv) -> Double -> IO PricingEngine Source #

Finite-difference Heston barrier engine; an empty list selects the no-dividend overload.

binomialBarrierEngine Source #

Arguments

:: BinomialTree 
-> GeneralizedBlackScholesProcess 
-> Word

timeSteps

-> Word

maxTimeSteps

-> IO PricingEngine 

NB Timesteps for Cox-Ross-Rubinstein trees are adjusted using the Boyle-Lau algorithm; pass maxTimeSteps = timeSteps to disable it, or 0 to use the library's default heuristic.

vannaVolgaBarrierEngine Source #

Arguments

:: DeltaVolQuote

atmVol

-> DeltaVolQuote

vol25Put

-> DeltaVolQuote

vol25Call

-> GenQuote q

spotFX

-> GenYieldTermStructure y1

domesticTS

-> GenYieldTermStructure y2

foreignTS

-> Bool

adaptVanDelta

-> Double

bsPriceWithSmile

-> IO PricingEngine 

FX barrier option engine using the vanna-volga method to account for the volatility smile

analyticDoubleBarrierEngine Source #

analytic pricing engine for double-barrier European options

fdHestonDoubleBarrierEngine Source #

Arguments

:: GenHestonModel hm 
-> Word

tGrid

-> Word

xGrid

-> Word

vGrid

-> Word

dampingSteps

-> FdmScheme 
-> Maybe (GenLocalVolTermStructure lv)

leverageFct

-> Double

mixingFactor, upstream default: 1.0

-> IO PricingEngine 

finite-differences Heston-model double-barrier-option pricing engine

vannaVolgaDoubleBarrierEngine Source #

Arguments

:: DeltaVolQuote

atmVol

-> DeltaVolQuote

vol25Put

-> DeltaVolQuote

vol25Call

-> GenQuote q

spotFX

-> GenYieldTermStructure y1

domesticTS

-> GenYieldTermStructure y2

foreignTS

-> Bool

adaptVanDelta

-> Double

bsPriceWithSmile

-> Int

series

-> IO PricingEngine 

always uses AnalyticDoubleBarrierEngine as the underlying smile-free double-barrier engine

binomialDoubleBarrierEngine Source #

pricing engine for double-barrier options using binomial trees

mcDoubleBarrierEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for double-barrier options

analyticCliquetEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for Cliquet (ratchet) options

analyticCompoundOptionEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for compound options

analyticContinuousFixedLookbackEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European continuous fixed-strike lookback options

analyticContinuousFloatingLookbackEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European continuous floating-strike lookback options

analyticContinuousPartialFloatingLookbackEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European continuous partial-time floating-strike lookback options

analyticContinuousPartialFixedLookbackEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European continuous partial-time fixed-strike lookback options

analyticContinuousGeometricAveragePriceAsianEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European continuous geometric average-price Asian options

analyticContinuousGeometricAveragePriceAsianHestonEngine Source #

Arguments

:: GenHestonProcess hp 
-> Word

summationCutoff

-> Double

xiRightLimit

-> IO PricingEngine 

Analytic pricing engine for European continuous geometric average-price Asian options under the Heston stochastic-volatility model. Implements the closed-form solution of Kim & Wee, "Pricing of geometric Asian options under Heston's stochastic volatility model", Quantitative Finance 14:10 (2014). summationCutoff and xiRightLimit bound the truncated summation and integration ranges used by the closed form; QuantLib's own defaults are 50 and 100.0.

analyticDiscreteGeometricAveragePriceAsianHestonEngine Source #

Arguments

:: GenHestonProcess hp 
-> Double

xiRightLimit

-> IO PricingEngine 

Analytic pricing engine for European discrete geometric average-price Asian options under the Heston stochastic-volatility model. Implements the closed-form solution of Kim, Kim, Kim & Wee, "A Recursive Method for Discretely Monitored Geometric Asian Option Prices", Bull. Korean Math. Soc. 53 (2016). xiRightLimit bounds the truncated integration range; QuantLib's own default is 100.0.

mcLookbackFixedEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for continuous fixed-strike lookback options. Exactly one of timeSteps/timeStepsPerYear must be given; the other must be Nothing.

mcLookbackFloatingEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for continuous floating-strike lookback options. Exactly one of timeSteps/timeStepsPerYear must be given; the other must be Nothing.

mcLookbackPartialFixedEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for continuous partial-time fixed-strike lookback options. Exactly one of timeSteps/timeStepsPerYear must be given; the other must be Nothing.

mcLookbackPartialFloatingEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for continuous partial-time floating-strike lookback options. Exactly one of timeSteps/timeStepsPerYear must be given; the other must be Nothing.

analyticDigitalAmericanEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for American digital (cash-or-nothing/asset-or-nothing) options

analyticDigitalAmericanKoEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for American knock-out digital (cash-or-nothing/asset-or-nothing) options

analyticDiscreteGeometricAveragePriceAsianEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European discrete geometric average-price Asian options

analyticDiscreteGeometricAverageStrikeAsianEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for European discrete geometric average-strike Asian options

turnbullWakemanAsianEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

Turnbull-Wakeman moment-matching pricing engine for discrete arithmetic average-price/-strike Asian options

fdBlackScholesAsianEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> Word

tGrid

-> Word

xGrid

-> Word

aGrid

-> FdmScheme 
-> IO PricingEngine 

finite-differences Black-Scholes pricing engine for discrete-averaging Asian options

analyticDividendEuropeanEngine :: GeneralizedBlackScholesProcess -> [Dividend] -> IO PricingEngine Source #

analytic pricing engine for European options with discrete dividends

analyticEuropeanEngine Source #

analytic Black-Scholes pricing engine for European options

analyticPerformanceEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for performance (return) options

forwardEuropeanEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

analytic pricing engine for forward-starting European options; binds the AnalyticEuropeanEngine instantiation of upstream's ForwardVanillaEngine<Engine> template

forwardBaroneAdesiWhaleyEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

Barone-Adesi/Whaley approximation pricing engine for forward-starting American options; binds the BaroneAdesiWhaleyApproximationEngine instantiation of ForwardVanillaEngine<Engine>

forwardBjerksundStenslandEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

Bjerksund/Stensland approximation pricing engine for forward-starting American options; binds the BjerksundStenslandApproximationEngine instantiation of ForwardVanillaEngine<Engine>

forwardFdBlackScholesVanillaEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

finite-differences Black-Scholes pricing engine for forward-starting vanilla options, with the wrapped engine's grid/scheme params fixed at their QuantLib defaults; binds the FdBlackScholesVanillaEngine instantiation of ForwardVanillaEngine<Engine>

mcForwardEuropeanBsEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for forward-starting European options under a Black-Scholes process

mcForwardEuropeanHestonEngine Source #

Arguments

:: RngTrait

rng

-> StatisticsTrait

statistics

-> GenHestonProcess hp

process

-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> Bool

controlVariate

-> IO PricingEngine 

Monte Carlo engine for European forwardVanillaOptions under a Heston process. Supply either requiredSamples or requiredTolerance, and use a fixed nonzero seed for reproducible results.

analyticHestonForwardEuropeanEngine Source #

Arguments

:: GenHestonProcess hp 
-> Word

integrationOrder

-> IO PricingEngine 

analytic pricing engine for forward-starting European options under a Heston process

quantoEuropeanEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GenYieldTermStructure y

foreignRiskFreeRate

-> GenBlackVolTermStructure bv

exchangeRateVolatility

-> GenQuote q

correlation

-> IO PricingEngine 

quanto-adjusts a European vanilla option's price and greeks for a payoff paid in a currency other than the underlying's; binds the VanillaOption/AnalyticEuropeanEngine instantiation of upstream's QuantoEngine<Instr,Engine> template

quantoForwardEuropeanEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GenYieldTermStructure y

foreignRiskFreeRate

-> GenBlackVolTermStructure bv

exchangeRateVolatility

-> GenQuote q

correlation

-> IO PricingEngine 

quanto-adjusts a forward-starting vanilla option; binds the ForwardVanillaOption/ForwardVanillaEngine<AnalyticEuropeanEngine> instantiation of QuantoEngine<Instr,Engine>

quantoForwardPerformanceEuropeanEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GenYieldTermStructure y

foreignRiskFreeRate

-> GenBlackVolTermStructure bv

exchangeRateVolatility

-> GenQuote q

correlation

-> IO PricingEngine 

quanto-adjusts a forward-starting performance (strike-resetting, percentage-payoff) vanilla option; binds the ForwardVanillaOption/ForwardPerformanceVanillaEngine<AnalyticEuropeanEngine> instantiation of QuantoEngine<Instr,Engine>

quantoBarrierEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GenYieldTermStructure y

foreignRiskFreeRate

-> GenBlackVolTermStructure bv

exchangeRateVolatility

-> GenQuote q

correlation

-> IO PricingEngine 

quanto-adjusts a single-barrier option; binds the BarrierOption/AnalyticBarrierEngine instantiation of QuantoEngine<Instr,Engine>

quantoDoubleBarrierEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GenYieldTermStructure y

foreignRiskFreeRate

-> GenBlackVolTermStructure bv

exchangeRateVolatility

-> GenQuote q

correlation

-> IO PricingEngine 

quanto-adjusts a double-barrier option; binds the DoubleBarrierOption/AnalyticDoubleBarrierEngine instantiation of QuantoEngine<Instr,Engine>

Rates and inflation

blackCapFloorEngineFromVolatilityStructure :: GenYieldTermStructure y -> GenOptionletVolatilityStructure ov -> IO PricingEngine Source #

Black-formula cap/floor engine, taking an optionlet volatility structure

blackCapFloorEngine Source #

Arguments

:: GenYieldTermStructure y 
-> GenQuote q 
-> DayCounter 
-> Double

displacement

-> IO PricingEngine 

Black-formula cap/floor engine, taking a flat volatility quote

blackSwaptionEngine Source #

Arguments

:: GenYieldTermStructure y 
-> GenQuote q 
-> DayCounter 
-> Double

displacement

-> CashAnnuityModel

model

-> IO PricingEngine 

shifted-lognormal Black-formula swaption engine, taking a flat volatility quote

blackSwaptionEngineFromVolatilityStructure :: GenYieldTermStructure y -> GenSwaptionVolatilityStructure sv -> IO PricingEngine Source #

shifted-lognormal Black-formula swaption engine, taking a swaption volatility structure

bachelierCapFloorEngineFromVolatilityStructure :: GenYieldTermStructure y -> GenOptionletVolatilityStructure ov -> IO PricingEngine Source #

Bachelier (normal) cap/floor engine, taking an optionlet volatility structure

bachelierCapFloorEngine :: GenYieldTermStructure y -> GenQuote q -> DayCounter -> IO PricingEngine Source #

Bachelier (normal) cap/floor engine, taking a flat volatility quote

yoyInflationBlackCapFloorEngine Source #

Black-formula YoY inflation cap/floor engine. The nominal discount curve and the index's own linked YoYInflationTermStructure are separate -- nominalTermStructure discounts cashflows, while the index forecasts them.

interpolatingCpiCapFloorEngine :: CPICapFloorTermPriceSurface -> IO PricingEngine Source #

The only CPICapFloor pricing engine in QL 1.43 -- prices purely by interpolating a market price surface, no stochastic-vol model (see that type's own haddock for the CPI/YoY asymmetry).

bachelierSwaptionEngine Source #

Bachelier (normal) swaption engine, taking a flat volatility quote

bachelierSwaptionEngineFromVolatilityStructure :: GenYieldTermStructure y -> GenSwaptionVolatilityStructure sv -> IO PricingEngine Source #

Bachelier (normal) swaption engine, taking a swaption volatility structure

analyticBsmHullWhiteEngine :: Double -> GeneralizedBlackScholesProcess -> HullWhite -> IO PricingEngine Source #

analytic European option pricer including stochastic interest rates (Black-Scholes-Merton + Hull-White)

analyticCapFloorEngine :: AffineModel -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

the term structure is only needed when the short-rate model cannot provide one itself.

gaussian1dCapFloorEngine Source #

Arguments

:: Gaussian1dModel 
-> Int

integrationPoints

-> Double

stddevs

-> Bool

extrapolatePayoff

-> Bool

flatPayoffExtrapolation

-> Maybe (GenYieldTermStructure y)

discountCurve

-> IO PricingEngine 

cap/floor pricing engine for any one-factor Gaussian short-rate model, evaluated by integration over the model's state variable. As gaussian1dSwaptionEngine, without Probabilities.

Equity, stochastic-volatility and exotic products

analyticGjrGarchEngine :: GJRGARCHModel -> IO PricingEngine Source #

analytic pricing engine for vanilla options under a GJR-GARCH process

analyticHestonEngine :: GenHestonModel hm -> IntegrationControl -> IO PricingEngine Source #

Semi-analytic Heston engine with either fixed-order or tolerance-based integration.

analyticHestonHullWhiteEngine :: GenHestonModel hm -> HullWhite -> IntegrationControl -> IO PricingEngine Source #

Semi-analytic Heston/Hull-White engine with fixed-order or tolerance-based integration.

batesEngine :: GenBatesModel bm -> IntegrationControl -> IO PricingEngine Source #

Semi-analytic Bates engine with either fixed-order or tolerance-based integration.

fftVanillaEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> Double

logStrikeSpacing

-> IO PricingEngine 

FFT-based pricing engine for vanilla options under a Black-Scholes process

g2SwaptionEngine Source #

Arguments

:: G2 
-> Double

range

-> Word

intervals

-> IO PricingEngine 

swaption pricing engine for the G2 two-factor short-rate model, priced via the Black formula

jumpDiffusionEngine Source #

Arguments

:: Merton76Process 
-> Double

relativeAccuracy

-> Word

maxIterations

-> IO PricingEngine 

jump-diffusion pricing engine for vanilla options, taking a Merton76 process

treeCapFloorEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

Numerical-lattice cap/floor engine using either a step count or an explicit grid.

treeSwaptionEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

Numerical-lattice swaption engine using either a step count or an explicit grid.

treeVanillaSwapEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

Numerical-lattice vanilla-swap engine using either a step count or an explicit grid.

varianceGammaEngine Source #

Arguments

:: VarianceGammaProcess 
-> Double

absoluteError

-> IO PricingEngine 

pricing engine for European vanilla options using the Variance Gamma model, integrated numerically

analyticHestonEngineOptimalControlVariate Source #

Arguments

:: Double

t

-> Double

v0

-> Double

kappa

-> Double

theta

-> Double

sigma

-> Double

rho

-> ComplexLogFormula 

The complex-logarithm evaluation formula AnalyticHestonEngine would pick for the given maturity and Heston parameters when constructed with ComplexLogFormula left to default to the model's own heuristic (mirrors upstream's asymptotic-characteristic-function threshold).

mcHestonHullWhiteEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> HybridHestonHullWhiteProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timStepsPerYear

-> Bool

antitheticVariate

-> Bool

controlVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

NB every Monte Carlo engine in this module is C++-templated on both an RNG policy and a statistics accumulator; all of them (bar mcAmericanBasketEngine, see its own doc comment) take an explicit StatisticsTrait argument for the latter, letting the caller pick Statistics/GaussianStatistics/GeneralStatistics/IncrementalStatistics instead of being pinned to upstream's default Statistics.

mcAmericanEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word 
-> Maybe Word

timeStepsPerYear

-> Bool

antitheticVariate

-> Bool

controlVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> Word

polynomOrder

-> PolynomialType 
-> Maybe Word

nCalibrationSamples

-> Maybe Bool

antitheticVariateCalibration

-> Maybe Word

seedCalibration

-> IO PricingEngine 

Monte Carlo (least-squares) pricing engine for American options

mcBarrierEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Bool

isBiased

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for barrier options

mcDigitalEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word 
-> Bool 
-> Bool 
-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for digital (cash-or-nothing/asset-or-nothing) options

mcDiscreteArithmeticApEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Bool

controlVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for discrete arithmetic average-price Asian options

mcDiscreteArithmeticAsEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for discrete arithmetic average-strike Asian options

mcDiscreteGeometricApEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for discrete geometric average-price Asian options

mcDiscreteArithmeticApHestonEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GenHestonProcess hp 
-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

controlVariate

-> IO PricingEngine 

Monte Carlo pricing engine for discrete arithmetic average-price Asian options under the Heston stochastic-volatility model. Uses one time step per fixing date unless timeSteps or timeStepsPerYear overrides the grid. When controlVariate is true, prices the same path against analyticDiscreteGeometricAveragePriceAsianHestonEngine as a control variate.

mcDiscreteGeometricApHestonEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GenHestonProcess hp 
-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> IO PricingEngine 

Monte Carlo pricing engine for discrete geometric average-price Asian options under the Heston stochastic-volatility model. Uses one time step per fixing date unless timeSteps or timeStepsPerYear overrides the grid.

mcEuropeanEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for European options under a Black-Scholes process

mcEuropeanGjrGarchEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GJRGARCHProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for European options under a GJR-GARCH process

mcEuropeanHestonEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GenHestonProcess hp 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for European options under a Heston process

integralHestonVarianceOptionEngine :: GenHestonProcess hp -> IO PricingEngine Source #

Prices a VarianceOption by integrating its payoff against the Heston-model transition density.

mcHullWhiteCapFloorEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> HullWhite 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo Hull-White pricing engine for caps/floors

mcHimalayaEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> StochasticProcessArray 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for himalayaOption

mcPagodaEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> StochasticProcessArray 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for pagodaOption

mcEuropeanBasketEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> StochasticProcessArray 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for a European basketOption.

mcEverestEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> StochasticProcessArray 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for everestOption. Exactly one of timeSteps/timeStepsPerYear must be given.

mcAmericanBasketEngine Source #

Arguments

:: RngTrait 
-> StochasticProcessArray 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> Maybe Word

nCalibrationSamples

-> Word

polynomialOrder

-> PolynomialType

polynomialType

-> IO PricingEngine 

Monte Carlo (least-squares) pricing engine for an American basketOption. NB unlike every other MC engine in this module, this one has no StatisticsTrait parameter: upstream's MCAmericanBasketEngine<RNG> is templated on RNG only -- its base MCLongstaffSchwartzEngine<BasketOption::engine,MultiVariate,RNG> never forwards a second template argument, so there is no S to expose here (a real upstream limitation, not an oversight).

mcPerformanceEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

Monte Carlo pricing engine for performance (return) options

mcVarianceSwapEngine Source #

Arguments

:: RngTrait 
-> StatisticsTrait 
-> GeneralizedBlackScholesProcess 
-> Maybe Word

timeSteps

-> Maybe Word

timeStepsPerYear

-> Bool

brownianBridge

-> Bool

antitheticVariate

-> Maybe Word

requiredSamples

-> Maybe Double

requiredTolerance

-> Maybe Word

maxSamples

-> Word

seed

-> IO PricingEngine 

variance-swap pricing engine using Monte Carlo simulation (see the note above mcHestonHullWhiteEngine for the StatisticsTrait parameter shared by every MC engine here).

baroneAdesiWhaleyApproximationEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

Barone-Adesi and Whaley (1987) quadratic-approximation engine for American options

batesDetJumpEngine :: BatesDetJumpModel -> IntegrationControl -> IO PricingEngine Source #

Semi-analytic engine for the Bates model with deterministic jumps, with fixed-order or tolerance-based integration.

batesDoubleExpDetJumpEngine :: BatesDoubleExpDetJumpModel -> IntegrationControl -> IO PricingEngine Source #

Semi-analytic engine for the double-exponential-jump Bates model with deterministic jumps, with fixed-order or tolerance-based integration.

batesDoubleExpEngine :: GenBatesDoubleExpModel bdem -> IntegrationControl -> IO PricingEngine Source #

Semi-analytic engine for the double-exponential-jump Bates model, with fixed-order or tolerance-based integration.

bjerksundStenslandApproximationEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

Bjerksund and Stensland (1993) approximation engine for American options

qdPlusAmericanEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> Word

interpolationPoints, number of Chebyshev nodes used to interpolate the exercise boundary

-> SolverType

solverType, root-finding method used to locate the exercise boundary

-> Double

eps, solver accuracy

-> Maybe Word

maxIter, solver iteration cap; Nothing uses upstream's default

-> IO PricingEngine 

American engine based on the QD+ approximation to the exercise boundary. Mainly a good initial guess for the exercise boundary of qdFpAmericanEngine; usable as a standalone (lower-accuracy) American pricer on its own.

qdFpAmericanEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> QdFpScheme

iterationScheme

-> FixedPointEquation

fpEquation, which fixed-point formulation of the exercise boundary equation to solve

-> IO PricingEngine 

High performance/precision American engine based on fixed point iteration for the exercise boundary (Andersen, Lake and Offengenden 2015; Andersen and Lake 2021). QdFpScheme selects one of upstream's three built-in iterationSchemes (FastScheme, AccurateScheme, HighPrecisionScheme), trading speed for accuracy.

continuousArithmeticAsianVecerEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> Maybe (GenQuote q)

currentAverage

-> Day

startDate

-> Word

timeSteps

-> Word

assetSteps

-> Double

zMin

-> Double

zMax

-> IO PricingEngine 

Vecer (2001) engine for continuous-averaging arithmetic Asian options, replicating the average by a self-financing strategy in the underlying and solving the resulting PDE on a finite [zMin,zMax] grid; requires zMin <= 0 <= zMax and startDate no earlier than the evaluation date (seasoned Asians are not supported). currentAverage is accepted for parity with upstream's constructor but is not read by the current implementation (only the not-yet-seasoned case is handled), so Nothing is fine.

Credit and spread products

integralCdsEngine Source #

Arguments

:: (Word, TimeUnit)

integrationStep

-> GenDefaultProbabilityTermStructure d 
-> Double

recoveryRate

-> GenYieldTermStructure y

discountCurve

-> Maybe Bool

includeSettlementDateFlows

-> IO PricingEngine 

CDS pricing engine that integrates the default-leg payoff over the CDS's step-wise schedule

integralEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

pricing engine for European vanilla options using an integral approach

isdaCdsEngine Source #

Arguments

:: GenDefaultProbabilityTermStructure d 
-> Double

recoveryRate

-> GenYieldTermStructure y 
-> Maybe Bool

includeSettlementDateFlows

-> NumericalFix

numericalFix

-> AccrualBias

accrualBias

-> ForwardsInCouponPeriod

forwardsInCouponPeriod

-> IO PricingEngine 

CDS pricing engine implementing the ISDA standard model

jamshidianSwaptionEngine :: GenOneFactorAffineModel om -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

the term structure is only needed when the short-rate model cannot provide one itself.

gaussian1dSwaptionEngine Source #

Arguments

:: Gaussian1dModel 
-> Int

integrationPoints

-> Double

stddevs

-> Bool

extrapolatePayoff

-> Bool

flatPayoffExtrapolation

-> Maybe (GenYieldTermStructure y)

discountCurve

-> Probabilities

probabilities

-> IO PricingEngine 

swaption pricing engine for any one-factor Gaussian short-rate model, evaluated by integration over the model's state variable

gaussian1dNonstandardSwaptionEngine Source #

Arguments

:: Gaussian1dModel 
-> Int

integrationPoints

-> Double

stddevs

-> Bool

extrapolatePayoff

-> Bool

flatPayoffExtrapolation

-> Maybe (GenQuote q)

oas

-> Maybe (GenYieldTermStructure y)

discountCurve

-> Probabilities

probabilities

-> IO PricingEngine 

As gaussian1dSwaptionEngine, for a NonstandardSwaption. Adds an optional OAS (oas, continuously compounded w.r.t. the discount curve's day counter) on top of the shared parameters.

gaussian1dFloatFloatSwaptionEngine Source #

Arguments

:: Gaussian1dModel 
-> Int

integrationPoints

-> Double

stddevs

-> Bool

extrapolatePayoff

-> Bool

flatPayoffExtrapolation

-> Maybe (GenQuote q)

oas

-> Maybe (GenYieldTermStructure y)

discountCurve

-> Bool

includeTodaysExercise

-> Probabilities

probabilities

-> IO PricingEngine 

As gaussian1dNonstandardSwaptionEngine, for a FloatFloatSwaption. Adds includeTodaysExercise -- whether a fixing due exactly "today" counts as part of the exercise-into leg.

gaussian1dJamshidianSwaptionEngine :: Gaussian1dModel -> IO PricingEngine Source #

swaption pricing engine using Jamshidian's decomposition, for any one-factor Gaussian short-rate model.

juQuadraticApproximationEngine :: GeneralizedBlackScholesProcess -> IO PricingEngine Source #

Ju (1999) quadratic-approximation engine for American options

kirkEngine Source #

Arguments

:: BlackProcess 
-> BlackProcess 
-> Double

correlation

-> IO PricingEngine 

pricing engine for a spread option on two futures/assets

midPointCdsEngine Source #

Arguments

:: GenDefaultProbabilityTermStructure d 
-> Double

recoveryRate

-> GenYieldTermStructure y 
-> Maybe Bool

includeSettlementDateFlows

-> IO PricingEngine 

CDS pricing engine using the mid-point approximation, evaluating the default leg at the mid-point of each accrual period

midPointCdoEngine Source #

Arguments

:: GenYieldTermStructure y

discountCurve

-> IO PricingEngine 

Synthetic CDO tranche pricing engine using the mid-point approximation, evaluating the expected tranche loss at the mid-point of each accrual/protection period. The basket must already have a DefaultLossModel attached.

integralCdoEngine Source #

Arguments

:: GenYieldTermStructure y

discountCurve

-> (Word, TimeUnit)

stepSize

-> IO PricingEngine 

Synthetic CDO tranche pricing engine that integrates the expected tranche loss over stepSize-sized steps of the tranche's schedule.

integralNtdEngine Source #

Arguments

:: (Word, TimeUnit)

integrationStep

-> GenYieldTermStructure y

discountCurve

-> IO PricingEngine 

Nth-to-default pricing engine that integrates the probability of at least n defaults over integrationStep-sized steps of the underlying basket's copula.

replicatingVarianceSwapEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> Double

dk

-> NonEmpty Double

callStrikes

-> NonEmpty Double

putStrikes

-> IO PricingEngine 

variance-swap pricing engine using a replicating portfolio of vanilla options at the given strikes

stulzEngine Source #

pricing engine for 2D European basket options (Stulz formula)

bjerksundStenslandSpreadEngine Source #

Bjerksund-Stensland (2014) closed-form pricing engine for a spread option on two futures

operatorSplittingSpreadEngine Source #

Chi-Fai Lo (2015) operator-splitting-approximation pricing engine for a spread option

pearsonSpreadEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GeneralizedBlackScholesProcess 
-> Double

correlation

-> Double

integrationTolerance, upstream default: 1e-10

-> Word

maxIntegrationIterations, upstream default: 10000

-> Double

nStd, upstream default: 8.0

-> IO PricingEngine 

Pearson (1995) 1-D-numerical-integration pricing engine for a spread option

gaussianCopulaSpreadEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GeneralizedBlackScholesProcess 
-> Double

correlation

-> Word

nPoints, upstream default: 64

-> IO PricingEngine 

Gaussian-copula nested-Gauss-Hermite-quadrature pricing engine for a spread option with smile-implied marginals

fd2dBlackScholesVanillaEngine Source #

Arguments

:: GeneralizedBlackScholesProcess 
-> GeneralizedBlackScholesProcess 
-> Double

correlation

-> Word

xGrid, upstream default: 100

-> Word

yGrid, upstream default: 100

-> Word

tGrid, upstream default: 50

-> Word

dampingSteps, upstream default: 0

-> FdmScheme

schemeDesc, upstream default: Hundsdorfer

-> Bool

localVol

-> Double

illegalLocalVolOverwrite, upstream default: -Null<Real>()

-> IO PricingEngine 

two-dimensional finite-differences Black-Scholes basket-option pricing engine

choiBasketEngine Source #

Arguments

:: NonEmpty GeneralizedBlackScholesProcess 
-> Matrix Double

correlation matrix rho

-> Double

lambda, upstream default: 10.0

-> Word

maxNrIntegrationSteps, upstream default: unbounded; the C shim takes a 32-bit count

-> Bool

calcfwdDelta

-> Bool

controlVariate

-> IO PricingEngine 

Choi (2018) "sum of Black-Scholes-Merton models" pricing engine for a basket option on multiple underlyings, correlated via rho

dengLiZhouBasketEngine Source #

Arguments

:: NonEmpty GeneralizedBlackScholesProcess 
-> Matrix Double

correlation matrix rho

-> IO PricingEngine 

Deng-Li-Zhou (2008) closed-form-approximation pricing engine for a spread option on multiple underlyings, correlated via rho

fdndimBlackScholesVanillaEngine :: NonEmpty GeneralizedBlackScholesProcess -> Matrix Double -> FdmGrid -> Word -> Word -> FdmScheme -> IO PricingEngine Source #

N-dimensional Black-Scholes finite-difference engine with uniform or per-axis grids.

singleFactorBsmBasketEngine Source #

Arguments

:: NonEmpty GeneralizedBlackScholesProcess 
-> Double

xTol, upstream default: 1e4*QL_EPSILON

-> IO PricingEngine 

pricing engine for a basket where all underlyings are driven by one stochastic factor

lfmSwaptionEngine :: LiborForwardModel -> GenYieldTermStructure y -> IO PricingEngine Source #

Libor forward model swaption engine, priced via the Black formula

Finite-difference engines

fdG2SwaptionEngine Source #

Arguments

:: G2 
-> Word

tGrid

-> Word

xGrid

-> Word

yGrid

-> Word

dampingSpecs

-> Double

invEps

-> FdmScheme 
-> IO PricingEngine 

finite-differences swaption pricing engine for the G2 two-factor short-rate model

fdHullWhiteSwaptionEngine Source #

Arguments

:: HullWhite 
-> Word

tGrid

-> Word

xGrid

-> Word

dampingSpecs

-> Double

invEps

-> FdmScheme 
-> IO PricingEngine 

finite-differences swaption pricing engine for the Hull-White short-rate model

binomialVanillaEngine Source #

pricing engine for vanilla options using binomial trees

fdBlackScholesVanillaEngine :: GeneralizedBlackScholesProcess -> [Dividend] -> Word -> Word -> Word -> FdmScheme -> Bool -> Double -> CashDividendModel -> IO PricingEngine Source #

Finite-difference Black-Scholes vanilla engine; [] selects no-dividend behavior.

fdBlackScholesVanillaEngineQuanto :: GeneralizedBlackScholesProcess -> [Dividend] -> Maybe FdmQuantoHelper -> Word -> Word -> Word -> FdmScheme -> Bool -> Double -> CashDividendModel -> IO PricingEngine Source #

Quanto-adjusted Black-Scholes vanilla engine; [] selects no-dividend behavior.

fdmQuantoHelper Source #

Arguments

:: GenYieldTermStructure y1

rTS

-> GenYieldTermStructure y2

fTS

-> GenBlackVolTermStructure bv

fxVolTS

-> Double

equityFxCorrelation

-> Double

exchRateATMlevel

-> IO FdmQuantoHelper 

Snapshots rTSfTSfxVolTS at construction time (their underlying shared_ptrs are copied out of their handles): a later relink of a RelinkableYieldTermStructure or RelinkableBlackVolTermStructure passed in here will not be reflected in this FdmQuantoHelper.

quantoAdjustment Source #

Arguments

:: FdmQuantoHelper 
-> Double

equityVol

-> Double

t1

-> Double

t2

-> IO Double 

quanto drift adjustment domesticRate - foreignRate + equityFxCorrelation*equityVol*fxVol over [t1,t2]

fdHestonVanillaEngine :: GenHestonModel hm -> [Dividend] -> Word -> Word -> Word -> Word -> FdmScheme -> Maybe (GenLocalVolTermStructure lv) -> Double -> IO PricingEngine Source #

Finite-difference Heston vanilla engine; [] selects no-dividend behavior.

cosHestonEngine Source #

Arguments

:: GenHestonModel hm

model

-> Double

L

-> Word

n

-> IO PricingEngine 

Fourier-cosine-series Heston engine for European vanilla options. L controls the truncation range and n the number of cosine terms.

analyticPdfHestonEngine Source #

Arguments

:: GenHestonModel hm

model

-> Double

eps

-> Word

integrationOrder

-> IO PricingEngine 

Heston transition-density integration engine for European vanilla options. eps and integrationOrder control Gauss-Lobatto integration accuracy and its iteration limit.

fdBatesVanillaEngine :: GenBatesModel bm -> [Dividend] -> Word -> Word -> Word -> Word -> FdmScheme -> IO PricingEngine Source #

Finite-difference Bates vanilla engine; [] selects no-dividend behavior.

fdBlackScholesShoutEngine :: GeneralizedBlackScholesProcess -> [Dividend] -> Word -> Word -> Word -> FdmScheme -> IO PricingEngine Source #

Finite-difference Black-Scholes shout engine; [] selects no-dividend behavior.

fdHestonVanillaEngineQuanto :: GenHestonModel hm -> [Dividend] -> Maybe FdmQuantoHelper -> Word -> Word -> Word -> Word -> FdmScheme -> Maybe (GenLocalVolTermStructure lv) -> Double -> IO PricingEngine Source #

Quanto-adjusted Heston vanilla engine; [] selects no-dividend behavior.

fdHestonHullWhiteVanillaEngine :: GenHestonModel hm -> HullWhiteProcess -> [Dividend] -> Double -> Word -> Word -> Word -> Word -> Word -> Bool -> FdmScheme -> IO PricingEngine Source #

Heston/Hull-White finite-difference engine; [] selects no-dividend behavior.

Convertible and callable bond engines

binomialConvertibleEngine Source #

Arguments

:: BinomialTree 
-> GeneralizedBlackScholesProcess 
-> Word

timeSteps

-> GenQuote q

creditSpread

-> [Dividend]

dividends

-> IO PricingEngine 

binomial Tsiveriotis-Fernandes pricing engine for convertible bonds

blackCallableFixedRateBondEngine :: GenQuote q -> GenYieldTermStructure y -> IO PricingEngine Source #

volatility is the quoted fwd yield volatility, not price vol

blackCallableZeroCouponBondEngine :: GenQuote q -> GenYieldTermStructure y -> IO PricingEngine Source #

volatility is the quoted fwd yield volatility, not price vol

treeCallableFixedRateBondEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

Callable fixed-rate bond lattice engine using either a step count or an explicit grid.

treeCallableZeroCouponBondEngine :: GenShortRateModel sm -> LatticeTime -> Maybe (GenYieldTermStructure y) -> IO PricingEngine Source #

Callable zero-coupon bond lattice engine using either a step count or an explicit grid.

Black and Bachelier calculators

blackCalculator :: StrikeSpec -> Double -> Double -> Double -> IO BlackCalculator Source #

Black 1976 option-price calculator.

blackScholesCalculator :: StrikeSpec -> Double -> Double -> Double -> Double -> IO BlackScholesCalculator Source #

Black-Scholes-Merton option-price calculator.

bachelierCalculator :: StrikeSpec -> Double -> Double -> Double -> IO BachelierCalculator Source #

Bachelier (normal-model) option-price calculator.

blackDeltaCalculator Source #

Arguments

:: OptionType 
-> DeltaType 
-> Double

spot

-> Double

dDiscount (domestic discount factor)

-> Double

fDiscount (foreign discount factor)

-> Double

stdDev

-> IO BlackDeltaCalculator 

computes the strike given the option's Black-Scholes delta (in an FX-style delta/vol quotation)

Inspectors

Option-calculator capability

class HasOptionCalculator a where Source #

The common Black and Bachelier option-calculator surface. Operations whose inputs differ between the models, such as vanna, remain model-qualified functions.

Instances

Instances details
HasOptionCalculator BachelierCalculator Source # 
Instance details

Defined in QuantLib.PricingEngine

HasOptionCalculator (GenBlackCalculator bc) Source # 
Instance details

Defined in QuantLib.PricingEngine

Calculator sensitivities

blackVanna Source #

Arguments

:: GenBlackCalculator bc 
-> Double

spot

-> Double

maturity

-> IO Double 

Sensitivity of vega to spot (Vanna).

blackScholesDelta :: BlackScholesCalculator -> IO Double Source #

Sensitivity to change in the underlying spot price.

blackScholesElasticity :: BlackScholesCalculator -> IO Double Source #

Sensitivity in percent to a percent change in the underlying spot price.

blackScholesGamma :: BlackScholesCalculator -> IO Double Source #

Second order derivative with respect to change in the underlying spot price.

blackScholesTheta Source #

Arguments

:: BlackScholesCalculator 
-> Double

maturity

-> IO Double 

Sensitivity to time to maturity.

blackScholesThetaPerDay Source #

Arguments

:: BlackScholesCalculator 
-> Double

maturity

-> IO Double 

Sensitivity to time to maturity per day (assuming 365 day in a year).

bachelierVanna Source #

Arguments

:: BachelierCalculator 
-> Double

maturity

-> IO Double 

Sensitivity of vega to spot (Vanna).

Formulae, probabilities and SABR helpers

deltaFromStrike Source #

Arguments

:: BlackDeltaCalculator 
-> Double

strike

-> IO Double 

the option delta under the calculator's chosen convention, for the given strike

strikeFromDelta Source #

Arguments

:: BlackDeltaCalculator 
-> Double

delta

-> IO Double 

the strike price corresponding to the given option delta (under the calculator's chosen convention)

atmStrike :: BlackDeltaCalculator -> AtmType -> IO Double Source #

the at-the-money strike under the given ATM convention, independent of the strike passed at construction

blackFormula Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> Double

displacement

-> IO Double 

Black 1976 formula Warning instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)

blackCashItmProbability Source #

Arguments

:: OptionType 
-> Double 
-> Double

forward

-> Double

stdDev

-> Double

displacement

-> IO Double 

Black 1976 probability of being in the money (in the bond martingale measure), i.e. N(d2). It is a risk-neutral probability, not the real world one. Warning instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)

blackImpliedStdDev Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

blackPrice

-> Double

discount

-> Double

displacement

-> Double

guess

-> Double

accuracy

-> Word

maxIterations

-> IO Double 

Black 1976 implied standard deviation, i.e. volatility*sqrt(timeToMaturity)

blackImpliedStdDevApproximation Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

blackPrice

-> Double

discount

-> Double

displacement

-> IO Double 

Approximated Black 1976 implied standard deviation, i.e. volatility*sqrt(timeToMaturity).It is calculated using Brenner and Subrahmanyan (1988) and Feinstein (1988) approximation for at-the-money forward option, with the extended moneyness approximation by Corrado and Miller (1996)

blackStdDevDerivative Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> Double

displacement

-> IO Double 

Black 1976 formula for standard deviation derivative Warning instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity), and it returns the derivative with respect to the standard deviation. If T is the time to maturity Black vega would be blackStdDevDerivative(strike, forward, stdDev)*sqrt(T)

blackVolDerivative Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

stdDev

-> Double

expiry

-> Double

discount

-> Double

displacement

-> IO Double 

Black 1976 formula for derivative with respect to implied vol, this is basically the vega, but if you want 1% change multiply by 1%

bachelierBlackFormula Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> IO Double 

Black style formula when forward is normal rather than log-normal. This is essentially the model of Bachelier. Warning Bachelier model needs absolute volatility, not percentage volatility. Standard deviation is absoluteVolatility*sqrt(timeToMaturity)

blackForwardDerivative Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> Double

displacement

-> IO Double 

Black 1976 formula for the derivative with respect to the forward. Warning instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)

blackImpliedStdDevChambers Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

blackPrice

-> Double

blackAtmPrice

-> Double

discount

-> Double

displacement

-> IO Double 

Approximated Black 1976 implied standard deviation following Chambers and Nawalkha, The Financial Review 2001, 89-100. The at-the-money option price must be known to use this method.

blackImpliedStdDevApproximationRs Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

blackPrice

-> Double

discount

-> Double

displacement

-> IO Double 

Approximated Black 1976 implied standard deviation following Radoicic and Stefanica, An Explicit Implicit Volatility Formula

blackImpliedStdDevLiRs Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

blackPrice

-> Double

discount

-> Double

displacement

-> Maybe Double

guess

-> Double

omega

-> Double

accuracy

-> Word

maxIterations

-> IO Double 

Black 1976 implied standard deviation by the Li-Rational-Substitution solver, started from the Radoicic-Stefanica approximation. Pass Nothing for the guess to let QuantLib pick the starting point.

blackAssetItmProbability Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

stdDev

-> Double

displacement

-> IO Double 

Black 1976 probability of being in the money in the asset martingale measure, i.e. N(d1). It is a risk-neutral probability, not the real world one.

blackStdDevSecondDerivative Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> Double

displacement

-> IO Double 

Black 1976 formula for the second derivative with respect to the standard deviation. Warning instead of volatility it uses standard deviation, i.e. volatility*sqrt(timeToMaturity)

bachelierForwardDerivative Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> IO Double 

Bachelier formula for the derivative with respect to the forward. Warning the Bachelier model needs absolute volatility, not percentage volatility; standard deviation is absoluteVolatility*sqrt(timeToMaturity)

bachelierImpliedVol Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

tte

-> Double

bachelierPrice

-> Double

discount

-> IO Double 

Bachelier implied (absolute) volatility by the analytic formula of Jaeckel (2017), Implied Normal Volatility. Unlike the Black implied-standard-deviation functions this takes the time to expiry and returns a volatility, not a standard deviation.

bachelierImpliedVolChoi Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

tte

-> Double

bachelierPrice

-> Double

discount

-> IO Double 

Bachelier implied (absolute) volatility by the analytic approximation of Choi, Kim and Kwak (2009). Unlike the Black implied-standard-deviation functions this takes the time to expiry and returns a volatility, not a standard deviation.

bachelierStdDevDerivative Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

stdDev

-> Double

discount

-> IO Double 

Bachelier formula for the standard deviation derivative. Warning it returns the derivative with respect to the standard deviation; Bachelier vega is this times sqrt(T).

bachelierAssetItmProbability Source #

Arguments

:: OptionType 
-> Double

strike

-> Double

forward

-> Double

stdDev

-> IO Double 

Bachelier probability of being in the money in the asset martingale measure, i.e. N(d). It is a risk-neutral probability, not the real world one.

defaultThetaPerDay Source #

Arguments

:: Double

theta

-> IO Double 

default theta-per-day calculation

unsafeSabrLogNormalVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> IO Double 

lognormal SABR volatility, no validity checks on the parameters

unsafeShiftedSabrVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> Double

shift

-> VolatilityType

volatilityType

-> IO Double 

shifted SABR volatility (lognormal or normal), no validity checks on the parameters

unsafeSabrNormalVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> IO Double 

normal SABR volatility, no validity checks on the parameters

unsafeSabrVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> VolatilityType

volatilityType

-> IO Double 

SABR volatility (lognormal or normal), no validity checks on the parameters

sabrVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> VolatilityType

volatilityType

-> IO Double 

SABR volatility (lognormal or normal), with validity checks on the parameters

shiftedSabrVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> Double

shift

-> VolatilityType

volatilityType

-> IO Double 

shifted SABR volatility (lognormal or normal), with validity checks on the parameters

sabrFlochKennedyVolatility Source #

Arguments

:: Double

strike

-> Double

forward

-> Double

expiryTime

-> Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> IO Double 

lognormal SABR volatility using the Floc'h-Kennedy formula, with validity checks on the parameters

validateSabrParameters Source #

Arguments

:: Double

alpha

-> Double

beta

-> Double

nu

-> Double

rho

-> IO () 

validate SABR parameters, throwing if they are not acceptable

sabrGuess Source #

Arguments

:: Double

k_m

-> Double

vol_m

-> Double

k_0

-> Double

vol_0

-> Double

k_p

-> Double

vol_p

-> Double

forward

-> Double

expiryTime

-> Double

beta

-> Double

shift

-> VolatilityType

volatilityType

-> IO [Double] 

initial guess (alpha, beta, nu, rho) for SABR calibration, per Le Floc'h and Kennedy