Documentation
¶
Index ¶
- Constants
- Variables
- func BinanceSymbol(pair string) string
- func Intervals() []period.Symbol
- func KLineTimeToTime(t int64) time.Time
- func KLineToCandlestick(k binance.Kline, p period.Symbol, now time.Time) (candlestick.Candlestick, error)
- func KLinesToCandlesticks(pair string, period period.Symbol, kl []*binance.Kline, now time.Time) (*candlestick.List, error)
- func PeriodToInterval(interval period.Symbol) (e string, err error)
- func TimeToKLineTime(t time.Time) int64
- func WrapError(err error) error
Constants ¶
View Source
const (
// ExchangeName is the name of the exchange.
ExchangeName = "binance"
)
Variables ¶
View Source
var ( // ErrBinanceAdapter is returned when there is an error with the binance adapter. ErrBinanceAdapter = errors.New("binance error") // ErrUnknownPeriod is returned when the period is unknown. ErrUnknownPeriod = fmt.Errorf("%w: unknown period", ErrBinanceAdapter) )
Functions ¶
func BinanceSymbol ¶
BinanceSymbol will convert a pair to a Binance symbol.
func KLineTimeToTime ¶
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 ¶
PeriodToInterval converts an interval to its corresponding epoch.
func TimeToKLineTime ¶
TimeToKLineTime will take the time from a candle and will convert it to Kline time.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.