marketdata

package
v0.0.0-...-a4552ea Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewYahooClient

func NewYahooClient() (supplier.Marketdata, error)

Types

type AlpacaClient

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

func NewAlpacaClient

func NewAlpacaClient() (*AlpacaClient, error)

func (*AlpacaClient) GetAsset

func (a *AlpacaClient) GetAsset(symbol string) (*pb.Asset, error)

func (*AlpacaClient) GetIndex

func (a *AlpacaClient) GetIndex(_ string) ([]*pb.Asset, error)

func (*AlpacaClient) GetOHLC

func (a *AlpacaClient) GetOHLC(symbol string, start time.Time, end *time.Time) ([]*pb.OHLC, error)

type AssetResponse

type AssetResponse struct {
	QuoteSummary struct {
		Result []struct {
			AssetProfile struct{} `json:"assetProfile"`
			QuoteType    struct {
				Exchange  string `json:"exchange"`
				Symbol    string `json:"symbol"`
				QuoteType string `json:"quoteType"`
				ShortName string `json:"shortName"`
				LongName  string `json:"longName"`
			} `json:"quoteType"`
		} `json:"result"`
		Error struct {
			Code        string `json:"code"`
			Description string `json:"description"`
		} `json:"error"`
	} `json:"quoteSummary"`
}

type IndexResponse

type IndexResponse struct {
	Summary struct {
		Result []struct {
			Components struct {
				Components []string `json:"components"`
			} `json:"components"`
		} `json:"result"`
	} `json:"quoteSummary"`
}

type OHLCResponse

type OHLCResponse struct {
	Chart struct {
		Result []struct {
			Meta struct {
				Currency string `json:"currency"`
				Symbol   string `json:"symbol"`
			} `json:"meta"`
			Timestamp  []int64 `json:"timestamp"`
			Indicators struct {
				Quote []struct {
					Open   []float64 `json:"open"`
					High   []float64 `json:"high"`
					Low    []float64 `json:"low"`
					Close  []float64 `json:"close"`
					Volume []uint64  `json:"volume"`
				} `json:"quote"`
			} `json:"indicators"`
		} `json:"result"`
		Error struct {
			Code        string `json:"code"`
			Description string `json:"description"`
		}
	}
}

type YahooClient

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

func (*YahooClient) GetAsset

func (y *YahooClient) GetAsset(symbol string) (*pb.Asset, error)

func (*YahooClient) GetIndex

func (y *YahooClient) GetIndex(symbol string) ([]*pb.Asset, error)

func (*YahooClient) GetOHLC

func (y *YahooClient) GetOHLC(symbol string, start time.Time, end *time.Time) ([]*pb.OHLC, error)

Jump to

Keyboard shortcuts

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