option

package
v0.0.0-...-b6a1b54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinomialModel

func BinomialModel(option Option, spot m.Money, t m.Time, sigmaX m.Return, rf m.Rate) m.Money

func FiniteDifferenceGrid

func FiniteDifferenceGrid(NAS int, SInf float64) func(option Option, t m.Time, sigma m.Return, rf m.Rate) (S []float64, V [][]float64)

func ImplyVol

func ImplyVol(pricingMethod func(PricingParameters) Pricing, R m.Rate) func(option Option, spot m.Money, t m.Time) func(price m.Money) (float64, error)

func NoEarlyExcerciseMonteCarloModel

func NoEarlyExcerciseMonteCarloModel(npaths int, nsteps int, seed int64) func(option Option, spot m.Money, t m.Time, sigmaX m.Return, rf m.Rate) m.Money

Types

type AmericanCallOption

type AmericanCallOption struct {
	AmericanOption
}

func (*AmericanCallOption) Payoff

func (option *AmericanCallOption) Payoff(spot m.Money) m.Money

type AmericanOption

type AmericanOption struct {
	VanillaOption
}

func (*AmericanOption) EarlyExcercise

func (option *AmericanOption) EarlyExcercise(excercisePayoff m.Money, nonExcercisedValue m.Money) m.Money

type AmericanPutOption

type AmericanPutOption struct {
	AmericanOption
}

func (*AmericanPutOption) Payoff

func (option *AmericanPutOption) Payoff(spot m.Money) m.Money

type Decision

type Decision interface {
	EarlyExcercise(spot m.Money, nonExcercisedValue m.Money) m.Money
}

type EuropeanCallOption

type EuropeanCallOption struct {
	EuropeanOption
}

func (*EuropeanCallOption) Payoff

func (option *EuropeanCallOption) Payoff(spot m.Money) m.Money

type EuropeanOption

type EuropeanOption struct {
	VanillaOption
}

func (*EuropeanOption) EarlyExcercise

func (option *EuropeanOption) EarlyExcercise(excercisePayoff m.Money, nonExcercisedValue m.Money) m.Money

type EuropeanPutOption

type EuropeanPutOption struct {
	EuropeanOption
}

func (*EuropeanPutOption) Payoff

func (option *EuropeanPutOption) Payoff(spot m.Money) m.Money

type Greek

type Greek func(option Option, spot m.Money, t m.Time) float64

func Delta

func Delta(pricing Pricing) Greek

func Gamma

func Gamma(pricing Pricing) Greek

func Rho

func Rho(pricingFromParameters func(parameters PricingParameters) Pricing, parameters PricingParameters) Greek

func Theta

func Theta(pricing Pricing) Greek

type Option

type Option interface {
	Decision
	Expiration() m.Time
	Payoff(spot m.Money) m.Money

	Strike() m.Money // FIXME deprecated ... does not generalize!
}

type Pricing

type Pricing func(option Option, spot m.Money, t m.Time) m.Money

func BinomialPricing

func BinomialPricing(parameters PricingParameters) Pricing

func EuropeanMCPricing

func EuropeanMCPricing(parameters PricingParameters) Pricing

func GridPricing

func GridPricing(parameters PricingParameters) Pricing

type PricingParameters

type PricingParameters struct {
	Sigma m.Return
	R     m.Rate
}

type VanillaOption

type VanillaOption struct {
	S m.Money
	T m.Time
}

func (*VanillaOption) Expiration

func (option *VanillaOption) Expiration() m.Time

func (*VanillaOption) Strike

func (option *VanillaOption) Strike() m.Money

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL