Documentation
¶
Index ¶
- Constants
- func ConnectMongo(ctx context.Context, conf MongoConf) (*mongo.Database, error)
- func IsDuplicateError(err error) bool
- func ParseJsonConfig(filename string, config interface{}) error
- type BroadcastConf
- type Candle
- type Exchange
- type ExchangeConf
- type Grid
- type GridStrategyConf
- type HistoryConf
- type MongoConf
- type MySQLConf
- type Order
- type OrderStatus
- type OrderType
- type RestAPIExchange
- type RestGridStrategyConf
- type SQLiteConf
- type Ticker
- type Trade
- type WsAPIExchange
Constants ¶
View Source
const ( GateIO = "gate" MXC = "mxc" OKEx = "okex" Huobi = "huobi" )
View Source
const ( Open OrderStatus = 1 // open but not filled Closed = 2 // full filled Filled = 3 // part filled Cancelled = 4 )
Variables ¶
This section is empty.
Functions ¶
func ConnectMongo ¶ added in v0.6.0
func IsDuplicateError ¶ added in v0.6.0
func ParseJsonConfig ¶
Types ¶
type BroadcastConf ¶ added in v0.7.7
type Candle ¶ added in v0.7.5
type Exchange ¶ added in v0.7.2
type Exchange interface {
RestAPIExchange
WsAPIExchange
}
common exchange interface, for all symbols, all crypto-exchanges
type ExchangeConf ¶ added in v0.5.1
type GridStrategyConf ¶ added in v0.5.8
type HistoryConf ¶ added in v0.6.1
type OrderStatus ¶ added in v0.7.14
type OrderStatus = int
type RestAPIExchange ¶ added in v0.10.0
type RestAPIExchange interface {
PricePrecision(symbol string) int32
AmountPrecision(symbol string) int32
MinAmount(symbol string) decimal.Decimal
MinTotal(symbol string) decimal.Decimal
SpotAvailableBalance() (map[string]decimal.Decimal, error)
LastPrice(symbol string) (decimal.Decimal, error)
Candle(symbol string, period time.Duration, size int) (Candle, error)
//PlaceOrder(orderType, symbol, clientOrderId string, price, amount decimal.Decimal) (uint64, error)
BuyLimit(symbol, clientOrderId string, price, amount decimal.Decimal) (orderId uint64, err error)
SellLimit(symbol, clientOrderId string, price, amount decimal.Decimal) (orderId uint64, err error)
BuyStopLimit(symbol, clientOrderId string, price, amount, stopPrice decimal.Decimal, operator string) (orderId uint64, err error)
SellStopLimit(symbol, clientOrderId string, price, amount, stopPrice decimal.Decimal, operator string) (orderId uint64, err error)
CancelOrder(symbol string, orderId uint64) error
}
common exchange interface for all symbols
type RestGridStrategyConf ¶ added in v0.5.8
type SQLiteConf ¶ added in v0.5.8
type SQLiteConf struct {
Location string
}
type WsAPIExchange ¶ added in v0.10.0
type WsAPIExchange interface {
SubscribeCandlestick(ctx context.Context, symbol, clientId string, period time.Duration, responseHandler websocketclientbase.ResponseHandler)
SubscribeCandlestickWithReq(ctx context.Context, symbol, clientId string, period time.Duration, responseHandler websocketclientbase.ResponseHandler)
}
Click to show internal directories.
Click to hide internal directories.