api

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BatchSize = 100
)

Variables

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

Functions

func SetSandbox

func SetSandbox(b bool)

func SetToken

func SetToken(t string)

func SupportedRange

func SupportedRange(r string) bool

Types

type Chart

type Chart struct {
	Date                 string  `json:"date"`
	Minute               string  `json:"minute"`
	Label                string  `json:"label"`
	High                 float32 `json:"high"`
	Low                  float32 `json:"low"`
	Average              float64 `json:"average"`
	Volume               int32   `json:"volume"`
	Notional             float64 `json:"notional"`
	NumberOfTrades       int     `json:"numberOfTrades"`
	MarketHigh           float64 `json:"marketHigh"`
	MarketLow            float64 `json:"marketLow"`
	MarketAverage        float64 `json:"marketAverage"`
	MarketVolume         int     `json:"marketVolume"`
	MarketNotional       float64 `json:"marketNotional"`
	MarketNumberOfTrades int     `json:"marketNumberOfTrades"`
	Open                 float32 `json:"open"`
	Close                float32 `json:"close"`
	MarketOpen           float64 `json:"marketOpen,omitempty"`
	MarketClose          float64 `json:"marketClose,omitempty"`
	ChangeOverTime       float64 `json:"changeOverTime"`
	MarketChangeOverTime float64 `json:"marketChangeOverTime"`
}

func (*Chart) GetTimestamp

func (c *Chart) GetTimestamp() (ts time.Time, err error)

type ChartResponse

type ChartResponse struct {
	Chart          []Chart `json:"chart"`
	IntradayPrices []Chart `json:"intraday-prices"`
}

type GetBarsResponse

type GetBarsResponse map[string]*ChartResponse

func GetBars

func GetBars(ctx context.Context, symbols []string, barRange string, limit *int, retries int,
) (*GetBarsResponse, error)

type ListSymbolsResponse

type ListSymbolsResponse []struct {
	Symbol    string `json:"symbol"`
	Date      string `json:"date"`
	IsEnabled bool   `json:"isEnabled"`
}

func ListSymbols

func ListSymbols(ctx context.Context) (*ListSymbolsResponse, error)

Jump to

Keyboard shortcuts

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