entities

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBinanceAdapter = errors.New("binance error")
	ErrUnknownPeriod  = fmt.Errorf("%w: unknown period", ErrBinanceAdapter)
)

Functions

func BinanceSymbol

func BinanceSymbol(pair string) string

func Intervals

func Intervals() []period.Symbol

Intervals represents every intervals supported by Binance API

func KLineTimeToTime

func KLineTimeToTime(t int64) time.Time

KLineTimeToTime will take the time from a kline and will convert it to candle time

func KLineToCandlestick

func KLineToCandlestick(k binance.Kline, p period.Symbol, now time.Time) (candlestick.Candlestick, error)

KLineToCandlestick will convert KLine binance format for Candlestick

func KLinesToCandlesticks

func KLinesToCandlesticks(pair string, period period.Symbol, kl []*binance.Kline, now time.Time) (*candlestick.List, error)

KLinesToCandlesticks will transform a slice of binance format for Candlestick

func PeriodToInterval

func PeriodToInterval(interval period.Symbol) (e string, err error)

PeriodToInterval converts an interval to its corresponding epoch

func TimeToKLineTime

func TimeToKLineTime(t time.Time) int64

TimeToKLineTime will take the time from a candle and will convert it to Kline time

func WrapError

func WrapError(err error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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