option

package
v0.0.0-...-d3c8f25 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxDaysUntilExpiration = 62

Variables

This section is empty.

Functions

This section is empty.

Types

type Expiration

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

Expiration holds details of all options for a specific stock and expiration date.

func NewExpiration

func NewExpiration(expDate time.Time, strikes []float64) (e Expiration, err error)

func (Expiration) Date

func (e Expiration) Date() time.Time

func (Expiration) ExpirationDateStr

func (e Expiration) ExpirationDateStr() string

ExpirationDateStr returns the expiration date as "YYYY-MM-DD".

func (Expiration) Strikes

func (e Expiration) Strikes() []Strike

func (Expiration) String

func (e Expiration) String() (s string)

func (Expiration) ToGob

func (e Expiration) ToGob() ExpirationGob

func (Expiration) Validate

func (e Expiration) Validate() error

type ExpirationGob

type ExpirationGob struct {
	Date    time.Time
	Strikes []float64
}

ExpirationGob is the type used to persist option expiration dates and strike prices.

func (ExpirationGob) ToExpiration

func (eg ExpirationGob) ToExpiration() (Expiration, error)

type ExpirationWarning

type ExpirationWarning string

ExpirationWarning indicates expiration dates which can be skipped without alerting the user.

func (ExpirationWarning) Error

func (ew ExpirationWarning) Error() string

type Option

type Option struct {
	Bid       float64
	BidSize   int
	Ask       float64
	AskSize   int
	Last      float64
	Change    float64
	ChangePct float64
	// contains filtered or unexported fields
}

Option holds the description of a stock option and its realtime values.

type Strike

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

Strike holds the call and put options for a specific strike price.

func (Strike) Price

func (s Strike) Price() float64

Jump to

Keyboard shortcuts

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