Documentation ¶
Index ¶
Constants ¶
View Source
const ( FifteenSecond = Interval(15 * time.Second) OneMin = Interval(time.Minute) ThreeMin = 3 * OneMin FiveMin = 5 * OneMin TenMin = 10 * OneMin FifteenMin = 15 * OneMin ThirtyMin = 30 * OneMin OneHour = Interval(time.Hour) TwoHour = 2 * OneHour FourHour = 4 * OneHour SixHour = 6 * OneHour EightHour = 8 * OneHour TwelveHour = 12 * OneHour OneDay = 24 * OneHour ThreeDay = 3 * OneDay SevenDay = 7 * OneDay FifteenDay = 15 * OneDay OneWeek = 7 * OneDay TwoWeek = 2 * OneWeek OneMonth = 31 * OneDay OneYear = 365 * OneDay )
Consts here define basic time intervals
View Source
const ( // ErrUnsupportedInterval locale for an unsupported interval ErrUnsupportedInterval = "%s interval unsupported by exchange" // ErrRequestExceedsExchangeLimits locale for exceeding rate limits message ErrRequestExceedsExchangeLimits = "requested data would exceed exchange limits please lower range or use GetHistoricCandlesEx" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Candle ¶
type Candle struct { Time time.Time Open float64 High float64 Low float64 Close float64 Volume float64 }
Candle holds historic rate information.
type ErrorKline ¶
type ErrorKline struct {
Interval Interval
}
ErrorKline struct to hold kline interval errors
func (ErrorKline) Error ¶
func (k ErrorKline) Error() string
Error returns short interval unsupported message
func (*ErrorKline) Unwrap ¶
func (k *ErrorKline) Unwrap() error
Unwrap returns interval unsupported message
type ExchangeCapabilitiesEnabled ¶
type ExchangeCapabilitiesEnabled struct { Intervals map[string]bool `json:"intervals,omitempty"` ResultLimit uint32 }
ExchangeCapabilitiesEnabled all kline related exchange enabled options
type ExchangeCapabilitiesSupported ¶
ExchangeCapabilitiesSupported all kline related exchange supported options
type Interval ¶
Interval type for kline Interval usage
type Item ¶
type Item struct { Exchange string Pair currency.Pair Asset asset.Item Interval Interval Candles []Candle }
Item holds all the relevant information for internal kline elements
func CreateKline ¶
func CreateKline(trades []order.TradeHistory, interval Interval, p currency.Pair, a asset.Item, exchange string) (Item, error)
CreateKline creates candles out of trade history data for a set time interval
func (*Item) SortCandlesByTimestamp ¶
SortCandlesByTimestamp sorts candles by timestamp
Click to show internal directories.
Click to hide internal directories.