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 RestAPI
- type RestGridStrategyConf
- type SQLiteConf
- type Ticker
- type Trade
- type WsAPI
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 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 RestAPI ¶ added in v0.7.4
type RestAPI interface { PricePrecision(symbol string) int32 AmountPrecision(symbol string) int32 GetSpotBalance() (map[string]decimal.Decimal, error) GetPrice(symbol string) (decimal.Decimal, error) GetCandle(symbol, clientId, period string, from, to time.Time) (Candle, error) PlaceOrder(orderType, symbol, clientOrderId string, price, amount decimal.Decimal) (uint64, error) CancelOrder(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 WsAPI ¶ added in v0.7.4
type WsAPI 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.