Documentation ¶
Overview ¶
Package option implements a financial option reference http://en.wikipedia.org/wiki/Option_%28finance%29
Index ¶
- type Option
- func (o *Option) Ask() financial.Money
- func (o *Option) BetaWeightedDelta(targetBetaStockLastTradePrice float64, underlyingStockLastTradePrice float64, ...) float64
- func (o *Option) Bid() financial.Money
- func (o *Option) Copy() *Option
- func (o *Option) DaysToExpiration() int64
- func (o *Option) Delta() float64
- func (o *Option) Description() string
- func (o *Option) Error() error
- func (o *Option) ExpirationDate() time.Time
- func (o *Option) Gamma() float64
- func (o *Option) IsOTM() bool
- func (o *Option) Last() financial.Money
- func (o *Option) Multiplier() float64
- func (o *Option) OptionTickerSymbol() string
- func (o *Option) OptionType() TypeOfOption
- func (o *Option) SetAsk(ask financial.Money) error
- func (o *Option) SetBid(bid financial.Money) error
- func (o *Option) SetDaysToExpiration(daysToExpiration int64) error
- func (o *Option) SetDelta(delta float64)
- func (o *Option) SetDescription(description string)
- func (o *Option) SetExpirationDate(expirationDate time.Time) error
- func (o *Option) SetGamma(gamma float64)
- func (o *Option) SetIsOTM(isOTM bool)
- func (o *Option) SetLast(last financial.Money) error
- func (o *Option) SetMultiplier(multiplier float64)
- func (o *Option) SetOptionTickerSymbol(optionTickerSymbol string)
- func (o *Option) SetOptionType(optionType TypeOfOption)
- func (o *Option) SetStrike(strike float64) error
- func (o *Option) SetSymbol(symbol string)
- func (o *Option) SetTheoPrice(theoPrice float64) error
- func (o *Option) SetTheta(theta float64)
- func (o *Option) SetUnderlying(underlying string)
- func (o *Option) SetVega(vega float64)
- func (o *Option) Strike() float64
- func (o *Option) String() string
- func (o *Option) Symbol() string
- func (o *Option) TheoPrice() float64
- func (o *Option) Theta() float64
- func (o *Option) Underlying() string
- func (o *Option) Vega() float64
- type TypeOfOption
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) BetaWeightedDelta ¶
func (*Option) DaysToExpiration ¶
DaysToExpiration returns the number of days to expiration
func (*Option) Description ¶
Description returns the description
func (*Option) ExpirationDate ¶
ExpirationDate returns the expiration date as time.Time, but with no timestamp value
func (*Option) OptionTickerSymbol ¶
OptionTickerSymbol returns the option ticker symbol
func (*Option) OptionType ¶
func (o *Option) OptionType() TypeOfOption
OptionType returns the type of option (Call/Put)
func (*Option) SetDaysToExpiration ¶
SetDaysToExpiration sets the number of days to expiration
func (*Option) SetDescription ¶
SetDescription sets the description
func (*Option) SetExpirationDate ¶
SetExpirationDate returns the expiration date as time.Time, but with no timestamp value expiration date cannot be in the past
func (*Option) SetMultiplier ¶
SetMultiplier sets the multiplier
func (*Option) SetOptionTickerSymbol ¶
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) SetTheoPrice ¶
SetTheoPrice sets the theoretical price
func (*Option) SetUnderlying ¶
SetUnderlying sets the underlying associated with the option
func (*Option) Underlying ¶
Underlying returns the underlying associated with the option
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