order

package
v0.0.0-...-4e5e1bb Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// contains filtered or unexported fields
}

Info holds information about a particular orders, from the raw data of an orders to relevant information to an orders in relation to other orders

func (Info) CheckTag

func (i Info) CheckTag(o Tags) bool

CheckTag checks if a particular tag exists

func (Info) CheckTags

func (i Info) CheckTags(o ...Tags) bool

CheckTags check if a particular group of tags exist

func (Info) GetMeta

func (i Info) GetMeta() (b []byte)

GetMeta retrieves a copy of the metadata

func (*Info) RemoveTag

func (i *Info) RemoveTag(o Tags) bool

RemoveTag removes a particular tag

func (Info) Seen

func (i Info) Seen() time.Time

Seen the creation time of this Order Info

func (*Info) SetMeta

func (i *Info) SetMeta(b []byte)

SetMeta stores metadata i.e: the raw data we got from the exchange

func (*Info) SetTags

func (i *Info) SetTags(o ...Tags)

SetTags sets one or more tags

type Order

type Order struct {
	Asset    string
	Price    decimal.Decimal
	Quantity decimal.Decimal
	Inf      Info
}

Order holds order information

func EmptyOrder

func EmptyOrder() (o Order)

EmptyOrder convenience function to return a dummy/empty orders

func NewOrderFloat32

func NewOrderFloat32(price, quantity float32) (o Order)

NewOrderFloat32 based on float32

func NewOrderFloat64

func NewOrderFloat64(price, quantity float64) (o Order)

NewOrderFloat64 based on float64

func NewOrderString

func NewOrderString(price, quantity string) (o Order)

NewOrderString creates from string

type Tags

type Tags int

Tags describe information about an order

const (
	Empty Tags = iota
	Open
	Matched
	Closed
	Buy
	Sell
)

Jump to

Keyboard shortcuts

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