forex

package
v0.0.0-...-795d1ad Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForexService

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

func NewForexService

func NewForexService(token string) *ForexService

func (*ForexService) History

func (t *ForexService) History(request *HistoryRequest) (*HistoryResponse, error)

Returns the data for the previous close

func (*ForexService) Price

func (t *ForexService) Price(request *PriceRequest) (*PriceResponse, error)

Get the latest price for a given forex ticker

func (*ForexService) Quote

func (t *ForexService) Quote(request *QuoteRequest) (*QuoteResponse, error)

Get the latest quote for the forex

type HistoryRequest

type HistoryRequest struct {
	// the forex symbol e.g GBPUSD
	Symbol string `json:"symbol"`
}

type HistoryResponse

type HistoryResponse struct {
	// the close price
	Close float64 `json:"close"`
	// the date
	Date string `json:"date"`
	// the peak price
	High float64 `json:"high"`
	// the low price
	Low float64 `json:"low"`
	// the open price
	Open float64 `json:"open"`
	// the forex symbol
	Symbol string `json:"symbol"`
	// the volume
	Volume float64 `json:"volume"`
}

type PriceRequest

type PriceRequest struct {
	// forex symbol e.g GBPUSD
	Symbol string `json:"symbol"`
}

type PriceResponse

type PriceResponse struct {
	// the last price
	Price float64 `json:"price"`
	// the forex symbol e.g GBPUSD
	Symbol string `json:"symbol"`
}

type QuoteRequest

type QuoteRequest struct {
	// the forex symbol e.g GBPUSD
	Symbol string `json:"symbol"`
}

type QuoteResponse

type QuoteResponse struct {
	// the asking price
	AskPrice float64 `json:"askPrice"`
	// the bidding price
	BidPrice float64 `json:"bidPrice"`
	// the forex symbol
	Symbol string `json:"symbol"`
	// the UTC timestamp of the quote
	Timestamp string `json:"timestamp"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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