Documentation ¶
Index ¶
- Constants
- func DailyPriceHeader() string
- func GetSymbols() []string
- func OneMinSaleHeader() string
- func SortByLastPrice(stockList []*Stock)
- func SortBySymbol(stockList []*Stock)
- type DailyPrice
- func (dp DailyPrice) Date() time.Time
- func (dp DailyPrice) DateStr() string
- func (dp DailyPrice) HighLow() (float64, float64)
- func (dp DailyPrice) OpenClose() (float64, float64)
- func (dp DailyPrice) String() string
- func (dp DailyPrice) ToGob() DailyPriceGob
- func (dp DailyPrice) Validate() error
- func (dp DailyPrice) Volume() int64
- type DailyPriceGob
- type OneMinSale
- func (oms OneMinSale) DateTimeStr() string
- func (oms OneMinSale) HighLow() (float64, float64)
- func (oms OneMinSale) OpenClose() (float64, float64)
- func (oms OneMinSale) StartTime() time.Time
- func (oms OneMinSale) String() string
- func (oms OneMinSale) VWAP() float64
- func (oms OneMinSale) Validate() error
- func (oms OneMinSale) Volume() int64
- type Stock
- func (s *Stock) AppendDailyPrices(dps []*DailyPrice) error
- func (s *Stock) AppendExpirations(exps []option.Expiration) error
- func (s *Stock) AppendOneMinSales(omss []OneMinSale) error
- func (s *Stock) LastPrice() float64
- func (s *Stock) Prices() []DailyPrice
- func (s *Stock) Quote() quote.Quote
- func (s *Stock) SetQuote(q quote.Quote)
- func (s *Stock) String() string
- func (s *Stock) Symbol() string
Constants ¶
View Source
const ( MarketOpenHour = 9 MarketOpenMinute = 30 MarketCloseHour = 15 MarketCloseMinute = 59 )
Variables ¶
This section is empty.
Functions ¶
func DailyPriceHeader ¶
func DailyPriceHeader() string
func GetSymbols ¶
func GetSymbols() []string
func OneMinSaleHeader ¶
func OneMinSaleHeader() string
func SortByLastPrice ¶
func SortByLastPrice(stockList []*Stock)
func SortBySymbol ¶
func SortBySymbol(stockList []*Stock)
Types ¶
type DailyPrice ¶
type DailyPrice struct {
// contains filtered or unexported fields
}
DailyPrice holds a single day's price and volume data for a security.
func NewDailyPrice ¶
func NewDailyPrice( year, month, day int, open, close, high, low float64, volume int64, ) (dp DailyPrice, err error)
func (DailyPrice) Date ¶
func (dp DailyPrice) Date() time.Time
func (DailyPrice) DateStr ¶
func (dp DailyPrice) DateStr() string
DateStr returns the daily price date as "YYYY-MM-DD".
func (DailyPrice) HighLow ¶
func (dp DailyPrice) HighLow() (float64, float64)
func (DailyPrice) OpenClose ¶
func (dp DailyPrice) OpenClose() (float64, float64)
func (DailyPrice) String ¶
func (dp DailyPrice) String() string
func (DailyPrice) ToGob ¶
func (dp DailyPrice) ToGob() DailyPriceGob
func (DailyPrice) Validate ¶
func (dp DailyPrice) Validate() error
func (DailyPrice) Volume ¶
func (dp DailyPrice) Volume() int64
type DailyPriceGob ¶
type DailyPriceGob struct { Year int Month int Day int Open float64 Close float64 High float64 Low float64 Volume int64 }
DailyPriceGob is the type used to persist daily price data.
func (DailyPriceGob) ToDailyPrice ¶
func (dpg DailyPriceGob) ToDailyPrice() (DailyPrice, error)
type OneMinSale ¶
type OneMinSale struct {
// contains filtered or unexported fields
}
OneMinSale holds price and volume data for one minute of stock trading activity.
func NewOneMinSale ¶
func (OneMinSale) DateTimeStr ¶
func (oms OneMinSale) DateTimeStr() string
DateTimeStr returns the one minute sales time as "YYYY-MM-DD HH:MM".
func (OneMinSale) HighLow ¶
func (oms OneMinSale) HighLow() (float64, float64)
func (OneMinSale) OpenClose ¶
func (oms OneMinSale) OpenClose() (float64, float64)
func (OneMinSale) StartTime ¶
func (oms OneMinSale) StartTime() time.Time
func (OneMinSale) String ¶
func (oms OneMinSale) String() string
func (OneMinSale) VWAP ¶
func (oms OneMinSale) VWAP() float64
func (OneMinSale) Validate ¶
func (oms OneMinSale) Validate() error
func (OneMinSale) Volume ¶
func (oms OneMinSale) Volume() int64
type Stock ¶
func (*Stock) AppendDailyPrices ¶
func (s *Stock) AppendDailyPrices(dps []*DailyPrice) error
func (*Stock) AppendExpirations ¶
func (s *Stock) AppendExpirations(exps []option.Expiration) error
func (*Stock) AppendOneMinSales ¶
func (s *Stock) AppendOneMinSales(omss []OneMinSale) error
func (*Stock) Prices ¶
func (s *Stock) Prices() []DailyPrice
Click to show internal directories.
Click to hide internal directories.