okexfutures

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 (b *OkexFutures) AmendOrder(symbol string, id string, price float64, size float64, opts ...OrderOption) (result *Order, err error)

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 (b *OkexFutures) GetRecords(symbol string, period string, from int64, end int64, limit int) (records []*Record, err error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL