Documentation ¶
Overview ¶
Code generated by go generate; DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Parse(str string) (interface{}, error)
- type BookData
- type BookEntry
- type Candle
- type CandleKey
- type Exchange
- func (e *Exchange) CancelOrders(ctx context.Context, orders ...types.Order) error
- func (e *Exchange) Name() types.ExchangeName
- func (e *Exchange) NewStream() types.Stream
- func (e *Exchange) PlatformFeeCurrency() string
- func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error)
- func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap, error)
- func (e *Exchange) QueryKLines(ctx context.Context, symbol string, interval types.Interval, ...) ([]types.KLine, error)
- func (e *Exchange) QueryMarkets(ctx context.Context) (types.MarketMap, error)
- func (e *Exchange) QueryOpenOrders(ctx context.Context, symbol string) (orders []types.Order, err error)
- func (e *Exchange) QueryTicker(ctx context.Context, symbol string) (*types.Ticker, error)
- func (e *Exchange) QueryTickers(ctx context.Context, symbols ...string) (map[string]types.Ticker, error)
- func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder) (createdOrders types.OrderSlice, err error)
- type Stream
- func (s *Stream) Close() error
- func (s *Stream) Connect(ctx context.Context) error
- func (s *Stream) EmitAccount(account okexapi.Account)
- func (s *Stream) EmitBookData(book BookData)
- func (s *Stream) EmitCandleData(candle Candle)
- func (s *Stream) EmitEvent(event WebSocketEvent)
- func (s *Stream) EmitOrderDetails(orderDetails []okexapi.OrderDetails)
- func (s *Stream) OnAccount(cb func(account okexapi.Account))
- func (s *Stream) OnBookData(cb func(book BookData))
- func (s *Stream) OnCandleData(cb func(candle Candle))
- func (s *Stream) OnEvent(cb func(event WebSocketEvent))
- func (s *Stream) OnOrderDetails(cb func(orderDetails []okexapi.OrderDetails))
- func (s *Stream) Reconnector(ctx context.Context)
- func (s *Stream) SetPublicOnly()
- type StreamEventHub
- type WebSocketEvent
- type WebsocketLogin
- type WebsocketOp
- type WebsocketSubscription
Constants ¶
View Source
const OKB = "OKB"
OKB is the platform currency of OKEx, pre-allocate static string here
Variables ¶
View Source
var CandleChannels = []string{
"candle1Y",
"candle6M", "candle3M", "candle1M",
"candle1W",
"candle1D", "candle2D", "candle3D", "candle5D",
"candle12H", "candle6H", "candle4H", "candle2H", "candle1H",
"candle30m", "candle15m", "candle5m", "candle3m", "candle1m",
}
Functions ¶
Types ¶
type BookData ¶
type BookData struct { InstrumentID string Symbol string Action string Bids []BookEntry Asks []BookEntry MillisecondTimestamp int64 Checksum int }
func (*BookData) Book ¶
func (data *BookData) Book() types.SliceOrderBook
type BookEntry ¶
type BookEntry struct { Price fixedpoint.Value Volume fixedpoint.Value NumLiquidated int NumOrders int }
type Candle ¶
type Candle struct { Channel string InstrumentID string Symbol string Interval string Open fixedpoint.Value High fixedpoint.Value Low fixedpoint.Value Close fixedpoint.Value // Trading volume, with a unit of contact. // If it is a derivatives contract, the value is the number of contracts. // If it is SPOT/MARGIN, the value is the amount of trading currency. Volume fixedpoint.Value // Trading volume, with a unit of currency. // If it is a derivatives contract, the value is the number of settlement currency. // If it is SPOT/MARGIN, the value is the number of quote currency. VolumeInCurrency fixedpoint.Value MillisecondTimestamp int64 StartTime time.Time }
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
func (*Exchange) CancelOrders ¶
func (*Exchange) Name ¶
func (e *Exchange) Name() types.ExchangeName
func (*Exchange) PlatformFeeCurrency ¶
func (*Exchange) QueryAccount ¶
func (*Exchange) QueryAccountBalances ¶
func (*Exchange) QueryKLines ¶
func (*Exchange) QueryMarkets ¶
func (*Exchange) QueryOpenOrders ¶
func (*Exchange) QueryTicker ¶
func (*Exchange) QueryTickers ¶
func (*Exchange) SubmitOrders ¶
func (e *Exchange) SubmitOrders(ctx context.Context, orders ...types.SubmitOrder) (createdOrders types.OrderSlice, err error)
type Stream ¶
type Stream struct { types.StandardStream Client *okexapi.RestClient Conn *websocket.Conn // contains filtered or unexported fields }
func NewStream ¶
func NewStream(client *okexapi.RestClient) *Stream
func (*Stream) EmitAccount ¶
func (*Stream) EmitBookData ¶
func (*Stream) EmitCandleData ¶
func (*Stream) EmitEvent ¶
func (s *Stream) EmitEvent(event WebSocketEvent)
func (*Stream) EmitOrderDetails ¶
func (s *Stream) EmitOrderDetails(orderDetails []okexapi.OrderDetails)
func (*Stream) OnBookData ¶
func (*Stream) OnCandleData ¶
func (*Stream) OnEvent ¶
func (s *Stream) OnEvent(cb func(event WebSocketEvent))
func (*Stream) OnOrderDetails ¶
func (s *Stream) OnOrderDetails(cb func(orderDetails []okexapi.OrderDetails))
func (*Stream) Reconnector ¶
func (*Stream) SetPublicOnly ¶
func (s *Stream) SetPublicOnly()
type StreamEventHub ¶
type StreamEventHub interface { OnCandleData(cb func(candle Candle)) OnBookData(cb func(book BookData)) OnEvent(cb func(event WebSocketEvent)) OnAccount(cb func(account okexapi.Account)) OnOrderDetails(cb func(orderDetails []okexapi.OrderDetails)) }
type WebSocketEvent ¶
type WebsocketLogin ¶
type WebsocketOp ¶
type WebsocketOp struct { Op string `json:"op"` Args interface{} `json:"args"` }
type WebsocketSubscription ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.