hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Quote

Synopsis

Types

Quote hierarchy

data GenQuote q Source #

Quote
  SimpleQuote
  DeltaVolQuote
  FuturesConvAdjustmentQuote
  RelinkableQuote

type Quote = GenQuote CQuote Source #

The root of the hierarchy shown under GenQuote.

type SimpleQuote = GenQuote CSimpleQuote Source #

A Quote; see the hierarchy under GenQuote.

type DeltaVolQuote = GenQuote CDeltaVolQuote Source #

A Quote; see the hierarchy under GenQuote.

type FuturesConvAdjustmentQuote = GenQuote CFuturesConvAdjustmentQuote Source #

A Quote; see the hierarchy under GenQuote.

type RelinkableQuote = GenQuote CRelinkableQuote Source #

A Quote; see the hierarchy under GenQuote.

Configuration

data IntervalPriceType Source #

Operation used by derivedQuote or compositeQuote. The former applies quote `op` operand; the latter applies quote1 `op` quote2. Use withDerivedQuote for reversed unary operations such as FX inversion.

data QuoteOp Source #

Instances

Instances details
Bounded QuoteOp Source # 
Instance details

Defined in QuantLib.Quote

Enum QuoteOp Source # 
Instance details

Defined in QuantLib.Quote

Read QuoteOp Source # 
Instance details

Defined in QuantLib.Quote

Show QuoteOp Source # 
Instance details

Defined in QuantLib.Quote

Eq QuoteOp Source # 
Instance details

Defined in QuantLib.Quote

Methods

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

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

Constructors

Basic quotes and conversions

simpleQuote :: Double -> IO SimpleQuote Source #

market element returning a stored value

deltaVolQuote Source #

Arguments

:: Double

delta

-> GenQuote q

vol

-> Double

maturity

-> DeltaType 
-> IO DeltaVolQuote 

quotation of an FX delta vs vol, e.g. a 25-delta risk-reversal/butterfly point

atmVolQuote Source #

Arguments

:: GenQuote q

vol

-> DeltaType 
-> Double

maturity

-> AtmType 
-> IO DeltaVolQuote 

quotation of an FX at-the-money vol point (e.g. ATM straddle)

eurodollarFuturesImpliedStdDevQuote Source #

Arguments

:: GenQuote q1

forward

-> GenQuote q2

callPrice

-> GenQuote q3

putPrice

-> Double

strike

-> Double

guess

-> Double

accuracy

-> Word

maxIter

-> IO Quote 

implied standard deviation of a Eurodollar future's underlying, solved from its call/put prices

forwardSwapQuote Source #

Arguments

:: GenSwapIndex sidx 
-> GenQuote q

spread

-> (Int, TimeUnit)

fwdStart

-> IO Quote 

implied rate of a forward-starting swap on the given swap index, offset by a spread quote

forwardValueQuote :: GenIndex idx -> Day -> IO Quote Source #

forward value of an index as of a given fixing date

futuresConvAdjustmentQuoteFromImmCode Source #

Arguments

:: GenIborIndex ibor 
-> String

immCode

-> GenQuote q1

futuresQuote

-> GenQuote q2

volatility

-> GenQuote q3

meanReversion

-> IO FuturesConvAdjustmentQuote 

futures-convexity adjustment for an Ibor future identified by its IMM code

futuresConvAdjustmentQuote Source #

Arguments

:: GenIborIndex ibor 
-> Day

futuresDate

-> GenQuote q1

futuresQuote

-> GenQuote q2

volatility

-> GenQuote q3

meanReversion

-> IO FuturesConvAdjustmentQuote 

futures-convexity adjustment for an Ibor future identified by its futures (IMM) date

impliedStdDevQuote Source #

Arguments

:: OptionType 
-> GenQuote q1

forward

-> GenQuote q2

price

-> Double

strike

-> Double

guess

-> Double

accuracy

-> Word

maxIter

-> IO Quote 

implied standard deviation of an underlying, solved from its option price at a given strike

lastFixingQuote :: GenIndex idx -> IO Quote Source #

last available fixing of the given index, updating whenever a new fixing is added

relinkableQuote :: Maybe (GenQuote q) -> IO RelinkableQuote Source #

A relinkable quote handle. Objects built from it follow later linkTo calls. Nothing creates an empty handle; reading it throws until linked.

Composite quotes

derivedQuote Source #

Arguments

:: QuoteOp 
-> GenQuote q 
-> Double

operand

-> IO Quote 

A quote derived from another by applying quote `op` operand, live: it recomputes whenever the underlying quote moves, and notifies everything built on it.

derivedQuote QuoteAdd base 0.0005 is the "base plus 5bp" spread quote for a rate helper. For anything outside the QuoteOp catalogue -- 1/x, a cap, a nonlinear transform -- use withDerivedQuote.

compositeQuote :: QuoteOp -> GenQuote q1 -> GenQuote q2 -> IO Quote Source #

A quote combining two others as quote1 `op` quote2, live in both: it recomputes whenever either moves. Use withCompositeQuote for an operation outside the QuoteOp catalogue.

multiCompositeQuote :: MultiQuoteOp -> [GenQuote q] -> IO Quote Source #

A quote folding any number of others, live in all of them. An empty list is accepted and gives the fold's identity (0 for QuoteSum and QuoteNorm2, 1 for QuoteProduct) -- upstream imposes no non-empty requirement. Use withMultiCompositeQuote for a fold outside the MultiQuoteOp catalogue.

withDerivedQuote Source #

Arguments

:: (Double -> Double)

f(value)

-> GenQuote q 
-> (Quote -> IO b) 
-> IO b 

As derivedQuote, with an arbitrary Haskell function.

The continuation must span the whole use, not only construction. QuantLib calls f later from Quote::value(). Returning frees its function pointer, so a later read crashes.

f must be total: exceptions cross C++, including during bootstrap. Prefer derivedQuote when its QuoteOp fits.

withCompositeQuote Source #

Arguments

:: (Double -> Double -> Double)

f(value1, value2)

-> GenQuote q1 
-> GenQuote q2 
-> (Quote -> IO b) 
-> IO b 

As compositeQuote, but combining the two quotes with an arbitrary Haskell function. Same continuation-lifetime and totality rules as withDerivedQuote.

withMultiCompositeQuote Source #

Arguments

:: ([Double] -> Double)

f(values)

-> [GenQuote q] 
-> (Quote -> IO b) 
-> IO b 

As multiCompositeQuote, but folding with an arbitrary Haskell function. The whole element vector is passed per evaluation, so this crosses into Haskell once per value, not once per element. Same continuation-lifetime and totality rules as withDerivedQuote.

Mutators

setValue :: SimpleQuote -> Double -> IO Double Source #

returns the difference between the new value and the old value NB The change will propagate to all users of the quote

linkTo :: RelinkableQuote -> GenQuote q -> IO () Source #

Point a relinkable handle at another quote. Existing dependents reprice without reconstruction. Use setValue for a value bump; this swaps the quote object.

Inspectors

value :: GenQuote q -> IO Double Source #

Returns the current value of the given Quote object

isValid :: GenQuote q -> IO Bool Source #

returns true if the Quote holds a valid value

futuresValue :: FuturesConvAdjustmentQuote -> IO Double Source #

The futures-vs-forward-rate value implied by the futures quote alone (futuresQuote_->value()).