-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | HQuantLib is a port of essencial parts of QuantLib to Haskell
--
-- HQuantLib is intended to be a functional style port of QuantLib
-- (http:quantlib.org)
@package hquantlib
@version 0.0.1.2
module QuantLib.Options
data OptionType
Call :: OptionType
Put :: OptionType
toInt :: OptionType -> Int
toDouble :: OptionType -> Double
instance Show OptionType
instance Eq OptionType
module QuantLib.PricingEngines.BlackFormula
blackFormulaImpliedStdDev :: OptionType -> Double -> Double -> Double -> Double -> Double -> Maybe Double -> Double -> Int -> Maybe Double
module QuantLib.Quotes
-- | Base type class for market observables
class Quote a
qValue :: Quote a => a -> Maybe Double
pureValue :: Quote a => a -> Double
-- | Market element returning a stored value
data SimpleQuote
SimpleQuote :: (Maybe Double) -> SimpleQuote
-- | Market element whose value depends on two other market elements
data CompositeQuote a
CompositeQuote :: a -> a -> (a -> a -> Maybe Double) -> CompositeQuote a
-- | First element
cqQuote1 :: CompositeQuote a -> a
-- | Second element
cqQuote2 :: CompositeQuote a -> a
-- | Composition function
cqComposite :: CompositeQuote a -> a -> a -> Maybe Double
-- | Market element whose value depends on another quote
data DerivedQuote a
DerivedQuote :: a -> (a -> Maybe Double) -> DerivedQuote a
dqQuote :: DerivedQuote a -> a
dqDerivateFunc :: DerivedQuote a -> a -> Maybe Double
-- | Quote for the implied standard deviation of an underlying
data ImpliedStdDevQuote a
ImpliedStdDevQuote :: OptionType -> a -> a -> Double -> Maybe Double -> ImpliedStdDevQuote a
isdqOptionType :: ImpliedStdDevQuote a -> OptionType
isdqForward :: ImpliedStdDevQuote a -> a
isdqPrice :: ImpliedStdDevQuote a -> a
isdqStrike :: ImpliedStdDevQuote a -> Double
isdqGuess :: ImpliedStdDevQuote a -> Maybe Double
-- | Quote for the Eurodollar-future implied standard deviation
data EurodollarFutureQuote a
EurodollarFutureQuote :: a -> a -> a -> Double -> Maybe Double -> EurodollarFutureQuote a
efqForward :: EurodollarFutureQuote a -> a
efqCallPrice :: EurodollarFutureQuote a -> a
efqPutPrice :: EurodollarFutureQuote a -> a
efqStrike :: EurodollarFutureQuote a -> Double
efqGuess :: EurodollarFutureQuote a -> Maybe Double
instance Show SimpleQuote
instance Eq SimpleQuote
instance Show a => Show (ImpliedStdDevQuote a)
instance Show a => Show (EurodollarFutureQuote a)
instance Quote a => Quote (EurodollarFutureQuote a)
instance Quote a => Quote (ImpliedStdDevQuote a)
instance Quote (DerivedQuote a)
instance Quote (CompositeQuote a)
instance Quote SimpleQuote
module QuantLib.PricingEngines
class PricingEngine a
peCalculate :: PricingEngine a => a -> a
module QuantLib.Currencies
-- | Currency specification
data Currency
Currency :: String -> String -> Integer -> Integer -> Currency
-- | currency name, e.g. U.S. dollar
cName :: Currency -> String
-- | ISO 4217 three-letter code, e.g. USD
cCode :: Currency -> String
-- | ISO 4217 numeric code, e.g. 840
cIsoCode :: Currency -> Integer
-- | number of fractionary parts in a unit
cFracsPerUnit :: Currency -> Integer
-- | Swiss france
chf :: Currency
-- | Czech koruna
czk :: Currency
-- | Danish krone
dkk :: Currency
-- | European Euro
eur :: Currency
-- | British pound sterling
gbp :: Currency
-- | Canadian dollar
cad :: Currency
-- | U.S. dollar
usd :: Currency
module QuantLib.Instruments
-- | Instrument type class
class Instrument a
iNPV :: Instrument a => a -> Double
iErrorEstimate :: Instrument a => a -> Double
iDate :: Instrument a => a -> LocalTime
iIsExpired :: Instrument a => a -> Bool
-- | Composite instrument is an aggregate of other instruments.
data Instrument a => CompositeInstrument a
CompositeInstrument :: (Map a Double) -> CompositeInstrument a
-- | Single stock instrument
data Stock
Stock :: Double -> LocalTime -> Stock
sQuote :: Stock -> Double
sDate :: Stock -> LocalTime
module QuantLib.Prices
-- | Price types
data PriceType
Bid :: PriceType
Ask :: PriceType
Last :: PriceType
Close :: PriceType
Mid :: PriceType
MidEq :: PriceType
MidSafe :: PriceType
-- | Call price
data CallPrice
DirtyPrice :: Double -> CallPrice
cpPrice :: CallPrice -> Double
CleanPrice :: Double -> CallPrice
cpPrice :: CallPrice -> Double
-- | Interval price
data IntervalPrice
IntervalPrice :: Double -> Double -> Double -> Double -> IntervalPrice
ipOpen :: IntervalPrice -> Double
ipHigh :: IntervalPrice -> Double
ipLow :: IntervalPrice -> Double
ipClose :: IntervalPrice -> Double
instance Show PriceType
instance Eq PriceType
instance Show CallPrice
instance Eq CallPrice
instance Ord CallPrice
instance Show IntervalPrice
instance Eq IntervalPrice
module QuantLib.Event
class Event a
evDate :: Event a => a -> LocalTime
evOccured :: Event a => a -> LocalTime -> Bool
evOccuredInclude :: Event a => a -> LocalTime -> Bool
evCompare :: Event a => a -> a -> Ordering
evEqual :: Event a => a -> a -> Bool
data CashFlow
CashFlow :: LocalTime -> Double -> CashFlow
cfDate :: CashFlow -> LocalTime
cfAmount :: CashFlow -> Double
data Callability
Call :: CallPrice -> LocalTime -> Callability
cPrice :: Callability -> CallPrice
cDate :: Callability -> LocalTime
Put :: CallPrice -> LocalTime -> Callability
cPrice :: Callability -> CallPrice
cDate :: Callability -> LocalTime
instance Show CashFlow
instance Show Callability
instance Ord Callability
instance Eq Callability
instance Event Callability
instance Ord CashFlow
instance Eq CashFlow
instance Event CashFlow
module QuantLib.TimeSeries
-- | Time series
type TimeSeries m = Map LocalTime m
module QuantLib.VolatilityModel
-- | Volatility type
type Volatility = Double
-- | Volatility time series
type VolatilitySeries = TimeSeries Volatility
-- | The estimator of time series of doubles
class DoubleVolatilityEstimator a
dveCalculate :: DoubleVolatilityEstimator a => a -> TimeSeries Double -> VolatilitySeries
-- | The calculator of volatility for interval price
class IntervalPointCalculator a
ipcCalculatePoint :: IntervalPointCalculator a => a -> IntervalPrice -> Volatility
-- | Interval price volatility estimator
class IntervalVolatilityEstimator a
iveCalculate :: (IntervalVolatilityEstimator a, IntervalPointCalculator b) => a -> b -> TimeSeries IntervalPrice -> VolatilitySeries
-- | Simple local estimator
data SimpleLocalEstimator
SimpleLocalEstimator :: Double -> SimpleLocalEstimator
sleYearFraction :: SimpleLocalEstimator -> Double
-- | Garman-Klass interval estimators
data GarmanKlass
GarmanKlass :: Double -> GarmanKlass
gkYearFraction :: GarmanKlass -> Double
-- | Types of Garman-Klass estimators
data GarmanKlassPoint
GarmanKlassSimpleSigma :: GarmanKlassPoint
ParkinsonSigma :: GarmanKlassPoint
instance Show SimpleLocalEstimator
instance Eq SimpleLocalEstimator
instance Show GarmanKlass
instance Eq GarmanKlass
instance IntervalPointCalculator GarmanKlassPoint
instance IntervalVolatilityEstimator GarmanKlass
instance DoubleVolatilityEstimator SimpleLocalEstimator
module QuantLib.Position
-- | Position types
data Position
Long :: Position
Short :: Position
instance Show Position
instance Eq Position
module QuantLib.Money
-- | Amount of cash. Please, note that currency conversion is not
-- implemented yet.
data Money
Money :: Double -> Currency -> Money
mValue :: Money -> Double
mCurrency :: Money -> Currency
instance Eq Money
instance Num Money
instance Show Money
module QuantLib.Stochastic
-- | Discretization of stochastic process over given interval
class Discretize b
dDrift :: (Discretize b, StochasticProcess a) => a -> b -> Dot -> Double
dDiff :: (Discretize b, StochasticProcess a) => a -> b -> Dot -> Double
dDt :: (Discretize b, StochasticProcess a) => a -> b -> Dot -> Double
-- | 1D Stochastic process
class StochasticProcess a
drift :: StochasticProcess a => a -> Dot -> Double
diff :: StochasticProcess a => a -> Dot -> Double
evolve :: (StochasticProcess a, Discretize b) => b -> a -> Dot -> Double -> Dot
-- | Dot. t and x pair
data Dot
Dot :: Double -> Double -> Dot
getT :: Dot -> Double
getX :: Dot -> Double
-- | Path as list of Dots
type Path = [Dot]
-- | Generates sample path for given stochastic process under
-- discretization and normal generator for given amount of steps,
-- starting from x0
generatePath :: (StochasticProcess a, NormalGenerator b, Discretize c) => b -> c -> a -> Int -> Dot -> IO Path
-- | Geometric Brownian motion
data GeometricBrownian
GeometricBrownian :: Double -> Double -> GeometricBrownian
gbDrift :: GeometricBrownian -> Double
gbDiff :: GeometricBrownian -> Double
-- | Ito process
data ItoProcess
ItoProcess :: (Dot -> Double) -> (Dot -> Double) -> ItoProcess
ipDrift :: ItoProcess -> Dot -> Double
ipDiff :: ItoProcess -> Dot -> Double
-- | Square-root process
data SquareRootProcess
SquareRootProcess :: Double -> Double -> Double -> SquareRootProcess
srpSpeed :: SquareRootProcess -> Double
srpMean :: SquareRootProcess -> Double
srpSigma :: SquareRootProcess -> Double
-- | Ornstein-Uhlenbeck process
data OrnsteinUhlenbeckProcess
OrnsteinUhlenbeckProcess :: Double -> Double -> Double -> OrnsteinUhlenbeckProcess
oupSpeed :: OrnsteinUhlenbeckProcess -> Double
oupLevel :: OrnsteinUhlenbeckProcess -> Double
oupSigma :: OrnsteinUhlenbeckProcess -> Double
-- | Generalized Black-Scholes process
data BlackScholesProcess
BlackScholesProcess :: (Double -> Double) -> (Double -> Double) -> (Dot -> Double) -> BlackScholesProcess
bspRiskFree :: BlackScholesProcess -> Double -> Double
bspDividend :: BlackScholesProcess -> Double -> Double
bspBlackVol :: BlackScholesProcess -> Dot -> Double
-- | Euler discretization of stochastic processes
data Euler
Euler :: Double -> Euler
eDt :: Euler -> Double
-- | Euler end-point discretization of stochastic processes
data EndEuler
EndEuler :: Double -> EndEuler
eeDt :: EndEuler -> Double
-- | Box-Muller method
data BoxMuller
-- | Creates normally distributed generator
createNormalGen :: RNG -> BoxMuller
-- | Normally distributed generator
class NormalGenerator a
ngGetNext :: NormalGenerator a => a -> IO (Double, a)
module QuantLib