Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- newtype ContingentClaim = ContingentClaim {
- unCC :: [CCProcessor]
- data CCProcessor = CCProcessor {
- monitorTime :: Time
- payoutFunc :: Maybe [PayoffFunc CashFlow]
- data Observables a = Observables {
- obsGet :: [a]
- type MCObservables = Observables Double
- data OptionType
- data CashFlow = CashFlow {}
- type CCBuilder w r a = WriterT w (Reader r) a
- specify :: CCBuilder ContingentClaim MCMap CashFlow -> ContingentClaim
- monitor :: Time -> CCBuilder ContingentClaim MCMap Double
- monitorByNum :: Int -> Time -> CCBuilder ContingentClaim MCMap Double
- vanillaOption :: OptionType -> Double -> Time -> ContingentClaim
- binaryOption :: OptionType -> Double -> Double -> Time -> ContingentClaim
- straddle :: Double -> Time -> ContingentClaim
- arithmeticAsianOption :: OptionType -> Double -> [Time] -> Time -> ContingentClaim
- geometricAsianOption :: OptionType -> Double -> [Time] -> Time -> ContingentClaim
- callSpread :: Double -> Double -> Time -> ContingentClaim
- putSpread :: Double -> Double -> Time -> ContingentClaim
- forwardContract :: Time -> ContingentClaim
- zcb :: Time -> Double -> ContingentClaim
- fixedBond :: Double -> Double -> Double -> Int -> ContingentClaim
- multiplier :: Double -> ContingentClaim -> ContingentClaim
- short :: ContingentClaim -> ContingentClaim
- combine :: ContingentClaim -> ContingentClaim -> ContingentClaim
- terminalOnly :: Time -> (Double -> Double) -> ContingentClaim
Types for modeling contingent claims.
data CCProcessor Source
CCProcessor | |
|
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).
Observables | |
|
Show a => Show (Observables a) |
type MCObservables = Observables Double Source
Options and option combinators
specify :: CCBuilder ContingentClaim MCMap CashFlow -> ContingentClaim Source
monitorByNum :: Int -> Time -> CCBuilder ContingentClaim MCMap Double Source
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.