okex

package
v0.0.0-...-b093a28 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OKEX = "OKEX"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient struct {
	*retryablehttp.Client
	*rate.Limiter
}

func NewOkexAPIClient

func NewOkexAPIClient() *ApiClient

func (*ApiClient) GetAllOHLCVMarketData

func (apiClient *ApiClient) GetAllOHLCVMarketData(
	symbol models.Symbol,
	interval time.Duration,
	startTime time.Time,
	endTime time.Time,
) ([]*models.OHLCVMarketData, error)

GetAllOHLCVMarketData get CandleStick data from [startTime, endTime] with pagination

func (*ApiClient) GetExchangeIdentifier

func (apiClient *ApiClient) GetExchangeIdentifier() string

func (*ApiClient) GetOHLCVMarketData

func (apiClient *ApiClient) GetOHLCVMarketData(
	symbol models.Symbol,
	interval time.Duration,
	startTime time.Time,
	endTime time.Time,
) ([]*models.OHLCVMarketData, error)

GetOHLCVMarketData get CandleStick data from [startTime, endTime]

func (*ApiClient) GetRawMarketData

func (apiClient *ApiClient) GetRawMarketData() ([]*models.RawMarketData, error)

func (*ApiClient) GetSupportedPairs

func (apiClient *ApiClient) GetSupportedPairs() ([]*models.Symbol, error)

type CandleStickData

type CandleStickData struct {
	OpenTime   float64
	OpenPrice  float64
	HighPrice  float64
	LowPrice   float64
	ClosePrice float64
	Volume     float64
}

CandleStickData https://www.okex.com/docs/en/#spot-line

func (*CandleStickData) UnmarshalJSON

func (candleStickResponse *CandleStickData) UnmarshalJSON(
	data []byte,
) (err error)

type Instrument

type Instrument struct {
	BaseCurrency  string `json:"base_currency"`
	Category      string `json:"category"`
	InstrumentID  string `json:"instrument_id"`
	MinSize       string `json:"min_size"`
	QuoteCurrency string `json:"quote_currency"`
	SizeIncrement string `json:"size_increment"`
	TickSize      string `json:"tick_size"`
}

Instrument https://www.okex.com/docs/en/#spot-some

type Interval

type Interval string

Jump to

Keyboard shortcuts

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