asset

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StockTheta = 0
	StockGamma = 0
	StockVega  = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetType

type AssetType int
const (
	EquityType AssetType = iota
	OptionType
	MutualFundType
	BondType
	MoneyMarketType
	SavingsType
	IndexType
	MaxAssetType
)

func (AssetType) String

func (a AssetType) String() string

type ImpliedVolatilityType

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

func NewImpliedVolInstance

func NewImpliedVolInstance(iv float32, ts time.Time) ImpliedVolatilityType

func (ImpliedVolatilityType) ImpliedVolatility

func (iv ImpliedVolatilityType) ImpliedVolatility() float32

func (ImpliedVolatilityType) SetImpliedVolatility

func (iv ImpliedVolatilityType) SetImpliedVolatility(newIv float32)

func (ImpliedVolatilityType) SetTimeStamp

func (iv ImpliedVolatilityType) SetTimeStamp(newTimeStamp time.Time)

func (ImpliedVolatilityType) String

func (iv ImpliedVolatilityType) String() string

func (ImpliedVolatilityType) TimeStamp

func (iv ImpliedVolatilityType) TimeStamp() time.Time

type ImpliedVolatilityTypeSlice

type ImpliedVolatilityTypeSlice []ImpliedVolatilityType

Note: if i ever needed sorted by multiple fields: http://stackoverflow.com/questions/19759274/sort-points-structs-by-different-dimensions-in-go-lang

func (ImpliedVolatilityTypeSlice) Len

func (ivs ImpliedVolatilityTypeSlice) Len() int

func (ImpliedVolatilityTypeSlice) Less

func (ivs ImpliedVolatilityTypeSlice) Less(i, j int) bool

func (ImpliedVolatilityTypeSlice) Swap

func (ivs ImpliedVolatilityTypeSlice) Swap(i, j int)

type PriceHistoryType

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

func NewPriceHistoryPoint

func NewPriceHistoryPoint(c financial.Money, ts time.Time) PriceHistoryType

func (PriceHistoryType) Close

func (ph PriceHistoryType) Close() financial.Money

func (PriceHistoryType) SetClose

func (ph PriceHistoryType) SetClose(newVal financial.Money)

func (PriceHistoryType) SetTimeStamp

func (ph PriceHistoryType) SetTimeStamp(newVal time.Time)

func (PriceHistoryType) String

func (ph PriceHistoryType) String() string

func (PriceHistoryType) TimeStamp

func (ph PriceHistoryType) TimeStamp() time.Time

type Quote

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

func (*Quote) AskPrice

func (q *Quote) AskPrice() financial.Money

AskPrice returns the ask price

func (*Quote) BidPrice

func (q *Quote) BidPrice() financial.Money

BidPrice returns the bid price

func (*Quote) Description

func (q *Quote) Description() string

func (*Quote) LastTradePrice

func (q *Quote) LastTradePrice() financial.Money

Last returns the last trade price

func (*Quote) NewQuote

func (q *Quote) NewQuote()

func (*Quote) SetAskPrice

func (q *Quote) SetAskPrice(newAskPrice financial.Money) error

SetAskPrice sets the ask price

func (*Quote) SetBidPrice

func (q *Quote) SetBidPrice(newBidPrice financial.Money) error

SetBidPrice sets the bid price

func (*Quote) SetDescription

func (q *Quote) SetDescription(newValue string)

func (*Quote) SetLastTradePrice

func (q *Quote) SetLastTradePrice(newLastTradePrice financial.Money) error

SetLast sets the last trade price

func (*Quote) SetSymbol

func (q *Quote) SetSymbol(newValue string)

func (*Quote) Symbol

func (q *Quote) Symbol() string

type Stock

type Stock struct {
	Quote
	// contains filtered or unexported fields
}

Stock represent a stock

func NewStock

func NewStock(newSymbol string) *Stock

func (*Stock) Beta

func (s *Stock) Beta(targetDailyCloseChange *statistics.Float64) float64

func (*Stock) Correlation

func (s *Stock) Correlation(targetStock *Stock, length int) float32

TODO: HIGH : FInish

func (*Stock) CurrentImpliedVolatility

func (s *Stock) CurrentImpliedVolatility() float32

func (*Stock) CurrentImpliedVolatilityRank

func (s *Stock) CurrentImpliedVolatilityRank() float32

func (*Stock) DailyCloseChange

func (s *Stock) DailyCloseChange() statistics.Float64

func (*Stock) HistoricalImpliedVol

func (s *Stock) HistoricalImpliedVol() ImpliedVolatilityTypeSlice

func (*Stock) HistoricalPrice

func (s *Stock) HistoricalPrice() []PriceHistoryType

func (*Stock) OptionChain

func (s *Stock) OptionChain() *optionchain.OptionChain

func (*Stock) SetHistoricalImpliedVol

func (s *Stock) SetHistoricalImpliedVol(newVolArray *ImpliedVolatilityTypeSlice)

func (*Stock) SetHistoricalPrice

func (s *Stock) SetHistoricalPrice(newVolArray *[]PriceHistoryType)

func (*Stock) SetOptionChain

func (s *Stock) SetOptionChain(oc *optionchain.OptionChain)

Jump to

Keyboard shortcuts

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