models

package
v0.0.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Symbol    string `gorm:"primarykey"`
	StepSize  float64
	CreatedAt time.Time
}

type Order

type Order struct {
	gorm.Model
	market.Order

	// Required field to indicate which market the order is for.
	Market string

	// Required field to indicate the type of order.
	Type OrderType

	// Required field to indicate the volume of the symbol.
	Volume float64

	// Optional field to store the take profit.
	// This field may be updated when trailing stop loss is used.
	// This field is only set when the type is a buy order.
	TakeProfit *float64

	// Optional field to store the stop loss.
	// This field may be updated when trailing stop loss is used.
	// This field is only set when the type is a buy order.
	StopLoss *float64

	// Optional field for the estimated profit.
	// This field is only set when the type is a sell order.
	PriceChangePercentage *float64

	// Optional field for the estimated profit or loss.
	// This field is only set when the type is a sell order.
	EstimatedProfitLoss *float64

	// Optional field for the realized profit or loss.
	// This field is only set when the type is a sell order.
	RealizedProfitLoss *float64

	// Whether the order is a dummy/fake order, created in test mode.
	IsTestMode bool
}

type OrderType

type OrderType string
const (
	BuyOrder  OrderType = "buy"
	SellOrder OrderType = "sell"
)

Jump to

Keyboard shortcuts

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