Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOrderbookForExchangeNotFound = "Ticker for exchange does not exist." ErrPrimaryCurrencyNotFound = "Error primary currency for orderbook not found." ErrSecondaryCurrencyNotFound = "Error secondary currency for orderbook not found." Orderbooks []Orderbook )
Functions ¶
func FirstCurrencyExists ¶
func FirstCurrencyExists(exchange string, currency pair.CurrencyItem) bool
func ProcessOrderbook ¶
func ProcessOrderbook(exchangeName string, p pair.CurrencyPair, orderbookNew OrderbookBase)
func SecondCurrencyExists ¶
func SecondCurrencyExists(exchange string, p pair.CurrencyPair) bool
Types ¶
type Orderbook ¶
type Orderbook struct {
Orderbook map[pair.CurrencyItem]map[pair.CurrencyItem]OrderbookBase
ExchangeName string
}
func CreateNewOrderbook ¶
func CreateNewOrderbook(exchangeName string, p pair.CurrencyPair, orderbookNew OrderbookBase) Orderbook
func GetOrderbookByExchange ¶
type OrderbookBase ¶
type OrderbookBase struct {
Pair pair.CurrencyPair `json:"pair"`
CurrencyPair string `json:"CurrencyPair"`
Bids []OrderbookItem `json:"bids"`
Asks []OrderbookItem `json:"asks"`
LastUpdated time.Time `json:"last_updated"`
}
func GetOrderbook ¶
func GetOrderbook(exchange string, p pair.CurrencyPair) (OrderbookBase, error)
func (*OrderbookBase) CalculateTotalAsks ¶
func (o *OrderbookBase) CalculateTotalAsks() (float64, float64)
func (*OrderbookBase) CalculateTotalBids ¶
func (o *OrderbookBase) CalculateTotalBids() (float64, float64)
func (*OrderbookBase) Update ¶
func (o *OrderbookBase) Update(Bids, Asks []OrderbookItem)
type OrderbookItem ¶
Click to show internal directories.
Click to hide internal directories.