Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Book ¶
type Book struct { Symbol string // book symbol ID int64 // the book update ID, optional Count int64 // updated count, optional Period int64 Price float64 // updated price Amount float64 // updated amount Rate float64 PriceJsNum json.Number // update price as json.Number AmountJsNum json.Number // update amount as json.Number Side common.OrderSide // side Action BookAction // action (add/remove) }
Book represents an order book price update.
func FromRaw ¶
func FromRaw(symbol, precision string, raw []interface{}, rawNumbers interface{}) (b *Book, err error)
FromRaw creates a new book object from raw data. Precision determines how to interpret the side (baked into Count versus Amount) raw book updates [ID, price, qty], aggregated book updates [price, amount, count]
type BookAction ¶
type BookAction byte
BookAction represents a new/update or removal for a book entry.
const ( //BookEntry represents a new or updated book entry. BookEntry BookAction = 0 //BookRemoveEntry represents a removal of a book entry. BookRemoveEntry BookAction = 1 )
Click to show internal directories.
Click to hide internal directories.