oms

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-1.1 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClOrdIDGenerator

type ClOrdIDGenerator interface {
	Next() string
}

type Execution

type Execution struct {
	ID       int       `json:"id"`
	Symbol   string    `json:"symbol"`
	Quantity string    `json:"quantity"`
	Side     enum.Side `json:"side"`
	Price    string    `json:"price"`
	Session  string    `json:"session_id"`
}

Execution is the execution type

type Order

type Order struct {
	ID                 int                `json:"id"`
	SessionID          quickfix.SessionID `json:"-"`
	ClOrdID            string             `json:"clord_id"`
	OrderID            string             `json:"order_id"`
	Symbol             string             `json:"symbol"`
	QuantityDecimal    decimal.Decimal    `json:"-"`
	Quantity           string             `json:"quantity"`
	Account            string             `json:"account"`
	Session            string             `json:"session_id"`
	Side               enum.Side          `json:"side"`
	OrdType            enum.OrdType       `json:"ord_type"`
	PriceDecimal       decimal.Decimal    `json:"-"`
	Price              string             `json:"price"`
	StopPriceDecimal   decimal.Decimal    `json:"-"`
	StopPrice          string             `json:"stop_price"`
	Closed             string             `json:"closed"`
	Open               string             `json:"open"`
	AvgPx              string             `json:"avg_px"`
	SecurityType       enum.SecurityType  `json:"security_type"`
	SecurityDesc       string             `json:"security_desc"`
	MaturityMonthYear  string             `json:"maturity_month_year"`
	MaturityDay        int                `json:"maturity_day"`
	PutOrCall          enum.PutOrCall     `json:"put_or_call"`
	StrikePrice        string             `json:"strike_price"`
	StrikePriceDecimal decimal.Decimal    `json:"-"`
}

Order is the order type

func (*Order) Init

func (order *Order) Init() error

Init initialized computed fields on order from user input

type OrderManager

type OrderManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewOrderManager

func NewOrderManager(idGen ClOrdIDGenerator) *OrderManager

func (*OrderManager) AssignNextClOrdID

func (om *OrderManager) AssignNextClOrdID(order *Order) string

func (*OrderManager) Get

func (om *OrderManager) Get(id int) (*Order, error)

func (*OrderManager) GetAll

func (om *OrderManager) GetAll() []*Order

func (*OrderManager) GetAllExecutions

func (om *OrderManager) GetAllExecutions() []*Execution

func (*OrderManager) GetByClOrdID

func (om *OrderManager) GetByClOrdID(clOrdID string) (*Order, error)

func (*OrderManager) GetExecution

func (om *OrderManager) GetExecution(id int) (*Execution, error)

func (*OrderManager) Save

func (om *OrderManager) Save(order *Order) error

func (*OrderManager) SaveExecution

func (om *OrderManager) SaveExecution(exec *Execution) error

Jump to

Keyboard shortcuts

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