Documentation ¶
Index ¶
- type FuturesWebSocket
- func (s *FuturesWebSocket) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
- func (s *FuturesWebSocket) SubscribeOrders(market Market, callback func(orders []*Order)) error
- func (s *FuturesWebSocket) SubscribePositions(market Market, callback func(positions []*Position)) error
- func (s *FuturesWebSocket) SubscribeTrades(market Market, callback func(trades []*Trade)) error
- type OkexFutures
- func (b *OkexFutures) AmendOrder(symbol string, id string, price float64, size float64, opts ...OrderOption) (result *Order, err error)
- func (b *OkexFutures) CancelAllOrders(symbol string, opts ...OrderOption) (err error)
- func (b *OkexFutures) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (b *OkexFutures) CloseLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *OkexFutures) CloseShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *OkexFutures) GetBalance(currency string) (result *Balance, err error)
- func (b *OkexFutures) GetContractID() (symbol string, err error)
- func (b *OkexFutures) GetName() (name string)
- func (b *OkexFutures) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error)
- func (b *OkexFutures) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
- func (b *OkexFutures) GetOrderBook(symbol string, depth int) (result *OrderBook, err error)
- func (b *OkexFutures) GetPositions(symbol string) (result []*Position, err error)
- func (b *OkexFutures) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error)
- func (b *OkexFutures) GetTime() (tm int64, err error)
- func (b *OkexFutures) OpenLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *OkexFutures) OpenShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
- func (b *OkexFutures) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, ...) (result *Order, err error)
- func (b *OkexFutures) SetContractType(currencyPair string, contractType string) (err error)
- func (b *OkexFutures) SetLeverRate(value float64) (err error)
- func (b *OkexFutures) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
- func (b *OkexFutures) SubscribeOrders(market Market, callback func(orders []*Order)) error
- func (b *OkexFutures) SubscribePositions(market Market, callback func(positions []*Position)) error
- func (b *OkexFutures) SubscribeTrades(market Market, callback func(trades []*Trade)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuturesWebSocket ¶
type FuturesWebSocket struct {
// contains filtered or unexported fields
}
func NewFuturesWebSocket ¶
func NewFuturesWebSocket(params *Parameters) *FuturesWebSocket
func (*FuturesWebSocket) SubscribeLevel2Snapshots ¶
func (s *FuturesWebSocket) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
func (*FuturesWebSocket) SubscribeOrders ¶
func (s *FuturesWebSocket) SubscribeOrders(market Market, callback func(orders []*Order)) error
func (*FuturesWebSocket) SubscribePositions ¶
func (s *FuturesWebSocket) SubscribePositions(market Market, callback func(positions []*Position)) error
func (*FuturesWebSocket) SubscribeTrades ¶
func (s *FuturesWebSocket) SubscribeTrades(market Market, callback func(trades []*Trade)) error
type OkexFutures ¶
type OkexFutures struct {
// contains filtered or unexported fields
}
OkexFutures the Okex futures exchange
func NewOkexFutures ¶
func NewOkexFutures(params *Parameters) *OkexFutures
func (*OkexFutures) AmendOrder ¶
func (*OkexFutures) CancelAllOrders ¶
func (b *OkexFutures) CancelAllOrders(symbol string, opts ...OrderOption) (err error)
func (*OkexFutures) CancelOrder ¶
func (b *OkexFutures) CancelOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
func (*OkexFutures) CloseLong ¶
func (b *OkexFutures) CloseLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
func (*OkexFutures) CloseShort ¶
func (b *OkexFutures) CloseShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
func (*OkexFutures) GetBalance ¶
func (b *OkexFutures) GetBalance(currency string) (result *Balance, err error)
func (*OkexFutures) GetContractID ¶
func (b *OkexFutures) GetContractID() (symbol string, err error)
func (*OkexFutures) GetName ¶
func (b *OkexFutures) GetName() (name string)
func (*OkexFutures) GetOpenOrders ¶
func (b *OkexFutures) GetOpenOrders(symbol string, opts ...OrderOption) (result []*Order, err error)
func (*OkexFutures) GetOrder ¶
func (b *OkexFutures) GetOrder(symbol string, id string, opts ...OrderOption) (result *Order, err error)
func (*OkexFutures) GetOrderBook ¶
func (b *OkexFutures) GetOrderBook(symbol string, depth int) (result *OrderBook, err error)
func (*OkexFutures) GetPositions ¶
func (b *OkexFutures) GetPositions(symbol string) (result []*Position, err error)
func (*OkexFutures) GetRecords ¶
func (*OkexFutures) GetTime ¶
func (b *OkexFutures) GetTime() (tm int64, err error)
func (*OkexFutures) OpenLong ¶
func (b *OkexFutures) OpenLong(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
func (*OkexFutures) OpenShort ¶
func (b *OkexFutures) OpenShort(symbol string, orderType OrderType, price float64, size float64) (result *Order, err error)
func (*OkexFutures) PlaceOrder ¶
func (b *OkexFutures) PlaceOrder(symbol string, direction Direction, orderType OrderType, price float64, size float64, opts ...PlaceOrderOption) (result *Order, err error)
func (*OkexFutures) SetContractType ¶
func (b *OkexFutures) SetContractType(currencyPair string, contractType string) (err error)
设置合约类型 currencyPair: BTC-USD contractType: W1,W2,Q1,Q2,...
func (*OkexFutures) SetLeverRate ¶
func (b *OkexFutures) SetLeverRate(value float64) (err error)
设置杠杆大小
func (*OkexFutures) SubscribeLevel2Snapshots ¶
func (b *OkexFutures) SubscribeLevel2Snapshots(market Market, callback func(ob *OrderBook)) error
func (*OkexFutures) SubscribeOrders ¶
func (b *OkexFutures) SubscribeOrders(market Market, callback func(orders []*Order)) error
func (*OkexFutures) SubscribePositions ¶
func (b *OkexFutures) SubscribePositions(market Market, callback func(positions []*Position)) error
func (*OkexFutures) SubscribeTrades ¶
func (b *OkexFutures) SubscribeTrades(market Market, callback func(trades []*Trade)) error
Click to show internal directories.
Click to hide internal directories.