Documentation
¶
Index ¶
- Constants
- Variables
- func Cron() *cron.Cron
- func DelPairCopieds(keys ...string)
- func EnsureLatestPrice(symbol string) *errs.Error
- func GetBookTickers() (map[string]*banexg.Ticker, *errs.Error)
- func GetPairCopieds() map[string][2]int64
- func GetPrice(symbol string, side string) float64
- func GetPriceExp(symbol string, side string, expMS int64) float64
- func GetPriceSafe(symbol string, side string) float64
- func GetPriceSafeExp(symbol string, side string, expMS int64) float64
- func IsMaker(pair, side string, price float64) bool
- func IsPriceEmpty() bool
- func RefreshLatestPrice(symbol string) *errs.Error
- func SetBarPrice(pair string, price float64)
- func SetPairCopieds(items map[string][2]int64)
- func SetPairMs(pair string, barMS, waitMS int64)
- func SetPrice(pair string, ask, bid float64)
- func SetPrices(data map[string]float64, side string)
Constants ¶
View Source
const (
Day10MSecs = int64(864000000)
)
Variables ¶
View Source
var (
PriceExpireMS = int64(60000)
)
Functions ¶
func DelPairCopieds ¶
func DelPairCopieds(keys ...string)
func EnsureLatestPrice ¶ added in v0.2.33
EnsureLatestPrice makes sure the cached price is valid (not expired) for the symbol. It only fetches from exchange when the cache is invalid.
func GetBookTickers ¶ added in v0.2.33
GetBookTickers fetches latest book tickers and updates the price cache.
func GetPairCopieds ¶
func GetPriceExp ¶
GetPriceExp panic if price expired before expMS or not found
func GetPriceSafe ¶
GetPriceSafe return -1 if price expired or not found
func IsPriceEmpty ¶
func IsPriceEmpty() bool
func RefreshLatestPrice ¶ added in v0.2.33
RefreshLatestPrice forces a price refresh when called outside bar-complete flow. It respects a short throttle window and returns nil if a valid cached price exists.
func SetBarPrice ¶
func SetPairCopieds ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.