orders

package
v0.0.0-...-8fb26ab Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoExchangeError = errors.New("nil exchange metadata")
View Source
var NoOrderError = errors.New("nil order")
View Source
var NoSideError = errors.New("nil order side")
View Source
var NoTimeInForceError = errors.New("nil time in force")
View Source
var NonPositivePriceError = errors.New("non-positive order price")
View Source
var NonPositiveQtyError = errors.New("non-positive order qty")

Functions

func BoundQtyInDealt

func BoundQtyInDealt[T instr.Instrument](order *Limit[T], inventoryInDealt float64) error

func GenerateClientOrderID

func GenerateClientOrderID() string

func NormalizeMakerWithIncrement

func NormalizeMakerWithIncrement[T instr.Instrument](order *Limit[T], priceIncrement, qtyIncrement float64) error

func NormalizeMakerWithPrecision

func NormalizeMakerWithPrecision[T instr.Instrument](order *Limit[T], pricePrecision, qtyPrecision int) error

func NormalizeMakerWithRefData

func NormalizeMakerWithRefData[T instr.Instrument](order *Limit[T], refData *refdata.Composite) error

func NormalizeTakerWithIncrement

func NormalizeTakerWithIncrement[T instr.Instrument](order *Limit[T], priceIncrement, qtyIncrement float64) error

func NormalizeTakerWithPrecision

func NormalizeTakerWithPrecision[T instr.Instrument](order *Limit[T], pricePrecision, qtyPrecision int) error

func NormalizeTakerWithRefData

func NormalizeTakerWithRefData[T instr.Instrument](order *Limit[T], refData *refdata.Composite) error

func RoundPriceAggressiveWithIncrement

func RoundPriceAggressiveWithIncrement[T instr.Instrument](order *Limit[T], increment float64) error

func RoundPriceAggressiveWithPrecision

func RoundPriceAggressiveWithPrecision[T instr.Instrument](order *Limit[T], precision int) error

func RoundPricePassiveWithIncrement

func RoundPricePassiveWithIncrement[T instr.Instrument](order *Limit[T], increment float64) error

func RoundPricePassiveWithPrecision

func RoundPricePassiveWithPrecision[T instr.Instrument](order *Limit[T], precision int) error

func RoundQtyWithIncrement

func RoundQtyWithIncrement[T instr.Instrument](order *Limit[T], increment float64)

func RoundQtyWithPrecision

func RoundQtyWithPrecision[T instr.Instrument](order *Limit[T], precision int)

func Skew

func Skew[T instr.Instrument](order *Limit[T], skewBps float64)

func ValidateLimit

func ValidateLimit[T instr.Instrument](order *Limit[T]) error

func ValidateLimitWithBaseConstraints

func ValidateLimitWithBaseConstraints[T instr.Instrument](order *Limit[T], baseMinTradeSize, baseMaxTradeSize float64) error

func ValidateLimitWithRefData

func ValidateLimitWithRefData[T instr.Instrument](order *Limit[T], refData *refdata.Composite) error

func ValidateLimitWithTermConstraints

func ValidateLimitWithTermConstraints[T instr.Instrument](order *Limit[T], termMinTradeSize, termMaxTradeSize float64) error

Types

type Limit

type Limit[T instr.Instrument] struct {
	Instrument       T
	ClientOrderID    string // Our ID
	ExchangeMetaData *exchange.MetaData
	Price            float64
	Qty              float64
	Side             side.OrderSide
	TimeInForce      tif.TimeInForce
	TransactTime     time.Time
}

type Market

type Market[T instr.Instrument] struct {
	Instrument       T
	ExchangeMetaData *exchange.MetaData
	ClientOrderID    string // Our ID
	Qty              float64
	Side             side.OrderSide
	TransactTime     time.Time
}

Jump to

Keyboard shortcuts

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