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 ¶
NumDecPlaces returns the number of decimal places of a float64
Types ¶
type Candle ¶
type Candle struct { Pair string Time time.Time UpdatedAt time.Time Open float64 Close float64 Low float64 High float64 Volume float64 Complete bool // Aditional collums from CSV inputs Metadata map[string]float64 }
func (Candle) ToHeikinAshi ¶
func (c Candle) ToHeikinAshi(ha *HeikinAshi) Candle
type Dataframe ¶
type HeikinAshi ¶
type HeikinAshi struct {
PreviousHACandle Candle
}
func NewHeikinAshi ¶
func NewHeikinAshi() *HeikinAshi
func (*HeikinAshi) CalculateHeikinAshi ¶
func (ha *HeikinAshi) CalculateHeikinAshi(c Candle) Candle
type Order ¶
type Order struct { ID int64 `db:"id" json:"id" gorm:"primaryKey,autoIncrement"` ExchangeID int64 `db:"exchange_id" json:"exchange_id"` Pair string `db:"pair" json:"pair"` Side SideType `db:"side" json:"side"` Type OrderType `db:"type" json:"type"` Status OrderStatusType `db:"status" json:"status"` Price float64 `db:"price" json:"price"` Quantity float64 `db:"quantity" json:"quantity"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` // OCO Orders only Stop *float64 `db:"stop" json:"stop"` GroupID *int64 `db:"group_id" json:"group_id"` // Internal use (Plot) RefPrice float64 `json:"ref_price" gorm:"-"` Profit float64 `json:"profit" gorm:"-"` ProfitValue float64 `json:"profit_value" gorm:"-"` Candle Candle `json:"-" gorm:"-"` }
type OrderStatusType ¶
type OrderStatusType string
type PriorityQueue ¶
func NewPriorityQueue ¶
func NewPriorityQueue(data []Item) *PriorityQueue
func (*PriorityQueue) Len ¶
func (q *PriorityQueue) Len() int
func (*PriorityQueue) Peek ¶
func (q *PriorityQueue) Peek() Item
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() Item
func (*PriorityQueue) PopLock ¶
func (q *PriorityQueue) PopLock() <-chan Item
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(item Item)
type Series ¶
type Series[T constraints.Ordered] []T
Series is a time series of values
func (Series[T]) Cross ¶
Cross returns true if the last value of the series is greater than the last value of the reference series or less than the last value of the reference series
func (Series[T]) Crossover ¶
Crossover returns true if the last value of the series is greater than the last value of the reference series
func (Series[T]) Crossunder ¶
Crossunder returns true if the last value of the series is less than the last value of the reference series
func (Series[T]) LastValues ¶
LastValues returns the last values of the series given a size
type Settings ¶
type Settings struct { Pairs []string Telegram TelegramSettings }
type TelegramSettings ¶
Click to show internal directories.
Click to hide internal directories.