Documentation
¶
Index ¶
- Constants
- Variables
- func KlineChan(e Exchange, symbol, bSize string, start, end time.Time) (dataCh chan *Candle, errCh chan error)
- func RegisterExchange(name string, fn NewExchangeFn)
- type Config
- type Exchange
- type ExchangeConfig
- type ExchangeInfo
- type FetchLimit
- type NewExchangeFn
- type ViperCfg
- type WatchFn
- type WatchParam
Constants ¶
View Source
const ( WatchTypeCandle = "candle" WatchTypeDepth = "depth" WatchTypeTradeMarket = "trade_market" WatchTypeTrade = "trade" WatchTypePosition = "position" WatchTypeBalance = "balance" )
Variables ¶
View Source
var (
ErrRetry = errors.New("need retry")
)
Functions ¶
func RegisterExchange ¶
func RegisterExchange(name string, fn NewExchangeFn)
Types ¶
type Config ¶
type Exchange ¶
type Exchange interface {
Info() ExchangeInfo
Symbols() ([]Symbol, error)
Start() error
Stop() error
// Watch exchange event, call multiple times for different event
Watch(WatchParam, WatchFn) error
// Kline get klines
GetKline(symbol, bSize string, start, end time.Time) (data []*Candle, err error)
// for trade
ProcessOrder(act TradeAction) (ret *Order, err error)
CancelAllOrders() (orders []*Order, err error)
CancelOrder(old *Order) (orders *Order, err error)
}
func NewExchange ¶
func NewExchangeViper ¶
type ExchangeConfig ¶
type ExchangeInfo ¶
type ExchangeInfo struct {
Name string
Value string
Desc string
KLineLimit FetchLimit
OrderLimit FetchLimit
}
ExchangeInfo exchange info
type FetchLimit ¶
type ViperCfg ¶
func (*ViperCfg) UnmarshalKey ¶
type WatchParam ¶
func WatchCandle ¶
func WatchCandle(symbol, binSize string) WatchParam
Directories
¶
| Path | Synopsis |
|---|---|
|
api/account
Package account provides primitives to interact with the openapi HTTP API.
|
Package account provides primitives to interact with the openapi HTTP API. |
|
api/market
Package market provides primitives to interact with the openapi HTTP API.
|
Package market provides primitives to interact with the openapi HTTP API. |
|
api/public
Package public provides primitives to interact with the openapi HTTP API.
|
Package public provides primitives to interact with the openapi HTTP API. |
|
api/trade
Package trade provides primitives to interact with the openapi HTTP API.
|
Package trade provides primitives to interact with the openapi HTTP API. |
Click to show internal directories.
Click to hide internal directories.