| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.Instrument
Synopsis
- data GenInstrument i
- type Instrument = GenInstrument CInstrument
- data AdditionalResultVal
- data Exercise
- data ExerciseType
- data Callability
- = Soft !(Double, BondPriceType) !Day !Double
- | Callability !(Double, BondPriceType) !CallabilityType !Day
- data CallabilityType
- data PositionType
- data SettlementType
- data SettlementMethod
- data OptionType
- data BarrierType
- data DoubleBarrierType
- data PartialBarrierRange
- data AverageType
- data Seniority
- data PricingModel
- data PerpetualFuturesPayoffType
- data PerpetualFuturesFundingType
- asInstrument :: GenInstrument i -> IO Instrument
- perpetualFutures :: PerpetualFuturesPayoffType -> PerpetualFuturesFundingType -> (Int, TimeUnit) -> Calendar -> DayCounter -> IO Instrument
- composite :: [(Instrument, Double)] -> IO Instrument
- setPricingEngine :: GenInstrument i -> PricingEngine -> IO ()
- npv :: GenInstrument i -> IO Double
- errorEstimate :: GenInstrument i -> IO Double
- isExpired :: GenInstrument i -> IO Bool
- valuationDate :: GenInstrument i -> IO Day
- additionalResults :: GenInstrument i -> IO [(String, AdditionalResultVal)]
Types
Instrument hierarchy
data GenInstrument i Source #
Instrument*
Forward*
BondForward
ForwardRateAgreement
FxForward
VarianceSwap
VarianceOption
Option*
CdsOption
MultiAssetOption
MargrabeOption
EverestOption
OneAssetOption
BarrierOption
DoubleBarrierOption
SoftBarrierOption
VanillaOption
QuantoVanillaOption
QuantoForwardVanillaOption
QuantoBarrierOption
QuantoDoubleBarrierOption
Swaption
NonstandardSwaption
FloatFloatSwaption
IrregularSwaption
Swap*
FixedVsFloatingSwap*
VanillaSwap
IrregularSwap
NonstandardSwap
FloatFloatSwap
AssetSwap
BMASwap
OvernightIndexedSwap
ZeroCouponInflationSwap
YearOnYearInflationSwap
CPISwap
ZeroCouponSwap
EquityTotalReturnSwap
ConstNotionalCrossCurrencySwap
ConstNotionalCrossCurrencyBasisSwap
ConstNotionalCrossCurrencyFixedVsFloatingSwap
CreditDefaultSwap
SyntheticCDO
NthToDefault
CapFloor
YoYInflationCapFloor
CPICapFloor
Bond
ConvertibleBond
FixedRateBond
BTP
CallableBond
CPIBond
Commodity*
EnergyCommodity*
EnergyFuture
EnergySwap*
EnergyVanillaSwap
EnergyBasisSwapInstances
type Instrument = GenInstrument CInstrument Source #
The root of the hierarchy shown under GenInstrument.
Additional results
data AdditionalResultVal Source #
One value from QuantLib's `Instrument::additionalResults()` map. QuantLib stores the map as
`ext::any`, so this Haskell view picks three concrete shapes -- Real (Double), `std::string`
(String), `std::vectorReal` (`[Double]`) -- plus an UnsupportedVal fallback recording the
value's C++ RTTI type name, so no key is ever silently dropped or mislabelled.
Constructors
| RealVal Double | |
| StringVal String | |
| RealVectorVal [Double] | |
| UnsupportedVal String |
Instances
| Show AdditionalResultVal Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> AdditionalResultVal -> ShowS # show :: AdditionalResultVal -> String # showList :: [AdditionalResultVal] -> ShowS # | |
| Eq AdditionalResultVal Source # | |
Defined in QuantLib.Internal.Common Methods (==) :: AdditionalResultVal -> AdditionalResultVal -> Bool # (/=) :: AdditionalResultVal -> AdditionalResultVal -> Bool # | |
Exercises and callability
Exercise American Early Vanilla EuropeanExercise BermudanExercise SwingExercise Rebated (wraps another Exercise)
Constructors
| American | |
| Early !ExerciseType !Bool | |
| Vanilla !ExerciseType | |
| European !EuropeanExercise | |
| Bermudan !BermudanExercise | |
| Rebated | |
Fields
| |
data ExerciseType Source #
Instances
| Enum ExerciseType Source # | |
Defined in QuantLib.Internal.Common Methods succ :: ExerciseType -> ExerciseType # pred :: ExerciseType -> ExerciseType # toEnum :: Int -> ExerciseType # fromEnum :: ExerciseType -> Int # enumFrom :: ExerciseType -> [ExerciseType] # enumFromThen :: ExerciseType -> ExerciseType -> [ExerciseType] # enumFromTo :: ExerciseType -> ExerciseType -> [ExerciseType] # enumFromThenTo :: ExerciseType -> ExerciseType -> ExerciseType -> [ExerciseType] # | |
| Read ExerciseType Source # | |
Defined in QuantLib.Internal.Common Methods readsPrec :: Int -> ReadS ExerciseType # readList :: ReadS [ExerciseType] # | |
| Show ExerciseType Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> ExerciseType -> ShowS # show :: ExerciseType -> String # showList :: [ExerciseType] -> ShowS # | |
| Eq ExerciseType Source # | |
Defined in QuantLib.Internal.Common | |
data Callability Source #
Constructors
| Soft !(Double, BondPriceType) !Day !Double | trigger |
| Callability !(Double, BondPriceType) !CallabilityType !Day |
data CallabilityType Source #
Constructors
| CallabilityCall | |
| CallabilityPut |
Instances
| Enum CallabilityType Source # | |
Defined in QuantLib.Internal.Common Methods succ :: CallabilityType -> CallabilityType # pred :: CallabilityType -> CallabilityType # toEnum :: Int -> CallabilityType # fromEnum :: CallabilityType -> Int # enumFrom :: CallabilityType -> [CallabilityType] # enumFromThen :: CallabilityType -> CallabilityType -> [CallabilityType] # enumFromTo :: CallabilityType -> CallabilityType -> [CallabilityType] # enumFromThenTo :: CallabilityType -> CallabilityType -> CallabilityType -> [CallabilityType] # | |
| Read CallabilityType Source # | |
Defined in QuantLib.Internal.Common Methods readsPrec :: Int -> ReadS CallabilityType # readList :: ReadS [CallabilityType] # | |
| Show CallabilityType Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> CallabilityType -> ShowS # show :: CallabilityType -> String # showList :: [CallabilityType] -> ShowS # | |
| Eq CallabilityType Source # | |
Defined in QuantLib.Internal.Common Methods (==) :: CallabilityType -> CallabilityType -> Bool # (/=) :: CallabilityType -> CallabilityType -> Bool # | |
Conventions
data PositionType Source #
Instances
| Enum PositionType Source # | |
Defined in QuantLib.Internal.Common Methods succ :: PositionType -> PositionType # pred :: PositionType -> PositionType # toEnum :: Int -> PositionType # fromEnum :: PositionType -> Int # enumFrom :: PositionType -> [PositionType] # enumFromThen :: PositionType -> PositionType -> [PositionType] # enumFromTo :: PositionType -> PositionType -> [PositionType] # enumFromThenTo :: PositionType -> PositionType -> PositionType -> [PositionType] # | |
| Read PositionType Source # | |
Defined in QuantLib.Internal.Common Methods readsPrec :: Int -> ReadS PositionType # readList :: ReadS [PositionType] # | |
| Show PositionType Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> PositionType -> ShowS # show :: PositionType -> String # showList :: [PositionType] -> ShowS # | |
| Eq PositionType Source # | |
Defined in QuantLib.Internal.Common | |
data SettlementType Source #
Instances
| Enum SettlementType Source # | |
Defined in QuantLib.Instrument Methods succ :: SettlementType -> SettlementType # pred :: SettlementType -> SettlementType # toEnum :: Int -> SettlementType # fromEnum :: SettlementType -> Int # enumFrom :: SettlementType -> [SettlementType] # enumFromThen :: SettlementType -> SettlementType -> [SettlementType] # enumFromTo :: SettlementType -> SettlementType -> [SettlementType] # enumFromThenTo :: SettlementType -> SettlementType -> SettlementType -> [SettlementType] # | |
| Read SettlementType Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS SettlementType # readList :: ReadS [SettlementType] # | |
| Show SettlementType Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> SettlementType -> ShowS # show :: SettlementType -> String # showList :: [SettlementType] -> ShowS # | |
| Eq SettlementType Source # | |
Defined in QuantLib.Instrument Methods (==) :: SettlementType -> SettlementType -> Bool # (/=) :: SettlementType -> SettlementType -> Bool # | |
data SettlementMethod Source #
Instances
| Enum SettlementMethod Source # | |
Defined in QuantLib.Instrument Methods succ :: SettlementMethod -> SettlementMethod # pred :: SettlementMethod -> SettlementMethod # toEnum :: Int -> SettlementMethod # fromEnum :: SettlementMethod -> Int # enumFrom :: SettlementMethod -> [SettlementMethod] # enumFromThen :: SettlementMethod -> SettlementMethod -> [SettlementMethod] # enumFromTo :: SettlementMethod -> SettlementMethod -> [SettlementMethod] # enumFromThenTo :: SettlementMethod -> SettlementMethod -> SettlementMethod -> [SettlementMethod] # | |
| Read SettlementMethod Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS SettlementMethod # readList :: ReadS [SettlementMethod] # | |
| Show SettlementMethod Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> SettlementMethod -> ShowS # show :: SettlementMethod -> String # showList :: [SettlementMethod] -> ShowS # | |
| Eq SettlementMethod Source # | |
Defined in QuantLib.Instrument Methods (==) :: SettlementMethod -> SettlementMethod -> Bool # (/=) :: SettlementMethod -> SettlementMethod -> Bool # | |
data OptionType Source #
Instances
| Enum OptionType Source # | |
Defined in QuantLib.Internal.Common Methods succ :: OptionType -> OptionType # pred :: OptionType -> OptionType # toEnum :: Int -> OptionType # fromEnum :: OptionType -> Int # enumFrom :: OptionType -> [OptionType] # enumFromThen :: OptionType -> OptionType -> [OptionType] # enumFromTo :: OptionType -> OptionType -> [OptionType] # enumFromThenTo :: OptionType -> OptionType -> OptionType -> [OptionType] # | |
| Read OptionType Source # | |
Defined in QuantLib.Internal.Common Methods readsPrec :: Int -> ReadS OptionType # readList :: ReadS [OptionType] # readPrec :: ReadPrec OptionType # readListPrec :: ReadPrec [OptionType] # | |
| Show OptionType Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> OptionType -> ShowS # show :: OptionType -> String # showList :: [OptionType] -> ShowS # | |
| Eq OptionType Source # | |
Defined in QuantLib.Internal.Common | |
data BarrierType Source #
Instances
| Enum BarrierType Source # | |
Defined in QuantLib.Instrument Methods succ :: BarrierType -> BarrierType # pred :: BarrierType -> BarrierType # toEnum :: Int -> BarrierType # fromEnum :: BarrierType -> Int # enumFrom :: BarrierType -> [BarrierType] # enumFromThen :: BarrierType -> BarrierType -> [BarrierType] # enumFromTo :: BarrierType -> BarrierType -> [BarrierType] # enumFromThenTo :: BarrierType -> BarrierType -> BarrierType -> [BarrierType] # | |
| Read BarrierType Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS BarrierType # readList :: ReadS [BarrierType] # readPrec :: ReadPrec BarrierType # readListPrec :: ReadPrec [BarrierType] # | |
| Show BarrierType Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> BarrierType -> ShowS # show :: BarrierType -> String # showList :: [BarrierType] -> ShowS # | |
| Eq BarrierType Source # | |
Defined in QuantLib.Instrument | |
data DoubleBarrierType Source #
Instances
| Enum DoubleBarrierType Source # | |
Defined in QuantLib.Instrument Methods succ :: DoubleBarrierType -> DoubleBarrierType # pred :: DoubleBarrierType -> DoubleBarrierType # toEnum :: Int -> DoubleBarrierType # fromEnum :: DoubleBarrierType -> Int # enumFrom :: DoubleBarrierType -> [DoubleBarrierType] # enumFromThen :: DoubleBarrierType -> DoubleBarrierType -> [DoubleBarrierType] # enumFromTo :: DoubleBarrierType -> DoubleBarrierType -> [DoubleBarrierType] # enumFromThenTo :: DoubleBarrierType -> DoubleBarrierType -> DoubleBarrierType -> [DoubleBarrierType] # | |
| Read DoubleBarrierType Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS DoubleBarrierType # readList :: ReadS [DoubleBarrierType] # | |
| Show DoubleBarrierType Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> DoubleBarrierType -> ShowS # show :: DoubleBarrierType -> String # showList :: [DoubleBarrierType] -> ShowS # | |
| Eq DoubleBarrierType Source # | |
Defined in QuantLib.Instrument Methods (==) :: DoubleBarrierType -> DoubleBarrierType -> Bool # (/=) :: DoubleBarrierType -> DoubleBarrierType -> Bool # | |
data PartialBarrierRange Source #
Instances
| Enum PartialBarrierRange Source # | |
Defined in QuantLib.Instrument Methods succ :: PartialBarrierRange -> PartialBarrierRange # pred :: PartialBarrierRange -> PartialBarrierRange # toEnum :: Int -> PartialBarrierRange # fromEnum :: PartialBarrierRange -> Int # enumFrom :: PartialBarrierRange -> [PartialBarrierRange] # enumFromThen :: PartialBarrierRange -> PartialBarrierRange -> [PartialBarrierRange] # enumFromTo :: PartialBarrierRange -> PartialBarrierRange -> [PartialBarrierRange] # enumFromThenTo :: PartialBarrierRange -> PartialBarrierRange -> PartialBarrierRange -> [PartialBarrierRange] # | |
| Read PartialBarrierRange Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS PartialBarrierRange # readList :: ReadS [PartialBarrierRange] # | |
| Show PartialBarrierRange Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> PartialBarrierRange -> ShowS # show :: PartialBarrierRange -> String # showList :: [PartialBarrierRange] -> ShowS # | |
| Eq PartialBarrierRange Source # | |
Defined in QuantLib.Instrument Methods (==) :: PartialBarrierRange -> PartialBarrierRange -> Bool # (/=) :: PartialBarrierRange -> PartialBarrierRange -> Bool # | |
data AverageType Source #
Constructors
| Arithmetic | |
| Geometric |
Instances
| Enum AverageType Source # | |
Defined in QuantLib.Instrument Methods succ :: AverageType -> AverageType # pred :: AverageType -> AverageType # toEnum :: Int -> AverageType # fromEnum :: AverageType -> Int # enumFrom :: AverageType -> [AverageType] # enumFromThen :: AverageType -> AverageType -> [AverageType] # enumFromTo :: AverageType -> AverageType -> [AverageType] # enumFromThenTo :: AverageType -> AverageType -> AverageType -> [AverageType] # | |
| Read AverageType Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS AverageType # readList :: ReadS [AverageType] # readPrec :: ReadPrec AverageType # readListPrec :: ReadPrec [AverageType] # | |
| Show AverageType Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> AverageType -> ShowS # show :: AverageType -> String # showList :: [AverageType] -> ShowS # | |
| Eq AverageType Source # | |
Defined in QuantLib.Instrument | |
Constructors
| SecDom | |
| SeniorSec | |
| SnrFor | |
| SeniorUnSec | |
| SubLT2 | |
| SubLoweTier2 | |
| JrSubT2 | |
| SubUpperTier2 | |
| PrefT1 | |
| SubTier1 | |
| NoSeniority |
Instances
| Enum Seniority Source # | |
Defined in QuantLib.Instrument Methods succ :: Seniority -> Seniority # pred :: Seniority -> Seniority # fromEnum :: Seniority -> Int # enumFrom :: Seniority -> [Seniority] # enumFromThen :: Seniority -> Seniority -> [Seniority] # enumFromTo :: Seniority -> Seniority -> [Seniority] # enumFromThenTo :: Seniority -> Seniority -> Seniority -> [Seniority] # | |
| Read Seniority Source # | |
| Show Seniority Source # | |
| Eq Seniority Source # | |
data PricingModel Source #
Instances
| Enum PricingModel Source # | |
Defined in QuantLib.Instrument Methods succ :: PricingModel -> PricingModel # pred :: PricingModel -> PricingModel # toEnum :: Int -> PricingModel # fromEnum :: PricingModel -> Int # enumFrom :: PricingModel -> [PricingModel] # enumFromThen :: PricingModel -> PricingModel -> [PricingModel] # enumFromTo :: PricingModel -> PricingModel -> [PricingModel] # enumFromThenTo :: PricingModel -> PricingModel -> PricingModel -> [PricingModel] # | |
| Read PricingModel Source # | |
Defined in QuantLib.Instrument Methods readsPrec :: Int -> ReadS PricingModel # readList :: ReadS [PricingModel] # | |
| Show PricingModel Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> PricingModel -> ShowS # show :: PricingModel -> String # showList :: [PricingModel] -> ShowS # | |
| Eq PricingModel Source # | |
Defined in QuantLib.Instrument | |
data PerpetualFuturesPayoffType Source #
Instances
| Enum PerpetualFuturesPayoffType Source # | |
Defined in QuantLib.Instrument Methods succ :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType # pred :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType # toEnum :: Int -> PerpetualFuturesPayoffType # fromEnum :: PerpetualFuturesPayoffType -> Int # enumFrom :: PerpetualFuturesPayoffType -> [PerpetualFuturesPayoffType] # enumFromThen :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType -> [PerpetualFuturesPayoffType] # enumFromTo :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType -> [PerpetualFuturesPayoffType] # enumFromThenTo :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType -> [PerpetualFuturesPayoffType] # | |
| Read PerpetualFuturesPayoffType Source # | |
Defined in QuantLib.Instrument | |
| Show PerpetualFuturesPayoffType Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> PerpetualFuturesPayoffType -> ShowS # show :: PerpetualFuturesPayoffType -> String # showList :: [PerpetualFuturesPayoffType] -> ShowS # | |
| Eq PerpetualFuturesPayoffType Source # | |
Defined in QuantLib.Instrument Methods (==) :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType -> Bool # (/=) :: PerpetualFuturesPayoffType -> PerpetualFuturesPayoffType -> Bool # | |
data PerpetualFuturesFundingType Source #
Instances
| Enum PerpetualFuturesFundingType Source # | Constructs a perpetual future. Linear contracts settle and margin in the domestic currency of the underlying FOR/DOM pair; Inverse contracts do so in the foreign currency; Quanto contracts use a separate quanto currency. A zero-length funding frequency selects continuous funding; otherwise funding is discrete at the supplied period. |
Defined in QuantLib.Instrument Methods succ :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType # pred :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType # toEnum :: Int -> PerpetualFuturesFundingType # fromEnum :: PerpetualFuturesFundingType -> Int # enumFrom :: PerpetualFuturesFundingType -> [PerpetualFuturesFundingType] # enumFromThen :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType -> [PerpetualFuturesFundingType] # enumFromTo :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType -> [PerpetualFuturesFundingType] # enumFromThenTo :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType -> PerpetualFuturesFundingType -> [PerpetualFuturesFundingType] # | |
| Read PerpetualFuturesFundingType Source # | |
Defined in QuantLib.Instrument | |
| Show PerpetualFuturesFundingType Source # | |
Defined in QuantLib.Instrument Methods showsPrec :: Int -> PerpetualFuturesFundingType -> ShowS # show :: PerpetualFuturesFundingType -> String # showList :: [PerpetualFuturesFundingType] -> ShowS # | |
| Eq PerpetualFuturesFundingType Source # | |
Defined in QuantLib.Instrument Methods (==) :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType -> Bool # (/=) :: PerpetualFuturesFundingType -> PerpetualFuturesFundingType -> Bool # | |
Constructors
asInstrument :: GenInstrument i -> IO Instrument Source #
Arguments
| :: PerpetualFuturesPayoffType | payoffType |
| -> PerpetualFuturesFundingType | fundingType |
| -> (Int, TimeUnit) | fundingFrequency |
| -> Calendar | fundingCalendar |
| -> DayCounter | fundingDayCounter |
| -> IO Instrument |
composite :: [(Instrument, Double)] -> IO Instrument Source #
Builds a composite instrument whose NPV is the sum of the given instruments' NPVs, each scaled by its paired multiplier.
Mutators
setPricingEngine :: GenInstrument i -> PricingEngine -> IO () Source #
Sets the pricing engine used to compute the instrument's results.
Inspectors
errorEstimate :: GenInstrument i -> IO Double Source #
returns the error estimate on the NPV when available.
isExpired :: GenInstrument i -> IO Bool Source #
returns whether the instrument might have value greater than zero.
valuationDate :: GenInstrument i -> IO Day Source #
returns the date the net present value refers to.
additionalResults :: GenInstrument i -> IO [(String, AdditionalResultVal)] Source #
Returns QuantLib's `additionalResults()` map for the given Instrument, as an association list keyed by the C++ result name. The map's values are populated by the pricing engine; `additionalResults()` calls `calculate()` internally, so this is safe and idempotent after pricing.