iex

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package iex provides a client to get stock data using the IEX API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartPoint

type ChartPoint struct {
	Date          time.Time
	Open          float32
	High          float32
	Low           float32
	Close         float32
	Volume        int
	Change        float32
	ChangePercent float32
}

ChartPoint is a single point on the chart.

type Client

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

Client is used to make IEX API requests.

func NewClient

func NewClient(dumpAPIResponses bool) *Client

NewClient returns a new Client.

func (*Client) GetStocks

func (c *Client) GetStocks(ctx context.Context, req *GetStocksRequest) ([]*Stock, error)

GetStocks gets a series of trading sessions for a stock symbol.

type GetStocksRequest

type GetStocksRequest struct {
	Symbols   []string
	Range     Range
	ChartLast int
}

GetStocksRequest is the request for GetStocks.

type Quote

type Quote struct {
	CompanyName   string
	LatestPrice   float32
	LatestSource  Source
	LatestTime    time.Time
	LatestUpdate  time.Time
	LatestVolume  int
	Open          float32
	High          float32
	Low           float32
	Close         float32
	Change        float32
	ChangePercent float32
}

Quote is a stock quote.

type Range

type Range int

Range is the range to specify in the request.

const (
	RangeUnspecified Range = iota
	OneDay
	TwoYears
)

Range values.

func (Range) String added in v1.1.0

func (i Range) String() string

type Source

type Source int

Source is the quote data source.

const (
	SourceUnspecified Source = iota
	IEXRealTimePrice
	FifteenMinuteDelayedPrice
	Close
	PreviousClose
)

Source values.

func (Source) String

func (i Source) String() string

type Stock

type Stock struct {
	Symbol string
	Quote  *Quote
	Chart  []*ChartPoint
}

Stock is the response from calling GetStocks.

Directories

Path Synopsis
The iextool command prints stock data for a list of stock symbols.
The iextool command prints stock data for a list of stock symbols.

Jump to

Keyboard shortcuts

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