quantfin-0.1.0.2: Quant finance library in pure Haskell.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Quant.ContingentClaim

Contents

Synopsis

Types for modeling contingent claims.

newtype ContingentClaim Source

Constructors

ContingentClaim 

Fields

unCC :: [CCProcessor]
 

data CCProcessor Source

Constructors

CCProcessor 

Fields

monitorTime :: Time
 
payoutFunc :: Maybe [PayoffFunc CashFlow]
 

data Observables a Source

Observables are the observables available in a Monte Carlo simulation. Most basic MCs will have one observables (Black-Scholes) whereas more complex ones will have multiple (i.e. Heston-Hull-White).

Constructors

Observables 

Fields

obsGet :: [a]
 

Instances

Show a => Show (Observables a) 

data OptionType Source

Type for Put or Calls

Constructors

Put 
Call 

data CashFlow Source

Constructors

CashFlow 

Fields

cfTime :: Time
 
cfAmount :: Double
 

type CCBuilder w r a = WriterT w (Reader r) a Source

Options and option combinators

vanillaOption :: OptionType -> Double -> Time -> ContingentClaim Source

Takes an OptionType, a strike, and a time to maturity and generates a vanilla option.

binaryOption :: OptionType -> Double -> Double -> Time -> ContingentClaim Source

Takes an OptionType, a strike, a payout amount and a time to maturity and generates a vanilla option.

straddle :: Double -> Time -> ContingentClaim Source

A straddle is a put and a call with the same time to maturity / strike.

arithmeticAsianOption :: OptionType -> Double -> [Time] -> Time -> ContingentClaim Source

Takes an OptionType, a strike, observation times, time to maturity and generates an arithmetic Asian option.

geometricAsianOption :: OptionType -> Double -> [Time] -> Time -> ContingentClaim Source

Takes an OptionType, a strike, observation times, time to maturity and generates an arithmetic Asian option.

callSpread :: Double -> Double -> Time -> ContingentClaim Source

A call spread is a long position in a low-strike call and a short position in a high strike call.

putSpread :: Double -> Double -> Time -> ContingentClaim Source

A put spread is a long position in a high strike put and a short position in a low strike put.

forwardContract :: Time -> ContingentClaim Source

Takes a time to maturity and generates a forward contract.

zcb :: Time -> Double -> ContingentClaim Source

Takes an amount and a time and generates a fixed cash flow.

fixedBond :: Double -> Double -> Double -> Int -> ContingentClaim Source

Takes a face value, an interest rate, a payment frequency and makes a fixed bond

multiplier :: Double -> ContingentClaim -> ContingentClaim Source

Scales up a contingent claim by a multiplier.

short :: ContingentClaim -> ContingentClaim Source

Flips the signs in a contingent claim to make it a short position.

combine :: ContingentClaim -> ContingentClaim -> ContingentClaim Source

Combines two contingent claims into one.

terminalOnly :: Time -> (Double -> Double) -> ContingentClaim Source

Takes a maturity time and a function and generates a ContingentClaim dependent only on the terminal value of the observable.