{-# LINE 1 "./QuantLib/Instrument/Option.chs" #-}
{-# LANGUAGE FlexibleInstances #-}
module QuantLib.Instrument.Option
(
GenOption
, Option
, GenOneAssetOption
, OneAssetOption
, GenMultiAssetOption
, MultiAssetOption
, CdsOption
, BarrierOption
, DoubleBarrierOption
, EverestOption
, MargrabeOption
, QuantoBarrierOption
, QuantoDoubleBarrierOption
, QuantoForwardVanillaOption
, QuantoVanillaOption
, SoftBarrierOption
, VanillaOption
, ExerciseType(..)
, Exercise(..)
, EuropeanExercise(..)
, BermudanExercise(..)
, SwingExercise(..)
, OptionType(..)
, PositionType(..)
, StrikedPayoff(..)
, PlainVanillaPayoff(..)
, PercentageStrikePayoff(..)
, BasketPayoff(..)
, Payoff(..)
, TypePayoff(..)
, asOption
, asOneAssetOption
, strikedPayoff
, plainVanillaPayoff
, percentageStrikePayoff
, withCustomPayoff
, withCustomStrikedPayoff
, withCustomBasketPayoff
, swingExercise
, barrierOption
, partialTimeBarrierOption
, doubleBarrierOption
, softBarrierOption
, forwardVanillaOption
, compoundOption
, margrabeOption
, simpleChooserOption
, complexChooserOption
, twoAssetCorrelationOption
, writerExtensibleOption
, holderExtensibleOption
, multiAssetOption
, oneAssetOption
, quantoBarrierOption
, quantoDoubleBarrierOption
, quantoForwardVanillaOption
, quantoVanillaOption
, twoAssetBarrierOption
, vanillaOption
, basketOption
, himalayaOption
, pagodaOption
, cliquetOption
, continuousAveragingAsianOption
, continuousFixedLookbackOption
, continuousFloatingLookbackOption
, continuousPartialFixedLookbackOption
, continuousPartialFloatingLookbackOption
, everestOption
, discreteAveragingAsianOption
, vanillaStorageOption
, vanillaSwingOption
, europeanOption
, HasImpliedVol(..)
, doubleBarrierOptionImpliedVolatility
, softBarrierOptionImpliedVolatility
, HasGreeks(..)
, HasQuanto(..)
, firstAssetDelta
, secondAssetDelta
, firstAssetGamma
, secondAssetGamma
, deltaForward
, elasticity
, itmCashProbability
, strikeSensitivity
, thetaPerDay
, yield
) where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.ForeignPtr as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import QuantLib.Internal
import QuantLib.Instrument(AverageType, BarrierType, DoubleBarrierType, PartialBarrierRange)
import QuantLib.Internal.Type
import QuantLib.Internal.Common
import Data.List.NonEmpty(NonEmpty, toList)
{-# LINE 127 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 128 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 129 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 130 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 131 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 132 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 133 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 134 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 135 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 136 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 137 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 138 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 139 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 140 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 141 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 142 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 143 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 144 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 145 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 146 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 147 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 148 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 149 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 150 "./QuantLib/Instrument/Option.chs" #-}
{-# LINE 151 "./QuantLib/Instrument/Option.chs" #-}
quantoForwardVanillaOption :: (Double)
-> (Day)
-> (StrikedPayoff) -> (Exercise) -> IO ((QuantoForwardVanillaOption))
quantoForwardVanillaOption :: Double
-> Day
-> StrikedPayoff
-> Exercise
-> IO QuantoForwardVanillaOption
quantoForwardVanillaOption Double
a1 Day
a2 StrikedPayoff
a3 Exercise
a4 =
let {a1' :: CDouble
a1' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a1} in
Day
-> (CInt -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a. Day -> (CInt -> IO a) -> IO a
withDay Day
a2 ((CInt -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption)
-> (CInt -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. (a -> b) -> a -> b
$ \CInt
a2' ->
StrikedPayoff
-> (QlStrikedTypePayoff -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a. StrikedPayoff -> (QlStrikedTypePayoff -> IO a) -> IO a
withStrikedPayoff StrikedPayoff
a3 ((QlStrikedTypePayoff -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption)
-> (QlStrikedTypePayoff -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. (a -> b) -> a -> b
$ \QlStrikedTypePayoff
a3' ->
Exercise
-> (QlExercise -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a. Exercise -> (QlExercise -> IO a) -> IO a
withExercise Exercise
a4 ((QlExercise -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption)
-> (QlExercise -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. (a -> b) -> a -> b
$ \QlExercise
a4' ->
(Ptr (Ptr CChar) -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption)
-> (Ptr (Ptr CChar) -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a5' ->
CDouble
-> CInt
-> QlStrikedTypePayoff
-> QlExercise
-> Ptr (Ptr CChar)
-> IO (Ptr CQuantoForwardVanillaOption')
quantoForwardVanillaOption'_ CDouble
a1' CInt
a2' QlStrikedTypePayoff
a3' QlExercise
a4' Ptr (Ptr CChar)
a5' IO (Ptr CQuantoForwardVanillaOption')
-> (Ptr CQuantoForwardVanillaOption'
-> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr CQuantoForwardVanillaOption'
res ->
Ptr CQuantoForwardVanillaOption' -> IO QuantoForwardVanillaOption
peekQuantoForwardVanillaOption Ptr CQuantoForwardVanillaOption'
res IO QuantoForwardVanillaOption
-> (QuantoForwardVanillaOption -> IO QuantoForwardVanillaOption)
-> IO QuantoForwardVanillaOption
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \QuantoForwardVanillaOption
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a5'IO ()
-> IO QuantoForwardVanillaOption -> IO QuantoForwardVanillaOption
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
QuantoForwardVanillaOption -> IO QuantoForwardVanillaOption
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (QuantoForwardVanillaOption
res')
{-# LINE 156 "./QuantLib/Instrument/Option.chs" #-}
quantoVanillaOption :: (StrikedPayoff) -> (Exercise) -> IO ((QuantoVanillaOption))
quantoVanillaOption a1 a2 =
withStrikedPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
preErrorCheck $ \a3' ->
quantoVanillaOption'_ a1' a2' a3' >>= \res ->
peekQuantoVanillaOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 159 "./QuantLib/Instrument/Option.chs" #-}
vanillaOption :: (StrikedPayoff) -> (Exercise) -> IO ((VanillaOption))
vanillaOption a1 a2 =
withStrikedPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
preErrorCheck $ \a3' ->
vanillaOption'_ a1' a2' a3' >>= \res ->
peekVanillaOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 162 "./QuantLib/Instrument/Option.chs" #-}
barrierOption :: (BarrierType) -> (Double)
-> (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((BarrierOption))
barrierOption a1 a2 a3 a4 a5 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
withStrikedPayoff a4 $ \a4' ->
withExercise a5 $ \a5' ->
preErrorCheck $ \a6' ->
barrierOption'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekBarrierOption res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 167 "./QuantLib/Instrument/Option.chs" #-}
partialTimeBarrierOption :: (BarrierType) -> (PartialBarrierRange) -> (Double)
-> (Double)
-> (Day)
-> (StrikedPayoff) -> (Exercise) -> IO ((OneAssetOption))
partialTimeBarrierOption a1 a2 a3 a4 a5 a6 a7 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = (fromIntegral . fromEnum) a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
withDay a5 $ \a5' ->
withStrikedPayoff a6 $ \a6' ->
withExercise a7 $ \a7' ->
preErrorCheck $ \a8' ->
partialTimeBarrierOption'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a8'>>
return (res')
{-# LINE 174 "./QuantLib/Instrument/Option.chs" #-}
doubleBarrierOption :: (DoubleBarrierType) -> (Double)
-> (Double)
-> (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((DoubleBarrierOption))
doubleBarrierOption a1 a2 a3 a4 a5 a6 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
withStrikedPayoff a5 $ \a5' ->
withExercise a6 $ \a6' ->
preErrorCheck $ \a7' ->
doubleBarrierOption'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekDoubleBarrierOption res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 180 "./QuantLib/Instrument/Option.chs" #-}
softBarrierOption :: (BarrierType) -> (Double)
-> (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((SoftBarrierOption))
softBarrierOption a1 a2 a3 a4 a5 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
withStrikedPayoff a4 $ \a4' ->
withExercise a5 $ \a5' ->
preErrorCheck $ \a6' ->
softBarrierOption'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekSoftBarrierOption res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 185 "./QuantLib/Instrument/Option.chs" #-}
softBarrierOptionImpliedVolatility :: (SoftBarrierOption) -> (Double)
-> (GenGeneralizedBlackScholesProcess gbs) -> (Double)
-> (Word)
-> (Double)
-> (Double)
-> IO ((Double))
softBarrierOptionImpliedVolatility a1 a2 a3 a4 a5 a6 a7 =
withSoftBarrierOption a1 $ \a1' ->
let {a2' = realToFrac a2} in
withGeneralizedBlackScholesProcess a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = fromIntegral a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
preErrorCheck $ \a8' ->
softBarrierOptionImpliedVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
let {res' = realToFrac res} in
errorCheck a8'>>
return (res')
{-# LINE 194 "./QuantLib/Instrument/Option.chs" #-}
forwardVanillaOption :: (Double)
-> (Day)
-> (StrikedPayoff) -> (Exercise) -> IO ((OneAssetOption))
forwardVanillaOption a1 a2 a3 a4 =
let {a1' = realToFrac a1} in
withDay a2 $ \a2' ->
withStrikedPayoff a3 $ \a3' ->
withExercise a4 $ \a4' ->
preErrorCheck $ \a5' ->
forwardVanillaOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 199 "./QuantLib/Instrument/Option.chs" #-}
compoundOption :: (StrikedPayoff)
-> (Exercise)
-> (StrikedPayoff)
-> (Exercise)
-> IO ((OneAssetOption))
compoundOption a1 a2 a3 a4 =
withStrikedPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
withStrikedPayoff a3 $ \a3' ->
withExercise a4 $ \a4' ->
preErrorCheck $ \a5' ->
compoundOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 206 "./QuantLib/Instrument/Option.chs" #-}
simpleChooserOption :: (Day)
-> (Double)
-> (Exercise) -> IO ((OneAssetOption))
simpleChooserOption a1 a2 a3 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
simpleChooserOption'_ a1' a2' a3' a4' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 211 "./QuantLib/Instrument/Option.chs" #-}
complexChooserOption :: (Day)
-> (Double)
-> (Double)
-> (Exercise)
-> (Exercise)
-> IO ((OneAssetOption))
complexChooserOption a1 a2 a3 a4 a5 =
withDay a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
withExercise a4 $ \a4' ->
withExercise a5 $ \a5' ->
preErrorCheck $ \a6' ->
complexChooserOption'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 219 "./QuantLib/Instrument/Option.chs" #-}
writerExtensibleOption :: (PlainVanillaPayoff)
-> (Exercise)
-> (PlainVanillaPayoff)
-> (Exercise)
-> IO ((OneAssetOption))
writerExtensibleOption a1 a2 a3 a4 =
withPlainVanillaPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
withPlainVanillaPayoff a3 $ \a3' ->
withExercise a4 $ \a4' ->
preErrorCheck $ \a5' ->
writerExtensibleOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 226 "./QuantLib/Instrument/Option.chs" #-}
holderExtensibleOption :: (OptionType)
-> (Double)
-> (Day)
-> (Double)
-> (StrikedPayoff)
-> (Exercise)
-> IO ((OneAssetOption))
holderExtensibleOption a1 a2 a3 a4 a5 a6 =
let {a1' = fromEnumC a1} in
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
let {a4' = realToFrac a4} in
withStrikedPayoff a5 $ \a5' ->
withExercise a6 $ \a6' ->
preErrorCheck $ \a7' ->
holderExtensibleOption'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 235 "./QuantLib/Instrument/Option.chs" #-}
firstAssetDelta :: (MargrabeOption) -> IO ((Double))
firstAssetDelta a1 =
withMargrabeOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
firstAssetDelta'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 238 "./QuantLib/Instrument/Option.chs" #-}
secondAssetDelta :: (MargrabeOption) -> IO ((Double))
secondAssetDelta a1 =
withMargrabeOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
secondAssetDelta'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 241 "./QuantLib/Instrument/Option.chs" #-}
firstAssetGamma :: (MargrabeOption) -> IO ((Double))
firstAssetGamma a1 =
withMargrabeOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
firstAssetGamma'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 244 "./QuantLib/Instrument/Option.chs" #-}
secondAssetGamma :: (MargrabeOption) -> IO ((Double))
secondAssetGamma a1 =
withMargrabeOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
secondAssetGamma'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 247 "./QuantLib/Instrument/Option.chs" #-}
deltaForward :: (GenOneAssetOption oo) -> IO ((Double))
deltaForward a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
deltaForward'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 250 "./QuantLib/Instrument/Option.chs" #-}
elasticity :: (GenOneAssetOption oo) -> IO ((Double))
elasticity a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
elasticity'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 253 "./QuantLib/Instrument/Option.chs" #-}
strikeSensitivity :: (GenOneAssetOption oo) -> IO ((Double))
strikeSensitivity a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
strikeSensitivity'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 256 "./QuantLib/Instrument/Option.chs" #-}
thetaPerDay :: (GenOneAssetOption oo) -> IO ((Double))
thetaPerDay a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
thetaPerDay'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 259 "./QuantLib/Instrument/Option.chs" #-}
margrabeOption :: (Int)
-> (Int)
-> (Exercise) -> IO ((MargrabeOption))
margrabeOption a1 a2 a3 =
let {a1' = fromIntegral a1} in
let {a2' = fromIntegral a2} in
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
margrabeOption'_ a1' a2' a3' a4' >>= \res ->
peekMargrabeOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 264 "./QuantLib/Instrument/Option.chs" #-}
twoAssetBarrierOption :: (BarrierType) -> (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((Instrument))
twoAssetBarrierOption a1 a2 a3 a4 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
withStrikedPayoff a3 $ \a3' ->
withExercise a4 $ \a4' ->
preErrorCheck $ \a5' ->
twoAssetBarrierOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekInstrument res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 269 "./QuantLib/Instrument/Option.chs" #-}
multiAssetOption :: (Payoff) -> (Exercise) -> IO ((MultiAssetOption))
multiAssetOption a1 a2 =
withPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
preErrorCheck $ \a3' ->
multiAssetOption'_ a1' a2' a3' >>= \res ->
peekMultiAssetOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 272 "./QuantLib/Instrument/Option.chs" #-}
twoAssetCorrelationOption :: (OptionType)
-> (Double)
-> (Double)
-> (Exercise) -> IO ((MultiAssetOption))
twoAssetCorrelationOption a1 a2 a3 a4 =
let {a1' = fromEnumC a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
withExercise a4 $ \a4' ->
preErrorCheck $ \a5' ->
twoAssetCorrelationOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekMultiAssetOption res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 278 "./QuantLib/Instrument/Option.chs" #-}
itmCashProbability :: (GenOneAssetOption oo) -> IO ((Double))
itmCashProbability a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
itmCashProbability'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 281 "./QuantLib/Instrument/Option.chs" #-}
oneAssetOption :: (Payoff) -> (Exercise) -> IO ((OneAssetOption))
oneAssetOption a1 a2 =
withPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
preErrorCheck $ \a3' ->
oneAssetOption'_ a1' a2' a3' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 284 "./QuantLib/Instrument/Option.chs" #-}
quantoBarrierOption :: (BarrierType) -> (Double)
-> (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((QuantoBarrierOption))
quantoBarrierOption a1 a2 a3 a4 a5 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
withStrikedPayoff a4 $ \a4' ->
withExercise a5 $ \a5' ->
preErrorCheck $ \a6' ->
quantoBarrierOption'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekQuantoBarrierOption res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 290 "./QuantLib/Instrument/Option.chs" #-}
quantoDoubleBarrierOption :: (DoubleBarrierType) -> (Double)
-> (Double)
-> (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((QuantoDoubleBarrierOption))
quantoDoubleBarrierOption a1 a2 a3 a4 a5 a6 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
withStrikedPayoff a5 $ \a5' ->
withExercise a6 $ \a6' ->
preErrorCheck $ \a7' ->
quantoDoubleBarrierOption'_ a1' a2' a3' a4' a5' a6' a7' >>= \res ->
peekQuantoDoubleBarrierOption res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 297 "./QuantLib/Instrument/Option.chs" #-}
basketOption :: (BasketPayoff) -> (Exercise) -> IO ((MultiAssetOption))
basketOption a1 a2 =
withBasketPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
preErrorCheck $ \a3' ->
basketOption'_ a1' a2' a3' >>= \res ->
peekMultiAssetOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 300 "./QuantLib/Instrument/Option.chs" #-}
qlHimalayaOption :: ([Day])
-> (Double)
-> IO ((MultiAssetOption))
qlHimalayaOption a1 a2 =
withDayArray a1 $ \(a1'1, a1'2) ->
let {a2' = realToFrac a2} in
preErrorCheck $ \a3' ->
qlHimalayaOption'_ a1'1 a1'2 a2' a3' >>= \res ->
peekMultiAssetOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 305 "./QuantLib/Instrument/Option.chs" #-}
qlPagodaOption :: ([Day])
-> (Double)
-> (Double)
-> IO ((MultiAssetOption))
qlPagodaOption a1 a2 a3 =
withDayArray a1 $ \(a1'1, a1'2) ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
preErrorCheck $ \a4' ->
qlPagodaOption'_ a1'1 a1'2 a2' a3' a4' >>= \res ->
peekMultiAssetOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 311 "./QuantLib/Instrument/Option.chs" #-}
himalayaOption :: NonEmpty Day -> Double -> IO MultiAssetOption
himalayaOption dates strike = qlHimalayaOption (toList dates) strike
pagodaOption :: NonEmpty Day -> Double -> Double -> IO MultiAssetOption
pagodaOption dates roof fraction = qlPagodaOption (toList dates) roof fraction
cliquetOption :: (PercentageStrikePayoff) -> (EuropeanExercise)
-> ([Day])
-> IO ((OneAssetOption))
cliquetOption :: PercentageStrikePayoff
-> EuropeanExercise -> [Day] -> IO OneAssetOption
cliquetOption PercentageStrikePayoff
a1 EuropeanExercise
a2 [Day]
a3 =
PercentageStrikePayoff
-> (QlPercentageStrikePayoff -> IO OneAssetOption)
-> IO OneAssetOption
forall a.
PercentageStrikePayoff
-> (QlPercentageStrikePayoff -> IO a) -> IO a
withPercentageStrikePayoff PercentageStrikePayoff
a1 ((QlPercentageStrikePayoff -> IO OneAssetOption)
-> IO OneAssetOption)
-> (QlPercentageStrikePayoff -> IO OneAssetOption)
-> IO OneAssetOption
forall a b. (a -> b) -> a -> b
$ \QlPercentageStrikePayoff
a1' ->
EuropeanExercise
-> (QlEuropeanExercise -> IO OneAssetOption) -> IO OneAssetOption
forall a. EuropeanExercise -> (QlEuropeanExercise -> IO a) -> IO a
withEuropeanExercise EuropeanExercise
a2 ((QlEuropeanExercise -> IO OneAssetOption) -> IO OneAssetOption)
-> (QlEuropeanExercise -> IO OneAssetOption) -> IO OneAssetOption
forall a b. (a -> b) -> a -> b
$ \QlEuropeanExercise
a2' ->
[Day]
-> ((CUInt, Ptr CInt) -> IO OneAssetOption) -> IO OneAssetOption
forall b. [Day] -> ((CUInt, Ptr CInt) -> IO b) -> IO b
withDayArray [Day]
a3 (((CUInt, Ptr CInt) -> IO OneAssetOption) -> IO OneAssetOption)
-> ((CUInt, Ptr CInt) -> IO OneAssetOption) -> IO OneAssetOption
forall a b. (a -> b) -> a -> b
$ \(CUInt
a3'1, Ptr CInt
a3'2) ->
(Ptr (Ptr CChar) -> IO OneAssetOption) -> IO OneAssetOption
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO OneAssetOption) -> IO OneAssetOption)
-> (Ptr (Ptr CChar) -> IO OneAssetOption) -> IO OneAssetOption
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a4' ->
QlPercentageStrikePayoff
-> QlEuropeanExercise
-> CUInt
-> Ptr CInt
-> Ptr (Ptr CChar)
-> IO (Ptr COneAssetOption')
cliquetOption'_ QlPercentageStrikePayoff
a1' QlEuropeanExercise
a2' CUInt
a3'1 Ptr CInt
a3'2 Ptr (Ptr CChar)
a4' IO (Ptr COneAssetOption')
-> (Ptr COneAssetOption' -> IO OneAssetOption) -> IO OneAssetOption
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \Ptr COneAssetOption'
res ->
Ptr COneAssetOption' -> IO OneAssetOption
peekOneAssetOption Ptr COneAssetOption'
res IO OneAssetOption
-> (OneAssetOption -> IO OneAssetOption) -> IO OneAssetOption
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \OneAssetOption
res' ->
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a4'IO () -> IO OneAssetOption -> IO OneAssetOption
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
OneAssetOption -> IO OneAssetOption
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (OneAssetOption
res')
{-# LINE 322 "./QuantLib/Instrument/Option.chs" #-}
continuousAveragingAsianOption :: (AverageType) -> (StrikedPayoff) -> (Exercise) -> IO ((OneAssetOption))
continuousAveragingAsianOption a1 a2 a3 =
let {a1' = (fromIntegral . fromEnum) a1} in
withStrikedPayoff a2 $ \a2' ->
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
continuousAveragingAsianOption'_ a1' a2' a3' a4' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 325 "./QuantLib/Instrument/Option.chs" #-}
continuousFixedLookbackOption :: (Double)
-> (StrikedPayoff) -> (Exercise) -> IO ((OneAssetOption))
continuousFixedLookbackOption a1 a2 a3 =
let {a1' = realToFrac a1} in
withStrikedPayoff a2 $ \a2' ->
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
continuousFixedLookbackOption'_ a1' a2' a3' a4' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 329 "./QuantLib/Instrument/Option.chs" #-}
continuousFloatingLookbackOption :: (Double)
-> (TypePayoff) -> (Exercise) -> IO ((OneAssetOption))
continuousFloatingLookbackOption a1 a2 a3 =
let {a1' = realToFrac a1} in
withTypePayoff a2 $ \a2' ->
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
continuousFloatingLookbackOption'_ a1' a2' a3' a4' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 333 "./QuantLib/Instrument/Option.chs" #-}
continuousPartialFloatingLookbackOption :: (Double)
-> (Double)
-> (Day)
-> (TypePayoff) -> (Exercise) -> IO ((OneAssetOption))
continuousPartialFloatingLookbackOption a1 a2 a3 a4 a5 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
withDay a3 $ \a3' ->
withTypePayoff a4 $ \a4' ->
withExercise a5 $ \a5' ->
preErrorCheck $ \a6' ->
continuousPartialFloatingLookbackOption'_ a1' a2' a3' a4' a5' a6' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a6'>>
return (res')
{-# LINE 339 "./QuantLib/Instrument/Option.chs" #-}
continuousPartialFixedLookbackOption :: (Day)
-> (StrikedPayoff) -> (Exercise) -> IO ((OneAssetOption))
continuousPartialFixedLookbackOption a1 a2 a3 =
withDay a1 $ \a1' ->
withStrikedPayoff a2 $ \a2' ->
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
continuousPartialFixedLookbackOption'_ a1' a2' a3' a4' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 343 "./QuantLib/Instrument/Option.chs" #-}
everestOption :: (Double)
-> (Double)
-> (Exercise) -> IO ((EverestOption))
everestOption a1 a2 a3 =
let {a1' = realToFrac a1} in
let {a2' = realToFrac a2} in
withExercise a3 $ \a3' ->
preErrorCheck $ \a4' ->
everestOption'_ a1' a2' a3' a4' >>= \res ->
peekEverestOption res >>= \res' ->
errorCheck a4'>>
return (res')
{-# LINE 348 "./QuantLib/Instrument/Option.chs" #-}
yield :: (EverestOption) -> IO ((Double))
yield a1 =
withEverestOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
yield'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 351 "./QuantLib/Instrument/Option.chs" #-}
discreteAveragingAsianOption :: (AverageType) -> (Double)
-> (Word)
-> ([Day])
-> (StrikedPayoff) -> (Exercise) -> IO ((OneAssetOption))
discreteAveragingAsianOption a1 a2 a3 a4 a5 a6 =
let {a1' = (fromIntegral . fromEnum) a1} in
let {a2' = realToFrac a2} in
let {a3' = fromIntegral a3} in
withDayArray a4 $ \(a4'1, a4'2) ->
withStrikedPayoff a5 $ \a5' ->
withExercise a6 $ \a6' ->
preErrorCheck $ \a7' ->
discreteAveragingAsianOption'_ a1' a2' a3' a4'1 a4'2 a5' a6' a7' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a7'>>
return (res')
{-# LINE 357 "./QuantLib/Instrument/Option.chs" #-}
vanillaStorageOption :: (BermudanExercise) -> (Double)
-> (Double)
-> (Double)
-> IO ((OneAssetOption))
vanillaStorageOption a1 a2 a3 a4 =
withBermudanExercise a1 $ \a1' ->
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
preErrorCheck $ \a5' ->
vanillaStorageOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 363 "./QuantLib/Instrument/Option.chs" #-}
vanillaSwingOption :: (StrikedPayoff) -> (SwingExercise) -> (Word)
-> (Word)
-> IO ((OneAssetOption))
vanillaSwingOption a1 a2 a3 a4 =
withStrikedPayoff a1 $ \a1' ->
withSwingExercise a2 $ \a2' ->
let {a3' = fromIntegral a3} in
let {a4' = fromIntegral a4} in
preErrorCheck $ \a5' ->
vanillaSwingOption'_ a1' a2' a3' a4' a5' >>= \res ->
peekOneAssetOption res >>= \res' ->
errorCheck a5'>>
return (res')
{-# LINE 368 "./QuantLib/Instrument/Option.chs" #-}
europeanOption :: (StrikedPayoff) -> (Exercise) -> IO ((VanillaOption))
europeanOption a1 a2 =
withStrikedPayoff a1 $ \a1' ->
withExercise a2 $ \a2' ->
preErrorCheck $ \a3' ->
europeanOption'_ a1' a2' a3' >>= \res ->
peekVanillaOption res >>= \res' ->
errorCheck a3'>>
return (res')
{-# LINE 371 "./QuantLib/Instrument/Option.chs" #-}
class HasGreeks a where
delta :: a -> IO Double
gamma :: a -> IO Double
rho :: a -> IO Double
theta :: a -> IO Double
vega :: a -> IO Double
dividendRho :: a -> IO Double
instance HasGreeks MultiAssetOption where
delta = qlMultiAssetOptionDelta
gamma = qlMultiAssetOptionGamma
rho = qlMultiAssetOptionRho
theta = qlMultiAssetOptionTheta
vega = qlMultiAssetOptionVega
dividendRho = qlMultiAssetOptionDividendRho
instance HasGreeks OneAssetOption where
delta :: OneAssetOption -> IO Double
delta = OneAssetOption -> IO Double
forall oo. GenOneAssetOption oo -> IO Double
qlOneAssetOptionDelta
gamma :: OneAssetOption -> IO Double
gamma = OneAssetOption -> IO Double
forall oo. GenOneAssetOption oo -> IO Double
qlOneAssetOptionGamma
rho :: OneAssetOption -> IO Double
rho = OneAssetOption -> IO Double
forall oo. GenOneAssetOption oo -> IO Double
qlOneAssetOptionRho
theta :: OneAssetOption -> IO Double
theta = OneAssetOption -> IO Double
forall oo. GenOneAssetOption oo -> IO Double
qlOneAssetOptionTheta
vega :: OneAssetOption -> IO Double
vega = OneAssetOption -> IO Double
forall oo. GenOneAssetOption oo -> IO Double
qlOneAssetOptionVega
dividendRho :: OneAssetOption -> IO Double
dividendRho = OneAssetOption -> IO Double
forall oo. GenOneAssetOption oo -> IO Double
qlOneAssetOptionDividendRho
qlMultiAssetOptionDelta :: (GenMultiAssetOption mo) -> IO ((Double))
qlMultiAssetOptionDelta :: forall mo. GenMultiAssetOption mo -> IO Double
qlMultiAssetOptionDelta GenMultiAssetOption mo
a1 =
GenMultiAssetOption mo
-> (Ptr CMultiAssetOption' -> IO Double) -> IO Double
forall mo b.
GenMultiAssetOption mo -> (Ptr CMultiAssetOption' -> IO b) -> IO b
withMultiAssetOption GenMultiAssetOption mo
a1 ((Ptr CMultiAssetOption' -> IO Double) -> IO Double)
-> (Ptr CMultiAssetOption' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CMultiAssetOption'
a1' ->
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a2' ->
Ptr CMultiAssetOption' -> Ptr (Ptr CChar) -> IO CDouble
qlMultiAssetOptionDelta'_ Ptr CMultiAssetOption'
a1' Ptr (Ptr CChar)
a2' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a2'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 398 "./QuantLib/Instrument/Option.chs" #-}
qlMultiAssetOptionDividendRho :: (GenMultiAssetOption mo) -> IO ((Double))
qlMultiAssetOptionDividendRho a1 =
withMultiAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlMultiAssetOptionDividendRho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 401 "./QuantLib/Instrument/Option.chs" #-}
qlMultiAssetOptionGamma :: (GenMultiAssetOption mo) -> IO ((Double))
qlMultiAssetOptionGamma a1 =
withMultiAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlMultiAssetOptionGamma'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 404 "./QuantLib/Instrument/Option.chs" #-}
qlMultiAssetOptionRho :: (GenMultiAssetOption mo) -> IO ((Double))
qlMultiAssetOptionRho a1 =
withMultiAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlMultiAssetOptionRho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 407 "./QuantLib/Instrument/Option.chs" #-}
qlMultiAssetOptionTheta :: (GenMultiAssetOption mo) -> IO ((Double))
qlMultiAssetOptionTheta a1 =
withMultiAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlMultiAssetOptionTheta'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 410 "./QuantLib/Instrument/Option.chs" #-}
qlMultiAssetOptionVega :: (GenMultiAssetOption mo) -> IO ((Double))
qlMultiAssetOptionVega a1 =
withMultiAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlMultiAssetOptionVega'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 413 "./QuantLib/Instrument/Option.chs" #-}
qlOneAssetOptionDelta :: (GenOneAssetOption oo) -> IO ((Double))
qlOneAssetOptionDelta a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlOneAssetOptionDelta'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 416 "./QuantLib/Instrument/Option.chs" #-}
qlOneAssetOptionDividendRho :: (GenOneAssetOption oo) -> IO ((Double))
qlOneAssetOptionDividendRho a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlOneAssetOptionDividendRho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 419 "./QuantLib/Instrument/Option.chs" #-}
qlOneAssetOptionGamma :: (GenOneAssetOption oo) -> IO ((Double))
qlOneAssetOptionGamma a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlOneAssetOptionGamma'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 422 "./QuantLib/Instrument/Option.chs" #-}
qlOneAssetOptionRho :: (GenOneAssetOption oo) -> IO ((Double))
qlOneAssetOptionRho a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlOneAssetOptionRho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 425 "./QuantLib/Instrument/Option.chs" #-}
qlOneAssetOptionTheta :: (GenOneAssetOption oo) -> IO ((Double))
qlOneAssetOptionTheta a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlOneAssetOptionTheta'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 428 "./QuantLib/Instrument/Option.chs" #-}
qlOneAssetOptionVega :: (GenOneAssetOption oo) -> IO ((Double))
qlOneAssetOptionVega a1 =
withOneAssetOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlOneAssetOptionVega'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 431 "./QuantLib/Instrument/Option.chs" #-}
class HasQuanto a where
qrho :: a -> IO Double
qvega :: a -> IO Double
qlambda :: a -> IO Double
instance HasQuanto QuantoBarrierOption where
qrho = qlQuantoBarrierOptionQrho
qvega = qlQuantoBarrierOptionQvega
qlambda = qlQuantoBarrierOptionQlambda
instance HasQuanto QuantoDoubleBarrierOption where
qrho :: QuantoDoubleBarrierOption -> IO Double
qrho = QuantoDoubleBarrierOption -> IO Double
qlQuantoDoubleBarrierOptionQrho
qvega :: QuantoDoubleBarrierOption -> IO Double
qvega = QuantoDoubleBarrierOption -> IO Double
qlQuantoDoubleBarrierOptionQvega
qlambda :: QuantoDoubleBarrierOption -> IO Double
qlambda = QuantoDoubleBarrierOption -> IO Double
qlQuantoDoubleBarrierOptionQlambda
instance HasQuanto QuantoForwardVanillaOption where
qrho :: QuantoForwardVanillaOption -> IO Double
qrho = QuantoForwardVanillaOption -> IO Double
qlQuantoForwardVanillaOptionQrho
qvega :: QuantoForwardVanillaOption -> IO Double
qvega = QuantoForwardVanillaOption -> IO Double
qlQuantoForwardVanillaOptionQvega
qlambda :: QuantoForwardVanillaOption -> IO Double
qlambda = QuantoForwardVanillaOption -> IO Double
qlQuantoForwardVanillaOptionQlambda
instance HasQuanto QuantoVanillaOption where
qrho :: QuantoVanillaOption -> IO Double
qrho = QuantoVanillaOption -> IO Double
qlQuantoVanillaOptionQrho
qvega :: QuantoVanillaOption -> IO Double
qvega = QuantoVanillaOption -> IO Double
qlQuantoVanillaOptionQvega
qlambda :: QuantoVanillaOption -> IO Double
qlambda = QuantoVanillaOption -> IO Double
qlQuantoVanillaOptionQlambda
class HasImpliedVol a where
impliedVolatility :: a
-> Double
-> GeneralizedBlackScholesProcess
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
instance HasImpliedVol VanillaOption where
impliedVolatility :: VanillaOption
-> Double
-> GeneralizedBlackScholesProcess
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
impliedVolatility = VanillaOption
-> Double
-> GeneralizedBlackScholesProcess
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
forall gbs.
VanillaOption
-> Double
-> GenGeneralizedBlackScholesProcess gbs
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
qlVanillaOptionImpliedVolatility
instance HasImpliedVol BarrierOption where
impliedVolatility :: BarrierOption
-> Double
-> GeneralizedBlackScholesProcess
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
impliedVolatility = BarrierOption
-> Double
-> GeneralizedBlackScholesProcess
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
forall gbs.
BarrierOption
-> Double
-> GenGeneralizedBlackScholesProcess gbs
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
qlBarrierOptionImpliedVolatility
qlQuantoBarrierOptionQrho :: (QuantoBarrierOption) -> IO ((Double))
qlQuantoBarrierOptionQrho :: QuantoBarrierOption -> IO Double
qlQuantoBarrierOptionQrho QuantoBarrierOption
a1 =
QuantoBarrierOption
-> (Ptr CQuantoBarrierOption' -> IO Double) -> IO Double
forall b.
QuantoBarrierOption -> (Ptr CQuantoBarrierOption' -> IO b) -> IO b
withQuantoBarrierOption QuantoBarrierOption
a1 ((Ptr CQuantoBarrierOption' -> IO Double) -> IO Double)
-> (Ptr CQuantoBarrierOption' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CQuantoBarrierOption'
a1' ->
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a2' ->
Ptr CQuantoBarrierOption' -> Ptr (Ptr CChar) -> IO CDouble
qlQuantoBarrierOptionQrho'_ Ptr CQuantoBarrierOption'
a1' Ptr (Ptr CChar)
a2' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a2'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 471 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoBarrierOptionQvega :: (QuantoBarrierOption) -> IO ((Double))
qlQuantoBarrierOptionQvega a1 =
withQuantoBarrierOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoBarrierOptionQvega'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 474 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoBarrierOptionQlambda :: (QuantoBarrierOption) -> IO ((Double))
qlQuantoBarrierOptionQlambda a1 =
withQuantoBarrierOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoBarrierOptionQlambda'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 477 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoDoubleBarrierOptionQrho :: (QuantoDoubleBarrierOption) -> IO ((Double))
qlQuantoDoubleBarrierOptionQrho a1 =
withQuantoDoubleBarrierOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoDoubleBarrierOptionQrho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 480 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoDoubleBarrierOptionQvega :: (QuantoDoubleBarrierOption) -> IO ((Double))
qlQuantoDoubleBarrierOptionQvega a1 =
withQuantoDoubleBarrierOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoDoubleBarrierOptionQvega'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 483 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoDoubleBarrierOptionQlambda :: (QuantoDoubleBarrierOption) -> IO ((Double))
qlQuantoDoubleBarrierOptionQlambda a1 =
withQuantoDoubleBarrierOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoDoubleBarrierOptionQlambda'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 486 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoForwardVanillaOptionQrho :: (QuantoForwardVanillaOption) -> IO ((Double))
qlQuantoForwardVanillaOptionQrho a1 =
withQuantoForwardVanillaOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoForwardVanillaOptionQrho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 489 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoForwardVanillaOptionQvega :: (QuantoForwardVanillaOption) -> IO ((Double))
qlQuantoForwardVanillaOptionQvega a1 =
withQuantoForwardVanillaOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoForwardVanillaOptionQvega'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 492 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoForwardVanillaOptionQlambda :: (QuantoForwardVanillaOption) -> IO ((Double))
qlQuantoForwardVanillaOptionQlambda a1 =
withQuantoForwardVanillaOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoForwardVanillaOptionQlambda'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 495 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoVanillaOptionQrho :: (QuantoVanillaOption) -> IO ((Double))
qlQuantoVanillaOptionQrho a1 =
withQuantoVanillaOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoVanillaOptionQrho'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 498 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoVanillaOptionQvega :: (QuantoVanillaOption) -> IO ((Double))
qlQuantoVanillaOptionQvega a1 =
withQuantoVanillaOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoVanillaOptionQvega'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 501 "./QuantLib/Instrument/Option.chs" #-}
qlQuantoVanillaOptionQlambda :: (QuantoVanillaOption) -> IO ((Double))
qlQuantoVanillaOptionQlambda a1 =
withQuantoVanillaOption a1 $ \a1' ->
preErrorCheck $ \a2' ->
qlQuantoVanillaOptionQlambda'_ a1' a2' >>= \res ->
let {res' = realToFrac res} in
errorCheck a2'>>
return (res')
{-# LINE 504 "./QuantLib/Instrument/Option.chs" #-}
qlVanillaOptionImpliedVolatility :: (VanillaOption) -> (Double)
-> (GenGeneralizedBlackScholesProcess gbs) -> ([Dividend])
-> (Double)
-> (Word)
-> (Double)
-> (Double)
-> IO ((Double))
qlVanillaOptionImpliedVolatility :: forall gbs.
VanillaOption
-> Double
-> GenGeneralizedBlackScholesProcess gbs
-> [Dividend]
-> Double
-> Word
-> Double
-> Double
-> IO Double
qlVanillaOptionImpliedVolatility VanillaOption
a1 Double
a2 GenGeneralizedBlackScholesProcess gbs
a3 [Dividend]
a4 Double
a5 Word
a6 Double
a7 Double
a8 =
VanillaOption -> (Ptr CVanillaOption' -> IO Double) -> IO Double
forall b. VanillaOption -> (Ptr CVanillaOption' -> IO b) -> IO b
withVanillaOption VanillaOption
a1 ((Ptr CVanillaOption' -> IO Double) -> IO Double)
-> (Ptr CVanillaOption' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CVanillaOption'
a1' ->
let {a2' :: CDouble
a2' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a2} in
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO Double) -> IO Double
forall gbs b.
GenGeneralizedBlackScholesProcess gbs
-> (Ptr CGeneralizedBlackScholesProcess' -> IO b) -> IO b
withGeneralizedBlackScholesProcess GenGeneralizedBlackScholesProcess gbs
a3 ((Ptr CGeneralizedBlackScholesProcess' -> IO Double) -> IO Double)
-> (Ptr CGeneralizedBlackScholesProcess' -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr CGeneralizedBlackScholesProcess'
a3' ->
[Dividend]
-> ((CUInt, Ptr (Ptr CDividend)) -> IO Double) -> IO Double
forall b.
[Dividend] -> ((CUInt, Ptr (Ptr CDividend)) -> IO b) -> IO b
withDividendArray [Dividend]
a4 (((CUInt, Ptr (Ptr CDividend)) -> IO Double) -> IO Double)
-> ((CUInt, Ptr (Ptr CDividend)) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \(CUInt
a4'1, Ptr (Ptr CDividend)
a4'2) ->
let {a5' :: CDouble
a5' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a5} in
let {a6' :: CUInt
a6' = Word -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word
a6} in
let {a7' :: CDouble
a7' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a7} in
let {a8' :: CDouble
a8' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
a8} in
(Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (Ptr (Ptr a) -> IO b) -> IO b
preErrorCheck ((Ptr (Ptr CChar) -> IO Double) -> IO Double)
-> (Ptr (Ptr CChar) -> IO Double) -> IO Double
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
a9' ->
Ptr CVanillaOption'
-> CDouble
-> Ptr CGeneralizedBlackScholesProcess'
-> CUInt
-> Ptr (Ptr CDividend)
-> CDouble
-> CUInt
-> CDouble
-> CDouble
-> Ptr (Ptr CChar)
-> IO CDouble
qlVanillaOptionImpliedVolatility'_ Ptr CVanillaOption'
a1' CDouble
a2' Ptr CGeneralizedBlackScholesProcess'
a3' CUInt
a4'1 Ptr (Ptr CDividend)
a4'2 CDouble
a5' CUInt
a6' CDouble
a7' CDouble
a8' Ptr (Ptr CChar)
a9' IO CDouble -> (CDouble -> IO Double) -> IO Double
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \CDouble
res ->
let {res' :: Double
res' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
res} in
Ptr (Ptr CChar) -> IO ()
errorCheck Ptr (Ptr CChar)
a9'IO () -> IO Double -> IO Double
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>>
Double -> IO Double
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Double
res')
{-# LINE 514 "./QuantLib/Instrument/Option.chs" #-}
qlBarrierOptionImpliedVolatility :: (BarrierOption) -> (Double)
-> (GenGeneralizedBlackScholesProcess gbs) -> ([Dividend])
-> (Double)
-> (Word)
-> (Double)
-> (Double)
-> IO ((Double))
qlBarrierOptionImpliedVolatility a1 a2 a3 a4 a5 a6 a7 a8 =
withBarrierOption a1 $ \a1' ->
let {a2' = realToFrac a2} in
withGeneralizedBlackScholesProcess a3 $ \a3' ->
withDividendArray a4 $ \(a4'1, a4'2) ->
let {a5' = realToFrac a5} in
let {a6' = fromIntegral a6} in
let {a7' = realToFrac a7} in
let {a8' = realToFrac a8} in
preErrorCheck $ \a9' ->
qlBarrierOptionImpliedVolatility'_ a1' a2' a3' a4'1 a4'2 a5' a6' a7' a8' a9' >>= \res ->
let {res' = realToFrac res} in
errorCheck a9'>>
return (res')
{-# LINE 524 "./QuantLib/Instrument/Option.chs" #-}
doubleBarrierOptionImpliedVolatility :: (DoubleBarrierOption) -> (Double)
-> (GenGeneralizedBlackScholesProcess gbs) -> (Double)
-> (Word)
-> (Double)
-> (Double)
-> IO ((Double))
doubleBarrierOptionImpliedVolatility a1 a2 a3 a4 a5 a6 a7 =
withDoubleBarrierOption a1 $ \a1' ->
let {a2' = realToFrac a2} in
withGeneralizedBlackScholesProcess a3 $ \a3' ->
let {a4' = realToFrac a4} in
let {a5' = fromIntegral a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
preErrorCheck $ \a8' ->
doubleBarrierOptionImpliedVolatility'_ a1' a2' a3' a4' a5' a6' a7' a8' >>= \res ->
let {res' = realToFrac res} in
errorCheck a8'>>
return (res')
{-# LINE 533 "./QuantLib/Instrument/Option.chs" #-}
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoForwardVanillaOption"
quantoForwardVanillaOption'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuantoForwardVanillaOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoVanillaOption"
quantoVanillaOption'_ :: ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuantoVanillaOption'))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlVanillaOption"
vanillaOption'_ :: ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CVanillaOption'))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlBarrierOption"
barrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CBarrierOption')))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlPartialTimeBarrierOption"
partialTimeBarrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlDoubleBarrierOption"
doubleBarrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CDoubleBarrierOption'))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlSoftBarrierOption"
softBarrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CSoftBarrierOption')))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlSoftBarrierOptionImpliedVolatility"
softBarrierOptionImpliedVolatility'_ :: ((C2HSImp.Ptr (CSoftBarrierOption')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlForwardVanillaOption"
forwardVanillaOption'_ :: (C2HSImp.CDouble -> (C2HSImp.CInt -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlCompoundOption"
compoundOption'_ :: ((QlStrikedTypePayoff) -> ((QlExercise) -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlSimpleChooserOption"
simpleChooserOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlComplexChooserOption"
complexChooserOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlExercise) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlWriterExtensibleOption"
writerExtensibleOption'_ :: ((QlPlainVanillaPayoff) -> ((QlExercise) -> ((QlPlainVanillaPayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlHolderExtensibleOption"
holderExtensibleOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CInt -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMargrabeOptionDelta1"
firstAssetDelta'_ :: ((C2HSImp.Ptr (CMargrabeOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMargrabeOptionDelta2"
secondAssetDelta'_ :: ((C2HSImp.Ptr (CMargrabeOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMargrabeOptionGamma1"
firstAssetGamma'_ :: ((C2HSImp.Ptr (CMargrabeOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMargrabeOptionGamma2"
secondAssetGamma'_ :: ((C2HSImp.Ptr (CMargrabeOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionDeltaForward"
deltaForward'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionElasticity"
elasticity'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionStrikeSensitivity"
strikeSensitivity'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionThetaPerDay"
thetaPerDay'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMargrabeOption"
margrabeOption'_ :: (C2HSImp.CInt -> (C2HSImp.CInt -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMargrabeOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlTwoAssetBarrierOption"
twoAssetBarrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CInstrument'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOption"
multiAssetOption'_ :: ((QlPayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMultiAssetOption'))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlTwoAssetCorrelationOption"
twoAssetCorrelationOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMultiAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionItmCashProbability"
itmCashProbability'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOption"
oneAssetOption'_ :: ((QlPayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoBarrierOption"
quantoBarrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuantoBarrierOption')))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoDoubleBarrierOption"
quantoDoubleBarrierOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CQuantoDoubleBarrierOption'))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlBasketOption"
basketOption'_ :: ((QlBasketPayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMultiAssetOption'))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlHimalayaOption"
qlHimalayaOption'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMultiAssetOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlPagodaOption"
qlPagodaOption'_ :: (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CMultiAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlCliquetOption"
cliquetOption'_ :: ((QlPercentageStrikePayoff) -> ((QlEuropeanExercise) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlContinuousAveragingAsianOption"
continuousAveragingAsianOption'_ :: (C2HSImp.CInt -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlContinuousFixedLookbackOption"
continuousFixedLookbackOption'_ :: (C2HSImp.CDouble -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlContinuousFloatingLookbackOption"
continuousFloatingLookbackOption'_ :: (C2HSImp.CDouble -> ((QlTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlContinuousPartialFloatingLookbackOption"
continuousPartialFloatingLookbackOption'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CInt -> ((QlTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlContinuousPartialFixedLookbackOption"
continuousPartialFixedLookbackOption'_ :: (C2HSImp.CInt -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlEverestOption"
everestOption'_ :: (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CEverestOption')))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlEverestOptionYield"
yield'_ :: ((C2HSImp.Ptr (CEverestOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlDiscreteAveragingAsianOption"
discreteAveragingAsianOption'_ :: (C2HSImp.CInt -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr C2HSImp.CInt) -> ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption')))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlVanillaStorageOption"
vanillaStorageOption'_ :: ((QlBermudanExercise) -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlVanillaSwingOption"
vanillaSwingOption'_ :: ((QlStrikedTypePayoff) -> ((QlSwingExercise) -> (C2HSImp.CUInt -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (COneAssetOption'))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlEuropeanOption"
europeanOption'_ :: ((QlStrikedTypePayoff) -> ((QlExercise) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO (C2HSImp.Ptr (CVanillaOption'))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOptionDelta"
qlMultiAssetOptionDelta'_ :: ((C2HSImp.Ptr (CMultiAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOptionDividendRho"
qlMultiAssetOptionDividendRho'_ :: ((C2HSImp.Ptr (CMultiAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOptionGamma"
qlMultiAssetOptionGamma'_ :: ((C2HSImp.Ptr (CMultiAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOptionRho"
qlMultiAssetOptionRho'_ :: ((C2HSImp.Ptr (CMultiAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOptionTheta"
qlMultiAssetOptionTheta'_ :: ((C2HSImp.Ptr (CMultiAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlMultiAssetOptionVega"
qlMultiAssetOptionVega'_ :: ((C2HSImp.Ptr (CMultiAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionDelta"
qlOneAssetOptionDelta'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionDividendRho"
qlOneAssetOptionDividendRho'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionGamma"
qlOneAssetOptionGamma'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionRho"
qlOneAssetOptionRho'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionTheta"
qlOneAssetOptionTheta'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlOneAssetOptionVega"
qlOneAssetOptionVega'_ :: ((C2HSImp.Ptr (COneAssetOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoBarrierOptionQrho"
qlQuantoBarrierOptionQrho'_ :: ((C2HSImp.Ptr (CQuantoBarrierOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoBarrierOptionQvega"
qlQuantoBarrierOptionQvega'_ :: ((C2HSImp.Ptr (CQuantoBarrierOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoBarrierOptionQlambda"
qlQuantoBarrierOptionQlambda'_ :: ((C2HSImp.Ptr (CQuantoBarrierOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoDoubleBarrierOptionQrho"
qlQuantoDoubleBarrierOptionQrho'_ :: ((C2HSImp.Ptr (CQuantoDoubleBarrierOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoDoubleBarrierOptionQvega"
qlQuantoDoubleBarrierOptionQvega'_ :: ((C2HSImp.Ptr (CQuantoDoubleBarrierOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoDoubleBarrierOptionQlambda"
qlQuantoDoubleBarrierOptionQlambda'_ :: ((C2HSImp.Ptr (CQuantoDoubleBarrierOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoForwardVanillaOptionQrho"
qlQuantoForwardVanillaOptionQrho'_ :: ((C2HSImp.Ptr (CQuantoForwardVanillaOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoForwardVanillaOptionQvega"
qlQuantoForwardVanillaOptionQvega'_ :: ((C2HSImp.Ptr (CQuantoForwardVanillaOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoForwardVanillaOptionQlambda"
qlQuantoForwardVanillaOptionQlambda'_ :: ((C2HSImp.Ptr (CQuantoForwardVanillaOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoVanillaOptionQrho"
qlQuantoVanillaOptionQrho'_ :: ((C2HSImp.Ptr (CQuantoVanillaOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoVanillaOptionQvega"
qlQuantoVanillaOptionQvega'_ :: ((C2HSImp.Ptr (CQuantoVanillaOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlQuantoVanillaOptionQlambda"
qlQuantoVanillaOptionQlambda'_ :: ((C2HSImp.Ptr (CQuantoVanillaOption')) -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlVanillaOptionImpliedVolatility"
qlVanillaOptionImpliedVolatility'_ :: ((C2HSImp.Ptr (CVanillaOption')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlBarrierOptionImpliedVolatility"
qlBarrierOptionImpliedVolatility'_ :: ((C2HSImp.Ptr (CBarrierOption')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CUInt -> ((C2HSImp.Ptr (C2HSImp.Ptr (CDividend))) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))))
foreign import ccall safe "QuantLib/Instrument/Option.chs.h qlDoubleBarrierOptionImpliedVolatility"
doubleBarrierOptionImpliedVolatility'_ :: ((C2HSImp.Ptr (CDoubleBarrierOption')) -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (CGeneralizedBlackScholesProcess')) -> (C2HSImp.CDouble -> (C2HSImp.CUInt -> (C2HSImp.CDouble -> (C2HSImp.CDouble -> ((C2HSImp.Ptr (C2HSImp.Ptr C2HSImp.CChar)) -> (IO C2HSImp.CDouble)))))))))