depth

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DepthStreamLevel5    DepthStreamLevel = 5
	DepthStreamLevel10   DepthStreamLevel = 10
	DepthStreamLevel20   DepthStreamLevel = 20
	DepthAPILimit5       DepthAPILimit    = 5
	DepthAPILimit10      DepthAPILimit    = 10
	DepthAPILimit20      DepthAPILimit    = 20
	DepthAPILimit50      DepthAPILimit    = 50
	DepthAPILimit100     DepthAPILimit    = 100
	DepthAPILimit500     DepthAPILimit    = 500
	DepthAPILimit1000    DepthAPILimit    = 1000
	DepthStreamRate100ms DepthStreamRate  = DepthStreamRate(100 * time.Millisecond)
	DepthStreamRate250ms DepthStreamRate  = DepthStreamRate(250 * time.Millisecond)
	DepthStreamRate500ms DepthStreamRate  = DepthStreamRate(500 * time.Millisecond)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DepthAPILimit

type DepthAPILimit int

type DepthStreamLevel

type DepthStreamLevel int

type DepthStreamRate

type DepthStreamRate time.Duration

type Depths

type Depths struct {
	LastUpdateID int64

	Init types.InitFunction
	// contains filtered or unexported fields
}

func New

func New(
	degree int,
	symbol string,
	startDepthStreamCreator func(*Depths) types.StreamFunction,
	initCreator func(*Depths) types.InitFunction,
	stops ...chan struct{}) *Depths

DepthBTree - B-дерево для зберігання стакана заявок

func (*Depths) GetAsks

func (d *Depths) GetAsks() *asks_types.Asks

func (*Depths) GetBids

func (d *Depths) GetBids() *bids_types.Bids

func (*Depths) GetNextDownCoefficient

func (d *Depths) GetNextDownCoefficient() items_types.PricePercentType

func (*Depths) GetNextUpCoefficient

func (d *Depths) GetNextUpCoefficient() items_types.PricePercentType

func (*Depths) IsStreamStarted

func (d *Depths) IsStreamStarted() bool

func (*Depths) Lock

func (d *Depths) Lock()

Lock implements depth_interface.Depths.

func (*Depths) MarkStreamAsStarted

func (d *Depths) MarkStreamAsStarted()

func (*Depths) MarkStreamAsStopped

func (d *Depths) MarkStreamAsStopped()

func (*Depths) NextPriceDown

func (d *Depths) NextPriceDown(percent items_types.PricePercentType, price ...items_types.PriceType) (next items_types.PriceType)

func (*Depths) NextPriceUp

func (d *Depths) NextPriceUp(percent items_types.PricePercentType, price ...items_types.PriceType) (next items_types.PriceType)

func (*Depths) ResetEvent

func (a *Depths) ResetEvent(err error)

func (*Depths) SetInit

func (d *Depths) SetInit(initCreator func(*Depths) types.InitFunction)

func (*Depths) SetStartDepthStream

func (d *Depths) SetStartDepthStream(startDepthStreamCreator func(*Depths) types.StreamFunction)

func (*Depths) StreamStart

func (d *Depths) StreamStart() (err error)

func (*Depths) StreamStop

func (d *Depths) StreamStop() (err error)

func (*Depths) Symbol

func (d *Depths) Symbol() string

Symbol implements depth_interface.Depths.

func (*Depths) TryLock

func (d *Depths) TryLock() bool

TryLock implements depth_interface.Depths.

func (*Depths) Unlock

func (d *Depths) Unlock()

Unlock implements depth_interface.Depths.

func (*Depths) UpdateAsk

func (a *Depths) UpdateAsk(item *items_types.Ask) bool

func (*Depths) UpdateBid

func (a *Depths) UpdateBid(item *items_types.Bid) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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