Documentation ¶
Index ¶
- Variables
- func Round3(val float64) float64
- func Round8(val float64) float64
- type CommonTicker
- type RedisCacheEntry
- type RedisInputCache
- func (c *RedisInputCache) GetFirst() (*RedisCacheEntry, error)
- func (c *RedisInputCache) GetN(n int64) (*RedisCacheEntry, error)
- func (c *RedisInputCache) LRange(start, stop int64) ([]string, error)
- func (c *RedisInputCache) LRemove()
- func (c *RedisInputCache) Len() (int64, error)
- func (c *RedisInputCache) RPush(buf []byte)
- type TickerMetrics
- type TickerTracker
- type TickerTrackerMap
Constants ¶
This section is empty.
Variables ¶
View Source
var Buckets []int
Functions ¶
Types ¶
type CommonTicker ¶
type CommonTicker struct { // The coin and the pairing: ETHBTC, ETH-BTC... Symbol string Timestamp time.Time // The last, or closing price. LastPrice float64 // Volume in the base pair. Usually 24h. QuoteVolume float64 // The 24 hour price change as a percentage value. PriceChangePct24 float64 Bid float64 Ask float64 High float64 Low float64 }
func CommonTickerFromBinanceTicker ¶
func CommonTickerFromBinanceTicker(ticker binance.Ticker24) CommonTicker
func CommonTickerFromKuCoinTicker ¶
func CommonTickerFromKuCoinTicker(ticker kucoin.TickEntry) CommonTicker
type RedisCacheEntry ¶
func DecodeRedisCacheEntry ¶
func DecodeRedisCacheEntry(buf string) (RedisCacheEntry, error)
type RedisInputCache ¶
type RedisInputCache struct {
// contains filtered or unexported fields
}
func NewRedisInputCache ¶
func NewRedisInputCache(key string) *RedisInputCache
func (*RedisInputCache) GetFirst ¶
func (c *RedisInputCache) GetFirst() (*RedisCacheEntry, error)
func (*RedisInputCache) GetN ¶
func (c *RedisInputCache) GetN(n int64) (*RedisCacheEntry, error)
func (*RedisInputCache) LRange ¶
func (c *RedisInputCache) LRange(start, stop int64) ([]string, error)
func (*RedisInputCache) LRemove ¶
func (c *RedisInputCache) LRemove()
Like LPop, but ignores the result.
func (*RedisInputCache) Len ¶
func (c *RedisInputCache) Len() (int64, error)
func (*RedisInputCache) RPush ¶
func (c *RedisInputCache) RPush(buf []byte)
type TickerMetrics ¶
type TickerTracker ¶
type TickerTracker struct { Symbol string Ticks []CommonTicker Metrics map[int]*TickerMetrics LastUpdate time.Time H24Metrics TickerMetrics // Trades, in Binance format. Trades []binance.AggTrade HaveVwap bool HaveTotalVolume bool HaveNetVolume bool }
func NewTickerTracker ¶
func NewTickerTracker(symbol string) *TickerTracker
func (*TickerTracker) AddTrade ¶
func (t *TickerTracker) AddTrade(trade binance.AggTrade)
func (*TickerTracker) LastTick ¶
func (t *TickerTracker) LastTick() *CommonTicker
func (*TickerTracker) PruneTrades ¶
func (t *TickerTracker) PruneTrades(now time.Time)
func (*TickerTracker) Recalculate ¶
func (t *TickerTracker) Recalculate()
func (*TickerTracker) Update ¶
func (t *TickerTracker) Update(ticker CommonTicker)
type TickerTrackerMap ¶
type TickerTrackerMap struct {
Trackers map[string]*TickerTracker
}
func NewTickerTrackerMap ¶
func NewTickerTrackerMap() *TickerTrackerMap
func (*TickerTrackerMap) GetLastForSymbol ¶
func (t *TickerTrackerMap) GetLastForSymbol(symbol string) *CommonTicker
func (*TickerTrackerMap) GetTracker ¶
func (t *TickerTrackerMap) GetTracker(symbol string) *TickerTracker
Click to show internal directories.
Click to hide internal directories.