level2

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Order

type Order struct {
	Price decimal.Decimal
	Size  decimal.Decimal
	Info  interface{}
}

Price, Quantity

func NewOrder

func NewOrder(price string, size string, info interface{}) (order *Order, err error)

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
}

func NewOrderBook

func NewOrderBook() *OrderBook

func (*OrderBook) GetPartOrderBookBySide

func (ob *OrderBook) GetPartOrderBookBySide(side string, number int) [][2]string

func (*OrderBook) MarshalJSON

func (ob *OrderBook) MarshalJSON() ([]byte, error)

func (*OrderBook) SetOrder

func (ob *OrderBook) SetOrder(side string, order *Order) error

addToOrderBookSide

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL