Documentation
¶
Index ¶
- type Order
- type OrderBook
- func (ob *OrderBook) AddOrder(order *Order) error
- func (ob *OrderBook) ChangeOrder(orderId string, size decimal.Decimal) error
- func (ob *OrderBook) GetOrder(orderId string) *Order
- func (ob *OrderBook) GetPartOrderBookBySide(side string, number int) [][3]string
- func (ob *OrderBook) MarshalJSON() ([]byte, error)
- func (ob *OrderBook) MatchOrder(orderId string, size decimal.Decimal) error
- func (ob *OrderBook) RemoveByOrderId(orderId string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Order ¶
type OrderBook ¶
type OrderBook struct {
Sequence uint64 //Sequence || UpdateID
Asks *skiplist.SkipList //ask 是 要价,喊价 卖家 卖单 Sort price from low to high
Bids *skiplist.SkipList //bid 是 投标,买家 买单 Sort price from high to low
OrderPool map[string]*Order
}
func NewOrderBook ¶
func NewOrderBook() *OrderBook
func (*OrderBook) ChangeOrder ¶
替换, change 事件
func (*OrderBook) GetPartOrderBookBySide ¶
func (*OrderBook) MarshalJSON ¶
func (*OrderBook) MatchOrder ¶
更新, match 事件
func (*OrderBook) RemoveByOrderId ¶
done 事件
Click to show internal directories.
Click to hide internal directories.