api

package
v2.3.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NY, _ = time.LoadLocation("America/New_York")
)

Functions

func SetAPIKey

func SetAPIKey(key string)

func SetBaseURL

func SetBaseURL(url string)

func SetNatsServers

func SetNatsServers(serverList string)

func Stream

func Stream(handler func(m *nats.Msg), symbols []string) (err error)

Stream from the polygon nats server

Types

type GetAggregatesResponse

type GetAggregatesResponse struct {
	Symbol  string `json:"symbol"`
	AggType string `json:"aggType"`
	Map     struct {
		O string `json:"o"`
		C string `json:"c"`
		H string `json:"h"`
		L string `json:"l"`
		V string `json:"v"`
		D string `json:"d"`
	} `json:"map"`
	Ticks []struct {
		Open        float64 `json:"o"`
		Close       float64 `json:"c"`
		High        float64 `json:"h"`
		Low         float64 `json:"l"`
		Volume      int     `json:"v"`
		EpochMillis int64   `json:"d"`
	} `json:"ticks"`
}

func GetAggregates

func GetAggregates(symbol string, from time.Time) (*GetAggregatesResponse, error)

type StreamAggregate

type StreamAggregate struct {
	Symbol      string  `json:"sym"`
	Open        float64 `json:"o"`
	High        float64 `json:"h"`
	Low         float64 `json:"l"`
	Close       float64 `json:"c"`
	Volume      int     `json:"v"`
	EpochMillis int64   `json:"s"`

	// unneeded
	X int     `json:"-"`
	A float64 `json:"-"`
	T float64 `json:"-"`
	E int64   `json:"-"`
}

Jump to

Keyboard shortcuts

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