option

package
v0.0.0-...-48f5d39 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package option implements a financial option reference http://en.wikipedia.org/wiki/Option_%28finance%29

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option represents an option

func NewNilOption

func NewNilOption() *Option

func NewOption

func NewOption(ul string, strike float64, expDate time.Time, optType TypeOfOption, multiplier float64) (*Option, error)

NewOption is an Option constructor

func (*Option) Ask

func (o *Option) Ask() financial.Money

Ask returns the ask price

func (*Option) BetaWeightedDelta

func (o *Option) BetaWeightedDelta(targetBetaStockLastTradePrice float64, underlyingStockLastTradePrice float64, underlyingStockBeta float64) float64

func (*Option) Bid

func (o *Option) Bid() financial.Money

Bid returns the bid price

func (*Option) Copy

func (o *Option) Copy() *Option

Copy returns a new copy/clone of the option

func (*Option) DaysToExpiration

func (o *Option) DaysToExpiration() int64

DaysToExpiration returns the number of days to expiration

func (*Option) Delta

func (o *Option) Delta() float64

Delta returns the delta

func (*Option) Description

func (o *Option) Description() string

Description returns the description

func (*Option) Error

func (o *Option) Error() error

func (*Option) ExpirationDate

func (o *Option) ExpirationDate() time.Time

ExpirationDate returns the expiration date as time.Time, but with no timestamp value

func (*Option) Gamma

func (o *Option) Gamma() float64

Gamma returns the gamma

func (*Option) IsOTM

func (o *Option) IsOTM() bool

IsOTM returns if the option is Out-Of-The-Money

func (*Option) Last

func (o *Option) Last() financial.Money

Last returns the last trade price

func (*Option) Multiplier

func (o *Option) Multiplier() float64

Multiplier retuns the multiplier

func (*Option) OptionTickerSymbol

func (o *Option) OptionTickerSymbol() string

OptionTickerSymbol returns the option ticker symbol

func (*Option) OptionType

func (o *Option) OptionType() TypeOfOption

OptionType returns the type of option (Call/Put)

func (*Option) SetAsk

func (o *Option) SetAsk(ask financial.Money) error

SetAsk sets the ask price

func (*Option) SetBid

func (o *Option) SetBid(bid financial.Money) error

SetBid sets the bid price

func (*Option) SetDaysToExpiration

func (o *Option) SetDaysToExpiration(daysToExpiration int64) error

SetDaysToExpiration sets the number of days to expiration

func (*Option) SetDelta

func (o *Option) SetDelta(delta float64)

SetDelta sets the delta

func (*Option) SetDescription

func (o *Option) SetDescription(description string)

SetDescription sets the description

func (*Option) SetExpirationDate

func (o *Option) SetExpirationDate(expirationDate time.Time) error

SetExpirationDate returns the expiration date as time.Time, but with no timestamp value expiration date cannot be in the past

func (*Option) SetGamma

func (o *Option) SetGamma(gamma float64)

SetGamma sets the gamma

func (*Option) SetIsOTM

func (o *Option) SetIsOTM(isOTM bool)

SetIsOTM sets if the option is Out-Of-The-Money

func (*Option) SetLast

func (o *Option) SetLast(last financial.Money) error

SetLast sets the last trade price

func (*Option) SetMultiplier

func (o *Option) SetMultiplier(multiplier float64)

SetMultiplier sets the multiplier

func (*Option) SetOptionTickerSymbol

func (o *Option) SetOptionTickerSymbol(optionTickerSymbol string)

SetOptionTickerSymbol sets the option ticker symbol

func (*Option) SetOptionType

func (o *Option) SetOptionType(optionType TypeOfOption)

SetOptionType sets the type of option (Call/Put)

func (*Option) SetStrike

func (o *Option) SetStrike(strike float64) error

SetStrike sets the current strike price

func (*Option) SetSymbol

func (o *Option) SetSymbol(symbol string)

SetSymbol sets the symbol

func (*Option) SetTheoPrice

func (o *Option) SetTheoPrice(theoPrice float64) error

SetTheoPrice sets the theoretical price

func (*Option) SetTheta

func (o *Option) SetTheta(theta float64)

SetTheta sets the theta

func (*Option) SetUnderlying

func (o *Option) SetUnderlying(underlying string)

SetUnderlying sets the underlying associated with the option

func (*Option) SetVega

func (o *Option) SetVega(vega float64)

SetVega sets the vega

func (*Option) Strike

func (o *Option) Strike() float64

Strike returns the current strike price

func (*Option) String

func (o *Option) String() string

func (*Option) Symbol

func (o *Option) Symbol() string

Symbol retuns the symbol

func (*Option) TheoPrice

func (o *Option) TheoPrice() float64

TheoPrice retuns the theoretical price

func (*Option) Theta

func (o *Option) Theta() float64

Theta returns the theta

func (*Option) Underlying

func (o *Option) Underlying() string

Underlying returns the underlying associated with the option

func (*Option) Vega

func (o *Option) Vega() float64

Vega returns the vega

type TypeOfOption

type TypeOfOption int

TypeOfOption is an enum type of option (ie CALL/PUT)

const (
	CALL TypeOfOption = iota
	PUT
)

defines constants related to TypeOfOption

func (TypeOfOption) String

func (t TypeOfOption) String() string

Jump to

Keyboard shortcuts

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