quotes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Client
}

Client defines a REST client for the Polygon quotes API.

func (*Client) GetLastForexQuote

GetLastForexQuote retrieves the last quote (BBO) for a forex currency pair. For more details see https://polygon.io/docs/forex/get_v1_last_quote_currencies__from___to.

func (*Client) GetLastQuote

func (c *Client) GetLastQuote(ctx context.Context, params *models.GetLastQuoteParams, options ...models.RequestOption) (*models.GetLastQuoteResponse, error)

GetLastQuote retrieves the last quote (NBBO) for a specified ticker. For more details see https://polygon.io/docs/stocks/get_v2_last_nbbo__stocksticker.

func (*Client) ListQuotes

func (c *Client) ListQuotes(ctx context.Context, params *models.ListQuotesParams, options ...models.RequestOption) *ListQuotesIter

ListQuotes retrieves quotes for a specified ticker. For more details see https://polygon.io/docs/stocks/get_v3_quotes__stockticker. This method returns an iterator that should be used to access the results via this pattern:

iter, err := c.ListQuotes(context.TODO(), params, opts...)
for iter.Next() {
    // do something with the current value
    log.Print(iter.Quote())
}
if iter.Err() != nil {
    return err
}

type ListQuotesIter

type ListQuotesIter struct {
	models.Iter
}

ListQuotesIter is an iterator for the ListQuotes method.

func (*ListQuotesIter) Quote

func (it *ListQuotesIter) Quote() models.Quote

Quote returns the current result that the iterator points to.

Jump to

Keyboard shortcuts

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