model

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SideTypeBuy  SideType = "BUY"
	SideTypeSell SideType = "SELL"

	OrderTypeLimit           OrderType = "LIMIT"
	OrderTypeMarket          OrderType = "MARKET"
	OrderTypeLimitMaker      OrderType = "LIMIT_MAKER"
	OrderTypeStopLoss        OrderType = "STOP_LOSS"
	OrderTypeStopLossLimit   OrderType = "STOP_LOSS_LIMIT"
	OrderTypeTakeProfit      OrderType = "TAKE_PROFIT"
	OrderTypeTakeProfitLimit OrderType = "TAKE_PROFIT_LIMIT"

	OrderStatusTypeNew             OrderStatusType = "NEW"
	OrderStatusTypePartiallyFilled OrderStatusType = "PARTIALLY_FILLED"
	OrderStatusTypeFilled          OrderStatusType = "FILLED"
	OrderStatusTypeCanceled        OrderStatusType = "CANCELED"
	OrderStatusTypePendingCancel   OrderStatusType = "PENDING_CANCEL"
	OrderStatusTypeRejected        OrderStatusType = "REJECTED"
	OrderStatusTypeExpired         OrderStatusType = "EXPIRED"
)

Functions

func NumDecPlaces

func NumDecPlaces(v float64) int64

Types

type Account

type Account struct {
	Balances []Balance
}

func (Account) Balance

func (a Account) Balance(tick string) Balance

type Balance

type Balance struct {
	Tick string
	Free float64
	Lock float64
}

type Candle

type Candle struct {
	Symbol   string
	Time     time.Time
	Open     float64
	Close    float64
	Low      float64
	High     float64
	Volume   float64
	Trades   int64
	Complete bool
}

func (Candle) ToSlice

func (c Candle) ToSlice() []string

type Dataframe

type Dataframe struct {
	Pair string

	Close  series.Series
	Open   series.Series
	High   series.Series
	Low    series.Series
	Volume series.Series

	Time       []time.Time
	LastUpdate time.Time

	// Custom user metadata
	Metadata map[string]series.Series
}

type Order

type Order struct {
	ID         int64
	ExchangeID int64
	Symbol     string
	Side       SideType
	Type       OrderType
	Status     OrderStatusType
	Price      float64
	Quantity   float64

	CreatedAt time.Time
	UpdatedAt time.Time

	// OCO Orders only
	Stop    *float64
	GroupID *int64

	// Internal use (Plot)
	Profit float64
	Candle Candle
}

func (Order) String

func (o Order) String() string

type OrderStatusType

type OrderStatusType string

type OrderType

type OrderType string

type Settings

type Settings struct {
	Pairs    []string
	Telegram TelegramSettings
}

type SideType

type SideType string

type TelegramSettings added in v0.0.6

type TelegramSettings struct {
	Enabled bool
	Token   string
	Users   []int
}

Jump to

Keyboard shortcuts

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