hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.Instrument

Synopsis

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
       EnergyBasisSwap

Instances

Instances details
HasGreeks MultiAssetOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasGreeks OneAssetOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasImpliedVol BarrierOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasImpliedVol VanillaOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasQuanto QuantoBarrierOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasQuanto QuantoDoubleBarrierOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasQuanto QuantoForwardVanillaOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasQuanto QuantoVanillaOption Source # 
Instance details

Defined in QuantLib.Instrument.Option

HasFairRate CPISwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairRate ConstNotionalCrossCurrencyFixedVsFloatingSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairRate IrregularSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairRate OvernightIndexedSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairRate YearOnYearInflationSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairRate ZeroCouponInflationSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread AssetSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread CPISwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread ConstNotionalCrossCurrencyFixedVsFloatingSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread CreditDefaultSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread IrregularSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread OvernightIndexedSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread YearOnYearInflationSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFixedLeg OvernightIndexedSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFloatingLeg AssetSwap Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasInstrumentUnderlying CdsOption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasInstrumentUnderlying FloatFloatSwaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasInstrumentUnderlying IrregularSwaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasInstrumentUnderlying NonstandardSwaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasInstrumentUnderlying Swaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairRate (GenFixedVsFloatingSwap f) Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFairSpread (GenFixedVsFloatingSwap f) Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFixedLeg (GenFixedVsFloatingSwap f) Source # 
Instance details

Defined in QuantLib.Instrument.Swap

HasFloatingLeg (GenFixedVsFloatingSwap f) Source # 
Instance details

Defined in QuantLib.Instrument.Swap

type InstrumentUnderlying CdsOption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

type InstrumentUnderlying FloatFloatSwaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

type InstrumentUnderlying IrregularSwaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

type InstrumentUnderlying NonstandardSwaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

type InstrumentUnderlying Swaption Source # 
Instance details

Defined in QuantLib.Instrument.Swap

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.

Exercises and callability

data Exercise Source #

Exercise
 American
 Early
 Vanilla
 EuropeanExercise
 BermudanExercise
   SwingExercise
 Rebated (wraps another Exercise)

Constructors

American 

Fields

Early !ExerciseType !Bool 
Vanilla !ExerciseType 
European !EuropeanExercise 
Bermudan !BermudanExercise 
Rebated 

Fields

Conventions

data PerpetualFuturesPayoffType Source #

Instances

Instances details
Enum PerpetualFuturesPayoffType Source # 
Instance details

Defined in QuantLib.Instrument

Read PerpetualFuturesPayoffType Source # 
Instance details

Defined in QuantLib.Instrument

Show PerpetualFuturesPayoffType Source # 
Instance details

Defined in QuantLib.Instrument

Eq PerpetualFuturesPayoffType Source # 
Instance details

Defined in QuantLib.Instrument

data PerpetualFuturesFundingType Source #

Instances

Instances details
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.

Instance details

Defined in QuantLib.Instrument

Read PerpetualFuturesFundingType Source # 
Instance details

Defined in QuantLib.Instrument

Show PerpetualFuturesFundingType Source # 
Instance details

Defined in QuantLib.Instrument

Eq PerpetualFuturesFundingType Source # 
Instance details

Defined in QuantLib.Instrument

Constructors

perpetualFutures 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

npv :: GenInstrument i -> IO Double Source #

Returns the net present value of the given Instrument

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.