| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Quote
Synopsis
- data GenQuote q
- type Quote = GenQuote CQuote
- type SimpleQuote = GenQuote CSimpleQuote
- type DeltaVolQuote = GenQuote CDeltaVolQuote
- type FuturesConvAdjustmentQuote = GenQuote CFuturesConvAdjustmentQuote
- type RelinkableQuote = GenQuote CRelinkableQuote
- data PriceType
- data IntervalPriceType
- data AtmType
- data DeltaType
- data QuoteOp
- data MultiQuoteOp
- asQuote :: GenQuote q -> IO Quote
- simpleQuote :: Double -> IO SimpleQuote
- deltaVolQuote :: Double -> GenQuote q -> Double -> DeltaType -> IO DeltaVolQuote
- atmVolQuote :: GenQuote q -> DeltaType -> Double -> AtmType -> IO DeltaVolQuote
- eurodollarFuturesImpliedStdDevQuote :: GenQuote q1 -> GenQuote q2 -> GenQuote q3 -> Double -> Double -> Double -> Word -> IO Quote
- forwardSwapQuote :: GenSwapIndex sidx -> GenQuote q -> (Int, TimeUnit) -> IO Quote
- forwardValueQuote :: GenIndex idx -> Day -> IO Quote
- fxCashSpotQuote :: GenQuote q -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> Calendar -> Word -> IO Quote
- futuresConvAdjustmentQuoteFromImmCode :: GenIborIndex ibor -> String -> GenQuote q1 -> GenQuote q2 -> GenQuote q3 -> IO FuturesConvAdjustmentQuote
- futuresConvAdjustmentQuote :: GenIborIndex ibor -> Day -> GenQuote q1 -> GenQuote q2 -> GenQuote q3 -> IO FuturesConvAdjustmentQuote
- impliedStdDevQuote :: OptionType -> GenQuote q1 -> GenQuote q2 -> Double -> Double -> Double -> Word -> IO Quote
- lastFixingQuote :: GenIndex idx -> IO Quote
- relinkableQuote :: Maybe (GenQuote q) -> IO RelinkableQuote
- derivedQuote :: QuoteOp -> GenQuote q -> Double -> IO Quote
- compositeQuote :: QuoteOp -> GenQuote q1 -> GenQuote q2 -> IO Quote
- multiCompositeQuote :: MultiQuoteOp -> [GenQuote q] -> IO Quote
- withDerivedQuote :: (Double -> Double) -> GenQuote q -> (Quote -> IO b) -> IO b
- withCompositeQuote :: (Double -> Double -> Double) -> GenQuote q1 -> GenQuote q2 -> (Quote -> IO b) -> IO b
- withMultiCompositeQuote :: ([Double] -> Double) -> [GenQuote q] -> (Quote -> IO b) -> IO b
- setValue :: SimpleQuote -> Double -> IO ()
- linkTo :: RelinkableQuote -> GenQuote q -> IO ()
- value :: GenQuote q -> IO Double
- isValid :: GenQuote q -> IO Bool
- futuresValue :: FuturesConvAdjustmentQuote -> IO Double
Types
Quote hierarchy
type FuturesConvAdjustmentQuote = GenQuote CFuturesConvAdjustmentQuote Source #
Configuration
Instances
| Enum PriceType Source # | |
Defined in QuantLib.Quote Methods succ :: PriceType -> PriceType # pred :: PriceType -> PriceType # fromEnum :: PriceType -> Int # enumFrom :: PriceType -> [PriceType] # enumFromThen :: PriceType -> PriceType -> [PriceType] # enumFromTo :: PriceType -> PriceType -> [PriceType] # enumFromThenTo :: PriceType -> PriceType -> PriceType -> [PriceType] # | |
| Read PriceType Source # | |
| Show PriceType Source # | |
| Eq PriceType Source # | |
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.
Instances
Constructors
| AtmNull | |
| AtmSpot | |
| AtmFwd | |
| AtmDeltaNeutral | |
| AtmVegaMax | |
| AtmGammaMax | |
| AtmPutCall50 |
Instances
| Enum AtmType Source # | |
| Read AtmType Source # | |
| Show AtmType Source # | |
| Eq AtmType Source # | |
Instances
| Enum DeltaType Source # | |
Defined in QuantLib.Quote Methods succ :: DeltaType -> DeltaType # pred :: DeltaType -> DeltaType # fromEnum :: DeltaType -> Int # enumFrom :: DeltaType -> [DeltaType] # enumFromThen :: DeltaType -> DeltaType -> [DeltaType] # enumFromTo :: DeltaType -> DeltaType -> [DeltaType] # enumFromThenTo :: DeltaType -> DeltaType -> DeltaType -> [DeltaType] # | |
| Read DeltaType Source # | |
| Show DeltaType Source # | |
| Eq DeltaType Source # | |
Constructors
| QuoteAdd | |
| QuoteSubtract | |
| QuoteMultiply | |
| QuoteDivide |
Instances
| Bounded QuoteOp Source # | |
| Enum QuoteOp Source # | |
| Read QuoteOp Source # | |
| Show QuoteOp Source # | |
| Eq QuoteOp Source # | |
data MultiQuoteOp Source #
Which fold a catalogue multiCompositeQuote applies over its elements.
Constructors
| QuoteSum | |
| QuoteProduct | |
| QuoteNorm2 |
Instances
| Bounded MultiQuoteOp Source # | |
Defined in QuantLib.Quote | |
| Enum MultiQuoteOp Source # | |
Defined in QuantLib.Quote Methods succ :: MultiQuoteOp -> MultiQuoteOp # pred :: MultiQuoteOp -> MultiQuoteOp # toEnum :: Int -> MultiQuoteOp # fromEnum :: MultiQuoteOp -> Int # enumFrom :: MultiQuoteOp -> [MultiQuoteOp] # enumFromThen :: MultiQuoteOp -> MultiQuoteOp -> [MultiQuoteOp] # enumFromTo :: MultiQuoteOp -> MultiQuoteOp -> [MultiQuoteOp] # enumFromThenTo :: MultiQuoteOp -> MultiQuoteOp -> MultiQuoteOp -> [MultiQuoteOp] # | |
| Read MultiQuoteOp Source # | |
Defined in QuantLib.Quote Methods readsPrec :: Int -> ReadS MultiQuoteOp # readList :: ReadS [MultiQuoteOp] # | |
| Show MultiQuoteOp Source # | |
Defined in QuantLib.Quote Methods showsPrec :: Int -> MultiQuoteOp -> ShowS # show :: MultiQuoteOp -> String # showList :: [MultiQuoteOp] -> ShowS # | |
| Eq MultiQuoteOp Source # | |
Defined in QuantLib.Quote | |
Constructors
Basic quotes and conversions
simpleQuote :: Double -> IO SimpleQuote Source #
market element returning a stored value
quotation of an FX delta vs vol, e.g. a 25-delta risk-reversal/butterfly point
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
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
Arguments
| :: GenQuote q | settlementSpot: |
| -> GenYieldTermStructure y1 | domesticTS: discounting in the domestic (quote) currency |
| -> GenYieldTermStructure y2 | foreignTS: discounting in the foreign (base) currency |
| -> Calendar | settlementCalendar: business days that set |
| -> Word | settlementDays: spot lag in business days from the evaluation date |
| -> IO Quote |
The cash value, at the evaluation date d, of an FX spot quoted for settlement on
V = advance calendar d settlementDays Days (business days; with zero days, d adjusted
Following). Its value is
S_d = S_V * (P_dom(V) / P_dom(d)) / (P_for(V) / P_for(d))
with P each curve's discount factor, so a forward built from it,
S_d * (P_for(T) / P_for(d)) / (P_dom(T) / P_dom(d)), equals S_V at T = V. Use it as a
Garman-Kohlhagen process's spot when the market quotes spot for settlement rather than cash.
This class is defined by hasquant, not QuantLib (which has no quote observing yield curves);
QuantExt's FxRateQuote is the prior art. It is live: it notifies its observers when the
settlement spot, either curve (including a relink) or the evaluation date changes, and recomputes
V and every discount factor on each read. A read throws when a curve cannot discount to d, for
instance when its reference date is after the evaluation 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
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 #
Composite quotes
A quote derived from another by applying quote `op` operand, live: it recomputes whenever
the underlying quote moves, and notifies everything built on it.
is the "base plus 5bp" spread quote for a rate helper.
For anything outside the derivedQuote QuoteAdd base 0.0005QuoteOp 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.
As derivedQuote, with an arbitrary Haskell function.
The quote and its native dependents retain the callback after the continuation returns. Callback exceptions are rethrown by the enclosing Haskell call.
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
ownership and exception rules as withDerivedQuote.
withMultiCompositeQuote Source #
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 ownership and exception rules as withDerivedQuote.
Mutators
setValue :: SimpleQuote -> Double -> IO () Source #
Set the quote's value. The change propagates 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
futuresValue :: FuturesConvAdjustmentQuote -> IO Double Source #
The futures-vs-forward-rate value implied by the futures quote alone (futuresQuote_->value()).