model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commission

type Commission struct {
	CommissionID int `gorm:"primary_key;AUTO_INCREMENT"`
	FirmID       int
	FuturesID    string
	OrderType    string
	Percentage   decimal.Decimal `sql:"DECIMAL(10,2)"`
}

Commission represents a service charge assessed by a broker or investment advisor in return for providing investment advice and/or handling the purchase or sale of a security.

func (Commission) TableName

func (Commission) TableName() string

type Firm

type Firm struct {
	FirmID   int    `gorm:"primary_key;AUTO_INCREMENT" json:"firm_id"`
	FirmName string `json:"firm_name"`
	Credit   int    `gorm:"default:100" json:"credit"`
}

Firm represents a business organization, such as a corporation, limited liability company or partnership, that sells goods or services to make a profit.

func (Firm) TableName

func (Firm) TableName() string

type Futures

type Futures struct {
	FuturesID   string `gorm:"primary_key" json:"futures_id"`
	FuturesName string `json:"futures_name"`
	Symbol      string `json:"symbol"`
	Period      string `json:"period"`
}

Futures represent financial contracts obligating the buyer to purchase an asset or the seller to sell an asset.

func (Futures) TableName

func (Futures) TableName() string

type Order

type Order struct {
	OrderID      uuid.UUID       `json:"order_id" gorm:"primary_key"`
	OrderType    string          `json:"order_type"`
	Side         string          `json:"side"`
	FuturesID    string          `json:"futures_id"`
	FirmID       int             `json:"firm_id"`
	TraderName   string          `json:"trader_name"`
	Quantity     decimal.Decimal `json:"quantity" sql:"DECIMAL(10,2)"`
	OpenQuantity decimal.Decimal `json:"open_quantity" sql:"DECIMAL(10,2)"`
	Price        decimal.Decimal `json:"price" sql:"DECIMAL(10,2)"`
	StopPrice    decimal.Decimal `json:"stop_price" sql:"DECIMAL(10,2)"`
	Status       string          `json:"status"`
	CreatedAt    time.Time       `json:"created_at"`
	UpdatedAt    time.Time       `json:"updated_at"`
}

Order represents an investor's instructions to a broker or brokerage firm to purchase or sell a security.

func (Order) TableName

func (Order) TableName() string

type Trade

type Trade struct {
	TradeID              uuid.UUID       `gorm:"primary_key"`
	Quantity             decimal.Decimal `sql:"DECIMAL(10,2)"`
	Price                decimal.Decimal `sql:"DECIMAL(10,2)"`
	FuturesID            string
	InitiatorID          int
	InitiatorSide        string
	InitiatorName        string
	InitiatorCommission  decimal.Decimal `sql:"DECIMAL(10,2)"`
	InitiatorOrderID     uuid.UUID
	CompletionID         int
	CompletionSide       string
	CompletionName       string
	CompletionCommission decimal.Decimal `sql:"DECIMAL(10,2)"`
	CompletionOrderID    uuid.UUID
	CreatedAt            time.Time
}

Trade represents a basic economic concept involving the buying and selling of goods and services, with compensation paid by a buyer to a seller, or the exchange of goods or services between parties.

func (Trade) TableName

func (Trade) TableName() string

Jump to

Keyboard shortcuts

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